Skip to content

fix(semantics,export): the ReferenceUsage a flow's end owns is named by the feature it redefines in the RDF conversion and answers isVariable true on the native walk — image in flow from telescope.image to …, owned by an Occurrence-typed FlowEnd — as KerML 1.1 § 8.3.3.3.4 names it, SysML v2.1 § 8.3.16.6 types its owner and the pilot exports both - #2369

Merged
HuiJun merged 3 commits into
developfrom
fix/flow-end-feature-name-variable
Nov 18, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

A flow's end (from telescope.image) owns a nameless ReferenceUsage redefining the last feature it names. The two legs of this implementation disagreed on four of its cells, which the QVTS reflection cross surfaced at the pin on #2266: the native semantic walk answered isVariable false where the RDF conversion stated true, and the conversion stated no memberName on the usage's FeatureMembership (nor a name on the usage) where the native walk derived the redefined feature's name. The pilot exports memberName and name "image", isVariable and mayTimeVary true, so each leg takes the other's answer:

  • internal/semantic/semantics/usage.go: synthesizedUsageMayTimeVary answers for the implied flow-end feature as for the other synthesized referential parts — its owning type is the FlowEnd, redefining Flows::Flow::source/target, an Occurrence-typed feature (UsageMayTimeVaryUnderLibraryFeature); never in a KerML document, where a Feature has no Usage::mayTimeVary.
  • internal/translate/export/rdf_out.go: flowEndReferences states sysml:name on the usage and sysml:memberName on its membership from the model's effective name (flowEndFeatureName), derived, so stated by name alone; nothing when the end resolves to nothing.
  • internal/translate/export/mapping_shape.go: a nameless feature its FeatureMembership names under a positional owner stays positional for the decoder, as the end itself is, so the Turtle → notation round trip holds.

Specification basis

KerML 1.1 § 8.3.3.3.4 (Feature::namingFeature): a feature declaring no name takes the name of the feature it redefines, which Membership::memberName derives. SysML v2.1 § 8.3.16.6: a FlowEnd redefines Flows::Flow::source or target, typed by Occurrence, so the usage it owns varies in time (deriveUsageMayTimeVary). No spec-compliance row moves: each leg already derived one of the two; this aligns them.

How it was verified

  • TestFlowEndFeatureVariesInTime (internal/semantic/semantics, library-backed): both ends' usages answer isVariable and mayTimeVary true, the ends themselves false.
  • TestElementFormFlowEndFeatureIsNamedByItsRedefinedFeatureAndVaries (internal/translate/export): flow f from a.x to b.y — each FlowEnd's FeatureMembership names its ReferenceUsage x / y, equal to the usage's name, no declaredName, isVariable and mayTimeVary true.
  • tests/export goldens re-recorded by -update: 4 files, two name and two memberName triples, nothing else.
  • Structure differential (TestSymbolStructureMatchesGraphStructure) re-recorded: Element::name, Element::qualifiedName, Membership::memberName, OwningMembership::ownedMemberName symbol-extra 5 → 2 (training) and 4 → 1 (pilot corpora), every movement toward agreement; different counts unchanged.
  • api-json differential re-recorded by pilot-apijson-diff -update, -check reproduces: one row moves, FeatureMembership.memberName, oursMissing → presentEqual in 11 fragments, 92 values (presentEqual 2105606 → 2105698, oursMissing 303083 → 302991); adjudicated in docs/project/api-json-differential.md; make docs-counts run.
  • derived-census -check -recorded-pilot: reproduces (no movement).
  • TestExamplesSweep with OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_SPEC_EXAMPLES=1: ok, no round-trip verdict moves.
  • Probes by hand (-convert ttl, then -from ttl -convert sysml): an end resolving to nothing (to b.zz) states no name; a bare end (from a) names a; a KerML flow states the name and no isVariable; all three round-trip.
  • go build ./..., go vet ./..., gofmt -l . (empty), make lint, tests/hygiene, tools/referee/apijson, scripts/changelog.py check, scripts/check-doc-ids.py: clean. make test-short: ok, with the packages that hit the 10 m default or a full local disk under concurrent load (cmd/sysml, internal/exec/{runtime,smt}, tests/{codegen,export,model,wasm}) rerun alone with -timeout 40m, all ok.

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

…by the feature it redefines in the RDF conversion and answers isVariable true on the native walk — `image` in `flow from telescope.image to …`, owned by an Occurrence-typed FlowEnd — as KerML 1.1 § 8.3.3.3.4 names it, SysML v2.1 § 8.3.16.6 types its owner and the pilot exports both

