Skip to content

feat(DocumentQueries): WhereType takes exact, to keep only the elements whose own metaclass is named - #15

Merged
NicolasRouquette merged 1 commit into
mainfrom
feature/wheretype-exact
Oct 29, 2026
Merged

NicolasRouquette merged 1 commit into
mainfrom
feature/wheretype-exact

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

WhereType(type = "PartUsage") keeps every element conforming to the type — subclasses of the metaclass and the model's own definitions/usages alike — which is the right default for a cookbook query and the wrong one for a reflective walk, where each element must be mirrored under exactly one metaclass (Open-MBEE/qvts reflection.sysml, generated per concrete metaclass from the metamodel table).

calc def WhereType {
    in source : Element[0..*] ordered;
    in type : String[1..*] ordered;
    in exact : Boolean[1] default false;   // new: only the elements whose own metaclass is named
    return result : Element[0..*] ordered;
}

Same shape as tolerate on Project/WhereFeature (#14): an optional Boolean with its default, so no existing query changes meaning; .meta.json regenerated.

Runtime, coordinated: Open-MBEE/OpenSysML#1689 implements it (queryexec.evaluateWhereType keeps a row when MetamodelTypeNameOf(sym) == type under exact, with its test) and vendors this branch's commit; it is a draft pinned to b6784f23 until this PR merges, then re-pins to main's merge commit and un-drafts.

Semver impact: MINOR. An added in parameter with a default is backward compatible: every existing WhereType invocation parses and means what it meant, and engine-contract.json is unchanged (WhereType is listed by name, its parameters are not part of the contract), so contract is not bumped. An engine built against the previous pin rejects exact = true as an unknown parameter rather than mis-evaluating it, which is the failure mode a MINOR bump allows.

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/18ad47adf36f44e9b6824a4472f9678d
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/18ad47adf36f44e9b6824a4472f9678d?variant=devin
Requested by: @NicolasRouquette


Devin Review

…ts whose own metaclass is named

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread libraries/DocumentQueries.sysml Resolved
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Runtime coordination (for the Review flag on libraries/DocumentQueries.sysml:154): Open-MBEE/OpenSysML#1689 implements exact in queryexec.evaluateWhereType with a test, and vendors this branch's commit b6784f23 so its queryplan accepts the parameter; it stays a draft until this PR merges, then re-pins to the merge commit on main and un-drafts. Users on the previous OpenSysML pin get an unknown-parameter error for exact, not a silent mis-evaluation.

@NicolasRouquette
NicolasRouquette merged commit 1ef079d into main Oct 29, 2026
2 checks passed
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.

1 participant