Skip to content

fix(query): a connector's Relationship::source and target answer on the query leg past the valueless source and target ends it inherits from the library — a connection, an interface, a flow and an allocation read them as the RDF writer and the pilot state them - #2172

Merged
HuiJun merged 2 commits into
developfrom
fix/connector-end-shadows-relationship-source
Nov 12, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

A Project over a connector read nothing for source and target while relatedElement, sourceFeature and targetFeature answered: allocation observeToCluster allocate observe to telescope.instrumentCluster returned source = (none), and every connection, interface and flow did the same, so a SysML v2 query of a model's connector ends could only reach them through the redefining properties.

The query leg reads an element's declared feature of a property's name before the metaclass property. Every connector inherits the library's source and target ends — Links::BinaryLink::source for a connection, Allocations::Allocation::source for an allocation — and they carry no value, so declaredFeatureValues answered present, empty and Relationship::source was never consulted. The then successions escaped only because their implied Occurrences::HappensBefore is not in member lookup.

executor.declaredFeatureValues now hands over to the metaclass property when the member found is one the element merely inherits (LookupContributedMember returns the same symbol as LookupMember), holds no value and shares its name with a metaclass property of the element. An element's own declaration (a redefining end, a feature it writes) and a valued inherited member keep answering as before.

A chained end now answers the chain Feature on the query leg, as sourceFeature/targetFeature already did; the RDF writer states source/target for a plain-named end only (#2135), so a cross-leg comparison sees new, truthful disagreements there until the writer names a chain's feature in a form both readers accept.

Specification basis

KerML 1.0 § 8.3.4.5.1 (Connector): relatedFeature, sourceFeature and targetFeature redefine Relationship::relatedElement, source and target. No row of docs/project/spec-compliance/ moves.

How it was verified

  • New TestConnectorSourceAndTargetAnswerPastInheritedEnds (internal/doc/queryexec): a connect a to b and an allocate a to b.x answer source = a and the connection target = b through a Project over KerML::Kernel::Connector. Fails on develop (both source cells empty), passes here.
  • TestInheritedStatedEmptyValueKeepsShadowingMetaclassProperty: an inherited attribute isComposite = null / = () keeps its empty cell, not the metaclass flag — only a member writing no value along its redefinitions yields (Model.InheritsValuelessMember).
  • TestMemberPathReadsConnectorSourcePastInheritedEnd: a member path d.source reads the connector's source past the inherited end as the connector's own row does.
  • go build ./..., go vet ./..., gofmt -l . (empty), make lint, go test -count=1 ./tests/hygiene, python3 scripts/changelog.py check, python3 scripts/check-doc-ids.py.
  • make test-short: 133 packages ok on this head; cmd/sysml, tests/codegen and tests/export hit the 10-minute default timeout on a cold build cache and pass run alone with -timeout 40m.
  • No export, census or structure-differential surface reads this path (DeclaredFeatureValues' other caller is the tree view's member listing, unaffected); RDF and API JSON already state source/target for a plain end.

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

🟢 Devin fixed all 2 findings · Follow Devin's work

Devin Review

…he query leg past the valueless source and target ends it inherits from the library — a connection, an interface, a flow and an allocation read them as the RDF writer and the pilot state them

The query leg reads an element's declared feature of a property's name before the metaclass property: for a connector, Model.LookupMember finds the library end Links::BinaryLink::source (Allocations::Allocation::source for an allocation), valueless, so the Relationship::source cell answered nothing while relatedElement, sourceFeature and targetFeature answered. A valueless member an element only inherits (LookupContributedMember finds the same symbol) no longer shadows a metaclass property of its name; an own declaration or a valued member still wins. New queryexec test fails on develop (both source cells empty), passes fixed.

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

… property of its name — a stated `= null` or `= ()` keeps answering, and a member path ending in a connector's inherited end reads the metaclass property too

The shadowing test keyed on the converted values being empty, which a member stating `= null` or `= ()` also is; it now asks the semantic model whether the inherited member and every feature it redefines write no value (Model.InheritsValuelessMember). A member path (`d.source`) walked its last segment through declaredFeatureValues alone, so the end it now marks absent made the path absent; it consults the metaclass property where the end is such a valueless inherited member.

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 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Inherited empty values replaced by metadata — Real: the check keyed on the converted values being empty, which an inherited = null/= () also is. It now asks the semantic model whether the inherited member and every feature it redefines write no value (Model.InheritsValuelessMember); new test fails without it.
  • Nested connector columns reject valid paths — Real: memberPathValues read its last segment through declaredFeatureValues alone, so the end now marked absent made d.source absent. It consults the metaclass property where the end is a valueless inherited member; new test fails without it.

View findings in Devin Review · Follow Devin's work

Devin Review

@HuiJun
HuiJun added this pull request to the merge queue Nov 12, 2026
Merged via the queue into develop with commit e6feeaa Nov 12, 2026
31 checks passed
@HuiJun
HuiJun deleted the fix/connector-end-shadows-relationship-source branch November 12, 2026 14:28
richetl pushed a commit to richetl/OpenSysML that referenced this pull request Nov 13, 2026
…ields to Relationship::source and target on the query leg — as an inherited library end does since Open-MBEE#2172, so an interface definition with ends named source and target answers its ends' types, as the pilot derives them

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
richetl pushed a commit to richetl/OpenSysML that referenced this pull request Nov 13, 2026
…s-relationship-source

fix(query): a definition's own valueless end named source or target yields to Relationship::source and target on the query leg — as an inherited library end does since Open-MBEE#2172, so an interface definition with ends named source and target answers its ends' types, as the pilot derives them
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