Skip to content

fix(metamodel): a feature typed by a library type inherits that type's memberships in the symbol structure — a stated library base is read from the inheritance table as an implied one is - #2063

Merged
NicolasRouquette merged 21 commits into
developfrom
fix/inherited-membership-library-typed
Nov 9, 2026

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

Every feature typed by a library type — attribute isMandatory : Boolean; in a metadata definition, attribute q : Quantities::ScalarQuantityValue; — failed Type::inheritedMembership, Namespace::membership, Type::feature, Type::inheritedFeature, Type::directedFeature, Definition::usage and everything built on them in the symbol-backed structure ("unresolved specialization references"). #2060 made it visible on 16 metadata-body features of the training root, but the hole is older: a stated library base reaches computeStructureTypeMembers as the structure's own handle for a library row (a metamodel.Element with no Symbol), which the library-members path — gated on element.Symbol != nil && !e.structureKnows(element) — never selected; an implied base (Base::dataValues) arrives as a symbol and took it, which is why the implied members were there and the stated type's own were not.

structureLibraryBase names the library type a base stands for: a symbol-carrying base the structure does not own, or a library row the SymbolStructure resolves through LibrarySymbol. computeStructureTypeMembers and computeStructureNonPrivateMemberships read that type's memberships from the semantic inheritance table, as they already did for implied bases.

if base, ok := e.structureLibraryBase(element); ok {
    return e.structureLibraryTypeMembers(base, property)
}

The fallback is the symbol structure's only. The API-JSON graph structure (apiJSONGraphStructure) states its library bases as symbols already, and its LibrarySymbol resolves a graph reference through the identity catalog — which, for an anonymous base, answers an unrelated library type (Items::Item, Metadata::MetadataItem, Metaobjects::Metaobject). A first version of this branch reached it and moved the api-json differential on inheritedMembership/feature/member by tens of thousands of cells (the pilot-apijson-diff gate caught it); restricted to *SymbolStructure, the api-json baseline reproduces unchanged and the element form reads exactly as develop. The catalog mis-resolution is pre-existing and out of scope here; filed as a follow-up.

Measured (derived-property census, tools/cmd/derived-census -check green on the re-recorded baseline): against develop at #1980's merge, not-derived Type::feature family 5995 → 1071, Namespace::member 6576 → 1706, Usage::usage 4830 → 616; every one of the 29 moved rows moves toward the pilot; summary and silent list unchanged.

Structure differential (testdata/structure_differential_expected.txt, re-recorded with -update-structure-differential): the symbol structure now computes membership cells for library-typed features that the graph structure still leaves unsupported, so those cells move from equal (the differential counts a cell both sides leave unsupported as equal) to symbol-extra — on examples, Namespace::member 215 → 2092 symbol-extra, Type::feature 215 → 2138, Behavior::step +25, Definition::usage/directedUsage +38, RequirementUsage::{actor,stakeholder,subject}Parameter +8, Function::expression +25; different and symbol-missing do not move on any root.

Develop merged in --no-ff eight times, the last at #2051's merge 227e88e (base of this head); the generated files that conflicted each time (census baseline, structure differential) were taken from develop and re-recorded with their tools on the merged tree, never hand-merged. At 227e88e, develop's own re-recording at that commit reproduces its committed baseline (no drift), and this branch's differs from it on exactly the 29 census rules named above (summary served 297 / answering 276 / notDerived 9 and the silent list unchanged; Type::feature not-derived 5995 → 1071, Namespace::member 6576 → 1706, Usage::usage 4830 → 616) and moves 29 structure-differential rows equal → symbol-extra (19 existing, 10 new), with different and symbol-missing unmoved on every root. make stdlib-snapshot leaves stdlib.snapshot unchanged; pilot-apijson-diff -check reproduces without re-recording.

How it was verified

  • internal/semantic/metamodel/structure_library_base_test.go: attribute q : Quantities::ScalarQuantityValue; — Type::inheritedMembership and Namespace::membership must carry Quantities::ScalarQuantityValue::mRef, a feature only the stated type owns (the implied Base::dataValues cannot supply it); fails without the fix.
  • internal/translate/export/api_json_element_form_test.go is develop's: the element form (graph structure) still omits a library-typed feature's inherited features with the unresolved-reference reason, as on develop — this PR fixes the symbol structure.
  • go run -C tools ./cmd/pilot-apijson-diff -check: baseline reproduces, every root.
  • go run -C tools ./cmd/derived-census -check: green on the re-recorded baseline.
  • Full gate on the merged tree at 91db7f0: go build ./..., go vet ./..., go vet -C tools ./..., gofmt -l . empty, make lint, make docs-counts, go test ./... (132 packages ok, training/pilot/spec-example corpora required), derived-census -check, pilot-apijson-diff -check, TestSymbolStructureMatchesGraphStructure; git merge-tree against develop@227e88ee3b clean, no conflict markers.

Checklist

  • Targets develop
  • Changelog fragment: changes/unreleased/library-typed-feature-inherited-membership.fixed.md
  • Generated outputs re-recorded with their tools; movements adjudicated above

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

