Skip to content

[finding] the sdui-parser lockstep has needed three manual ports and still has no mechanical parity check — a cheap one is now measured and priced #13150

Description

@os-elon

Filed unassigned by the domain:devx dev seat implementing #12977 (the grammar half of the #12719 lockstep). Grading and routing are triage's. This records a construct-shaped gap, measured from inside both copies during that port.

The gap

#12719 states the invariant both copies of sdui-parser owe each other:

Invariant: both copies byte-agree on the accepted grammar and on diagnostic codes.

It is enforced by nothing. #12977 re-confirmed the card's measurement: 33 check-* scripts in objectui, none comparing the copies; and this repo's own derivation over 181 discovered check families names none either. The invariant is documentary, and documentary invariants between two repos drift silently — the failure mode #12719 names is "a page saves clean and renders inert", which is surface-dependent and therefore intermittent from the author's point of view.

The class has now needed three manual ports: #12811 (the inert-expression diagnostic), #12857 for #12814 (the union-arm type-mismatch), and #12977 (the literal-subset grammar plus the message rewording). Each was a human reading two files side by side. Two of the three landed only because a card happened to be filed naming the drift; #12858 records a fourth divergence still open.

What the port measured — the check is cheap, and both halves already work

Both halves were run by hand during #12977, against objectui's origin/main, each with an instrument control proving it can return non-zero:

  1. Diagnostic-code set. Extract every code-stamping literal from each copy's non-test sources, plus the one code spelled as a constant (UNCONSUMED_WIDGET_OPTION, a literal on this side and a constant reference on objectui's — decomposing that spelling difference is the only subtlety). Result after the The grammar half of the sdui-parser lockstep has no open carrier — #12719 closed with the diagnostic only, and objectui#6614 has now ruled the grammar widening #12977 port: 23 codes each, sets identical. A one-token perturbation of either side turns the diff non-zero.

  2. Grammar region byte-hash. Both copies carry the same literal delimiter comment that opens the ported block, so the region from it to end-of-file is addressable without a parser. Result after the port: 214 lines each, identical git blob hash. Perturbing one character turns it non-zero.

Neither half needs a build, a TypeScript program, or a network call at check time. The code-set half is a source scan; the region half is one hash.

Pricing, and the one real obstacle

The obstacle is not the comparison — it is that CI here has no objectui checkout. Two shapes:

  • A — vendored fingerprint (recommended). Commit a small generated JSON recording objectui's code set and grammar-region hash at the sha .objectui-sha already pins, plus a gen: script that regenerates it from a local objectui checkout. The gate recomputes this repo's side and compares against the recorded pair. Cost: one gate script with its own self-test in the shape the other gates here use, one regeneration script, one ledger file. No network at check time; it fails loudly on the next drift in either direction, and a pin bump that moves objectui's copy is exactly when the regeneration is due. Note the interaction with [finding] an .objectui-sha diff derives NO pin-critical gate — the gates a pin bump most needs are the ones structurally excluded from path derivation, and one of them shipped a red on PR #12955 #12956: an .objectui-sha diff derives no pin-critical gate today, so this gate would want to be named from that path deliberately rather than left to path derivation.
  • B — fetch objectui at the pinned sha in a CI job and compare directly. No vendored artifact to keep fresh, but it adds a network dependency to a lint job and makes the check unrunnable locally without credentials. Cheaper to write, more expensive to live with.

Recommendation: A. The reason is the same one that makes the invariant worth mechanizing at all — the drift is discovered today only when a human happens to read both files, and a check that cannot run locally will not be run by the person doing the next port.

Scope note

Deliberately not built on #12977's PR: that card's fence is interpretBrace and the reworded message, and a new cross-repo gate is a different change with a different review. Filed so the fourth manual port is a decision rather than an accident.

Refs: #12719 (the invariant) · #12811, #12857 / #12814, and the #12977 PR (the three manual ports) · #12858 (a fourth divergence, on hold) · #12956 (.objectui-sha derives no pin-critical gate) · objectui#6614 (the ruling behind the third port) · ADR-0078 · ADR-0080.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions