Skip to content

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

Merged
HuiJun merged 2 commits into
developfrom
fix/transition-link-parameter-may-time-vary
Nov 14, 2026

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Since #2222 a transition owns its in link parameters on the native walk — the ReferenceUsages the conversion mints as <transition>_linkparam / _triggerparam. The RDF conversion states isVariable true for them (a referential usage an occurrence owns varies, mayTimeVary true), and the pilot exports transitionLinkSource with isVariable true, mayTimeVary true; the native walk answered false. The payload of a bare accept Sig trigger, synthesized under the AcceptActionUsage the trigger implies, had the same gap.

Root cause: UsageMayTimeVary reads 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 with false before 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::isVariable cells the QVTS reflection cross-check opened at its re-pin to #2222 (the writer and the pilot agree on true; 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 implied transitionLinkSource parameter) 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 in docs/project/spec-compliance/ moves: the rule was already implemented; the synthesized parts were missed.

How it was verified

  • New internal/semantic/semantics/transition_link_parameter_variability_test.go: a transition's two link parameters answer isVariable true, its succession's ends still false. Fails on develop, passes here.
  • New internal/translate/export/transition_payload_variability_test.go (library-backed model: the payload needs the standard library): both link parameters and the bare accept Sig payload answer isVariable true. Fails on develop, passes here.
  • internal/semantic/semantics, internal/doc/queryexec, internal/translate/export, tests/export suites; go vet, gofmt -l, lint, document-id, hygiene, make changelog-check, make docs-counts green.
  • Structure differential (-update) and derived census (-update): no row moves — neither records isVariable for these elements. pilot-apijson-diff -check and the corpus sweep (TestExamplesSweep with all three require variables) reproduce.
  • make test-short result in a gate comment.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

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 fixed the finding · Follow Devin's work

Devin Review

…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>
@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

Copy link
Copy Markdown
Contributor Author

Could the description carry a tracking-issue line near the top (Fixes #N / Refs #N), or "No tracking issue." if there is none?

… 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>

@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 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).

View findings in Devin Review · Follow Devin's work

Devin Review

@HuiJun
HuiJun added this pull request to the merge queue Nov 14, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Full gate at a91efbe (make test-short, no race detector): 137 packages ok. cmd/sysml, tests/codegen and tests/export hit the 10-minute default timeout under the parallel run and pass alone (296 s, 318 s, 215 s). go build ./..., go vet ./..., gofmt -l . (empty), make lint, doc-ids, hygiene, changelog-check clean; structure differential, derived census, api-json -check, corpus round-trip sweep and docs-counts reproduce.

Merged via the queue into develop with commit 0b92146 Nov 14, 2026
30 checks passed
@HuiJun
HuiJun deleted the fix/transition-link-parameter-may-time-vary branch November 14, 2026 11:07
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.

2 participants