Repository navigation
fix(semantics): type a transition's effect as declared and derive its source and target - #2274
Merged
NicolasRouquette merged 5 commits intoNov 16, 2026
Conversation
… source and target A transition effect written with a PerformActionUsageDeclaration is a PerformActionUsage and a `do assign` an AssignmentActionUsage (SysML v2.1 §8.2.2.18.3 EffectBehaviorUsage), where both were a plain ActionUsage. TransitionUsage::source and target are derived per §8.3.18.9. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
The target read only the succession's related feature, which does not reach a vertex the endpoint resolution accepts; fall back to that resolution, as the source already does. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Re-records state_machine.golden.ttl.sha256: develop's output plus this branch's two lines (isVariable, mayTimeVary on the perform effect). Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration
Bot
changed the base branch from
develop
to
fix/declared-end-feature-membership-native
November 16, 2026 05:49
…e/transition-effect-perform-action Stacks this change on #2268 (82ec554), itself on #2266 and develop at #2261. The state-machine Turtle golden digest, the structure differential and the derived census are re-recorded by tool under the merged code. Beyond what each side moves alone, the two interact on a transition's effect PerformActionUsages: six effects now agree with the graph on Feature::isComposite and Usage::isReference, two Type::endFeature 'symbol unsupported' rows resolve and one appears, and the census's Namespace, Type and Usage rows move by two to seven values on the same carriers with the pilot column unchanged. The api-json and pilot differentials reproduce unchanged. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…m-action' into feature/transition-effect-perform-action Brings the branch's own develop merge together with its stack merge onto #2268; the state-machine Turtle golden digest and the baselines are re-recorded by tool under the merged code. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
NicolasRouquette
approved these changes
Nov 16, 2026
NicolasRouquette
merged commit Nov 16, 2026
b012483
into
fix/declared-end-feature-membership-native
30 checks passed
NicolasRouquette
deleted the
feature/transition-effect-perform-action
branch
November 16, 2026 16:25
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Two gaps in the reflection of a
TransitionUsage, both on the compliance row "A transition's trigger, guard and effect are its owned features throughTransitionFeatureMemberships" (docs/project/spec-compliance/02-detailed-semantic-compliance-map/17-expression-evaluation.md):symbols/builder.godefineTransitionEffectbuilt every effect that is not asendas a plainActionUsage. The neweffectActionKindgives the effect the kind its declaration writes:do action e/do action e : A { … }→PerformActionUsage,do assign …→AssignmentActionUsage,do send …→SendActionUsage(unchanged),do perform …→PerformActionUsage. A braceddo { … }writes noPerformActionUsageDeclarationand stays a plainActionUsage. The kind is read by the symbol table, the query@typeand the reflective metaclass, soeffectAction istype SysML::PerformActionUsagenow holds.source/target.semantics/reflective_transitions.gotransitionElementsansweredreflective feature is not derivedfor both.transitionSourceandtransitionTargetnow derive them: the member of the sourceMembership(or, for a chainedfirst a.b, the chain's last feature) and the target feature of the transition's succession, each kept only when it is anActionUsage. Where the succession does not carry the target end,transitionTargetEndpointtakes the vertex the written target names by endpoint resolution, as the source side already does; that reaches a target nested in a sibling state (transition t first a then inner;withinnerdeclared inside stateb), which reflected as empty before the review fix.The row stays⚠️ Approximate; it is not flipped to ✅. Verifying the row against the grammar turned up three further divergences inside the same claim, each larger than this change and each now named in the row's limitation text:
succession s first a if g then b;and an action body'sif g then a;/else b;— is aTransitionUsage(SysML.xtextGuardedSuccession,GuardedTargetSuccession), yet reflects no owned membership,guardExpression,succession,sourceortarget.transition first a.b then creflects noOwningMembershipfor the chain feature the transition owns (SysML.xtextTransitionSourceMember).EffectBehaviorUsageallows: the reference formdo aanddo accept S(expected an action after 'do').Specification basis
EffectBehaviorUsage : ActionUsage = EmptyActionUsage | TransitionPerformActionUsage | TransitionAcceptActionUsage | TransitionSendActionUsage | TransitionAssignmentActionUsage, withTransitionPerformActionUsage : PerformActionUsage = PerformActionUsageDeclaration ( '{' ActionBodyItem* '}' )?. Pinned grammar (2026-09.1):SysML.xtextEffectBehaviorUsage→PerformedActionUsage={SysML::PerformActionUsage}.TransitionUsage:deriveTransitionUsageSource(thefeatureTargetof the source feature, as anActionUsage),deriveTransitionUsageTarget(thefeatureTargetof the succession's target feature, as anActionUsage),succession= the first owned member that is aSuccession.TransitionFeatureMembership(unchanged behaviour, the row's subject).The pilot was used only to confirm: the pinned JSON exporter writes
PerformActionUsage/SendActionUsage/AssignmentActionUsagefor the three declared effect forms and the state usages assource/targetfor the same probe model.How it was verified
New tests, failing on
develop(effect isActionUsage;source/targetnot derived) and passing here:internal/semantic/semantics/reflective_transition_ends_test.goTestTransitionReflectsItsEffectMetaclassAndEnds— eight transitions: declared action effect, typed effect with a body,send,assign, braced body, no effect, chained source, target nested in a sibling state.internal/semantic/symbols/action_node_kind_test.goTestBuildClassifiesTransitionEffectsByTheirDeclaration.meta_transition_feature_kinds:effectIsPerformed,sourceIsIdle,targetIsBusy,targetIsNotIdle.Baselines that moved, each read before re-recording (both in the first commit; the review fix moved none):
tests/export/testdata/convert/state_machine.golden.ttl.sha256— two lines added on one element: the effectactive_to_off::stop(do action stop : Warm), already written assysml:PerformActionUsagewithisComposite false, now also carriessysml:isVariable trueandsysml:mayTimeVary true. That isUsage::mayTimeVaryfor a referential action owned by an occurrence; the pilot exportsisVariable: true, mayTimeVary: truefor the same construct.internal/translate/export/testdata/structure_differential_expected.txt— in the three corpus roots whose lines moved (examples,examples/pilot-corpora,examples/spec-examples;tests/testdataandexamples/sysml-v2-trainingare unchanged), the symbol-backed structure now agrees with the graph-backed one on more elements: every moved line (Feature::isComposite,Usage::isReference,Usage::usage,Namespace::member/membership,Type::feature/featureMembership/inheritedFeature/inheritedMembership/endFeature) moves counts fromdifferentorsymbol-missingtoequal(for exampleFeature::isComposite: equal 12538 → 12545, different 26 → 19underexamples). No bucket moved the other way.go run -C tools ./cmd/pilot-apijson-diff -checkreproduces the baseline), the corpus sweep and round-trip, the training/pilot/spec-example gates.Gates run on the first commit:
gofmt -l .(empty),go vet ./...,go build ./...,make lint,python3 scripts/spec_compliance.py check,python3 scripts/changelog.py check,python3 scripts/check-doc-ids.py,make docs-counts,go test -count=1over./internal/semantic/...,./internal/check/...,./internal/ir/...,./internal/exec/runtime,./tests/hygiene,./tests/export, and, withOPENSYSML_REQUIRE_TRAINING_CORPUS,OPENSYSML_REQUIRE_PILOT_CORPORAandOPENSYSML_REQUIRE_SPEC_EXAMPLESset,./tests/corpusand./internal/translate/export.Re-run on the review fix (which touches only
reflective_transitions.goand its test):gofmt -l .(empty),go vet ./...,go build ./...,go test -count=1over./internal/semantic/...,./internal/exec/runtimeand./tests/hygiene.The current head merges
develop. One file conflicted,state_machine.golden.ttl.sha256, becausedevelopmoved the same digest: its output is 6033 lines, and this branch's output over it is 6035, the difference being exactly the twoisVariable/mayTimeVarylines described above (the two full outputs were diffed before re-recording).structure_differential_expected.txtmerged without conflict and reproduces. Re-run on this head:gofmt -l .(empty),go vet ./...,go build ./...,python3 scripts/spec_compliance.py check,python3 scripts/changelog.py check,go test -count=1over./internal/semantic/...,./internal/exec/runtime,./tests/export,./tests/hygieneand, with the three require variables set,./internal/translate/export. The corpus sweep and the api-json differential were not re-run locally on this head; CI ran them green on it.Not green locally and not caused by this change:
internal/workspace/libsTestEmbeddedSnapshotIsCurrentandexamplesTestSelfModelLibraryMatchesImplementationreport a stalestdlib.snapshot; the former fails identically with this branch's two implementation files reverted, the latter reports the same stale-snapshot error. The fullgo test ./...was not completed locally (cmd/sysmlandtests/codegenran past the 10-minute package timeout on this machine).Stacking and merge provenance
This PR is stacked on #2268 (
fix/declared-end-feature-membership-native), itself on #2266, bygit merge --no-ffof each predecessor's exact head (no rebase, no cherry-pick):3134ebccc8merges #2268's head82ec554ce4;222f44ac00merges the branch's own earlier develop mergea311f40868, whose content the stack already carried, so that merge moves no file. The baselines the stack merge moved were re-recorded by the repository tools only (go test ./tests/export -update,-update-structure-differential,derived-census -update -require-exporter); the full gate (go build,go vet,gofmt -l,go test -count=1 ./..., the tools suite,make lint,derived-census -check -require-exporter,pilot-apijson-diff -check,pilot-diff -check,changelog-check) is green on222f44ac00.Attribution of every line the stack merge moved, read against a dump of each side (
OPENSYSML_STRUCTURE_DIFFERENTIAL_DUMP):tests/export/testdata/convert/state_machine.golden.ttl.sha256— the digest conflicted because both sides rewrite the same graph: fix(semantics): a declared end feature is owned through a FeatureMembership whose member isEnd — a definition's, a usage body's or a KerML classifier's, association's or connector body's end feature — and only a connector's clause ends through an EndFeatureMembership, as KerML 8.3.3.3.3 and the notation grammars define them and the conversion writes them #2268 owns the declared end features through aFeatureMembershipand this branch types the transition effects asPerformActionUsage; the re-recorded digest is of the Turtle carrying both.internal/translate/export/testdata/structure_differential_expected.txt— the six transition-effectPerformActionUsageelements ofexamples/phase-c-behavioral-bodies.sysml,Arrowhead Framework Example/AHFNorwayTopics.sysml,Simple Tests/StateTest.sysmlandspec-examples/sysml/7.18.3/5.sysmlnow agree with the graph onFeature::isCompositeandUsage::isReference(this branch's effect kind meets fix(semantics): a declared end feature is owned through a FeatureMembership whose member isEnd — a definition's, a usage body's or a KerML classifier's, association's or connector body's end feature — and only a connector's clause ends through an EndFeatureMembership, as KerML 8.3.3.3.3 and the notation grammars define them and the conversion writes them #2268's membership kind: a performed effect is a referential, non-composite usage on both legs); twoType::endFeaturesymbol unsupportedrows resolve and one newType::endFeaturerow appears, all from fix(semantics): a declared end feature is owned through a FeatureMembership whose member isEnd — a definition's, a usage body's or a KerML classifier's, association's or connector body's end feature — and only a connector's clause ends through an EndFeatureMembership, as KerML 8.3.3.3.3 and the notation grammars define them and the conversion writes them #2268's end-feature memberships now seen through this branch's transitions. No row moves away from agreement.internal/semantic/metamodel/derived_census_records.tsv(and the.jsonbaseline) — rows move only within theNamespace::*,Type::*andUsage::*families on the same carriers; every pilot column is unchanged.docs/project/api-json-differential/anddocs/project/pilot-differential-baseline.jsonreproduce unchanged (-checkexits 0 on both).Checklist
make testandmake lintpass locally —make lintpasses;make testnot completed locally, see abovechanges/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 Review found nothing to fix · View findings · Follow Devin's work