Skip to content

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 #2172, so an interface definition with ends named source and target answers its ends' types, as the pilot derives them - #2194

Merged
HuiJun merged 3 commits into
developfrom
fix/owned-end-shadows-relationship-source
Nov 13, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

An interface, connection or allocation definition whose own ends are named source and target — the observatory's interface def OpticalInterface { end source : OpticalPort; end target : OpticalPort; } — answered Relationship::source and target as [] on the query leg: the member path and the property read resolved the name to the own end, a feature that states no value, and that empty answer shadowed the metaclass property. #2172 made a valueless member the element only inherits (the library's Links::BinaryLink::source end every connector gets) yield to the metaclass property; this extends the rule to a valueless member the element declares as an end, since an end carries no value of its own and the pilot derives source/target from the ends' types whatever their names.

// semantics: was InheritsValuelessMember — "contributed, not declared, valueless"
func (m *Model) ValuelessMemberYields(sym, feature) bool {
    member := LookupMember(sym, feature)
    if !(contributed == member) && !declaresEnd(member) { return false }
    return m.statesNoValue(member)   // now also walks implicitEndRedefinitions
}

OpticalInterface.source → OpticalPort, target → OpticalPort (relatedElement was already OpticalPort, OpticalPort); an own valueless attribute that is no end (part a : A { attribute isComposite : Boolean; }) keeps shadowing isComposite, as the new test checks beside the end case. The test fails on develop (both cells []).

Found by the QVTS reflection cross at #2180's landing (Open-MBEE/qvts#97): InterfaceDefinition::source/target of OpticalInterface — the RDF writer states OpticalPort since #2180, the native side answered nothing.

Specification basis

KerML 1.1 §8.3.4.4.2 (Association::sourceType/targetType redefine Relationship::source/target as the ends' types) and §8.3.4.5.1 (a Connector's sourceFeature/targetFeature likewise); SysML v2 §8.3.11 (a connection, interface or allocation definition's ends redefine the general association's by position). No compliance row moves: the derivation is #2175's; this PR only stops a same-named own end from masking it on the query leg.

How it was verified

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 fixed all 2 findings · Follow Devin's work

Devin Review

…ields to Relationship::source and target on the query leg — as an inherited library end does since #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>
@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 Bot and others added 2 commits November 13, 2026 07:42
…e an explicit one when it yields to a metaclass property — a stated empty value at its position keeps shadowing

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…fining its positional parent explicitly names one general, not two, so the valueless walk stays linear in a chain

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)
  • Positional empty values lose shadowing — Real: an end's positional redefinitions hold beside an explicit :>> (KerML 8.3.3.3.4; implicitEndRedefinitions says so), so statesNoValue now walks them in every case — connection def S :> G, G2 { end source : A redefines q; … } with G::a = null keeps the stated empty value (new test, fails without the fix).
  • Exponential traversal of redefined ends — Real: an end that redefines its positional parent explicitly named that parent twice (explicit + positional), doubling the walk at each level of a chain; the generals are now deduplicated so each is visited once (new 16-level chain test).

View findings in Devin Review · Follow Devin's work

Devin Review

@HuiJun
HuiJun added this pull request to the merge queue Nov 13, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Full gate on 04075e9 / 318e971 (the two later commits touch statesNoValue and the queryexec tests only; those packages re-ran green on 318e971): make test-short 134 packages ok; cmd/sysml, internal/exec/smt, tests/codegen, tests/corpus (with OPENSYSML_REQUIRE_TRAINING_CORPUS, OPENSYSML_REQUIRE_PILOT_CORPORA, OPENSYSML_REQUIRE_SPEC_EXAMPLES, OPENSYSML_REQUIRE_PSSM_SUITE set), tests/export, tests/model and tests/wasm pass re-run alone at -timeout 40m after Go's 10-minute package default under whole-suite load; derived-census -check, pilot-apijson-diff -check and the structure differential reproduce; make lint, make changelog-check, go vet ./..., gofmt -l . clean.

Merged via the queue into develop with commit a159469 Nov 13, 2026
30 checks passed
@HuiJun
HuiJun deleted the fix/owned-end-shadows-relationship-source branch November 13, 2026 10:24
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