Skip to content

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

Merged
HuiJun merged 14 commits into
developfrom
fix/declared-end-feature-membership-native
Nov 17, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

On the native walk every declared end feature was owned through an EndFeatureMembership: an interface, allocation or connection definition's end source : OpticalPort;, a usage body's end x : T;, a KerML classifier's, association's or connector body's end feature e : X;. The RDF conversion writes a FeatureMembership for them (and the pilot exports one), reserving EndFeatureMembership for a connector's clause ends, so Element::ownedRelationship of such a definition disagreed between the two legs — the EndFeatureMembership population line open in the QVTS cross ledger on the observatory's OpticalInterface and FunctionToPart (four native elements the RDF lacks).

Now the reflective membership metaclass (semantics.membershipMetaclass) and the census's structural one (metamodel.membershipKind) answer EndFeatureMembership only for a connector's clause end — a connect a to b end symbol, a then succession's or a transition's succession's implied end — and a declared end feature is a FeatureMembership whose member isEnd, as the conversion writes it. Type::endFeature, ownedEndFeature, Feature::isEnd are unchanged: they already read isEnd.

The RDF conversion's library stubs follow the native rule (identity.OwningMembershipMetaclass), so the stubs it writes for Links::selfLinks::thisThing/sameThing, Occurrences::happensBeforeLinks::earlierOccurrence/laterOccurrence, Flows::flows::source/target — declared end features of the library — now read FeatureMembership, as the pilot's library XMI owns them; nothing else in the Turtle moves.

Specification basis

KerML 1.1 §8.3.3.3.3 EndFeatureMembership: "a FeatureMembership that requires its memberFeature be owned and have isEnd = true" — the metaclass constrains its member, it is not what makes a feature an end; Type::endFeature = feature->select(isEnd) and ownedEndFeature = ownedFeature->select(isEnd) (§8.3.3.1). Textual notation at the pilot pin: KerML.xtext OwnedFeatureMember returns FeatureMembership owns a body's feature whatever its EndFeaturePrefix (isEnd ?= 'end'); EndFeatureMembership is returned only by ConnectorEndMember and FlowEndMember. SysML.xtext likewise: a definition or usage body's end member goes through DefinitionMember/InterfaceOccurrenceUsageMember (FeatureMembership, EndUsagePrefix sets isEnd), and EndFeatureMembership is returned only by ConnectorEndMember, InterfaceEndMember (an interface usage's connect ends), FlowEndMember, MultiplicitySourceEndMember, EmptySourceEndMember, EmptyTargetEndMember. The pilot's export of each form and its library XMI (Links.kermlx: source/target under FeatureMembership with isEnd="true") agree with the text. No compliance row moves.

How it was verified

  • New internal/semantic/semantics/declared_end_membership_test.go: interface/allocation/connection definitions, a part definition's end part, a connection usage's body end, a KerML association's, classifier's and connector body's end feature all own FeatureMemberships whose members isEnd; a connect clause's and a KerML connector … from a to b's ends stay EndFeatureMembership. Fails on develop. reflective_memberships_test.go's connection def CD { end a; end b; } expectation moves with it.
  • Pilot probes (export-json at the 2026-09.1 pin) of the same fixtures: every declared end is FeatureMembership/isEnd true; every clause end (connect, connector, binding, succession first a then b) is EndFeatureMembership.
  • Goldens: 14 Turtle digests re-recorded; each differs from develop's output only by a sysml:EndFeatureMembership → a sysml:FeatureMembership on the library end stubs named above (8 lines in end_binding_bodies, 2 in the others).
  • Derived census (JDK 21, exporter required): re-record byte-identical. Structure differential: unchanged. api-json differential: re-recorded, unchanged (935 fragments in 9 roots).
  • internal/semantic/..., internal/doc/..., internal/translate/export, internal/check/..., tools suites, tests/export, the corpus sweep and round-trip (require variables set); gofmt -l ., go vet, make lint, changelog, doc-ids, hygiene, make docs-counts clean. make test-short result follows in a comment.

Stack

790534cd31 is git merge --no-ff of #2266's current head 93403f5313 (develop acb1944b7b merged there: #2275, #2282, #2296, #2313, #2315–#2319); this branch meanwhile carries #2274 (b012483384) and #2326 (6117ddcb60), merged into it by a maintainer. Moved generated baselines, each re-recorded by tool: tests/export/testdata/convert/endpoint_scopes.golden.ttl.sha256 (f458b7f83a: the fixture's conversion carries both this change's FeatureMembership-owned declared ends and #2266's flow ends; the only Turtle golden that moves); derived_census_records.tsv / derived_census_baseline.json (73fe3f8ecd; -check -recorded-pilot reproduces; scripts/rebaseline-movement.py: 2295 records moved, nothing unexplained — 2284 moved by the merged branch alone, develop's eleven-column format with pilot.nondeterministic 0 → 804 and its pilot column, pilot.value 3069559 → 3069052, pilot.empty 2834157 → 2833860; 11 moved by both sides, this change's declared ends counted beside #2266's flow ends on the same carriers). The structure differential, the api-json differential, the corpus ratchets and the parser goldens reproduce as merged. One fixture moved (26d8db8ca4): develop (#2313) resolves a transition endpoint by name resolution only, so the t8 case of reflective_transition_ends_test.go spells its nested target idle.inner in full, as the fixtures #2313 adjusted do; its expectation is unchanged.

Stacked on #2266 (fix/flow-end-native-memberships): 82ec554ce4 is git merge --no-ff of #2266's head 04156ff8d1 (itself develop at #2261); earlier merges fed553c599/fe02ea7c1e brought develop (#2259, #2260, #2270, #2261) in. Moved generated baselines, each re-recorded by tool: the five tests/export/testdata/convert/*.golden.ttl.sha256 digests (develop's positional-end source/target statements from #2259 on top of this change's end-feature memberships); structure_differential_expected.txt (zero rows new to the merge: every moved row is one side's alone); derived_census_records.tsv / derived_census_baseline.json (the 36 rows new to the merge are #2266's (Usage::*, kerml-examples) rows, byte-identical to #2266's own; every other moved value is one side's alone). api-json and pilot differentials reproduce unchanged.

c0d7366f4f merges #2278 (fix/positional-then-succession-ends-native, stacked here) into this branch. One generated baseline moves on the merged tree and is re-recorded by tool (go run -C tools ./cmd/hideo-suite -update): the cross-MDK conformance baseline, cases B13-013/014/015 (endCount B13::NodeEnds, 0 → 2) go fail → pass on the opensysml-go-props and opensysml-py-props arms — the two unnamed then successions of NodeEnds (then accept Sig; after first a1;, then action a3; after it) reach their source by position and now own their two end features, which is #2278's change; the opensysml-go/opensysml-py arms still fail those cases because they do not list an unnamed SuccessionAsUsage, a gap this stack does not touch. Nothing else moved.

Checklist

  • make test and make lint pass locally (the suites above; lint)
  • 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

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

The native walk answered EndFeatureMembership for every declared end; the RDF conversion and the pilot own them through a FeatureMembership with isEnd true, reserving EndFeatureMembership for the ends a connector clause mints (KerML.xtext ConnectorEndMember/FlowEndMember, SysML.xtext ConnectorEndMember, InterfaceEndMember, the succession end members). The census structural rule follows. The conversion's library end stubs follow the native rule: 14 goldens re-recorded, differing only in those stubs' metaclass. Census and api-json differential unchanged.
@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 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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ 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

Gate: make test-short on b6e577a — 138 packages ok; cmd/sysml and tests/codegen hit the repository's usual 10-minute aggregate timeout and pass when run alone. Also green on this head: tests/export, the corpus sweep and round-trip (require variables set), internal/semantic/..., internal/doc/..., internal/translate/export, internal/check/..., the tools module; derived census re-record (JDK 21, exporter required) and api-json differential re-record both reproduce the committed baselines unchanged; gofmt -l ., go vet, make lint, changelog, doc-ids, hygiene and make docs-counts clean.

@NicolasRouquette
NicolasRouquette added this pull request to the merge queue Nov 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 15, 2026
devin-ai-integration Bot and others added 3 commits November 16, 2026 01:18
Brings in #2259, #2260 and #2270 as landed. The five Turtle goldens both sides moved are re-recorded by tool under the merged code; census, structure differential and api-json differential reproduce unchanged.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Brings in #2261 as landed; no conflicts.

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

Stacks this change on #2266 (04156ff). The Turtle golden digests, the structure differential and the derived census are re-recorded by tool under the merged code; the census rows new to the merge are #2266's own (Usage::*, kerml-examples) rows unchanged, every other moved value is the sum of what each side moved alone; the api-json and pilot differentials reproduce unchanged.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@devin-ai-integration
devin-ai-integration Bot changed the base branch from develop to fix/flow-end-native-memberships November 16, 2026 04:26
devin-ai-integration Bot added a commit that referenced this pull request Nov 16, 2026
…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>
devin-ai-integration Bot added a commit that referenced this pull request Nov 16, 2026
…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>
… source and target (#2274)

* fix(semantics): type a transition's effect as declared and derive its 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>

* fix(semantics): derive a transition's target nested in a sibling state

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>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…2326)

defineTransitionEffect returned at the existing-name guard before giving a
declared effect the kind its declaration writes, so `do action effect : A`,
and a declared effect beside any other member named `effect`, stayed a plain
ActionUsage where the same effect under another name is a PerformActionUsage
(SysML v2.1 §8.2.2.18.3 EffectBehaviorUsage). The kind is now set before the
name is considered; the role name is still defined only when it is free.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 6 commits November 16, 2026 17:53
…feature-membership-native

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…erging fix/flow-end-native-memberships

The only baseline the merge moves (-check reproduces for the census, the
structure differential, the api-json differential, the corpus ratchets and
the parser goldens; rebaseline-movement.py: nothing unexplained): the
endpoint_scopes fixture's conversion now carries both this branch's
FeatureMembership-owned declared ends and the flow ends #2266 mints.

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

-check -recorded-pilot reproduces. rebaseline-movement.py: 2295 records moved,
nothing unexplained — 2284 moved by the merged branch alone (develop's
eleven-column format with the pilot.nondeterministic column, 0 -> 804, and
its pilot column: pilot.value 3069559 -> 3069052, pilot.empty 2834157 ->
2833860), 11 moved by both sides: this branch's FeatureMembership-owned
declared ends counted beside #2266's flow ends on the same carriers.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
develop resolves a transition endpoint by name resolution only (KerML
8.2.3.5; the first-vertex fallback is gone), so `then inner` from the state
body no longer reaches idle.inner: the fixture names it as the other fixtures
that relied on the fallback now do.

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

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…fix/flow-end-native-memberships

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot added a commit that referenced this pull request Nov 17, 2026
…mbership-native

The structure differential and four Turtle golden digests (endpoint_scopes,
imported_references, irregular_layout, state_machine) are the baselines the
merge moves; the derived census (-check -recorded-pilot), the api-json
differential, the corpus ratchets and the parser goldens reproduce as merged.
rebaseline-movement.py: 398 structure-differential records moved, every one
moved by both sides (#2268's FeatureMembership-owned declared ends and #2266's
flow ends under the same roots as this branch's positional succession ends),
nothing unexplained.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration Bot and others added 2 commits November 16, 2026 16:19
…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 (#2278)

* fix(semantics,export): a `then` succession reaching its source by position 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>

* docs(export): name the grammar rule a positional then succession's source end comes from

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

* docs(spec-compliance): the state-body succession-ends row states only the owned ends; relatedFeature derivation stays on its own approximate row

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

* docs(spec-compliance): the action-body then row no longer says a positional succession owns no ends

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

* chore(baselines): re-record after merging develop

- `internal/semantic/metamodel/derived_census_records.tsv`: 854 record(s) moved; 854 moved by both sides (the merge's verdict, adjudicate)
  - ours.carriers: 5681228 → 5707923 (+26695)
  - ours.empty: 3431759 → 3447662 (+15903)
  - ours.notDerived: 164530 → 165126 (+596)
  - ours.value: 2084939 → 2095135 (+10196)
- `internal/translate/export/testdata/structure_differential_expected.txt`: 401 record(s) moved; 247 moved by this branch; 154 moved by both sides (the merge's verdict, adjudicate)
  - examples matched: 36647 → 36792 (+145)
  - examples unmatched: 11560 → 11570 (+10)
  - examples/pilot-corpora matched: 51298 → 51488 (+190)
  - examples/pilot-corpora unmatched: 10041 → 10061 (+20)
  - examples/spec-examples matched: 8354 → 8409 (+55)
  - examples/spec-examples unmatched: 3257 → 3262 (+5)
  - examples/sysml-v2-training matched: 9271 → 9316 (+45)
  - examples/sysml-v2-training unmatched: 1965 → 1975 (+10)
  - tests/testdata matched: 1559 → 1584 (+25)

* chore(baselines): re-record after merging fix/declared-end-feature-membership-native

The structure differential and four Turtle golden digests (endpoint_scopes,
imported_references, irregular_layout, state_machine) are the baselines the
merge moves; the derived census (-check -recorded-pilot), the api-json
differential, the corpus ratchets and the parser goldens reproduce as merged.
rebaseline-movement.py: 398 structure-differential records moved, every one
moved by both sides (#2268's FeatureMembership-owned declared ends and #2266's
flow ends under the same roots as this branch's positional succession ends),
nothing unexplained.

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…merging fix/positional-then-succession-ends-native

B13-013, B13-014 and B13-015 (endCount B13::NodeEnds, 0 -> 2) go fail -> pass on the opensysml-go-props and opensysml-py-props arms: the two unnamed `then` successions of NodeEnds reach their source by position (`first a1; then accept Sig; then action a3;`) and own their two end features since #2278. The opensysml-go and opensysml-py arms still fail them, not listing an unnamed SuccessionAsUsage, which this change does not touch. Recorded with `go run -C tools ./cmd/hideo-suite -update`; `-check` reproduces.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
Base automatically changed from fix/flow-end-native-memberships to develop November 17, 2026 01:28
@HuiJun
HuiJun added this pull request to the merge queue Nov 17, 2026
Merged via the queue into develop with commit 95b462c Nov 17, 2026
32 checks passed
@HuiJun
HuiJun deleted the fix/declared-end-feature-membership-native branch November 17, 2026 02:27
devin-ai-integration Bot added a commit that referenced this pull request Nov 17, 2026
Usage::directedUsage over examples/ measures 4186 equal once #2268's
flow-end memberships meet the self-model additions; the cell-wise merge
had summed to 4129.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot added a commit that referenced this pull request Nov 19, 2026
develop's native FlowEnds (#2266, #2268, #2369) supersede this branch's
synthesized ones, so the synthesis, its ExpressionFlowEnd role, ids and
tests are dropped; the filter-condition and body-result synthesis stays
and wraps develop's withFlowEndFeature. kinds.go keeps this branch's
ExtendedUsage branch ahead of #2279's narrowed ReferenceUsage test.

Two gaps the merge exposed are fixed at the root: a flow's FlowEnds are
now also its ownedMember/ownedElement/member (withSynthesizedMembers
places FlowEndMembers at their clause) and the element form answers an
implied end, its ReferenceUsage and its ReferenceSubsetting from the
conversion's slots; and a usage declared by prefix metadata alone
(`#M x;`, a plain Usage) is composite by default on the symbol side as
the RDF writer already states it, instead of referential.

Generated artifacts re-recorded by tool only: structure differential
(FlowEnds listed as members, Usage::isReference back to develop's
figures), derived census (elements/implied fall where the duplicate
FlowEnd synthesis went away).

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