feat(spar-sysml2): add refine/allocate/derive extraction (Phase 1 of #90)#97
Merged
feat(spar-sysml2): add refine/allocate/derive extraction (Phase 1 of #90)#97
Conversation
Expand the SysML v2 requirements extraction pipeline with three new relationship types: - `refine X by Y;` → `refines` link (was parsed but never extracted) - `allocate X to Y;` → `allocated-to` link (new grammar + extraction) - `derive X from Y;` → `derives-from` link (new grammar + extraction) Adds ALLOCATE_KW, DERIVE_KW, ALLOCATE_REQ, DERIVE_REQ to the SysML v2 syntax kind enum, grammar rules for both (allocate uses `to`, derive uses `from`), and wires all three into extract.rs alongside existing satisfy/verify extraction. Also adds `spar extract` as a top-level CLI alias for `spar sysml2 extract`. 8 new tests covering all relationship types individually, combined, and nested in packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Summary
Phase 1 of #90. Expands the SysML v2 requirements extraction pipeline with three new relationship types:
refine X by Y;→refineslink (grammar existed, extraction was missing)allocate X to Y;→allocated-tolink (new grammar + extraction)derive X from Y;→derives-fromlink (new grammar + extraction)Also adds
spar extractas a top-level CLI alias forspar sysml2 extract.Changes
syntax_kind.rs— addALLOCATE_KW,DERIVE_KW,ALLOCATE_REQ,DERIVE_REQgrammar/requirements.rs— addallocate_req(),derive_req()grammar rulesgrammar/mod.rs,grammar/packages.rs— wire new keywords into dispatchersextract.rs— addrefines,allocates,derivestoExtractedRequirement+ YAML outputmain.rs— addspar extracttop-level aliasTest plan
🤖 Generated with Claude Code