This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 5495b8d
feat(scripts): report-only component surface parity checker (objectui#4631) (#9551)
Fixes #4631
Lands `pnpm check:component-surface-parity` — a **report-only** checker
that prints, per
registered component type, where the four declared surfaces disagree. It
repairs nothing
it finds, and it exits `0` with findings.
> **Round 2.** The instrument review
([verdict](#9551 (comment)))
> returned FAIL with four repairs — all seven of the round-1 claims
reproduced exactly, so the
> FAIL was about what the census did not disclose, plus one rule that
fired on correct code.
> All four are fixed, every repair in the matcher; `origin/main` is
merged in and the census
> re-taken on the merged tree. The round-2 numbers are below and they
replace the round-1 ones.
## The rule, which is the ruling's and not the script's
From the director-seat ruling on this card (batch #112 item 2,
2026-09-10), quoted rather
than paraphrased:
> **裁定**:一个组件类型的权威序是 **spec 的 `ComponentPropsMap`(有声明时)> 渲染器实际读的键(实现)>
TS 接口与注册表 `inputs`(实现的说明书,跟随)**。
> 门:`check:component-surface-parity`——TS 接口键集 = spec 键集 ∪
渲染器读键集;`inputs` ⊆ 该集合;`defaultProps` 中作为设计器种子而非默认值的行须登记理由。report-only
起步,零分歧后翻阻断。
So: interface key set = spec ∪ renderer-reads; `inputs` ⊆ that union (an
**omission is
legal**); a `defaultProps` row that is a designer seed rather than a
default claim carries a
registered reason. Report-only first; the flip to blocking is a separate
card on a measured
zero, and repairing any row below is governed by the same ruling's
ordering note
(先判协议对不对 — the spec card goes first where the protocol is the thing that
is wrong).
## How this divides the work with the gate that already exists
`apps/console/src/__tests__/registry-inputs-spec-parity.test.ts` owns
registry `inputs` ↔ spec
`ComponentPropsMap`, in both directions, from the **live registry**,
with its own exemption
discipline — and it is one of a family: `git ls-tree -r --name-only
origin/main` filtered on
`spec-parity|inputs-spec` lists 36 paths, 34 of them `*.test.ts(x)`.
This checker neither
repeats nor contradicts that family:
- it judges `inputs` against the **union** (spec ∪ renderer reads),
which is the ruling's
accept set and is strictly *wider* — so a key this checker passes may
still be judged
there, and those tests stay the authority on the spec-only direction;
- it reads the two surfaces a live registry cannot hold: the TS
interface in
`packages/types`, and what the renderer actually **reads**;
- it reads **source**, not a runtime registry, so a lazily registered
block (a stub at
runtime) is a full member of this population. The two populations differ
on purpose.
`scripts/check-handler-key-read-sites.mjs` is the same read-site
question narrowed to `on*`
keys and judged against the zod arms; it blocks. This checker reuses
that gate's extraction
primitives rather than growing a fourth copy of "which files ship" and
"which registrations
exist", and judges every key against the TS interface instead.
## Acceptance notes
### Corpus — stated so every number below is reproducible from this text
alone
Measured at `e9dc38ee9e`, which is this branch **with `origin/main`
merged in**
(`8d50bc2bf4`, merge commit `0a1fda0402`).
1 parent 009f92d commit 5495b8d
4 files changed
Lines changed: 2600 additions & 0 deletions
File tree
- .changeset
- scripts
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
0 commit comments