Skip to content

fix(semantics,query): a transition owns the Membership naming its first source and its in link parameters on the native walk — a ReferenceUsage through a ParameterMembership ahead of its trigger, a second one when it declares a trigger — as the conversion mints them and the pilot exports them, and the query leg reads their ids - #2222

Merged
HuiJun merged 5 commits into
developfrom
fix/transition-native-memberships
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

A transition owned only its succession on the native walk (Element::ownedRelationship), where the RDF conversion mints the Membership of its first source (<id>_psourcemember), an in ReferenceUsage through a ParameterMembership (<id>_linkparam / _linkparam_om) and a second one ahead of a trigger (<id>_triggerparam / _triggerparam_om) — and where the pilot exports, for transition go first idle then busy;, a Membership of idle, a ParameterMembership of transitionLinkSource, the succession's OwningMembership and a FeatureMembership of transitionLink. The two legs of the reflection disagreed on TransitionUsage::ownedRelationship for every transition, with ids that already agreed since #2216.

Now:

  • internal/semantic/semantics/reflective_transitions.go synthesizes the link parameters as ReferenceUsage parts (symbols.ExpressionTransitionLinkParameter, direction in): one for every explicit transition head, a second when it declares a trigger (SysML.xtext EmptyParameterMember); transitionSourceMember resolves a named, unchained first source.
  • reflective_memberships.go lists the source Membership (slot psourcemember) ahead of everything else the transition owns, then the ParameterMemberships, the trigger, guard and succession in their written order; annotations.go and reflective_expression_parts.go answer the parts' direction and metaclass.
  • internal/translate/export/element_ids.go (recordTransitionHead) files the conversion's ids under the transition's node at those slots, and internal/doc/queryexec/elementids.go reads them, so the query leg answers <id>_psourcemember, <id>_linkparam, <id>_linkparam_om, <id>_triggerparam.
  • The structure differential's symbol mapper (api_json_symbol_structure_test.go) routes the new parts to the graph's _linkparam / _triggerparam elements.

Mirrors the conversion form by form: a state body's then x; written as a transition and a guarded transition if g then x; own the link parameter (the first also when the conversion writes one) but no source Membership where the conversion mints none. Two gaps stay open on both legs, for a follow-up: the pilot's transitionLink FeatureMembership, which neither leg has, and the source Membership of a state body's then x;, which the pilot owns and the conversion does not write.

Specification basis

SysML v2 textual notation (SysML.xtext, TransitionUsage → TransitionUsageDeclaration / GuardedTargetSuccession): a transition's first source is referenced through a Membership (FeatureChainMember), and its head owns an EmptyParameterMember ahead of a TriggerActionMember, a second ahead of the trigger when one is declared; the pilot implementation (SysMLv2 release 2025-xx, probed through its API-JSON exporter) exports exactly these memberships. No row of docs/project/spec-compliance/ moves: the change makes the reflective layer answer what the conversion already states.

How it was verified

  • New internal/semantic/semantics/transition_memberships_test.go: a transition, a triggered one, a guarded one and a state body's then x; — the memberships each owns, in order, their metaclasses, the link parameters' in direction; fails on develop (the transition owns only its succession).
  • New internal/doc/queryexec/transition_memberships_ids_test.go: the query leg answers Observatory__S__go_psourcemember, _linkparam, _linkparam_om, _succession_om; fails on develop.
  • reflective_transition_kinds_test.go and descendants_relationships_test.go adjusted for the memberships and the one more non-end ReferenceUsage.
  • Structure differential (TestSymbolStructureMatchesGraphStructure -update-structure-differential) re-recorded: matched grows on every root (examples +414, tests/testdata +15, training +115, pilot corpora +321, spec examples +60); no different row grows — the only rows that grow are the three every newly matched element adds (Feature::isConstant symbol-extra; Membership::memberElementId / OwningMembership::ownedMemberElementId symbol-missing, the id properties the symbol side never answers); Element::ownedElement / ownedRelationship different fall (examples 824→796 / 1413→1385, pilot corpora 1483→1469 / 2180→2166, spec examples 397→395 / 512→510).
  • Derived census (derived-census -update) re-recorded: no pilot column moves on any row; ours carriers grow by the new elements (examples root: Element::owner 33890→34304, ParameterMembership::ownedMemberParameter 2171→2323, Membership::memberElement 14350→14612, Feature::direction +152 stated in); Step::parameter's split moves 1264/2449→1373/2340 — 109 transitions now derive a non-empty parameter, as the pilot does.
  • pilot-apijson-diff -check reproduces (no triple changes); TestExamplesSweep with the three corpora required reproduces; make docs-counts reproduces.
  • go test on internal/semantic/..., internal/doc/queryexec, internal/translate/export, tests/export, tests/identity green; make lint, go vet ./..., gofmt -l . (empty), make changelog-check, scripts/check-doc-ids.py, tests/hygiene clean. make test-short runs now; result in a comment.

