Skip to content

Implement SysmlMetadataNode and Filtering subsystem for Phase 1#23

Merged
Malcolmnixon merged 6 commits into
mainfrom
feature/filter-expression-evaluation
Jul 10, 2026
Merged

Implement SysmlMetadataNode and Filtering subsystem for Phase 1#23
Malcolmnixon merged 6 commits into
mainfrom
feature/filter-expression-evaluation

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request introduces and documents a new Filtering subsystem in the DemaConsulting.SysML2Tools.Core library, enabling Phase 1 support for evaluating standalone view filter [<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:

  • Added a new Filtering subsystem to the core library, described in docs/design/sysml2-tools-core.md and 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:

  • Updated ROADMAP.md to reflect that Phase 1 of view filter expression evaluation is complete, specifying the supported constructs, deferred features, and the scope of the implementation.
  • Revised docs/design/introduction.md to include the new Filtering subsystem 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:

  • Added new reviewmark entries in .reviewmark.yaml for the Filtering subsystem, including design, verification, requirements completeness, and implementation of the FilterExpressionEvaluator. This ensures traceability and explicit review coverage for all filtering-related artifacts and code.
  • Added a reviewmark entry for the new SysmlMetadataNode semantic 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.

Malcolm Nixon and others added 6 commits July 10, 2026 17:02
… (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>
@Malcolmnixon Malcolmnixon merged commit 5215c33 into main Jul 10, 2026
15 checks passed
@Malcolmnixon Malcolmnixon deleted the feature/filter-expression-evaluation branch July 10, 2026 23:42
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