Repository navigation
Feature-chain resolution (#129 stage 3): corpus strict errors 94 → 48 - #136
Merged
Merged
Conversation
…): corpus strict errors 94 -> 48 Feature chains (a.b.c) now resolve per KerML 8.2.3.5: first segment by full resolution, every later segment by visible resolution in the previous feature through its own and inherited members (explicit and implicit general types, subsetting/redefinition, aliases, conjugated port types, inline members), public members only. Chains are accepted by every reference kind (supertype, redefinition, allocate, satisfy, verify, connect/bind/transition ends) and recorded at the instance path for relationship ends. - NameResolver: chain-aware Resolve/ResolveRedefinedFeature, ResolveFeatureChain (instance path), quote-aware dot splitting, quoted/unquoted name equivalence, re-entry guard for self-referential chains - ReferenceResolver: retire TryResolveFeatureChain/FindFeatureMember, accept anonymous $fork0-style succession ends - AstBuilder: satisfy requirement usage satisfies its typing, not its own name - OMG corpus strict errors 94 -> 48 (36 -> 18 files); stdlib warnings 45 -> 13; gallery output unchanged; remaining errors are members the AST does not model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The PR rewrites recursive name resolution and edge-path semantics across multiple reference kinds, while the review environment cannot run the claimed .NET test or corpus validation, so human confirmation of corpus and layout/query regressions is needed.
No open issues 🎉
What changed in this PR
This pull request implements stage 3 of feature-chain resolution for SysML/KerML references, centralizing chained lookup in NameResolver, extending semantic relationship resolution, and reducing false strict-mode OMG corpus diagnostics from 94 to 48.
Changes:
- Added segment-by-segment resolution for inherited, subsetted, aliased, conjugated, quoted, inline, qualified, and cyclic feature chains.
- Updated
ReferenceResolverfor chain-aware relationship endpoints, instance paths, anonymous action nodes, and satisfy requirement typing. - Added regression coverage and updated design, verification, requirements, and diagnostic-threshold documentation.
| File | Description |
|---|---|
| test/DemaConsulting.SysML2Tools.Tests/Semantic/WorkspaceLoaderTests.cs | Adds workspace-level tests for feature-chain relationships, anonymous action nodes, and satisfy requirement typing. |
| test/DemaConsulting.SysML2Tools.Tests/Semantic/StdlibProviderTests.cs | Lowers the standard-library unresolved-warning ceiling to 13. |
| test/DemaConsulting.SysML2Tools.Tests/Semantic/SemanticOmgModelsTests.cs | Lowers the OMG strict-mode diagnostic baseline to 48 and verifies resolved corpus models. |
| test/DemaConsulting.SysML2Tools.Tests/Semantic/NameResolverTests.cs | Adds unit coverage for feature-chain traversal, visibility, aliases, conjugation, quoting, cycles, and qualified names. |
| src/DemaConsulting.SysML2Tools.Language/Semantic/Model/ReferenceResolver.cs | Routes reference resolution through NameResolver, records instance-path relationship endpoints, and handles anonymous action nodes. |
| src/DemaConsulting.SysML2Tools.Language/Semantic/Model/NameResolver.cs | Implements feature-chain parsing and lookup, quote equivalence, cycle handling, instance paths, and chain-aware redefinition resolution. |
| src/DemaConsulting.SysML2Tools.Language/Semantic/Model/AstBuilder.cs | Records the requirement typing associated with declared satisfy usages. |
| docs/verification/sysml2-tools-language/semantic/model/reference-resolver.md | Updates resolver verification scenarios for chains, instance paths, anonymous nodes, and satisfy declarations. |
| docs/verification/sysml2-tools-language/semantic/model/name-resolver.md | Documents feature-chain and quoted-name verification coverage. |
| docs/user_guide/introduction.md | Updates strict-mode guidance, limitations, and OMG corpus metrics. |
| docs/reqstream/sysml2-tools-language/semantic/model/reference-resolver.yaml | Adds traceability for instance-path and anonymous-action requirements. |
| docs/reqstream/sysml2-tools-language/semantic/model/name-resolver.yaml | Adds feature-chain and quote-equivalence requirements and tests. |
| docs/reqstream/sysml2-tools-language/semantic/model/ast-builder.yaml | Adds traceability for satisfy requirement-name typing. |
| docs/reqstream/sysml2-tools-language/semantic/model.yaml | Registers the new semantic model requirements. |
| docs/reqstream/sysml2-tools-language.yaml | Updates language-level feature-chain and satisfy verification traceability. |
| docs/design/sysml2-tools-stdlib.md | Updates standard-library diagnostic metrics and remaining limitations. |
| docs/design/sysml2-tools-language/semantic/workspace-loader.md | Updates strict-mode corpus status, diagnostic rationale, and remaining gaps. |
| docs/design/sysml2-tools-language/semantic/model/reference-resolver.md | Documents centralized chain-aware reference resolution, instance paths, anonymous nodes, and remaining scope boundaries. |
| docs/design/sysml2-tools-language/semantic/model/name-resolver.md | Documents feature-chain semantics, quote handling, caching, and cycle behavior. |
| docs/design/sysml2-tools-language/semantic/model/ast-builder.md | Documents satisfy declaration typing extraction. |
| docs/design/introduction.md | Updates the architecture overview for centralized feature-chain resolution. |
Review effort: Lite
This was referenced Nov 23, 2026
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.
Pull Request
Description
This is stage 3 of #129, which fixes false "Unresolved reference" diagnostics on valid models. It adds feature-chain resolution per KerML 1.0 §8.2.3.5: the first segment resolves from the local namespace, and each later segment uses visible resolution in the previous segment's types. It builds on the stage 2 inherited lookup (explicit and implicit general types).
Chain kinds handled:
p1 :> p;thenp1.x.~Portmembers).P::p.x.Where chains are used: subsetting and redefinition targets,
allocate,satisfyandverifytargets, and connect, bind, message and transition endpoints.Also fixed:
$fork0-style endpoints no longer raise a diagnostic.satisfy r : R by snow satisfiesR, notr.Legacy code retired: about 150 lines of ad-hoc chain logic in
ReferenceResolver(TryResolveFeatureChain,FindFeatureMember). Chains now go throughNameResolver. The visibility rules from #94 still hold: private members are not visible through a chain from outside, and a first segment can still see local private members.Results (all of #129 so far):
Default mode still reports 0 errors.
The remaining 48 are not name-resolver bugs. They come from model data the AST does not capture yet:
calcandconstraintbodies, for exampleproducer_2.producerBehavior.publish.sentMessage.shoot.picture.vehicle1_t0.:>> a :>> b) is recorded.part def Cameraandpackage Camera).#service def, which is not modeled.Type of Change
Related Issues
Refs #129
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
pwsh ./build.ps1. Passed: 6149 tests.Code Quality
Quality Checks
pwsh ./lint.ps1. Passed.Testing
Documentation
Additional Notes
stdlib.json.gz: regenerated.