Skip to content

Commit a749dcc

Browse files
claude[bot]claude
andauthored
docs(audits): correct the strictness ledger's fourth union-flattening claim (#16792)
The `ui/` batch narrative's clause (a) restated, a few hundred lines below the `chart.zod.ts` row, the same claim that row's clause made: that what carries a strict arm's named surface and rename to the author is `packages/lint`'s arm unpacking, and that this is "a general fact about this campaign's remaining union sites". Both halves were already false the day they were written -- `e0f300ba5` (2026-08-08) is the same commit that wrote the `chart` row's clause, and all three flatteners had closed before it (#4971 / #5014 on 2026-08-05, #5341 on 2026-08-04). Under the ledger convention ruled on #14977, a clause false at its own batch is corrected outright rather than kept as a WRITTEN AT THE TIME record, so this site takes the same treatment the `chart` row received: the cleft is struck, the generalisation withdrawn, and `packages/spec/src/shared/union-branch-policy.ts` named as what lifted it. The two rows now state the mechanism identically. Re-measured through the paragraph's own door: `ChartAggregateSchema.safeParse` with `dateGranularty` inside `groupBy`, rendered by spec's own `formatZodError` with no `packages/lint` in the path, delivers the surface, the offending key and the rename beneath the one `invalid_union` wrapper line. The parenthesis each row keeps -- zod still raises a keyless `invalid_union` whose message is "Invalid input" -- is unchanged and still true. No other row is touched and the os-regen `.counts.md` companion is not edited. Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent ecd2158 commit a749dcc

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

docs/audits/2026-07-unknown-key-strictness-ledger.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,34 @@ collapse is now load-bearing on this file.** `groupBy` is a union, so the
971971
`unrecognized_keys` its strict arm raises never reaches `error.issues` — zod
972972
reports one `invalid_union` whose own message is the bare string *"Invalid
973973
input"* (#5014, the same flattening that hid `dashboard`'s `compareTo`
974-
prescription). What carries the named surface and the rename to the author is
974+
prescription). The named surface and the rename reach the author through
975975
`packages/lint/src/zod-issue-format.ts`'s arm unpacking, which #5020 had already
976-
built; **a strict object arm inside a union is only as loud as its consumer's
977-
unpacking**, and that is a general fact about this campaign's remaining union
978-
sites, not a chart detail. **(b) The product question this row carried is
976+
built; **a strict object arm inside a union is exactly as loud as its consumer's
977+
unpacking**. ⚠️ **CORRECTED, and this one is NOT a WRITTEN AT THE TIME
978+
case — it is the `chart.zod.ts` row's clause restated a few hundred lines up, and
979+
it takes the same treatment.** Two things are struck: the cleft that made
980+
`packages/lint`'s unpacking the *what* that carries the rename, and the trailing
981+
claim that this was *"a general fact about this campaign's remaining union sites,
982+
not a chart detail"*. Both were already false on the day #5583 wrote them
983+
(2026-08-08 — `e0f300ba5`, the same commit that wrote the `chart` row's clause):
984+
all three flatteners this campaign filed had closed first, **#4971**
985+
(`formatZodError`) and **#5014** (the wire mapper) on 2026-08-05 and **#5341**
986+
(the CLI) on 2026-08-04. Spec's OWN renderer unpacks, with no `packages/lint` in
987+
the path: `formatZodIssue` descends `invalid_union` and ranks the branches
988+
through `selectUnionBranches` (`packages/spec/src/shared/union-branch-policy.ts`
989+
— one policy, both spec-side walks, since **#8318**); `zodIssuesToFields` emits
990+
the same prescription as a second `unknown_field` entry. Re-measured through this
991+
paragraph's own door: `ChartAggregateSchema.safeParse({ field: 'amount',
992+
function: 'sum', groupBy: { field: 'stage', dateGranularty: 'month' } })`
993+
rendered by `formatZodError` prints `✗ groupBy: Invalid input` and, indented
994+
beneath it, *"Unrecognized key(s) on this chart groupBy: `dateGranularty`. Did
995+
you mean `dateGranularty``dateGranularity`?"* — the surface, the offending key
996+
and the rename all arrive, and the union's cost is the one wrapper line above
997+
them. The bolded sentence stays true as a statement about the MECHANISM;
998+
⛔ it is not a live constraint on this campaign's remaining union sites, and
999+
reading it as one cost a full dispatch cycle (**#14722**, filed on the
1000+
`chart` row's reasoning and closed unfixed once
1001+
the behaviour was measured). **(b) The product question this row carried is
9791002
ANSWERED and it did NOT move the schema.** `groupBy` stays REQUIRED: measured on
9801003
2026-08-08, the example corpus authors exactly one `<ObjectChart aggregate={…}>`
9811004
and it carries `groupBy`, while the ungrouped single-value need is served by a

0 commit comments

Comments
 (0)