Skip to content

Add conformance cases for the mechanically expressible uncovered codes - #23

Merged
AM-L merged 1 commit into
mainfrom
conformance/cover-specified-codes
Sep 7, 2026
Merged

AM-L merged 1 commit into
mainfrom
conformance/cover-specified-codes

Conversation

@ambroise-leclerc

Copy link
Copy Markdown
Contributor

Closes #4 (as far as is mechanically expressible today).

AGENTS.md wants a case for every mechanically testable rule. The 0.1 baseline left 12 registered codes uncovered; #20 and #21 changed the set. This adds cases for the ones a fixture can express now:

Code Meaning Case
MEDUI-E014 duplicate node ID conformance/syntax/duplicate-node-id
MEDUI-E010 unexpected token conformance/syntax/unexpected-token
MEDUI-E004 source is not UTF-8 conformance/syntax/source-not-utf8
MEDUI-E071 unknown CV check conformance/safety/unknown-cv-check
MEDUI-E052 surface exceeded conformance/layout/surface-exceeded
MEDUI-E051 layout overflow conformance/layout/positioned-node-overflow (E051's only prior case moved to E054 in #20)

conformance/README.md (new) records the coverage rule, the "point at the offending token" position convention, and why E000–E003, E016, E050, E053 stay uncovered — each needs a contract addition (a recipe-fixture convention, a forbidden-construct grammar, a font model, a charset model), not just a fixture.

New outcomes → 0.2.0 candidate line. Positions are candidate-level and will be pinned by TrustSC/MduX.

Validation: python3 tools/validate.py → OK (27 cases, 26 diagnostics). Every fixture's source-not-utf8 byte and every column verified programmatically.

Stacked on #22.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are additive conformance fixtures/docs that match the registered diagnostic phases and existing case patterns without introducing behavioral or contract-breaking modifications.

Pull request overview

Adds new conformance fixtures and case definitions to cover previously uncovered, mechanically expressible diagnostic codes (per the repository’s “every mechanically testable rule needs a case” requirement), and documents the coverage/positioning conventions for cases.

Changes:

  • Adds new syntax rejection cases for MEDUI-E010 (unexpected token), MEDUI-E004 (source not UTF-8), and MEDUI-E014 (duplicate node ID).
  • Adds new layout rejection cases for MEDUI-E052 (surface exceeded) and MEDUI-E051 (positioned node overflow).
  • Adds a new safety rejection case for MEDUI-E071 (unknown CV check), plus a conformance/README.md documenting coverage expectations and pinned-position conventions.
File summaries
File Description
conformance/README.md Documents conformance case structure, pinned-position convention, and remaining uncovered codes rationale.
conformance/syntax/unexpected-token/source.medui Fixture containing an unexpected token sequence to trigger MEDUI-E010.
conformance/syntax/unexpected-token/case.json Syntax case asserting MEDUI-E010 at the pinned location.
conformance/syntax/source-not-utf8/source.medui Fixture intended to exercise MEDUI-E004 (“source is not UTF-8”).
conformance/syntax/source-not-utf8/case.json Syntax case asserting MEDUI-E004 at the pinned location.
conformance/syntax/duplicate-node-id/source.medui Fixture with duplicated id to trigger MEDUI-E014.
conformance/syntax/duplicate-node-id/case.json Syntax case asserting MEDUI-E014 at the pinned location.
conformance/safety/unknown-cv-check/source.medui Fixture using an unknown cv_check value to trigger MEDUI-E071.
conformance/safety/unknown-cv-check/case.json Safety case asserting MEDUI-E071 at the pinned location.
conformance/layout/surface-exceeded/source.medui Fixture exceeding declared surface to trigger MEDUI-E052.
conformance/layout/surface-exceeded/case.json Layout case asserting MEDUI-E052 at the pinned location.
conformance/layout/positioned-node-overflow/source.medui Fixture positioning a node beyond the surface to trigger MEDUI-E051.
conformance/layout/positioned-node-overflow/case.json Layout case asserting MEDUI-E051 at the pinned location.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from 43d3524 to b8511ac Compare September 7, 2026 07:21
@ambroise-leclerc
ambroise-leclerc force-pushed the conformance/cover-specified-codes branch from b8511ac to 9e7461e Compare September 7, 2026 07:27
@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from 9e7461e to 349661c Compare September 7, 2026 07:32
@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from 349661c to ad67d58 Compare September 7, 2026 07:36
@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from ad67d58 to 5df8f47 Compare September 7, 2026 07:38
@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from 5df8f47 to c27b0a3 Compare September 7, 2026 07:41
Base automatically changed from spec/safety-critical-promotion to main September 7, 2026 07:46
AGENTS.md wants a case for every mechanically testable rule. The 0.1 baseline
left 12 registered codes uncovered; PR-3 and PR-4 changed the set. This adds
cases for the ones a fixture can express today:

- MEDUI-E014 duplicate node ID        conformance/syntax/duplicate-node-id
- MEDUI-E010 unexpected token          conformance/syntax/unexpected-token
- MEDUI-E004 source is not UTF-8       conformance/syntax/source-not-utf8
- MEDUI-E071 unknown CV check          conformance/safety/unknown-cv-check
- MEDUI-E052 surface exceeded          conformance/layout/surface-exceeded
- MEDUI-E051 layout overflow           conformance/layout/positioned-node-overflow
  (E051's only previous case moved to E054 in PR-3)

conformance/README.md records the coverage rule and why E000-E003, E016, E050
and E053 stay uncovered - each needs a contract addition (recipe-fixture
convention, forbidden-construct grammar, a font model, a charset model), not
just a fixture.
@AM-L
AM-L force-pushed the conformance/cover-specified-codes branch from c27b0a3 to 396b5b0 Compare September 7, 2026 07:46
@AM-L
AM-L merged commit 7ad4f1a into main Sep 7, 2026
3 checks passed
@AM-L
AM-L deleted the conformance/cover-specified-codes branch September 7, 2026 08:17
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.

17 of 22 registered codes have no conformance case

3 participants