Checklist

  • make test and make lint pass locally (make test-short result to follow in a comment)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md) — no documented surface moves
  • Changelog entry added as changes/unreleased/transition-native-memberships.fixed.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (structure differential and derived census re-recorded; docs-counts reproduces)
  • 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 Review found nothing to fix · View findings · Follow Devin's work

Devin Review

…st source and its in link parameters on the native walk — a ReferenceUsage through a ParameterMembership ahead of its trigger, a second one when it declares a trigger — as the conversion mints them and the pilot exports them, and the query leg reads their ids

A `transition` owned only its succession on the native walk, where the RDF conversion mints the Membership of its `first` source (`<id>_psourcemember`), an `in` ReferenceUsage through a ParameterMembership (`<id>_linkparam`, `_linkparam_om`) and a second one ahead of a trigger (`<id>_triggerparam`), and the pilot exports a Membership, a ParameterMembership and the succession's OwningMembership for it. The semantic model now synthesizes the link parameters (ExpressionTransitionLinkParameter) and lists the source Membership first, the conversion files the ids under the transition's node, and the query leg reads them — for a `transition`, a triggered one and a guarded one. A state body's `then x;` written as a transition owns neither on either leg, as the conversion writes it.

Structure differential re-recorded: matched grows on every root, no `different` row grows; derived census re-recorded: carriers grow by the new elements, Step::parameter answered on 109 more transitions, no pilot column moves. api-json `-check`, the round-trip sweep and docs-counts reproduce.

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 Bot and others added 3 commits November 14, 2026 03:43
…version's ids — `<transition>_linkparam` and `_triggerparam` — through SynthesizedElementID, so a metaobject over gRPC references them as it does the transition's succession

SynthesizedElementID had no case for ExpressionTransitionLinkParameter, so the protobuf conversion serialized a link parameter's metaobject as an unsupported null where the transition's succession resolved to its element reference. The two slots the conversion mints them at are named once, in transitionLinkParameterSlots, and the recorder and the synthesized-id table both read them.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…endpoint resolution on the native walk, so a vertex nested in a sibling state owns its Membership as the conversion writes it

transitionSourceMember used ResolveTarget, the ordinary lookup, which does not reach a state nested in a sibling state (`transition deep first nested then busy;` beside `state outer { state nested; }`), where the conversion's edgeReference reads the endpoint resolution and states the Membership; the native walk omitted it. EndpointSymbol is the resolution lowering and the conversion share.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
… elements — `<transition>_succession`, `_linkparam` and `_triggerparam` decode to the transition they are minted off, so a metaobject naming one crosses back over gRPC

The element form's Owner decoder read expression ids and encoded names only, so an id the conversion mints with a suffix of its own — the transition's succession since #2216, its link parameters here — named no element on the way back (ErrMetaobjectUnbound). SynthesizedElementOwner decodes those suffixes off the owner's encoded name, and Owner reads it as one element below that owner; the identity round-trip test covers the three and refuses the suffix on a state that owns no succession.

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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

make test-short on 84a168e: 118 packages ok; the six that hit the 10-minute default timeout under the full run's contention pass alone — cmd/sysml 610s, internal/exec/runtime 273s, internal/exec/smt 322s, tests/codegen 445s, tests/corpus 133s (the three corpora required), tests/export 214s. make lint, go vet ./..., gofmt -l . (empty), make changelog-check, scripts/check-doc-ids.py, tests/hygiene clean on the same head.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@HuiJun
HuiJun added this pull request to the merge queue Nov 14, 2026
Merged via the queue into develop with commit 41582fa Nov 14, 2026
30 checks passed
@HuiJun
HuiJun deleted the fix/transition-native-memberships branch November 14, 2026 08:15
devin-ai-integration Bot added a commit that referenced this pull request Nov 14, 2026
…ava 21

Ours columns reproduce develop's (#2222) on every line; the pilot columns
reproduce the 2026-09.1 recording on every line.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
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