Skip to content

Adopt the shared MedUI 0.3.0-rc.1 syntax baseline - #52

Merged
AM-L merged 2 commits into
mainfrom
335-shared-conformance-baseline
Sep 8, 2026
Merged

AM-L merged 2 commits into
mainfrom
335-shared-conformance-baseline

Conversation

@ambroise-leclerc

@ambroise-leclerc ambroise-leclerc commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

TrustSC and MduX previously ran different MedUI corpus revisions. This adopts MduX's exact v0.3.0-rc.1 pin (9a57f6462b6f8dbdf1f0b8b4519674f1c6235dbb) and passes all five syntax cases through TrustSC's production parser.

Duplicate authored IDs fail during parsing using each node's final ID and the later effective declaration's line. Repeated id: fields retain last-value-wins behavior; overwritten names reserve nothing. Rows are checked in effective source order even when their final ID follows their children. The compiled-node check remains for synthesized panels and edited ASTs.

Invalid UTF-8 produces MEDUI-E004 through the byte parser, file compiler, CLI and Studio file endpoints. Studio distinguishes encoding errors from missing/unreadable files (MEDUI-E003) for detail, frame and proposals; valid UTF-8 syntax errors keep their original source and byte-exact hash for editing.

The manifest retains syntax at line-only precision. Semantics, layout, safety and observation profiles remain unclaimed because complete shared adapters do not exist. Diagnostic documentation explicitly inventories the newer registry gaps, including E070: an annotated Button/TextInput can still compile without an otherwise optional requirement. This existing safety divergence is documented, not claimed as implemented.

A named CI step reports executed versus unclaimed cases. The disagreement negative reads its corpus source and executes a positive control outside the catch, then asserts the exact inverted-expectation message. An I/O or unrelated panic cannot satisfy it. No corpus expectations are copied into test code.

Validation at b21c423: Rust/Cargo 1.96.0; full cargo build --offline --locked --workspace passed; cargo test --offline --locked --quiet passed 319 tests with no failures or ignored tests and the pinned MEDUI_CONFORMANCE_DIR. The parser/checker tests account for 70 passes and Studio for 36. Documentation lint passed. CI is green: https://github.com/ambroise-leclerc/TrustSC/actions/runs/34229297866. MduX's paired local selection passed 313 tests at a722784 on the same pin.

Part of Compliatory/MduX#335, paired with Compliatory/MduX#337. This provides adoption evidence for joint review; it does not claim full cross-implementation conformance or close the joint sign-off.

Impact: potentially safety-relevant compiler/conformance evidence. Device rendering and baked artifacts are unaffected; no certification or production-readiness claim is introduced.

Summary by CodeRabbit

  • Bug Fixes

    • Invalid UTF-8 in MedUI files now produces a positioned MEDUI-E004 diagnostic instead of a generic read failure.
    • Studio preserves source bytes and editability for files containing syntax errors.
    • Studio distinguishes missing, unreadable, and invalidly encoded files with appropriate responses.
    • Duplicate authored IDs are detected during parsing, with diagnostics pointing to the later declaration.
  • Documentation

    • Added documentation for the shared MedUI conformance baseline, supported coverage, limitations, and verification process.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: da8619e3-2c45-4c7f-8015-6311d51df660

📥 Commits

Reviewing files that changed from the base of the PR and between 4f114dd and b21c423.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • crates/trustsc-ui-dsl-authoring/src/diagnostic.rs
  • crates/trustsc-ui-dsl-authoring/src/lib.rs
  • crates/trustsc-ui-dsl-authoring/tests/shared_conformance.rs
  • docs/dsl/conformance.md
  • docs/dsl/overview.md
  • medui-conformance.toml
  • tools/trustsc-medui-check/src/main.rs
  • tools/trustsc-medui-check/tests/cli.rs
  • tools/trustsc-medui-studio/src/api.rs
  • tools/trustsc-medui-studio/src/main.rs

📝 Walkthrough

Walkthrough

The PR adds byte-preserving MedUI parsing, positioned invalid-UTF-8 diagnostics, duplicate authored-ID validation, Studio error classification, and a CI gate for the pinned MedUI conformance corpus.

Changes

MedUI conformance and source handling

Layer / File(s) Summary
Parser decoding and authored-ID validation
crates/trustsc-ui-dsl-authoring/src/diagnostic.rs, crates/trustsc-ui-dsl-authoring/src/lib.rs
The parser adds parse_medui_bytes, reports invalid UTF-8 as MEDUI-E004, and rejects duplicate effective authored IDs with the later declaration’s line.
CLI and Studio source loading
tools/trustsc-medui-check/..., tools/trustsc-medui-studio/...
The tools read raw bytes. Studio distinguishes invalid, missing, and unreadable sources while preserving editable source text and hashes.
Pinned conformance gate and documentation
crates/trustsc-ui-dsl-authoring/tests/shared_conformance.rs, .github/workflows/ci.yml, medui-conformance.toml, docs/dsl/*
The harness validates claimed capabilities and adapter agreement against the updated pinned corpus. CI runs the gate and documentation records the baseline.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant StudioAPI
  participant FileSystem
  participant parse_medui_bytes
  Client->>StudioAPI: Request screen, frame, or proposal
  StudioAPI->>FileSystem: Read .medui bytes
  FileSystem-->>StudioAPI: Raw source bytes
  StudioAPI->>parse_medui_bytes: Decode and parse bytes
  parse_medui_bytes-->>StudioAPI: Parsed result or diagnostics
  StudioAPI-->>Client: Source response or classified error
Loading

Suggested reviewers: am-l

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 335-shared-conformance-baseline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AM-L
AM-L marked this pull request as ready for review September 8, 2026 13:23
@AM-L
AM-L merged commit dc0dd5b into main Sep 8, 2026
2 of 3 checks passed
@AM-L
AM-L deleted the 335-shared-conformance-baseline branch September 8, 2026 13:50
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.

2 participants