Repository navigation
fix(semantics): a succession's related features are what its owned ends reference - #2311
Merged
Merged
Conversation
…ition owns its two end features — a bare `entry;` or an unnamed action before it, with or without a multiplicity — on the native walk and in the RDF conversion, as the notation grammar's TargetSuccession declares them and the pilot exports them A positional `then x;` whose source carried no multiplicity owned no ends on either leg, so Type::endFeature, Connector::relatedFeature and SuccessionAsUsage::ownedRelationship answered one way for `first a then b;` and another for `then b;`. SuccessionMintsEnds and the writer now mint the two EndFeatureMemberships for every `then` succession however its source is reached. The state-machine compliance row for a state body's succession ends moves to Faithful; four Turtle goldens, the structure differential, the derived census and the api-json differential are re-recorded and adjudicated (no pilot column moves; the rows that grow are pre-existing families on the new carriers). Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…urce end comes from Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
… the owned ends; relatedFeature derivation stays on its own approximate row Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…action usage its owner owns Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ccession-ends-owned Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tional succession owns no ends Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…ds reference An action body's two-ended `first a then b;` is the SuccessionAsUsage the action owns, with two EndFeatureMemberships; relatedFeature, sourceFeature and targetFeature are read from a succession's ends (KerML 1.1 8.3.4.5.3) for every `then` form and for a transition's own succession. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…nds-native' into fix/succession-ends-owned Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/spec-compliance/02-detailed-semantic-compliance-map/13-action.md
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…atures unanswered An end written as a feature chain references the chain Feature it owns, not the chain's last step. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s-owned Co-Authored-By: jason.han <hanhuijun@gmail.com>
…sion ends Co-Authored-By: jason.han <hanhuijun@gmail.com>
Brings in #2259 (positional then source in the RDF conversion); the four Turtle golden digests both sides moved are re-recorded by tool (go test ./tests/export -update); census, structure and api-json differentials reproduce. Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration
Bot
changed the base branch from
develop
to
fix/positional-then-succession-ends-native
November 15, 2026 21:58
…nds-native' into fix/succession-ends-owned
Base automatically changed from
fix/positional-then-succession-ends-native
to
fix/declared-end-feature-membership-native
November 17, 2026 00:19
Base automatically changed from
fix/declared-end-feature-membership-native
to
develop
November 17, 2026 02:27
…s-owned Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t of its succession's ends A chained end leaves the succession's relatedFeature unanswered, but TransitionUsage::source and ::target read the featureTarget of the end (SysML v2.1 deriveTransitionUsageSource/Target), the last step of the chain. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…e succession Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s-owned Co-Authored-By: jason.han <hanhuijun@gmail.com>
…an action, not the succession Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s-owned Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 19, 2026
…family-complete Co-Authored-By: jason.han <hanhuijun@gmail.com>
5 of 6 tasks
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 19, 2026
…reflect-concrete-metaclasses
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 19, 2026
…elop's owned succession ends Clean develop reproduces its own baseline; the ten cells move only on the combined tree, where #2311's owned succession ends are also listed among the synthesized members this branch adds. Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 19, 2026
…s owned succession ends Clean develop reproduces its own census; the pilot-validation rows (and one pilot-examples, one training row) move only on the combined tree, where the succession ends #2311 owns are also members this branch synthesizes. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Open
5 of 6 tasks
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
A succession's
relatedFeature,sourceFeatureandtargetFeaturewere derived from the members athenis written between, not from the ends the succession owns, so they were unanswered wherever a neighbour had no element standing for it (then assign …;,then terminate;), and an action body's two-endedfirst a then b;had noSuccessionAsUsagesymbol at all.This change:
relatedFeature/sourceFeature/targetFeaturefrom the succession's owned end features for everythenform of an action or state body, a two-endedfirst a then b;and a transition's own succession (semantics/annotations.goConnectorRelatedFeaturesByEnd,EndReferencedFeature;semantics/succession_ends.gosuccessionEndReference);first a then b;theSuccessionAsUsageits owner owns, with twoEndFeatureMemberships whose ends each own theReferenceSubsettingof the feature written (symbols/builder.gobuildBehaviorDecl; export element ids inexport/element_ids.gorecordSuccessionEnds);assign,terminateorperformstatement the action usage its owner owns (AssignmentActionUsage,TerminateActionUsage,PerformActionUsage), the way a baresendalready was, so the successions around it relate it.It does not redo #2278 (owning the ends of positional
then), now ondevelop, or #2259 (the exporter's related-element derivation for positionalthen).Specification basis
deriveConnectorRelatedFeature:relatedFeature = connectorEnd.ownedReferenceSubsetting->select(s | s <> null).subsettedFeature;sourceFeature/targetFeatureare its first and remaining members.TargetSuccession(MultiplicitySourceEndMember 'then' ConnectorEndMember), §8.2.2.9.3SourceSuccession, §8.2.2.18.3TransitionSuccession(EmptySourceEndMember ConnectorEndMember), §8.2.2.17.1ActionBodyItem(aSuccessionAsUsagemember forfirst a then b;,AssignmentNode,TerminateNode,PerformActionUsage); pinnedSysML.xtexthas the same productions.thenshorthand is the nearest preceding occurrence lexically.Where the spec and the pilot differ in emphasis, the spec decided: an
EmptySourceEndMemberowns noReferenceSubsetting, so the strict OCL would leave a positional succession with one related feature. §7.17.2 states which occurrence that source end stands for, so the end's reference is answered from it as an implied one, and the source end is not reported as owning aReferenceSubsetting. The pilot'sexport-jsonagrees: target ends carry anownedReferenceSubsetting, empty source ends do not, andrelatedFeaturestill lists both.Rows moved (source files under
docs/project/spec-compliance/02-detailed-semantic-compliance-map/):15-state-machine.md, state-body successions: the owned-ends row is ✅ Faithful (fix(semantics,export): athensuccession reaching its source by position owns its two end features — a bareentry;or an unnamed action before it, with or without a multiplicity — on the native walk and in the RDF conversion, as the notation grammar's TargetSuccession declares them and the pilot exports them #2278's part). TherelatedFeaturederivation row staystransition first off then on.deep;). Such an end references the chainFeatureit owns (ConnectorEnd→OwnedReferenceSubsetting→OwnedFeatureChain), and no element stands for that feature on the symbol side, so the succession leaves the three properties unanswered rather than naming the chain's last step.13-action.md, action-bodythen: staysif,whileorforstatement still has no element standing for it (the pilot exportsIfActionUsage,WhileLoopActionUsage,ForLoopActionUsage), so a succession beside one owns both ends but leavesrelatedFeature,sourceFeatureandtargetFeatureunanswered rather than answering one feature short. Giving those statements symbols changes how names in their nested bodies resolve and is not a part of this change. The chained-end limitation above applies tofirst a then b.c;here as well.What the audit got wrong: it described both rows as one remaining gap. The owned-ends half was already covered by #2278; what remained was the derivation, the two-ended form and the statement nodes — and the control statements, which the audit did not mention, keep the action row from being ✅.
How it was verified
Tests added (fail on
develop, pass here),internal/semantic/semantics/succession_ends_owned_test.go:TestThenSuccessionRelatesStatementActions—then perform,then assign,then terminate;TestTwoEndedFirstThenIsAnOwnedSuccession—first a then b;, namedsuccession s first b then c;,start/done, a target multiplicity;TestSuccessionRelatedFeaturesAreItsEndsReferences— state-bodythen,transition first … then …, a triggered transition;TestSuccessionAtAControlStatementIsUnanswered— pins the control-statement limitation;TestSuccessionWithAChainedEndIsUnanswered—first a then obj.child;andtransition first off then on.deep;are unanswered, not the chain's last step;first a.k then obj;(a succession usage with written ends) answers its chain feature.then_succession_member_test.goTestThenSuccessionRelatedFeaturesnow expects the two formerly unanswered rows to be answered.No parser or runtime code changed, so no new parser golden, conformance fixture, trace or robustness case: the forms involved are already locked there (
tests/parser/testdata/parse/,internal/exec/runtime/testdata/conformance/action_body_*), and those suites pass unchanged.Gates on this head:
gofmt -l .empty,go build ./...,go vet ./...,make lint,python3 scripts/spec_compliance.py check,python3 scripts/changelog.py check,tests/hygiene. With the training, pilot and spec-example corpora required:tests/export,tests/corpus(sweep and round trips),internal/translate/export,internal/doc/...,tests/codegen,internal/exec/smtpassed before the final merge ofdevelop; the fullgo test ./...andpilot-apijson-diff -checkon the merged head are noted in a comment once finished.Baselines moved by this change (beyond those #2278 moves)
tests/export/testdata/convert/end_binding_bodies.golden.ttl.sha256attribute win the body offirst a1 then a2 { … }is now owned by a succession usage and gets the impliedMultiplicitymember its sibling insuccession first a1 then a2 { … }already had.internal/ir/view/testdata/state-forms-tree.*.goldendo action { assign flame := true; }lists theassignment action usagethedoaction owns.internal/ir/view/testdata/state-forms-most.*,state-forms-running-most.*internal/translate/export/testdata/structure_differential_expected.txtConnector::relatedFeature/sourceFeature/targetFeature: equal +56, symbol-missing −3;Type::featuredifferent −135,Usage::nestedActiondifferent −74,Behavior::stepdifferent −6. New disagreements come only with the newly matched elements and follow class-wide gaps already in the file:Membership::memberElementIdsymbol-missing +255 andFeature::isConstantsymbol-extra +258 (anonymous features),Element::ownedElementdifferent +24 andownedRelationship+30 (bodies of the newly matched statement actions, not traced one by one).The chained-end fix moved
structure_differential_expected.txtonce more: inexamplesandexamples/pilot-corpora, two successions each with a chained target move fromdifferent(the symbol named the last step, the graph the chain feature) tosymbol-missingonConnector::relatedFeature, and with them every property counted for those two elements (equal/different−2,symbol-missing+2 per property).tests/corpus/testdata/training_examples_expected.txtis untouched.Dry merges
develop: merged after fix(export): athensuccession reaching a nameless member by position states it as its sourceFeature and Relationship::source — a bareentry;or an unnamed action before it, a positional target likewise — as the pilot derives them and the native walk answers #2259 landed there.thensuccession reaching its source by position owns its two end features — a bareentry;or an unnamed action before it, with or without a multiplicity — on the native walk and in the RDF conversion, as the notation grammar's TargetSuccession declares them and the pilot exports them #2278 (fix/positional-then-succession-ends-native): its head is merged in; the one conflict was the13-action.mdrow both edit, resolved to this branch's wording, which supersedes it.thensuccession reaching a nameless member by position states it as its sourceFeature and Relationship::source — a bareentry;or an unnamed action before it, a positional target likewise — as the pilot derives them and the native walk answers #2259 (fix/positional-then-relationship-ends): now ondevelopand merged in. No source conflict; the four generated digeststests/export/testdata/convert/{state_machine,irregular_layout,imported_references,endpoint_scopes}.golden.ttl.sha256conflicted and were re-recorded. Compared withdevelop's Turtle for the same fixtures, the only difference is the two owned ends (EndFeatureMembership,ReferenceUsage, the target'sReferenceSubsetting) fix(semantics,export): athensuccession reaching its source by position owns its two end features — a bareentry;or an unnamed action before it, with or without a multiplicity — on the native walk and in the RDF conversion, as the notation grammar's TargetSuccession declares them and the pilot exports them #2278 adds to each positionalthensuccession.Merge of
developafter #2278 landedMerges of
develop(508d0fab4a, then after #2359 and #2263 landed, lastd332e73fbf). The generated families were resolved by takingdevelop's side and re-running each recorder; only the two compliance rows were merged by hand, andpilot-differential-baseline.jsonandtests/corpus/testdata/training_examples_expected.txtare identical todevelop. Againstdevelopthis PR moves:derived_census_baseline.json:elements/impliedof six roots;derived_census_records.tsv: 776 rule-root lines over 136 rules, all in theours.*columns, nopilot.*figure;structure_differential_expected.txt(the successions and statement action usages that are now elements, and the chained ends reportedsymbol-missing);tests/export/testdata/convert/end_binding_bodies.golden.ttl.sha256;Two tests that
developgained failed on the merged tree and are fixed here:TestTransitionReflectsItsEffectMetaclassAndEnds:TransitionUsage::sourceand::targetare thefeatureTargetof the succession's ends (SysML v2.1deriveTransitionUsageSource,deriveTransitionUsageTarget; KerML 1.1deriveFeatureFeatureTarget), the last step of a chained end, while the chained succession'srelatedFeaturestays unanswered (semantics/annotations.gosuccessionEndFeatureTargets,semantics/reflective_transitions.gotransitionSuccessionEnd).TestDrawioRoundTrip(route onaction-swimlanes): a two-endedfirst a then b;is now an element a draw.io reroute can target, and the@Routeit writes into the succession'sUsageBodyannotates the succession (ast/metadata.goDeclaredMetadata;TestTwoEndedFirstThenBodyMetadataAnnotatesTheSuccession).Checklist
make lintpasses locally; the Go suites of the touched layers pass on the merged headchanges/unreleased/succession-related-features-from-ends.fixed.mdLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/01bb4e8690d64dbdace1ab877ee9eaba
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/01bb4e8690d64dbdace1ab877ee9eaba?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work