…s memberships in the symbol structure — a stated library base is read from the inheritance table as an implied one is

A base the model implies (Base::dataValues) reached the structure walk as a symbol element and took the library-members path; a base the notation states (`: Boolean`) came back as the SymbolStructure's handle for a library row — no symbol, metaclass known — and fell through to the owned-relationship filter, which has nothing for a library row. Every library-typed feature therefore answered Type::inheritedMembership, Namespace::membership, Type::feature and the properties built on them with "unresolved specialization references". structureLibraryBase resolves such a handle through the LibrarySymbolResolver. Derived-property census and structure differential re-recorded; the element-form omission test reads a genuinely unresolved type and asserts the library-typed feature is carried.

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)
  • Library-base comment exceeds length limit — The comment restated in two lines: the decision both member walks make and why a library type the structure only references (implied or stated) is read by its symbol.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 14 commits November 8, 2026 20:07
…e stated type's own feature — Quantities::ScalarQuantityValue::mRef, which no implied base supplies

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

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

# Conflicts:
#	internal/semantic/metamodel/derived_census_baseline.json
#	internal/translate/export/testdata/structure_differential_expected.txt
…ure differential on develop at #2060 — library-typed features inherit their type's memberships, metadata body features own their implied Redefinition

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…only — a graph structure states its library bases as symbols already

The graph structure the API-JSON element form evaluates over resolves a library reference by its id, and an anonymous graph base resolved to an unrelated library type (Metadata::MetadataItem, Items::Item), so the form listed their members as inherited; pilot-apijson-diff caught it. The symbol structure is the only one that refers to a library type by a row of its own.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…yped feature; the structure differential re-recorded on the symbol-only fallback

The API-JSON graph structure states its library bases as symbols already, so the
fallback that reads a library row through the symbol structure does not reach it:
the element form omits a library-typed feature's inherited features exactly as
develop does, and its test says so again. The differential now records the symbol
structure computing what the graph structure leaves unsupported.

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

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

# Conflicts:
#	internal/translate/export/testdata/structure_differential_expected.txt
… comment-parser fix

The symbol structure now computes Type::feature, Namespace::member and
what builds on them for library-typed features; the graph structure still
leaves those cells unsupported, so they move from equal to symbol-extra.
No different or symbol-missing count moves on any root.

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

develop's comment-parser fix registers a bare /* */ comment at a member
position as an element; the training root gains 26 elements (13 implied)
and 40 rules of the Element, Annotation, Membership, Namespace and
Relationship families move by that count. Against develop re-recorded at
the same commit, this branch differs on exactly the 29 rules its body
names; summary and silent list unchanged.

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

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

# Conflicts:
#	internal/semantic/metamodel/derived_census_baseline.json
#	internal/translate/export/testdata/structure_differential_expected.txt
…re differential on develop at #1980

Both were re-recorded on develop by #1980 and conflicted with this
branch's recordings; re-recorded with their tools on the merged tree.
Against develop's recording, the census differs on exactly the 29 rules
this fix moves (summary and silent list unchanged: Type::feature
not-derived 5995 → 1071, Namespace::member 6576 → 1706, Usage::usage
4830 → 616), and the structure differential moves 91 rows, every one
from equal to symbol-extra; different and symbol-missing never rise.

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

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

# Conflicts:
#	internal/semantic/metamodel/derived_census_baseline.json
#	internal/translate/export/testdata/structure_differential_expected.txt
…e differential on the develop merge

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration Bot and others added 5 commits November 9, 2026 02:54
…member walks

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

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

# Conflicts:
#	internal/semantic/metamodel/derived_census_baseline.json
#	internal/translate/export/testdata/structure_differential_expected.txt
…ifferential on the merged tree

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@NicolasRouquette
NicolasRouquette merged commit 1556ade into develop Nov 9, 2026
34 checks passed
@NicolasRouquette
NicolasRouquette deleted the fix/inherited-membership-library-typed branch November 9, 2026 15:47
devin-ai-integration Bot added a commit that referenced this pull request Nov 9, 2026
…ructure

Snapshot regenerated first (unchanged). #2063's structureLibraryBase is kept as
the one decision both member walks make; the recovered-symbol reading of this
branch (a library type held as a symbol-less row, a feature the structure leaves
to the semantic model) is folded into it, so there is a single rule.

Re-recorded by tool: goldens (condition_references re-pinned), the conformance
library table (260 -> 262), the agreement ratchet (constraint, calculation and
assert-constraint member rows keyed symbol-51/symbol-53), the structure
differential, the API JSON baseline (reproduces under -check) and both corpus
round trips (no verdict moved).

Structure differential: every root's matched/unmatched count is identical to the
pre-merge record; 53 property rows move because the graph structure now derives
the implicit Base::things subsetting of anonymous filter references
(Base::things::that, which the pilot writes) while the symbol structure does
not yet - graph-correct, symbol-side follow-up - and develop respells one
unbounded_operand id.

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