Skip to content

Name the rule of context-stage and more semantic findings - #30

Open
mbrunnen wants to merge 1 commit into
Open-MBEE:mainfrom
mbrunnen:rule-codes
Open

mbrunnen wants to merge 1 commit into
Open-MBEE:mainfrom
mbrunnen:rule-codes

Conversation

@mbrunnen

@mbrunnen mbrunnen commented Nov 7, 2026

Copy link
Copy Markdown

Fixes #29. Follow-up to #10.

The context stage now sets Diagnostic::code for the findings that name a
rule, so check --format json reports their rule. Six owning-type rules
and the name clash get their rule name, and four semantic findings name the
rule they report. No finding is added or removed, and no severity changes.

How to test

$ cargo test -p sysmlv2-cli --test integration check_format_json_names_the_rule_of_every_stage
$ cargo test -p sysmlv2-parser --test integration opensysml::

Look closely at

  • sysmlv2-syntax/src/check.rs gets a rule_error helper that writes
    "rule: message" and sets the code, the style the context stage already
    used. The semantic stage keeps its "message [rule]" style.
  • The new names are in IMPLEMENTED_NORMATIVE_VALIDATION_RULES and
    IMPLEMENTED_NORMATIVE_SEMANTIC_RULES, and the XMI audit accepts them.
  • The opensysml baselines move only in message text (24 and 22 lines), one
    for one. No finding is added or lost.
  • A verify member in the wrong body had a context and a semantic finding
    before; both now name validateRequirementVerificationMembershipOwningType.
  • The CHANGELOG.md entry is under a new Unreleased heading. Move or drop
    it as you prefer.

The JSON report reads a finding's rule from Diagnostic::code since Open-MBEE#10,
but the context stage wrote the rule only into the message, and a few
findings that violate a named rule did not name it. The opensysml
baselines move only in message text.
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.

check --format json: context-stage and some semantic findings still report "rule": null (follow-up to #10)

1 participant