Skip to content

[capgen-v1] Require positive evidence before treating index_of_<X> as a constituent index - #780

Merged
climbfuji merged 7 commits into
NCAR:feature/capgen-v1from
climbfuji:bugfix/index_of_not_a_constituent
Sep 4, 2026
Merged

climbfuji merged 7 commits into
NCAR:feature/capgen-v1from
climbfuji:bugfix/index_of_not_a_constituent

Conversation

@climbfuji

@climbfuji climbfuji commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes #779.

The prefix is now a precondition, not a classifier. Auto-provisioning requires
positive evidence that X is a constituent — some scheme flagging X or
tendency_of_X as advected/constituent/molar_mass. Without it, the name
is an ordinary variable and resolution raises the normal missing-provider
error. A suite-wide assertion re-checks the invariant after resolution so a
future path cannot reintroduce the class of bug.

No host changes required: the only intent(in)-only CAM-SIMA name is declared
in src/data/registry.xml, and the other eight have intent=out producers.

Included are updates to doc/* that are optional to review - they are used
primarily as instructions and memory for the LLM. These will be removed
or moved elsewhere when feature/capgen-v1 eventually becomes develop.

Testing

  • Unit tests 1564 --> 1568, all passing. Residual gap recorded as FU-035.
  • CI
  • One-sided rename (physics only) of a variable std. name starting with index_of_

Issues

Fixes #779

…s a component of an internal constituent even though there was no constituent for it
@climbfuji climbfuji self-assigned this Sep 1, 2026
@climbfuji
climbfuji requested review from a team as code owners September 1, 2026 18:28

@dustinswales dustinswales left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@climbfuji This looks good to me. Thanks for making these changes.

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a possible request and the usual "courtney is confused by this comment" stuff

Comment thread capgen/generator/suite_resolver.py Outdated
Comment thread capgen/generator/suite_resolver.py
Comment thread capgen/generator/suite_resolver.py Outdated
climbfuji and others added 3 commits September 3, 2026 16:29
Co-authored-by: Courtney Peverley <courtneyp@ucar.edu>
…esolver.py: guard against schemes writing to a constituent index variable
@climbfuji
climbfuji force-pushed the bugfix/index_of_not_a_constituent branch from 3886458 to 23fc258 Compare September 3, 2026 23:09
…tituent; catch invalid metadat (index_of_... plus constituent = True)
@climbfuji
climbfuji requested a review from peverwhee September 4, 2026 02:11

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @climbfuji !

I'm still confused on some of the constituent handling; however, we'll have to rethink things when we remove build-time constituents anyway, so I'm happy to approve this.

@climbfuji

Copy link
Copy Markdown
Collaborator Author

thanks @climbfuji !

I'm still confused on some of the constituent handling; however, we'll have to rethink things when we remove build-time constituents anyway, so I'm happy to approve this.

Appreciate your thorough review.

@climbfuji
climbfuji merged commit 09ae1d7 into NCAR:feature/capgen-v1 Sep 4, 2026
8 checks passed
@climbfuji
climbfuji deleted the bugfix/index_of_not_a_constituent branch September 4, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants