Skip to content

feat(export): derive imported memberships over the graph in the api-json element form - #2324

Merged
HuiJun merged 33 commits into
developfrom
feat/api-json-graph-imported-membership
Nov 20, 2026
Merged

HuiJun merged 33 commits into
developfrom
feat/api-json-graph-imported-membership

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

Based on develop: #2309 has merged and this PR now targets develop directly. The head f581f2e2b6 merges origin/develop at 19590f521d (no-FF, no conflicts, one merge base), which contains #2142, the pull request that was ahead of this one in the generated-baseline chain; that merge moved no generated baseline. Earlier links of the chain merged develop at 887660259b and #2142's head 0ce332238a separately. The changes of this PR are the non-merge commits.

What and why

Namespace::importedMembership, and with it membership and member of a namespace that imports, were withheld in the api-json / RDF element form for every namespace owning an import: structureImportedMemberships read ast.Import nodes and resolver scopes, which a model rebuilt from the graph does not have. They are now derived over the graph alone:

  • namespace and membership imports, recursive (::**) and all, import visibility, the excluded-namespace set that terminates import cycles;
  • filtered imports and package filter members, expose of a view, evaluated over the graph: literals, metadata feature reads through a cast ((as M).f), metaclass feature reads (Element::name, Type::isAbstract, …), @M / hastype / istype, comparisons, three-valued Boolean connectives with short-circuit, enum literals. A condition the evaluator cannot read withholds the property with an unsupported reason; it never hides everything silently;
  • hiding of imported memberships not distinguishable from an owned, inherited or other imported one;
  • library namespaces and memberships the graph only references, including a library namespace's own public re-exports, its unnamed memberships and its alias memberships (alias memberships are now addressable library stubs);
  • a type inherits its generals' public and protected imports.

importedMembership joins the repeated lists that -inherited-members (APIJSONOptions.InheritedMembers) writes; default output stays owned-only as on develop.

A membership import of an alias imports the alias Membership itself (see the adjudication below); that is a behaviour fix of the RDF, api-json and reflective forms, with its own changelog fragment.

Two root-cause fixes surfaced by the corpus round trip: resolveTarget did not resolve a feature read past a cast against the cast's target type, so filter (as T).f; could not be written back; and the RDF reader resolved a library alias membership id through the qualified-name fallback with a warning.

Specification basis

KerML 1.1: §8.3.2.4.5 (Namespace::importedMembership, membership, member, visibleMemberships, importedMemberships), §8.3.2.4.2 (Import::importedMemberships, visibility, isRecursive, isImportAll), §8.3.2.4.4 / §8.3.2.4.7 (MembershipImport, NamespaceImport), §8.3.2.4.3 (Membership::isDistinguishableFrom) with §7.2.5.4, §8.3.3.1.10 (Type::visibleMemberships, nonPrivateMemberships, inherited memberships), §8.3.4.13.4 and §8.4.4.14 (Package::includeAsMember, filter conditions), §8.2.5.8.1 (feature read past a cast). SysML v2.1 §8.3.26 (Expose).

Compliance row 06-rdf-interchange:26 is updated but stays ⚠️ approximate: the import derivation itself is no longer a gap, but the row's other withholdings remain, and for imports specifically: a root namespace's imports (the element form writes a root-level import as an owned member of the wrapper Namespace, not as its ownedImport), an import reaching a file the single-file graph does not carry, and a filter condition outside the forms listed above.

Where this differs from the pilot

Of the 601 importedMembership rows now stated, 436 equal the pilot, 12 are indeterminate, 153 differ:

rows difference decision
75 import ISQ::*: ISQ re-exports subpackages declaring the same name twice (volumeFlowRate, the MagneticDipoleMoment… definitions). The pilot keeps 22 such memberships; we hide both of each pair. Pinned text controls: §7.2.5.4 and Namespace::importedMemberships drop memberships that are not distinguishable.
63 Pilot's list is a superset: same collision rule in the model's own namespaces, or the import/expose is filtered and the pilot states the unfiltered list. Pinned text controls (§8.3.2.4.3, §8.3.4.13.4, SysML §8.3.26).
4 Our list is the superset: a namespace import of a type brings its inherited memberships (3); a membership import of a feature named through an imported type (1). Pinned text controls (§8.3.3.1.10 Type::visibleMemberships).
11 Recursive imports/exposes over large models. Adjudicated below: the import derivation is the clause's on both sides; the differing entries are Memberships of nested namespaces whose owned structure or key already differs. Text decides the import walk; the residue is not an import difference.

