Skip to content

fix(symbols,semantics): a then x; succession without a body is the SuccessionAsUsage its action or state owns — the semantic model, the symbol structure and the query leg's ownedRelationship list it, as the pilot exports it and the RDF writer states it - #2121

Merged
HuiJun merged 14 commits into
developfrom
fix/then-succession-member
Nov 11, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

A then x; succession written without a body — then action acquire;, then done; — is the SuccessionAsUsage its action or state owns through a FeatureMembership (SysML.xtext ActionTargetSuccession/TargetSuccessionMember), as the pilot exports it and the RDF writer already states it. The symbol builder made a succession an anonymous symbol only when it had a body, so the semantic model, the symbol structure and the query leg's Descendants(relationships = true) walk listed no membership for a bodiless one — the QVTS cross ledger's ActionUsage/StateUsage ownedRelationship cells disagreed on exactly these members.

case *ast.SuccessionEdge:
    buildAnonymousNode(scope, d, SymbolSuccessionUsage, d.Members, vis, trivia)

Every succession edge is now an anonymous SymbolSuccessionUsage; one with a body still declares its own features in its scope. A state body's then x; is one too — EntryTransitionMember and TargetSuccessionMember both end in a SuccessionAsUsage (SysML.xtext:1796, :1703). The tree view, which now meets these symbols, draws them in the successions compartment as written — then off, or first running then off where the source was named — and names the member a then action b sequences to.

The new symbols reach the editor too. An entry transition's then idle; ends in ; by its production (:1796-1801) and has no name, so no Route or Style can be stated about it, inline or in a view; the editor had refused nothing and written then idle { @Route … }, which the parser rejects. ast.SuccessionAdmitsBody states the grammar once (the parser reads it too; the runtime must not depend on the parser): the editor refuses the inline annotation (FailureNotNamed, "ends in ';' where no body is written"), and the state view leaves the entry edge unsteered, so a draw.io import notes the re-route as it does for other edges no Route steers.

The new symbols are subjects of the self-check too. SysMLValidation::validateConnectorRelatedFeatures asks a succession for two related features; a then done; found none for done (its target is the FinalNode marker the edge absorbs) and a then assign t := …; or an entry transition's then idle; reaches a member the symbol model has no element for yet (the statement, the entry action), so every model with a bare then failed the rule. Now relatedFeature reaches the inherited library done/start, and where an end names a member no element stands for it is unanswered — ReflectiveElements says so, the self-check reports the constraint unevaluated as it does for any underived feature, and a library record keeps the end as a zero position. The structure differential already classed these ends symbol-missing; it, the census and the snapshot reproduce.

Known limitation, out of this PR's scope: first x then y; written with both ends in an action body is read as an InitialNode with a successor and has no SuccessionAsUsage symbol yet, where the RDF writer and the pilot state one (action def A { action x; action y; first x then y; } lists two memberships, not three). A state body's first a then b; already does.

Specification basis

SysML v2 8.2.2.16.2 (action successions: then target succession members), 7.17.4/8.3.16 SuccessionAsUsage; KerML 8.3.4.6 Succession. No compliance row moves.

