Repository navigation
fix(symbol): report a member's direction relative to the type it is read through - #2251
Merged
Merged
Conversation
…ead through A feature listed through a conjugated port carried its declared direction in Symbol metadata. GetSymbolRequest.member_of names the type the symbol is read as a feature of, and the direction is then the semantic model's Type::directionOf answer (KerML 8.3.3.1.10), the one GetElementProperties gives. GetElementProperties now reverses input/output for a port subsetting or redefining a conjugated one too. Fixes #2200 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction
…t-member-direction
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction
…t-member-direction
…ares itself Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # api/proto/sysml.pb.go # api/proto/sysml.proto # client/node/src/generated/sysml_pb.ts # client/opensysml/client.go # client/opensysml/types.go # client/python/opensysml/capabilities.py # client/python/opensysml/connection.py # client/python/opensysml/proto/sysml_pb2.py # client/python/opensysml/proto/sysml_pb2.pyi # client/python/opensysml/symbol.py # client/python/tests/test_connection.py # client/python/tests/test_integration.py # client/rust/conformance/sysml.descriptor.binpb # client/rust/opensysml/src/connection.rs # client/rust/opensysml/src/proto/sysml/sysml.rs # conformance/README.md # internal/frontend/combined/combined.go # internal/frontend/core/json.go # internal/frontend/grpc/capability_test.go # internal/frontend/grpc/service.go # internal/frontend/mcp/runtimetools/info.go # internal/frontend/mcp/runtimetools/parse.go # tests/wasm/combined_test.go
…wer moves Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # client/node/src/generated/sysml_pb.ts # client/python/opensysml/proto/sysml_pb2.py # client/python/tests/test_symbol.py # client/rust/conformance/sysml.descriptor.binpb # docs/project/api-json-differential/index.json # docs/project/api-json-differential/pilot-examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml.json # docs/project/api-json-differential/pilot-examples/Interaction Sequencing Examples/ServerSequenceRealization-3.sysml.json # internal/frontend/grpc/capability_test.go # internal/frontend/grpc/service.go
…ort direction rows that now pass Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction
…cted features Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/index.json # internal/semantic/metamodel/derived_census_records.tsv
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…nnector end included Co-Authored-By: jason.han <hanhuijun@gmail.com>
…l_member_direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
There was a problem hiding this comment.
Note
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 3 findings. Devin automatically fixed all 3 findings.
Fixed by Devin (3)
- Unnamed connector ends rejected as owners — The JSON core now reads memberOf with LookupElement, as symbolId and the gRPC service do; a new test fails without the change for an unnamed connector end id.
- Silent direction fallback on older services — get_symbol now raises MissingCapabilityError when member_of is given and the service does not report symbol_member_direction; member listings already checked the capability.
- Four-line capability comment exceeds limit — Comment shortened to two lines.
…s capabilities Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ugated-port-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
…r-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # api/proto/sysml.pb.go # api/proto/sysml.proto # client/node/src/generated/sysml_pb.ts # client/opensysml/client.go # client/opensysml/types.go # client/python/opensysml/capabilities.py # client/python/opensysml/connection.py # client/python/opensysml/proto/sysml_pb2.py # client/python/opensysml/proto/sysml_pb2.pyi # client/python/opensysml/symbol.py # client/python/tests/test_connection.py # client/python/tests/test_symbol.py # client/rust/conformance/sysml.descriptor.binpb # client/rust/opensysml/src/connection.rs # client/rust/opensysml/src/proto/sysml/sysml.rs # conformance/README.md # docs/project/spec-compliance/08-grpc-service-layer.md # internal/frontend/core/json.go # internal/frontend/grpc/capability_test.go # internal/frontend/grpc/service.go # internal/frontend/mcp/runtimetools/info.go # internal/frontend/mcp/runtimetools/parse.go
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ugated-port-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/semantic/metamodel/derived_census_records.tsv
Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/semantic/metamodel/derived_census_records.tsv
…t-member-direction
Cases B13-055, B13-056, B13-057, B13-073, B13-074 and B13-075 of the opensysml-py-props and opensysml-go-props readers pass since develop's range 2cdfa98..613a430 (#2259, #2260) and fail on neither side of this branch's own change. Recorded with hideo-suite -update, which also rewrites the table of docs/project/hideo-suite.md. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction
Merges 212483d (the cell-wise baseline merge driver, the ours-only census check and the pilot side recorded once per pin). Conflicts, both in generated baselines and both resolved by the recorders: - internal/semantic/metamodel/derived_census_records.tsv: the cell-wise driver declined it (the incoming side reshapes every row with a new pilot column while this branch moves two of them), so it was re-recorded with `derived-census -update -require-exporter`. It equals the incoming file except this branch's two rows, Type::input and Type::output over pilot-examples (1699/12523 and 2873/11349), which report a conjugated port's inherited features in the reversed direction. - docs/project/hideo-suite.md: regenerated with `hideo-suite -update`. The baseline keeps this branch's ten rows; the twelve B13 property-reader cells come from develop's range 2cdfa98..613a430 (#2259, #2260). Co-Authored-By: jason.han <hanhuijun@gmail.com>
docs/project/api-json-differential/index.json conflicted: both sides moved its aggregate counts. Resolved by taking develop's side and folding the merged fragments with pilot-apijson-diff -reindex; pilot-apijson-diff -check reproduces the result. No fragment conflicted and none was re-recorded. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction The generated protocol stubs both sides regenerated (the Node and Python message modules and the Rust conformance descriptor) are regenerated from the merged sysml.proto with make proto. No count baseline moves in this merge. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction
… fix/conjugated-port-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com>
…jugated-port-member-direction Re-recorded by tool on the merged tree: the hideo-suite table and baseline (both sides moved it), and the Type::input and Type::output rows of the derived census for the pilot-examples and testdata roots. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Keeps both tests appended to parity_options_internal_test.go: this branch's member-direction capability test and develop's Convert option tests. Co-Authored-By: jason.han <hanhuijun@gmail.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 17, 2026
…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>
Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…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>
…ugated-port-member-direction Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/hideo-suite.md
…ugated-port-member-direction
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2200.
What and why
For
port def CmdPort { out attribute cmd : Integer; in attribute ack : Boolean; }andport pIn : ~CmdPort;, the Symbol API listedcmd/ackthroughpInwith metadatadirectionout/in.GetElementProperties, the pilot and the specification answerin/out: a feature's direction is relative to the type it is a member of (KerML 1.1 §8.3.3.1.10Type::directionOf; SysML v2.1 §7.13.3, §8.3.12.2–§8.3.12.3 for conjugated port definitions and typings).One semantic answer, no client-side inversion:
(*Model).EffectiveDirection(owner, feature)answersType::directionOf: the feature's own direction when the type owns it, otherwise the direction through the type's generalizations, reversed across a conjugation.DeclaredDirectionremains the context-freeFeature::direction.GetSymbolRequest.member_of(field 6, afterresolve_name4 and thelookup5 of fix(grpc): an explicit lookup kind tells a qualified name from an element id #2255) names the type the symbol is read as a member of;symbolfactsthen statesdirectionfromEffectiveDirection.member_ofis read as an element id, never as a name, so an unnamed port's generated id is not answered by a sibling declared with that spelling. An emptymember_ofkeeps the feature's own direction, which is also what the pilot answers for the feature itself. Advertised as capabilitysymbol_member_direction; the JSON and MCPsymbolrequest carrymemberOf.port pSub :> pIn;) answered unconjugatedinput/output;~Palso reversed the features it declares itself (port p : ~P { out ref :>> publish; });directionOfgives those their own direction.part def A :> B, C; part def B :> A, C;) end the walk at the type owning the feature: one visited set follows the whole read, locked byTestAPIJSONDirectionThroughMutuallySpecializingTypes, which overflows the stack without it.children()/members()/parts()/attributes()pass the listing symbol asmember_of; Go gainsAsMemberOf(typeID)forLookupSymbol. Node, Java, Rust, Julia and MATLAB do not bind the capability yet (parity table updated).Specification basis
Type::directionOf: the direction of a feature relative to a type is the feature's own when the type owns it, otherwise the direction through the type's supertypes, reversed across a conjugation.~Ptypes a port by the conjugate ofP.docs/project/spec-compliance/gains thesymbol_member_directionrow.How it was verified
Tests
internal/semantic/semantics:TestEffectiveDirectionIsRelativeToTheType.internal/frontend/symbolfacts:TestMemberDirectionIsRelativeToTheTypeItIsReadThrough.tests/grpc/member_direction_test.go: SymboldirectionequalsGetElementPropertiesinput/outputthrough a plain typing, a conjugated typing, a specializing definition, nested ports, subsetting, redefinition, and features a conjugated port owns.hideo67/sysmlv2-tests (pin
99eae49a), pass / fail / unsupportedNo other matrix moves in any suite.
docs/project/hideo-suite-baseline.tsvis re-recorded withhideo-suite -updatefor those ten rows.Limitation: the ten A30 rows stay
failin opensysml-goThe suite's Go reader checks that the step is in the owner's listing and then looks the member up by id alone (
LookupSymbol(ctx, m, "A30::CmdPort::cmd", WithLibraryMembers())). A30-029/030 (throughpOut, wantout/in) and A30-031/032 (throughpIn, wantin/out) therefore make the identical call and cannot both pass on any implementation; today thepOuthalf passes, and answering the conjugated direction context-free would turn those passing rows to fail and contradictFeature::direction. The expectation is right; the reader is context-free. It would pass withLookupSymbol(..., AsMemberOf(owner)). Follow-up for the suite's owner; nothing is filed here.Baselines re-recorded (repository tools only)
pilot-apijson-diff -update): sixPortUsage.input/outputrows inInteraction Sequencing Examples/ServerSequenceRealization-3.sysmlandServerSequenceOutsideRealization-3.sysmlbecome equal to the pilot (totals: +6 present-equal, −4 present-different, −2 ours-missing, −2 pilot-missing, +2 absent-both). These are the ports that declare their own directed features under a conjugated typing. NoFlowEndrow moves. Adjudicated indocs/project/api-json-differential.md.derived-census -update):Type::inputon pilot-examples 1466 → 1464 values,Type::output2407 → 2409 — the same two ports, whose ownedoutfeature was reported as an input.On the test-data root,
Type::input63 → 64 values andType::output61 → 60 (641 elements, unchanged). One element moves the cell: intests/testdata/passes/corpus_notation.sysml,interface def CommunicationInterfacehasend spacePort : ~CommunicationPortoverport def CommunicationPort { out item data; in item ping; }, and the flow end offlow from groundPort.ping to spacePort.pingthat is reached through the conjugatedspacePortnow listsCommunicationPort::dataunderinputinstead ofoutput. That flow end is one of the elements docs(self-model): bring the pipeline, runtime, identity and quality packages up to date #2047 added to the census; with declared directions it counted as an output (63 / 61 on docs(self-model): bring the pipeline, runtime, identity and quality packages up to date #2047's head), and read through the conjugation it is an input.SpaceLink::spacePortin the same file swaps its two lists as well and stays non-empty in both, so it moves no cell. No other model undertests/testdatadiffers between docs(self-model): bring the pipeline, runtime, identity and quality packages up to date #2047's head and this branch.Merged in
This branch contains
developand the heads of #2249 and #2255, each merged once, since they change the same generated files: the api-json differential index and the derived census (#2242, #2245, #2249), and theGetSymbolrequest, its stubs and the capability list (#2255). The baselines were re-recorded with the same tools on the merged tree, andsymbol_member_directionfollowssymbol_lookup_kindin the capability list; the movement owned by this change stays the rows listed above. The #2255 head merged is the one that makes every RPC taking a symbol accept the idGetSymbolreports and addsSpecialization.target_qualified_nameandTypeInfo.resolved_qualified_name; the stubs both sides changed were regenerated withmake proto.Gates
go build ./...,go vet ./...,go vet -C tools ./...,gofmt -l(empty),make lint,go test ./...andgo test -C tools ./...with the training, pilot, specification-example, library-XMI and PSSM corpora required,derived-census -check,pilot-apijson-diff -check,hideo-suite -check,make docs-counts,scripts/check-doc-ids.py,scripts/changelog.py check, the Python client suite andcargo checkfor the Rust client all pass. Protobuf stubs regenerate unchanged withmake proto.Checklist
make lintpasses locally; the suite was run asgo test ./...with the corpora required (without-race)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog🟢 Devin Review found nothing to fix · View findings · Follow Devin's work