Adjudication: import of an alias (6 rows) — the pilot is right, fixed here

KerML 1.1 §8.2.3.4.2 (Imports, note 1): "The importedMembership of a MembershipImport is the single case in which the Element required from the resolution [QualifiedName] is the actual Membership identified by the QualifedName, not the memberElement of that Membership (see 8.2.3.5)." §7.2.5.4: "Note that the imported membership may be for an alias of the imported member (see 7.2.5.2), in which case the element will be known by that name in the importing namespace."

So import ISQ::TemperatureValue; imports the alias Membership that ISQThermodynamics declares, not the owning membership of ISQBase::ThermodynamicTemperatureValue. The pilot states the alias Membership; this implementation stated the target's owning membership whenever the alias was a library's, or was reached through a namespace that only imports it. Fixed in every reader: the RDF/api-json writer states the alias Membership under the id minted for it, the graph structure and the RDF reader resolve it, and the reflective MembershipImport::importedMembership no longer follows the alias (importedElement still is the aliased element). All 6 Namespace.importedMembership rows, and the MembershipImport.importedMembership / target rows with them, now equal the pilot (Package.importedMembership: 6 from present-different and 4 from indeterminate to present-equal; MembershipImport.importedMembership and target: 5 and 5 each).

Adjudication: deep recursive imports and exposes (11 rows) — the text decides the walk, and both sides follow it

KerML 1.1 §8.3.2.4.5, Namespace::visibleMemberships: "If isRecursive = true, also recursively include all visible Memberships of any public owned Namespaces, or, if IncludeAll = true, all Memberships of all owned Namespaces." §8.3.3.1.10: "The visible Memberships of a Type include inheritedMemberships."

Features and expressions are Namespaces, so a recursive import does reach the memberships they own; the pilot's lists contain them too. Every entry only one side names on these 11 rows was traced to its cause, and none comes from the import derivation:

  • 7 rows (six packages and one view of SimpleVehicleModel that import or expose VehicleConfiguration_b recursively): the same memberships appear on both sides under different keys or owners, because the owned tree below them already differs. (a) The unnamed parameters of a send / accept action are keyed by position here and by their effective name (payload, sender, receiver) in the pilot, and the pilot's via a.b operand is a FeatureChainExpression. (b) A connector end's [1] is owned through the OwnedCrossMultiplicity feature in the pilot and directly by the end here. (c) A sequence expression (a, b, c) is nested binary , operators in the pilot and one n-ary operator here. For (b) and (c) the pilot's tree is the one the pinned grammar produces; these are pre-existing differences of ownedRelationship, visible on those elements' own rows, and are out of scope here.
  • 3 rows (OOSEM Views): the documentation membership a redefining part inherits from the library feature it redefines; the difference is in the inherited part of the nested type, not in the import.
  • 1 row (relationshipMatrix): the model's package is the third owned membership of a root namespace whose two imports the element form writes as owned members, so its key index differs.

The pilot's own surplus on these rows is the collision and filter superset of the 57 above. Nothing in the pinned text is undecided for these rows: where the lists differ, they differ because the namespaces walked differ, and the text on which side's owned structure is right is the grammar's, not §8.3.2.4.

22 rows remain ours-missing: 7 root namespaces, 6 cross-file imports, 6 imports naming nothing the specification fragment declares, 2 where every imported membership is hidden (empty list, spelled by omission), 1 KerML class whose whole family is withheld. membership / member each state 605 previously missing rows (14 equal, 591 different; those lists already differed in their inherited part).