How it was verified

  • internal/semantic/semantics TestThenSuccessionIsAnOwnedMember fails on develop: observe's OwnedRelationships read Membership, ActionUsage, ActionUsage there, Membership + three SuccessionAsUsage and two ActionUsage memberships now.
  • TestSuccessionBodyScope restated: each then has a scope of its own, only the bodied one has a member.
  • internal/semantic/semantics TestThenSuccessionRelatedFeatures: then done relates acquire done; then assign's and the following then done's relatedFeature are unanswered; tests/grpc TestGRPCConformance/self_check_holds (a then assign …; then done; action) holds again.
  • internal/syntax/parser TestSuccessionAdmitsBody (action, state after a state: yes; entry transition, definition body: no); internal/check/edit TestSetRouteAtOfEntryTransitionIsRefused fails before the view/edit change with "the edited model does not parse"; TestDrawioRoundTrip picks the steerable transition again, as on develop.
  • View goldens (state-forms-*) re-recorded: each gains its succession rows.
  • Structure differential re-recorded: matched 30060 → 30252; Element::ownedRelationship equal 28619 → 28744, Definition::usage different 27 → 16, Connector::connectorEnd equal 372 → 468. The new successions also surface rows of their own that later sub-families address: Connector::relatedFeature/sourceFeature/targetFeature symbol-missing 111 → 178 (a then succession's implied source end) and Feature::isComposite different 229 → 325.
  • Derived census re-recorded (training elements 7926 → 8036): every moved row is growth on the rules a SuccessionAsUsage answers; no value shrank. pilot-apijson-diff -check, make stdlib-snapshot and make docs-counts reproduce unchanged.
  • build, vet, gofmt, make lint green; full go test ./... with the training, pilot, spec-example, PSSM and library-XMI corpora.

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 Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 6 commits November 10, 2026 23:56
… its action or state owns — bodiless as with a body, as the pilot exports it and the RDF writer states it; the tree view draws it as a `then x` succession row

The symbol builder registered a SuccessionEdge only when it carried a body, so Model.OwnedRelationships (and so the query leg's ownedRelationship, the structure, the census) listed no membership for a bare `then acquire;` where the RDF writer, walking the notation, states one owning a SuccessionAsUsage. Every edge is now an anonymous succession usage of its owner; the symbols test that pinned the old shape counts one scope per then. The tree view's successions compartment reads the edge as `then x` (its source only where written).

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…ssions

Every root moves the same way: the bodiless then successions now exist as symbols and match the graph's elements by id (examples matched 30060 -> 30252), so Element::ownedRelationship (equal 28619 -> 28744), Element::ownedElement, Definition::ownedUsage, Definition::usage (different 27 -> 16) and Connector::connectorEnd (equal 372 -> 468) gain equal rows. The new different rows are the successions' own properties the symbol structure does not derive yet: their ends (Connector::relatedFeature/sourceFeature/targetFeature symbol-missing 111 -> 178) and Feature::isComposite (different 229 -> 325), the next sub-family. No row that was equal moved away.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Each root counts the bodiless then successions as elements now (training 7926 -> 8036): every moved row is growth — the rules a SuccessionAsUsage answers (owner, owningMembership, owningType, isComposite, featuringType, the Relationship ends, Type::feature and the like) gain carriers and values; no value count shrank.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…tion or state

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
A then edge whose production ends in ';' (SysML.xtext EntryTransitionMember, a DefinitionBodyItem's then) has no body to state a Route or Style in and no name to state one about. Now that the edge is a symbol of its own, the editor refused nothing and wrote a body the parser rejects; parser.SuccessionAdmitsBody states the grammar once, the editor refuses the inline annotation with FailureNotNamed, and the state view leaves the entry edge unsteered so a draw.io import notes the re-route instead of offering it.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…y's done, and is unanswered for a member no element stands for

The grammar fact a then edge's production ends in ';' moves to ast.SuccessionAdmitsBody, which the parser, the view and the editor share: the runtime must not depend on the parser. A then done; now relates to the inherited done (a then start likewise), and a succession whose end is a statement or an entry action — members the symbol model has no element for yet — answers no relatedFeature rather than one feature short, so the self-check reports validateConnectorRelatedFeatures unevaluated for it instead of failing every model with a bare then. A record keeps such an end as a zero position.

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

Merge coordination: this PR is held from CI until it is re-based by merge. Its base is stale — it does not contain develop 98d8eca (#2117 touched internal/semantic/semantics/annotations.go and model.go). Please fix the open Devin Review findings locally, then do one --no-ff merge of origin/develop (regenerate derived_census_baseline.json and structure_differential_expected.txt with the repository tooling on the merged tree), run the full gate, and push exactly once. No rebase or force-push, no CI re-runs or labels: CI-optimization PRs #2118/#2120 currently have runner priority and the watcher starts only released heads.

devin-ai-integration Bot and others added 2 commits November 11, 2026 02:59
… then done

A then action b; or then done; is an edge whose notation is the then alone (its target is the member after it): a body opened on it lands on another member, so SuccessionAdmitsBody refuses it and the editor refuses the inline Route; the tree view labels a FinalNode-targeted edge then done.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
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

FYI: the run on 192355c is green on every job except "Go static and integrity checks", which fails in govulncheck on GO-2026-6859 (net/http in go1.27.3). That is a toolchain issue, not this branch; #2126 moves the toolchain to go1.27.4. Once #2126 is in develop, a single git merge origin/develop here and a push will let this PR go green.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

FYI: #2084 just merged into develop (def12d6) and re-recorded internal/semantic/metamodel/derived_census_baseline.json, so this branch now conflicts with develop on that file. Resolve by merging origin/develop and regenerating the derived census with the repository tooling (tools/census/derived, then its -check) rather than hand-merging the JSON. #2124, which splits that baseline into a header + one-record-per-line TSV, is in flight too; whichever of the two lands second regenerates again.

devin-ai-integration Bot and others added 4 commits November 11, 2026 06:49
… body as the parser reads one — SuccessionAdmitsBody mirrors each kind's body parser, so the editor accepts a Route there and refuses one in a behavior or step body

The predicate answered by a list of action-like kinds that disagreed with the body parsers both ways: a case, analysis, verification, use case, calculation, expression, constraint, predicate or bool body carries ActionBodyItems and reads `then x { … }` clean, yet the editor refused an inline Route there; a behavior or step body is a feature body whose `then` takes no body, yet the predicate admitted one and the editor wrote notation the parser rejects. DefinitionKind/UsageKind.HasActionBodyItems state the kinds once; TestSuccessionAdmitsBodyAgreesWithTheParser drives every definition and usage kind through the parser and fails on the old predicate for the thirteen kinds that disagreed.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…ent, not between it and its function

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…ofmt)

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
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