Implement SysmlMetadataNode and Filtering subsystem for Phase 1#23
Merged
Conversation
… (Phase 1)
- Add SysmlMetadataNode (10th SysmlNode subtype) capturing metadata annotations
({@type{attr = value;}} / bare @type;) with resolved type reference and
literal attribute values.
- Extend AstBuilder to build SysmlMetadataNode from metadataFeature grammar and
capture expose bracket-filter raw text (SysmlViewNode.ExposeBracketFilterTexts).
- Extend ReferenceResolver to resolve metadata type references into new
SysmlEdgeKind.MetadataType edges.
- Add DemaConsulting.SysML2Tools.Core.Filtering subsystem: FilterExpression AST
with round-trip pretty-printer, FilterExpressionParser (adapts ownedExpression()
CST into the Phase 1 construct subset, never throws), and
FilterExpressionEvaluator (never throws).
- Integrate into GeneralViewLayoutStrategy: standalone filter narrows the
rendered scope; parse/eval failures fall back to the existing warning with a
reason; expose bracket-filter gets its own distinct unevaluated warning.
- Update LayoutWarnings/GeneralViewLayoutStrategyTests/LayoutWarningsTests for
the new behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…re-associate DOT/attribute-read across boolean chains - AstBuilder now reconstructs filter/bracket-filter expression text from the original input stream (preserving inter-token whitespace) instead of ParserRuleContext.GetText(), which concatenates tokens with no separator and breaks keyword boundaries on re-lex (e.g. '@safety and (as Safety)' round-tripped as the unlexable '@Safetyand(asSafety)'). - FilterExpressionParser now re-associates a DOT-based attribute read onto the rightmost operand of a boolean/not chain, since this grammar's DOT binds looser than the boolean connectives (so 'X and (as T).attr' parses as 'DOT(AND(X, (as T)), attr)' rather than the intuitively-expected 'AND(X, DOT((as T), attr))'). This supports the canonical OMG filtering idiom without requiring extra parentheses. - Added FilterExpressionEvaluatorTests.cs and a new-fixture end-to-end rendering test (safety-metadata-filter.sysml under test/SysMLModels/Custom) proving the evaluator narrows General View rendered scope correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…stem + SysmlMetadataNode (Phase 1) - New subsystem/unit reqstream requirement files for Core.Filtering and SysmlMetadataNode, plus updates to ast-builder/sysml-node/ general-view-layout-strategy/layout-warnings requirement files. - New/updated design and verification docs mirroring the requirement structure, including docs/design/introduction.md Software Structure updates. - .reviewmark.yaml entries for all new reviewable files. - cspell:ignore annotations for new filter-grammar terminology (parenthesization/istype/hastype/LPAREN/RPAREN/unlexable/etc.). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…evaluation - ROADMAP.md: mark Phase 1 done, explicitly list Phase 2 deferrals (bracket expose-filter evaluation, istype/hastype/all/arithmetic/conditional/ feature-chain navigation, usage-level metadata filtering). - docs/user_guide/introduction.md: update 'View Body Statements' and 'Expose vs. Render: Worked Examples' to describe standalone filter evaluation vs. the still-capture-only bracket form. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…to avoid spurious unresolved-reference warning Verified end-to-end via the CLI: 'render' on this fixture now produces no diagnostics, and SafetyPartsView/MandatorySafetyPartsView SVG output correctly reflects the Phase 1 filter-narrowed scope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This pull request introduces and documents a new Filtering subsystem in the
DemaConsulting.SysML2Tools.Corelibrary, enabling Phase 1 support for evaluating standalone viewfilter [<expr>];expressions. The changes clarify design, architecture, and review coverage for this subsystem, update the project roadmap to reflect completed and deferred filtering features, and expand the requirements and review mapping for filtering-related implementation and verification.Filtering Subsystem Introduction and Documentation:
Filteringsubsystem to the core library, described indocs/design/sysml2-tools-core.mdand in a dedicated subsystem design file, with details on its architecture, interfaces, and data flow. This subsystem parses and evaluates a defined Phase 1 subset of view filter expressions, supporting metadata-based filtering. [1] [2] [3] [4] [5]Roadmap and Design Documentation Updates:
ROADMAP.mdto reflect that Phase 1 of view filter expression evaluation is complete, specifying the supported constructs, deferred features, and the scope of the implementation.docs/design/introduction.mdto include the newFilteringsubsystem and its main unit,FilterExpressionEvaluator, in the system and unit-level overviews, as well as in the directory structure. [1] [2] [3]Requirements and Review Coverage Expansion:
.reviewmark.yamlfor the Filtering subsystem, including design, verification, requirements completeness, and implementation of theFilterExpressionEvaluator. This ensures traceability and explicit review coverage for all filtering-related artifacts and code.SysmlMetadataNodesemantic model type, which is essential for metadata-driven filtering.These changes collectively establish the Filtering subsystem as a first-class concern in the core library, provide comprehensive documentation and review/traceability, and mark Phase 1 of filter expression evaluation as complete and integrated into the rendering pipeline.