Repository navigation
fix(semantics): a transition's link parameters and a bare accept's payload answer isVariable true on the native walk — referential usages an occurrence owns, as the conversion states them and the pilot exports them - #2234
Conversation
…yload answer isVariable true on the native walk — referential usages an occurrence owns, as the conversion states them and the pilot exports them Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Could the description carry a tracking-issue line near the top ( |
… reader — a time or change trigger's too, whose declaration is the event, not a usage The role-based derivation for a synthesized referential part — a transition's link parameter, a trigger's payload — moves into one helper that UsageMayTimeVary, UsageMayTimeVaryForOwningType and FeatureIsVariable all read first, where only UsageMayTimeVary read it and the other two fell to the declaration switch, false for an *ast.TimeEvent or *ast.ChangeEvent payload. The export test covers accept after, at and when beside the bare accept, asserting the three readers and the reflective value agree. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
There was a problem hiding this comment.
Devin Review found 1 finding. Devin automatically fixed it.
Fixed by Devin (1)
- Time-trigger payload variability disagrees across readers — Real: a time/change trigger's payload declares an *ast.TimeEvent/*ast.ChangeEvent, so FeatureIsVariable and UsageMayTimeVaryForOwningType fell to the declaration switch and answered false while UsageMayTimeVary answered true. The role-based derivation moves into one helper all three readers read first; the export test covers accept after/at/when and asserts the three readers and the reflective value agree (fails on the reviewed head).
|
Full gate at a91efbe ( |
What and why
Since #2222 a
transitionowns itsinlink parameters on the native walk — theReferenceUsages the conversion mints as<transition>_linkparam/_triggerparam. The RDF conversion statesisVariable truefor them (a referential usage an occurrence owns varies,mayTimeVary true), and the pilot exportstransitionLinkSourcewithisVariable true,mayTimeVary true; the native walk answeredfalse. The payload of a bareaccept Sigtrigger, synthesized under theAcceptActionUsagethe trigger implies, had the same gap.Root cause:
UsageMayTimeVaryreads the usage's owning scope to find the occurrence it is owned by, and a part the model synthesizes declares no scope of its own (OwnerScope == nil), so the walk bailed withfalsebefore reaching the owning transition or action. The fix derives variability for such a part from what owns it: a transition link parameter varies as its owning transition does (UsageMayTimeVaryUnder(Expr.Owner)); a trigger payload as a part of an action does (UsageMayTimeVaryUnderKind(ast.UsageAction), the rule the RDF conversion already applies to the same payload).This closes the two
ReferenceUsage::isVariablecells the QVTS reflection cross-check opened at its re-pin to #2222 (the writer and the pilot agree ontrue; the native walk disagreed).Specification basis
SysML v2 v2.0 §7.9.2.2 (Usage —
isVariable,mayTimeVary) and §7.16.2.4 (Transition Usages — the impliedtransitionLinkSourceparameter) via KerML v1.0 §7.3.4.2 (Feature::isVariable): a feature an occurrence type owns that is not an end, a portion or composite is a variable feature. No row indocs/project/spec-compliance/moves: the rule was already implemented; the synthesized parts were missed.How it was verified
internal/semantic/semantics/transition_link_parameter_variability_test.go: a transition's two link parameters answerisVariable true, its succession's ends stillfalse. Fails ondevelop, passes here.internal/translate/export/transition_payload_variability_test.go(library-backed model: the payload needs the standard library): both link parameters and the bareaccept Sigpayload answerisVariable true. Fails ondevelop, passes here.internal/semantic/semantics,internal/doc/queryexec,internal/translate/export,tests/exportsuites;go vet,gofmt -l, lint, document-id, hygiene,make changelog-check,make docs-countsgreen.-update) and derived census (-update): no row moves — neither recordsisVariablefor these elements.pilot-apijson-diff -checkand the corpus sweep (TestExamplesSweepwith all three require variables) reproduce.make test-shortresult in a gate comment.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink 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 fixed the finding · Follow Devin's work