Repository navigation
fix(sdui-parser): retire the binding: 'field' arm on both manifest faces (objectui#8315) - #8723
Conversation
…faces (objectui#8315) The 2026-09-07 ruling on objectui#6950 (director decision batch #69) retired the zero-writer `'field'` arm under ADR-0049, naming one coordinate: the serializer's input boundary, which PR #8297 narrowed. `ManifestInput.binding` and `ManifestValidationResult.bindings[].kind` kept it, so one published package narrowed on one face and stayed wide on the other. Both now read `'object'`. The subset counter-argument — a reader accepting a value no producer emits is permissive, not wrong — does not reach either declaration: `bindings[].kind` is a PRODUCER face that `validateTree` writes, where a wider union obliges consumers rather than accepting more; and the two are coupled by `kind: input.binding`, so narrowing one alone would need a cast at the only conversion site. `ManifestInput` is also `manifestFromConfigs`'s return type, so it is not a pure reader face either. Measured on both heads with a firing control: zero positive writers of `binding: 'field'` in objectui (the 2 occurrences are `@ts-expect-error` pins) and zero in objectstack; control `binding: 'object'` fires 19 and 2 times. The narrowing is compile-time only and a pin says so: this package has no runtime validator for a manifest it is handed. Two prose statements in `index.ts` and the pin test's header claimed the reader face was deliberately left wide; they became false with this change and are corrected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
|
Contract review — accepted, flipped out of draft, auto-merge armed. 33/33 checks green. I re-measured the load-bearing claims rather than reading them, because the whole PR rests on a zero. The zero is real, and the control is lit. Census over The 23 are what makes the 4 evidence rather than a broken query — same command shape, same population, plenty of hits. All four The negative pins are enforcement, and I checked the mechanism rather than the claim. On the bump, the PR is right for a reason it did not state. A changeset that says "Breaking for TypeScript consumers, deliberately" and declares The two legs I would have asked for were already there.
And every refusal is paired with a passing well-formed control, so "it refused" cannot be satisfied by a face that refuses everything. That is the discriminating-leg standard applied without being asked for. The argument that decided the design is the part worth keeping. The tempting answer — producer → reader is a subset relation, so a permissive reader is not wrong — was answered rather than waved away:
Generated by Claude Code |
Fixes #8315
Retires the
binding: 'field'arm on the two manifest faces that the 2026-09-07 rulingdid not name, so
@object-ui/sdui-parserstates one vocabulary instead of two.The choice, and the argument that decided it
The card admitted two outcomes: (1) narrow both faces, or (2) record the reader
face as deliberately wider and say why in the declaration itself. Outcome 1 was
taken.
The counter-argument, answered rather than assumed away
That argument is sound — for a pure reader face. Applied to the two residues it does
not carry, and the reason is decisive rather than a matter of taste:
ManifestValidationResult.bindings[].kindis not a reader face at all.validateTreewrites it (validate.ts:83,kind: input.binding). For an outputtype the subset relation runs the other way: a wider union accepts nothing extra, it
obliges every consumer to handle an arm this package cannot emit. So even if the
argument fully carried on
ManifestInput.binding, one of the two residues wouldstill be wrong.
The two are coupled by that assignment, so the choice is not per-declaration.
kind: input.bindingmeanskindcannot narrow whilebindingstays wide, andbindingcannot narrow whilekindis asserted from it — not without a cast at thesingle conversion site, which is precisely the lenient fallback AGENTS.md #0.1 bans.
"Both narrow" and "both wide" were the only self-consistent states, and outcome 2
would have required writing a justification on
bindings[].kindthat is not true ofa producer face. The card forbids a shrug there; there was no honest non-shrug to
write.
ManifestInputis not a pure reader face either.manifestFromConfigsreturnsManifest, so it is simultaneously this package's output type, fed straight fromthe boundary PR fix(types,core,sdui-parser): type the framework-injected
bindinginput instead of casting it in #8297 already narrowed.The permissiveness protected nothing, measured. For a reader's width to protect
anything some producer must emit the value. Zero writers on both repos (below), and
the only manifest producer in either tree is
manifestFromConfigs, whose input faceis already narrow.
The reopen route is the ruling's own and is unchanged: a measured need for field
bindings is filed as a widening with the vocabulary decided then.
What changed
packages/sdui-parser/src/types.ts:100ManifestInput.binding'object' | 'field''object'packages/sdui-parser/src/types.ts:138ManifestValidationResult.bindings[].kind'object' | 'field''object'Both carry the reasoning on the declaration, where a later reader lands — the card's
requirement for outcome 2 applied to outcome 1 as well, since the next reader's question
("why is this only
'object'?") is the same one either way.Two prose corrections, which are not optional:
index.tsand the pin test's header bothstated that the reader face "still reads
'object' | 'field'" / "is deliberately notnarrowed here". Those sentences became false with this change, and a confidently
false statement is this repository's worst failure direction.
Accept-set finding (Clause ②)
The accept set moved, so
needs:contract-reviewis hung on this PR as well as thecard. What a caller can no longer pass:
binding: 'field'in a hand-writtenManifestInput/Manifestliteral, andkind: 'field'in abindings[]entry. Nothingbecame newly acceptable.
Compile-time only, and stated as a pin so nobody mistakes it for more. Types are
erased; this package has no runtime validator for a
Manifestit is handed, so a JSONmanifest carrying the retired arm still produces a binding site nothing resolves.
the narrowing is COMPILE-TIME onlyininjected-component-input-6950.test.tsdrivesthat through
validateTreeand pins the actual behaviour. Closing that would be a newdiagnostic, not a type change, and is deliberately out of scope.
Every refusal is paired with a well-formed control that still passes, so "it refused"
cannot be satisfied by a face that refuses everything:
ManifestInputwithbinding: 'object'type-checks, abindings[]entry withkind: 'object'type-checks,and
validateTreestill records{ kind: 'object' }end to end. The@ts-expect-errordirectives are real enforcement — this package type-checks its tests through
tsconfig.test.json.Ablation, both legs, on the committed tree. Widening the two unions back on disk
(mutation proved to have landed: blob
e5ed29a6to2f0ad139, each widened spellinggrep-counted
1) turnstsc -p tsconfig.test.jsonRED, exit 2, with exactly the twonew pins named and nothing else:
Restore leg: blob back to
e5ed29a6(identical to theHEADblob),git diff HEADempty,tsc -p tsconfig.test.jsonexit 0. So the refusals are the narrowing's doing and thecontrols survive both legs. The mutation script carried
trap ... EXIT INT TERM; nomutated file is left in the tree, and nothing under
node_moduleswas touched — theablation is a source-level mutation of this package only.
Writer counts, re-derived on this head, each with its firing control
Discriminator
binding:\s*'(field|object)'overpackages/ apps/ examples/,*.ts+*.tsx, run on each repo's own head rather than recalled from the card:binding: 'field'binding: 'object'da5e4f69(this PR's base)@ts-expect-errornegative pinseabdd66(read-only)The card's figures (
0/7across 5 files) were taken at8f9d87aon a narrowerpattern; the reading that matters is unchanged and now re-derived rather than inherited:
zero positive writers on either side.
⭐ Not a re-grade trigger. The card's trigger is
binding: 'field'found written.Both objectui occurrences are
@ts-expect-errorlines asserting the arm is refused —they are the gate, not an author. There is no positive writer in either repo.
check:upstream-port-parity— read, run, and what it means hereGreen (exit 0), and it does not cover this change. Its pin
(
scripts/upstream-port-pin.json) carries exactly three ported files —scripts/pm/check-half-states.mjs,scripts/invoked-as.mjs,.claude/hooks/guard-main-checkout.selftest.sh— none underpackages/sdui-parser.⇒ The card's premise that "the two copies are kept in step by some mechanism" is
measurably false. No gate in this repo compares the two
sdui-parsercopies, and thisrepo has zero references to
@objectstack/sdui-parser(not a dependency, notimported, not in any
package.json). The two are independent copies of one design, not aproducer/consumer pair on a wire.
So this change neither trips that gate nor forces the objectstack side. Propagation is
a human decision on objectstack#16583, whose own writer face (
index.ts:81) has not evenhad PR #8297's narrowing applied yet — all three of its declarations are still wide, so
that repo is internally consistent today and stays so. This PR makes this package
internally consistent. ⛔ Nothing was pushed to objectstack.
Gates
Every gate below was run on
4e6f977c, this PR's head, with its exit code capturedbefore any pipe:
pnpm --filter @object-ui/sdui-parser type-check(tsc --noEmit+tsc -p tsconfig.test.json)pnpm exec vitest run packages/sdui-parser/ packages/types/src/__tests__/injected-component-input-6950.test.ts(repo root)pnpm --filter @object-ui/sdui-parser lintno-explicit-anywarnings, none in touched files)node scripts/check-changeset-presence.mjspnpm check:control-bytesnode scripts/check-upstream-port-parity.mjsnode scripts/check-upstream-port-parity.mjs --self-testpnpm check(afterpnpm --filter '@object-ui/cli...' build, exit 0)node scripts/check-type-check-coverage.mjspnpm check:element-data-source-declarationpnpm check:spec-symbols·check:phantom-deps·check:self-import·check:unreferenced-sources·check:side-effects-arraypnpm check:readme-exportsis NOT MEASURED here: it exits 1 with its own"the population COLLAPSED -- this run proves nothing" verdict because 31 of 40 packages
have no
dist/in this worktree (it saysrun 'pnpm build' first). That is aprerequisite failure, not a red —
readme-exports.ymlruns it onpull_requestafterturbo run build --filter='./packages/*', so CI judges it on a built tree.The full report on #8315 carries the same table plus an explicit NOT MEASURED section.
维护者速读(草稿)
改了什么 —
@object-ui/sdui-parser的 manifest 类型里,binding与bindings[].kind两处的
'field'分支退休,只留'object';理由写在声明本身上。为什么改 — 2026-09-07 的裁决只点名了一个坐标(序列化器入口,PR #8297 已收窄),
另外两处留着,同一个已发布包对同一个 wire key 说了两套话。卡片给的两个出路里,
「保留并写明理由」这条走不通:
bindings[].kind是生产者面,不是读者面 —— 在那儿写「读者宽容是对的」是假话,而两处被
validateTree的一次赋值绑死,不能只收窄一处(除非加 cast,那正是 AGENTS.md #0.1 禁止的宽容回退)。
风险与代价(含回滚) — 已发布类型的 accept set 变窄 ⇒ 对 TS 使用者是 breaking,
已按
minor声明 changeset 并写明迁移。实测两仓binding: 'field'写入方为 0(objectui 的 2 处是断言「被拒」的
@ts-expect-error),故迁移面为空。仅编译期:运行时行为未变,已用 pin 钉住这一限度。回滚 = revert 本 PR 单一 commit。
席位意见 — (留空,待席位定稿)
你要做的 — 确认 accept-set 变更(carrier 已挂 PR 与卡片,清除归 PM);
决定 objectstack#16583 是否同步收窄 —— 本仓没有任何机制会替它做,本 PR 也不强制它。
🤖 Generated with Claude Code
https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
Generated by Claude Code