The two legs disagreed on four cells of a flow end's redefining ReferenceUsage (the QVTS reflection cross at the #2266 pin): the native walk answered isVariable false where the conversion stated true, and the conversion stated no memberName on its FeatureMembership (nor a name on the usage) where the native walk derived the redefined feature's. The pilot exports memberName and name "image", isVariable and mayTimeVary true.

- semantics/usage.go: synthesizedUsageMayTimeVary answers for the implied flow-end feature as for the other synthesized referential parts — its owning type is the FlowEnd, redefining Flows::Flow::source/target, an Occurrence-typed feature (UsageMayTimeVaryUnderLibraryFeature), never in a KerML document.
- export/rdf_out.go: flowEndReferences states sysml:name on the usage and sysml:memberName on its membership from the model's effective name (flowEndFeatureName); nothing when the end resolves to nothing.
- export/mapping_shape.go: a nameless feature its FeatureMembership names under a positional owner stays positional for the decoder, as the end itself is, so the round trip holds.
- Tests: TestFlowEndFeatureVariesInTime (library-backed), TestElementFormFlowEndFeatureIsNamedByItsRedefinedFeatureAndVaries.
- Re-recorded by tool: tests/export goldens (4 files: two name and two memberName triples); structure differential (name/qualifiedName/memberName/ownedMemberName symbol-extra 5 -> 2 and 4 -> 1, both roots, all toward agreement); api-json differential (FeatureMembership.memberName oursMissing -> presentEqual in 11 fragments, 92 values; presentEqual 2105606 -> 2105698, oursMissing 303083 -> 302991), adjudicated in docs/project/api-json-differential.md; derived census and the corpus round-trip sweep 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

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 found 1 finding. Devin automatically fixed it.

Fixed by Devin (1)
  • Code comment exceeds repository limit — The test's header comment is two lines now (the repository's comment gate passes on the diff).

View findings in Devin Review · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Local gate on d939853 (code unchanged since 0049993; the second commit shortens a test comment):

  • go build ./..., go vet ./..., gofmt -l . (empty), make lint: clean
  • go test -count=1 ./tests/hygiene, go test -C tools ./referee/apijson: ok
  • python3 scripts/changelog.py check, python3 scripts/check-doc-ids.py: ok
  • go test -count=1 ./internal/semantic/semantics -run 'TestFlowEndFeatureVariesInTime|FlowEnd|MayTimeVary', go test -count=1 ./internal/translate/export: ok (the structure differential re-recorded by -update-structure-differential, every movement toward agreement)
  • go test -count=1 ./tests/export -run TestGoldenConversions: ok after -update (4 goldens, two name + two memberName triples)
  • go run -C tools ./cmd/pilot-apijson-diff -check: reproduces after -update (one row, FeatureMembership.memberName, oursMissing → presentEqual, 92 values in 11 fragments; adjudicated in docs/project/api-json-differential.md); make docs-counts: ok
  • go run -C tools ./cmd/derived-census -check -recorded-pilot: reproduces
  • OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_SPEC_EXAMPLES=1 go test -count=1 ./tests/corpus -run TestExamplesSweep: ok, no verdict moves
  • make test-short: ok, with the packages that hit the 10 m default or a full local disk under concurrent load (cmd/sysml, internal/exec/{runtime,smt}, tests/{codegen,export,model,wasm}) rerun alone with -timeout 40m, all ok

CI: the first two runs were cancelled at zero steps by the platform (every PR run in the repository between 19:43 and 20:06 UTC was); the rerun is green.

@NicolasRouquette
NicolasRouquette added this pull request to the merge queue Nov 17, 2026
…ow-end-feature-name-variable

Conflicts: the api-json differential (index and six fragments both PRs re-recorded), one Turtle golden digest, the adjudication prose and the api-json form test file, where #2359 and this branch each appended a paragraph and a test — both kept, develop's first.

Re-recorded by tool on the merged tree: tests/export goldens (-update), the structure differential (-update-structure-differential), the api-json differential (pilot-apijson-diff -update; -check reproduces). The movement against develop is this branch's alone: FeatureMembership.memberName oursMissing -> presentEqual in the same 11 fragments, 92 values (presentEqual 2106153 -> 2106245, oursMissing 302536 -> 302444), restated in docs/project/api-json-differential.md. derived-census -check reproduces.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 18, 2026
@HuiJun
HuiJun added this pull request to the merge queue Nov 18, 2026
Merged via the queue into develop with commit 9add482 Nov 18, 2026
32 of 104 checks passed
@HuiJun
HuiJun deleted the fix/flow-end-feature-name-variable branch November 18, 2026 11:22
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