Generated baselines that moved

  • docs/project/api-json-differential/ (fragments + index.json), re-recorded with pilot-apijson-diff -update. Buckets on this head: 935 files, 107344 matched, 2128214 present-equal, 146215 present-different, 259137 ours-missing, 84515 pilot-missing, 2282443 absent-both, 45294 indeterminate, 546 pilot-nondeterministic. The alias fix moves 10 fragments and the index and nothing else: MembershipImport.importedMembership, MembershipImport.target and Package.importedMembership rows of the alias imports go to present-equal (+30 equal, −16 different, −14 indeterminate in all; 20 fewer unkeyed references). The merge of develop moved no fragment. The moved rows are the importedMembership / membership / member rows classified above (docs/project/api-json-differential.md step 7).

  • internal/translate/export/testdata/structure_differential_expected.txt, re-recorded with -update-structure-differential on the merged tree. Against feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309 merged with develop, three properties move and nothing else:

    • Namespace::importedMembership is new: 44173 equal, 39 different, 151 symbol-missing.
    • Namespace::member 40250/4067/13/33 → 40037/4129/164/33 and Namespace::membership 39850/4467/13/33 → 39638/4528/164/33 (equal/different/symbol-missing/symbol-extra).
    • Relationship::relatedElement and Relationship::target move by the alias fix only: pilot corpora 30190/396 → 30193/393 and 30326/260 → 30329/257, specification examples 4846/53 → 4850/49 and 4864/35 → 4868/31 (equal/different). Both readers now state the alias Membership for an import of a library alias; before, the symbol-backed one stated the target's owning membership.
    • symbol-missing (+151): the symbol-backed reader still withholds (its import tree reaches the library or a condition it does not evaluate) where the graph reader now answers; both withheld before, which counted as equal.
    • different: the graph reader applies filter conditions and collision hiding and the symbol-backed one states the unfiltered list (graph ⊂ symbol); a recursive expose brings unnamed memberships the symbol-backed reader does not name (symbol ⊂ graph); Filtering.kerml and 11b show both. The graph reader is the clause-conformant side in each. Bringing the symbol-backed reader up to it is a known limitation left out of this PR.
  • tests/export/testdata/convert/*.golden.ttl: the Turtle form names every library element a completed property references, so each golden whose model imports from the library gains stubs for the imported library memberships and nothing else: declaration_head_order, invariant_references, relationship_clause_order, shadowing_body (additive stubs); condition_references, irregular_layout, shadowed_references (digest-only goldens, same cause); imports.golden.ttl grows from 60 KB to 1.5 MB because the model does import ISQ::* (about 6000 memberships), which is over the 200 KiB fixture cap, so the tool now records it as imports.golden.ttl.sha256.

  • tests/grpc/testdata/conformance/convert_library_references.*: the case keeps its three wildcard library imports (ISQ::*, SI::*, SIPrefixes::*). With the derived members asked for, the reference table names every membership those imports bring: 6082 rows (610 KB), over the 200 KiB fixture cap. The case therefore commits the table's digest (library_references_digest, sha256 … rows 6082), as tests/export does for an oversized golden; the harness checks the digest and holds the compact table, the stub counts and the owned-structure check to the table it pins. A second case, convert_library_member_references, imports the three members the model uses and states its 314 rows literally. go test ./tests/grpc -run TestGRPCConformance -update-library-references writes both forms from the service's response.

  • The corpus round-trip ratchets (TestExamplesSweep) and make docs-counts did not move. tests/corpus/testdata/training_examples_expected.txt and the wasm budgets are untouched.

  • internal/semantic/metamodel/derived_census_baseline.json and derived_census_records.tsv (go run -C tools ./cmd/derived-census -update -recorded-pilot; pilot column untouched). The baseline's only movement is elements and implied of four roots, +40 in all (training +6, pilot-examples +25, pilot-validation +7, spec-examples +2). All 40 are the ReferenceSubsetting of a feature stated by name alone (require r;, assume r;, variant x;), which feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309 introduced as an element (ImplicitShorthandReference) and which develop's baseline does not yet count; feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309 merged with develop without this PR moves identically. In the records, 24 rows are this PR's: Namespace::importedMembership, membership and member over the eight roots, each moving carriers from not-derived to valued (e.g. importedMembership in examples: 0 valued / 159 not derived → 124 / 35; in testdata two carriers go to empty). No carrier count and no other rule moves by this PR; the remaining record rows are feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309's inherited-family and end-feature rules, identical with and without this PR.

  • docs/project/hideo-suite-baseline.tsv and the table of docs/project/hideo-suite.md (go run -C tools ./cmd/hideo-suite -update): 16 cells, fail → pass, cases B10-091 to B10-098 for the two property adapters. They read the end count and end names of a connection definition, an interface definition and a specialization of each; Type::endFeature of feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309 now states the inherited ends. feat(export,metamodel): a library type the model states completes the inherited family in the element form, and Type::endFeature is completed #2309 merged with develop without this PR moves identically; nothing regressed.

Movements from merging develop at 887660259b and #2142 at 0ce332238a

Three merges (develop, then #2142 at f1d9e12fd3, then its newer head 0ce332238a). Nine generated files conflicted after the cell-wise merge driver and took the other side: three api-json fragments (develop's), five conversion goldens and the gRPC library-reference table (#2142's). The checks then refused the derived census, the api-json differential, the structure differential, TestGoldenConversions and TestGRPCConformance/convert_library_references; 25 files were re-recorded from the merged tree, none hand-edited:

  • api-json fragments (pilot-apijson-diff -update): 16 files. Three KerML ProductSelection fragments and 13 others whose presentDifferent summary moves by a few rows.

  • Derived census (derived-census -update -recorded-pilot): derived_census_baseline.json and derived_census_records.tsv. The merge driver had summed this implementation's element counts wrongly; re-recorded, elements and implied are each +1, +1, +2, +2 in four roots over the merged file. The pilot columns are unchanged.

  • Structure differential (-update-structure-differential). Namespace::importedMembership against this branch's previous head:

    root equal different symbol-missing
    examples 16518 → 18458 11 18
    tests/testdata 711 → 803 5 → 3 3 → 7
    training 4030 → 4129 4 → 2 12 → 14
    pilot corpora 21476 → 22053 19 → 10 58 → 68
    specification examples 3589 → 3811 0 60

    equal grows with the elements fix(semantics): reflect the concrete metaclass of eight grammar forms #2142 adds (an expression's implied bases). In three roots some namespaces move from different to symbol-missing, and member / membership move with them: on the merged tree the symbol-backed reader withholds there instead of answering a different list. The cause was not traced; the graph-backed answer, which the api-json form writes, is not what moved.

  • Conversion goldens (tests/export -update): declaration_head_order, invariant_references and shadowing_body gain the library stubs both branches reach (+148, +141, +228 lines); condition_references and irregular_layout are digests.

  • gRPC convert_library_references.expected.json: at that merge the table was written from the service's Convert response for a fixture narrowed to three member imports; against fix(semantics): reflect the concrete metaclass of eight grammar forms #2142's file it differed by three rows (the SI, ISQ and SIPrefixes LibraryPackage rows replaced by the three imported OwningMembership rows). The next section restores the wildcard fixture; those 314 rows are now the convert_library_member_references case.

Review fixes on the chain head (80ec283abd, 92e8c4310e)

  • A filter by a library supertype (filter @Metaobjects::SemanticMetadata over a member annotated with the library's MeasureOfEffectiveness) excluded matching members: the conformance walk stopped at the first library type. It now reads a library type's specializations from the semantic model and withholds the filter when they are not complete. TestAPIJSONGraphImportedMembershipFiltersByLibrarySupertype fails without it.
  • The gRPC library-reference case imports by wildcard again, as described under the gRPC fixture above.
  • No generated baseline moved: derived-census -check -recorded-pilot, pilot-apijson-diff -check, the structure differential and the conversion goldens reproduce without a re-record. The two gRPC expectations are the only expectation files that changed.

Movements from merging develop at 896bd9cde5 (after #2309 landed)

Generated paths in conflict took develop's side, and only what a check then refused was re-recorded, by its tool:

  • api-json fragments and index (pilot-apijson-diff -update): 37 fragments and the index against develop. 936 files, 109597 matched, 2173815 present-equal, 149068 present-different, 262223 ours-missing, 86657 pilot-missing, 2335397 absent-both, 49294 indeterminate, 547 pilot-nondeterministic. importedMembership over develop: 907 equal, 154 different, 17 indeterminate (was 904 / 154 / 15 before the merge; the different rows are the same ones).
  • Derived census (derived-census -update): derived_census_records.tsv only, 263 records; the baseline JSON is develop's.
  • Structure differential (-update-structure-differential): 38 records. Namespace::importedMembership keeps its different and symbol-missing counts in every root and grows only in equal with the elements develop adds; Feature::direction returns to this branch's different count in every root (examples 103 → 27, pilot corpora 188 → 66, training 59 → 23, specification examples 19 → 7, testdata 5 → 3), the flow-end direction fix below applied to develop's tree. scripts/rebaseline-movement.py flags these seven rows as not either side's value for that reason: each is this branch's delta on develop's larger count.
  • Conversion goldens (tests/export -update): one digest, irregular_layout.golden.ttl.sha256.
  • Reproduce develop's record unchanged: the Hideo suite table (1623 / 157 / 33), pilot-diff -check, make stdlib-snapshot.
  • Hand-resolved: the evaluator's caches (develop's memo table, this PR's imported-membership cache kept beside it), the implicit-relationship id reader, and the compliance row.

Movements from merging develop at 36c76c44ba

Every generated file in conflict was re-recorded with its tool on the merged tree, none hand-edited or taken from one side. Each row was compared as "this PR's effect on develop" before and after the merge; what is listed is all that changed in that effect.

  • One interaction, fixed. develop now gives a flow's end its ReferenceUsage on the native walk; this PR's base states that feature's direction on the graph. The symbol-backed reader gave none, which showed as new Feature::direction differences in the structure differential (examples 26 → 103, pilot corpora 66 → 188, training 23 → 59, specification examples 7 → 19) and in Type::directedFeature/input/output with it. The reflective direction of that feature is now the direction of the feature it redefines as the end's referenced feature inherits it (KerML.xtext FlowFeature, note 1), the rule the writer already applies; the rows return to their pre-merge effect. TestFlowEndFeatureStatesItsRedefinedDirection fails without it.
  • structure_differential_expected.txt: beyond develop's own movements, Connector::connectorEnd, Type::endFeature, Type::inheritedFeature, Type::inheritedMembership and Usage::usage lose differences in every root (for example Type::endFeature different 38 → 0 in examples, 84 → 1 in the pilot corpora): the flow ends develop adds to the symbol side are the ones the graph already stated. Type::endFeature symbol-extra rises (pilot corpora 18 → 56, specification examples 3 → 19, training 2 → 18): flow ends and their features, newly matched, for which the graph reader withholds the inherited family ("unresolved specialization references") and the symbol reader answers the empty list. The graph side withholds rather than states something wrong; I did not trace why those specializations do not resolve. Namespace::importedMembership keeps its different and symbol-missing counts in every root.
  • api-json fragments and index: 935 files, 107930 matched, 2140257 present-equal, 146962 present-different, 260341 ours-missing, 84956 pilot-missing, 2296454 absent-both, 45532 indeterminate, 547 pilot-nondeterministic. This PR's effect on develop is confined to the same thirteen properties as before (importedMembership, membership, member, the inherited and directed families). importedMembership: six Package rows of examples/self-model go equal → different because develop adds ProjectDiscovery to OpenSysMLPipeline, a name OpenSysMLSurfaces already declares; a package importing both hides both (§7.2.5.4) and the pilot keeps both. They join the collision group below (57 → 63); the totals are 436 equal, 153 different, 12 indeterminate.
  • Derived census: this PR's rows against develop are the same set plus Feature::direction in all seven roots (our valued count rises toward the pilot's, e.g. training 1390 → 1436 of the pilot's 1592: the flow-end features) and three single-root rows (Membership::memberShortName and OwningMembership::ownedMemberShortName in training, Type::input in testdata).
  • Hideo suite: the same 16 cells (B10-091 to B10-098, both property adapters) over develop's table; 1616 / 164 / 33.
  • Conversion goldens: the two text goldens in conflict carry the same delta against develop as before the merge (library stubs: kind_keyword_synonyms −26 lines, quoted_succession_ends +219/−26); eleven digest-only goldens move with them.

How it was verified

On head f581f2e2b6 (the merge of develop at 19590f521d), corpora required: go build ./..., go vet ./..., gofmt -l (empty), make lint, go test -count=1 over internal/semantic/..., internal/translate/export, tests/grpc, tests/export and tests/hygiene, derived-census -check -recorded-pilot and pilot-apijson-diff -check pass with no re-record.

On the previous head 92e8c4310e (the chain merge above plus the two review fixes), with the corpora downloaded and their OPENSYSML_REQUIRE_* variables set:

  • go build ./..., go vet ./..., gofmt -l (empty), make lint, make docs-counts: pass.
  • go test -count=1 over tests/hygiene, internal/translate/..., internal/semantic/..., internal/doc/queryexec, tests/export, tests/grpc, tests/corpus: pass.
  • pilot-apijson-diff -check and derived-census -check -recorded-pilot: pass. These two, the structure differential and the package tests above ran on the tree one condition short of the pushed one (a nil guard on the new library branch); build, vet, gofmt, lint, make docs-counts, the import-filter tests, tests/hygiene and tests/grpc were repeated after it.
  • The full go test -count=1 ./... (140 packages), go test -C tools ./... and make wasm-check pass on 92e8c4310e; gzipped sizes: REPL 16,071,727 / 16,500,000, engine 10,722,757 / 11,300,000, core 7,041,044 / 7,600,000, syntax 1,665,724 / 1,800,000 (no budget edited). Not run on it: pilot-diff -check, hideo-suite -check.

The full gate last ran on the previous head 8836bc71d3, which merged origin/develop at 896bd9cde5 (no-FF, one merge base), with the training, pilot, specification-example, pilot-library-XMI, PSSM and Hideo corpora downloaded and their OPENSYSML_REQUIRE_* variables set:

  • go build ./..., go vet ./..., gofmt -l (empty), make lint, make docs-counts: pass.
  • go test -count=1 ./... and go test -C tools -count=1 ./...: pass. tests/wasm failed once in the full run when the local disk filled and passes run on its own.
  • Gzipped WebAssembly sizes (no budget edited): REPL sysml.wasm 16,033,566 / 16,500,000; engine 10,703,164 / 11,300,000; core 7,032,603 / 7,600,000.
  • pilot-apijson-diff -check, derived-census -check, pilot-diff -check, hideo-suite -check: pass.
  • Not run: -race, the reference-FMU gate (OPENSYSML_REQUIRE_REFERENCE_FMUS), the PDF toolchain tests.

New tests (internal/translate/export/api_json_graph_import_test.go, api_json_graph_import_filter_test.go, tests/identity/alias_membership_test.go, and the alias case of TestMembershipImportTargetIsTheMembership) drive the evaluator over the graph-backed structure and cover each import form, visibility, cycles, collisions, filters, library and alias memberships, graph-only reconstruction and the RDF round trip; they fail without the change.

Checklist

  • make test and make lint pass locally — go test ./... without -race
  • 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

Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/1d1b01e71e094db8ad36f88516361946?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 16 commits November 16, 2026 09:49
WIP checkpoint: evaluator walk, collision hiding, filter conditions, annotation inverse.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…; excluded namespaces thread through inheritance

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ed, inherited and imported ones (KerML 8.3.2.4.3)

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…library membership imports

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…change:26; changelog fragment

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…h-imported-membership

The generated baselines both sides wrote (the api-json differential fragments and index, the
structure differential and the shadowed-references checksum) are re-recorded with their tools
rather than taken from either side.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… type (KerML 8.2.5.8.1)

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…red imports (KerML 8.3.4.13.4, 8.4.4.14)

Literals, classification tests, the Boolean connectives with their three-valued
short circuits, comparisons, metadata feature reads through a cast, metaclass
feature reads and enumeration literals; a form outside these withholds the
derived list instead of filtering everything out.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… imported with it

A library package's documentation is owned through an unnamed membership and its
aliases are Memberships no qualified name catalogues; both are memberships of the
namespace (KerML 8.3.2.4) and an alias membership gets an id of its own.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…members

Namespace::importedMembership repeats members the namespace does not own, so it
joins the derived lists -inherited-members writes; the tests of the inherited and
imported lists ask for them, and the graph-only reconstruction reads back the
owned-structure document.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… alias memberships

A library namespace re-exports what its public imports bring, so ISQ::* reaches
the documentation, comments and alias memberships of the packages ISQ imports
(KerML 8.3.2.4); the resolver enumerates them with the hidden ones left out.
The option text of every surface names importedMembership among the lists
-inherited-members writes, and the api-json differential is re-recorded.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…al adjudicated

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…hains back

A library alias a namespace imports is a Membership of its own (KerML 8.3.2.4):
the graph names it beside the element it aliases, and reading the graph back
recognizes it. A feature read past a cast resolves as a member of the type cast
to when the notation is written back (KerML 8.2.5.8.1).

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…n import brings

The Turtle form names every library element a completed property references, so
a wildcard library import now names each membership it imports. The gRPC
library-reference case imports the three members it uses, keeping its table
under the fixture size cap.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@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 4 commits November 16, 2026 15:19
The element and implied counts of four roots rise by 40 in all: the
ReferenceSubsetting a feature stated by name alone holds (`require r;`,
`variant x;`) is now an element of the census. The record rows move with the
inherited families, and Namespace::importedMembership, membership and member
are now derived where they were withheld.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…suite now passes

B10-091 to B10-098 read the end count and end names of a connection and an
interface definition and their specializations; Type::endFeature now states
the inherited ends, so both property adapters pass them.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…h-imported-membership

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…rt of an alias

KerML 1.1 8.2.3.4.2: the importedMembership of a MembershipImport is the
Membership the qualified name identifies, not the membership of its member
element. A library alias, or one reached through a namespace that only imports
it, was stated as the owning membership of the aliased element. The RDF and
api-json forms, the RDF reader and the reflective importedMembership now state
the alias Membership; the structure differential and the api-json differential
fragments are re-recorded and the two open pilot disagreements adjudicated.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review November 16, 2026 20:52
devin-ai-integration Bot and others added 3 commits November 16, 2026 21:00
… twice

A namespace importing one membership through two imports recorded only the
first import's visibility, so a private import ahead of a public one hid the
membership from visibleMemberships and from the types inheriting it
(KerML 8.3.2.4.5, 8.3.3.1.10).

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…on type's redefinition

A filter reading a feature off a metadata annotation fell back to the default
of the feature the filter names when the annotation itself bound nothing,
missing a default redefined by the annotation's type or one of its supertypes.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…cific inherited redefinition

Walking the annotation type's supertypes breadth-first took the first
redefinition met, so a type specializing both a general and a more specific
metadata definition read the general one's default. The redefinition no other
inherited one redefines binds; two unrelated ones withhold the filter.

Co-Authored-By: jason.han <hanhuijun@gmail.com>

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

Fixed by Devin (3)
  • Redundant supertypes select older metadata defaults — Reproduced: metadata def Redundant :> Strict, Strictest (Strictest :> Strict, each redefining level) read Strict's default. All inherited redefinitions are now collected and the one no other redefines binds; two unrelated ones withhold the filter. Regression case added.
  • Inherited metadata defaults misread by filters — Reproduced: metadata def Strict :> Safety { attribute :>> level = 2; } with @Strict read level as Safety's default 1. The value is now read through the nearest redefinition owned by the annotation's types or their supertypes; regression test added.
  • Later public imports lose their re-exports — Reproduced: private import Lib::*; public import Lib::A; hid A from importers. A membership imported twice now keeps its most visible import's visibility; regression test added.

View findings in Devin Review · Follow Devin's work

Devin Review

…h-imported-membership

Conflicts: the implicit-relationship id readers (the shorthand ReferenceSubsetting of this
branch beside the flow-end Redefinition of develop) are resolved by hand; every generated
baseline in conflict is re-recorded with its tool on the merged tree (structure
differential, api-json differential fragments and index, derived census, Hideo suite
table, conversion goldens).

The flow-end ReferenceUsage develop adds to the native walk met the direction this branch's
base states for it on the graph: its reflective direction is now that of the feature it
redefines as the end's referenced feature inherits it, so the two readers agree.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Base automatically changed from feat/api-json-inherited-family-complete to develop November 19, 2026 18:04
devin-ai-integration Bot and others added 8 commits November 19, 2026 18:39
…h-imported-membership

Hand-resolved: the evaluator's caches (develop's memo table, with this branch's
imported-membership cache beside it), the implicit-relationship id reader and the
compliance row of the api-json element form. Generated paths in conflict took
develop's side and are re-recorded by their tools in the next commit.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
The api-json differential (37 fragments and the index), the derived census records, the
structure differential and one conversion golden digest are re-recorded by their tools on
the merged tree. Hideo suite, pilot-diff and the library snapshot reproduce develop's
record and are unchanged.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…h-imported-membership

Generated api-json fragments in conflict took develop's side; re-recorded by tool after the predecessor merge.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…) into feat/api-json-graph-imported-membership

Generated conversion goldens and the gRPC library-reference expectation in conflict took
the predecessor's side; re-recorded by tool in the next commit.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ce3322) into feat/api-json-graph-imported-membership

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…baselines on the chain head

After merging develop and the pull request ahead in the baseline chain, the api-json
fragments, the derived census, the structure differential, five conversion goldens and
the gRPC library-reference table are regenerated from the merged tree.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…zations

A filter condition classifying by a library type (@metaobjects::SemanticMetadata)
excluded a member annotated with a library type that specializes it: the
conformance walk stopped at the first library type, whose specializations the
structure has no rows for. It now reads them from the semantic model, and
withholds the filter when they are not complete.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…orts

The Convert case imports ISQ, SI and SIPrefixes by wildcard again. Its table
now names every membership those imports bring (6082 rows, over the fixture
size cap), so the case commits the table's digest and every other form is held
to the table the digest pins. The three-member case stays beside it with its
rows stated, and -update-library-references rewrites both from the service.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Disposition of the Devin Review finding "View filters ignored during export" (internal/semantic/metamodel/structure_import_filters.go:174-179, head 92e8c4310e): rejected, as on the earlier heads.

For view v { expose Lib::*; filter @Safety; } the finding expects the view's filter to narrow v's importedMembership. It does not, by the specification: SysML v2.1 §8.3.26 deriveViewUsageExposedElement applies a view's conditions (viewCondition) to the elements it exposes, deriving ViewUsage::exposedElement; it does not touch Namespace::importedMembership. KerML 1.1 §8.3.4.13.4 ties filter conditions to imported memberships only for a Package (Package::importedMemberships / filterCondition), and a view is not a Package, so its exposes import what §8.3.2.4 gives them. A filter written on the expose itself (expose Lib::*[@Safety]) is a filtered import and is applied. The same finding was raised and rejected on the earlier review rounds of this pull request (heads 5dae91f8c8 and 8836bc71d3); the two commits added since (80ec283abd, 92e8c4310e) do not change this code path. No code change.

devin-ai-integration Bot added a commit that referenced this pull request Nov 20, 2026
… baselines for the self-model query path after merging develop and #2324

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun added this pull request to the merge queue Nov 20, 2026
Merged via the queue into develop with commit 57da054 Nov 20, 2026
35 checks passed
@HuiJun
HuiJun deleted the feat/api-json-graph-imported-membership branch November 20, 2026 18:31
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.

1 participant