This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit caf477f
* feat(types): refuse `chartType` on a chart series by name, pointing at `type`
`ChartDataSeriesSchema` is a non-strict `z.object`, so an authored series
`chartType` — the renderer's INTERNAL spelling of the declared `type`, the
first limb of `normalizeSeries`' `str(raw.chartType) ?? str(raw.type)` — was
stripped in silence while `safeParse` reported success. It is now declared as
a named ALIAS REFUSAL arm (`aliasKeyRefusal()` in `zod/tombstone.zod.ts`,
reusing `retirementTombstone`'s `z.never` primitive so `z.toJSONSchema` keeps
working) that answers with the spec's own sentence — "Unrecognized key(s) on
this chart series: `chartType`. Did you mean `chartType` → `type`?" — and the
TS twin carries a `?: never` tombstone. Both-written is refused, not folded.
Re-measured at implementation time, series-level, lit controls: docs 0,
fixtures 0, designer inputs 0, src literals 0, tests 9 (internal-shape).
Limb ablation over 304 files / 5817 tests: deleting the `chartType` limb
left all green; deleting the `type` sibling went 2 red. No reader changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
* docs(types): correct the alias-refusal rationale and derive pin (e) from the spec's live lead
Land-prep for PR #7737, asked for by its contract review (VERDICT: PASS, not
withdrawn). Text and one assertion only — no runtime or type behaviour moves.
- `tombstone.zod.ts`: the `aliasKeyRefusal` docblock argued that a census of
`retirementTombstone(` sites is a census of keys the contract once declared.
Re-measured on this merged head, that partition is false: `MenuItemSchema.type`
(`overlay.zod.ts:196`, objectui#6523) is a `retirementTombstone` whose own
guidance reads "`type` ('separator' or 'label') was an undeclared spelling two
renderers used to read and is now a declared refusal, not a strip", and
`overlay.ts:458-464` states it again ("a spelling the type never declared").
The docblock now cites that precedent and names the real differentiator — the
composed spec sentence: a vocabulary, not a shape.
- pin block (e): it compared ours and the spec's message each to a constant and
never to each other, so a spec reword of the lead would have left both green
while the faces diverged. The expected lead is now derived from the installed
spec's live message at assert time, guarded so the cut still contains the
remedy. The cut is unchanged — lead + `Did you mean …?`, excluding the spec's
trailing clause (91 bytes, byte-equal to ours on 17.2.0).
- changeset: names the parents the narrowing propagates through
(`ChartSchema.series`, `ReportSectionSchema.chart`, reached via
`safeValidateSchema` and `objectui check` / `validate`) and the io-mode
nuance — `io:'input'` narrows; `io:'output'` already emitted
`additionalProperties: false` on the base. Both measured on this head.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 83c77dc commit caf477f
8 files changed
Lines changed: 532 additions & 36 deletions
File tree
- .changeset
- content/docs
- api
- plugins
- packages/types/src
- __tests__
- zod
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
0 commit comments