Skip to content

Undefined whether an unknown position satisfies a case pinning a known one #7

Closed

Description

@ambroise-leclerc

spec/diagnostics.md defines what a position means in an emitted diagnostic:

Positions are 1-based; 0 means unknown. Columns count UTF-8 bytes.

It does not define what a position means in a conformance case. Every case pins an exact column:

"diagnostics": [{ "code": "MEDUI-E015", "line": 6, "column": 9 }]

So it is undefined whether an implementation that legitimately reports 0 (unknown) for a column satisfies a case pinning 9. Two readings are both defensible:

  1. Exact match. The case pins observable behaviour, so 0 != 9 fails. An implementation without positioned diagnostics cannot claim the phase at all.
  2. Unknown is permitted. 0 means "not reported", the case pins where a position-reporting implementation must point, and an implementation reporting nothing is not wrong, only less precise.

MEDUI-DEC-005 leans toward (1) — "exact 1-based UTF-8 byte positions where known" — but "where known" is exactly the ambiguity.

Why it matters now

This decides whether a real implementation can claim syntax today. TrustSC's parser is line-oriented and reports no column, so under reading (1) it cannot claim the phase until it has a positioned lexer, even though it agrees with every case on acceptance, code and line.

Rather than drop the column assertion, TrustSC records the deviation in its own manifest (Compliatory/TrustSC#49):

positions = "line-only"

Its harness then requires every diagnostic to carry no column, so the day a positioned lexer lands the suite fails until the key is set to full and the pinned columns are genuinely checked. That is a local workaround for a question only this repository can answer, and it should be deleted once the contract says something.

Suggested resolution

State the rule in MEDUI-DEC-005 and spec/diagnostics.md. If precision is declarable, the natural home is the consumer manifest alongside capabilities, and governance/versioning.md should say whether a phase claimed at reduced precision counts as claiming it for the purpose of "a contract change is accepted only after every implementation claiming the affected capability passes the candidate commit".

My inclination is to make it declarable rather than binary — a line-accurate implementation is genuinely useful, and forcing an all-or-nothing claim just makes claims rarer and less informative.

Activity

  1. ambroise-leclerc commented on Aug 15, 2026

    @ambroise-leclerc
    ContributorAuthor

    Resolved by #9, merged as 9eb3ace.

    Precision is declared rather than assumed. A consumer names positions in its manifest and a claimed phase is checked at that precision:

    positions Implementation reports Required reported position
    full line and column both equal the pinned values
    line-only line only line equals the pinned line, column is 0
    none neither both are 0

    The case itself is never rewritten or zeroed — only the expectation placed on the implementation's output varies. The rule is checked in both directions, so reporting more position than declared fails too and precision cannot move without a manifest edit.

    Both implementations now claim syntax honestly against the same cases: TrustSC at line-only (Compliatory/TrustSC#49), MduX at full (Compliatory/MduX#210), both green at c8cc45e.

    Review of #9 also surfaced that the manifest was only ever illustrated, never specified — so the two harnesses genuinely disagreed, TrustSC rejecting unknown keys and MduX ignoring them. governance/versioning.md and schemas/consumer-manifest.schema.json now state the contract, and both harnesses enforce it.

    This issue is closed manually because auto-close only fires against the default branch, which is still agent/bootstrap-medui-contract — see #1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions