This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 841dd2b
* feat(types)!: redirect the node recursion point at AnyComponentSchema (#8344)
Every child slot is `z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])`, and
`SchemaNodeSchema`'s component arm was `BaseSchemaCore` — the ~21 base keys and
nothing type-specific — so per-type enforcement was ROOT-ONLY at every depth, for
every component type. That is objectui#7869, measured there: an off-spec `size` on
a nested `icon` node was accepted while the same node alone was refused.
The arm is now `AnyComponentSchema`. ⛔ Nothing here is `.strict()`; no declaration
is repaired. Measured over the catalog + docs corpora on c90395b (554 node
documents): 45 refused before, 54 after — the nine documents the card enumerates,
each pre-existing debt this surfaces rather than creates.
Two mechanical constraints, both measured rather than assumed:
- `AnyComponentSchema` is built in `index.zod.ts` from all 13 category modules
while 14 modules import `base.zod.ts`, so the arm cannot be an import: `z.lazy`
defers evaluation, not the module graph, and the import deadlocks on
`BaseSchema`'s TDZ when the graph is entered at `base.zod.js`.
- It is a written `z.union` OPTION SLOT and not a `z.lazy` holder, because
`z.lazy` memoises: a holder lets whichever module graph parses first decide the
accept set for the whole process. `z.union` re-reads its options every parse, so
the fill is live and no first parse can freeze the pre-fill answer in.
`complex.zod.ts#DashboardWidgetSchema.component` names `BaseSchema` explicitly now.
It is the one slot where the redirect would reverse a standing ruling: `metric-card`
is objectui's CLOSED widget-slot component extension (objectstack#8593), admitted
there and deliberately not an arm of `AnyComponentSchema`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* fix(types): record the DashboardWidgetSchema.component drift the #8344 carve-out creates
The parity ledger is a TYPE MAP over the mirrors, so the `complex.zod.ts` change
in ae99480 moved a drift row INSIDE zod-mirror-parity.test.ts without editing it:
`DashboardWidgetSchema.component` names `BaseSchema` where TS declares `SchemaNode`,
so the five primitive arms are newly narrower-than-declared.
Re-derived from the tree with the compiler API, not copied: `DriftOf` for the pair
resolves to 'component' | 'options'. The header figure moves with it, 64 -> 65 keys
across an unchanged 42 entries, derived by an AST count of the interface.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(types): declare the chatbot widening, the bundle caveat and the memoisation
Three accept/reject facts and one caveat the changeset owed a reader:
- `DashboardWidgetSchema.component` narrows (a primitive in that slot was
accepted and is refused now);
- `SchemaNodeSchema` moves TDZ_BOUND -> MEMOISED;
- `ChatbotSchema.body` is a record and therefore WIDER than the base arm, so a
nested chatbot node carrying one is refused before and accepted now. Measured
with a corpus-valid seed at two child slots, against both the narrowing and a
legal-node control;
- the `sideEffects: false` bundle caveat: a bundler that drops the barrel body
leaves the redirect inert, measured on this repo's own Vite/rollup lib build.
The pin's header claimed `getter() === getter()` is FALSE for the exported
wrapper. Measured on the built face, that holds on `main` and NOT at this head:
the redirect made this const MEMOISED, and the `fill is LIVE` leg works because
of it. The header now states both readings and why the wrapper is still the
handle the pin uses.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(changeset): point the chatbot widening at its follow-up, and state the bundle caveat as measured
The widening declaration now names objectui#8572, the card filed for the
narrowing decision, so the declaration reads as "declared, follow-up filed"
rather than as an accepted permanent state.
The bundle caveat is restated from what was actually measured this round. Three
candidate fixes were tried on disk and none of them is a manifest edit this
change may make on its own:
- narrowing `sideEffects` to an array is not a legal declaration for this
package. `scripts/check-side-effects-array.mjs` requires an array to name
every ENTRY FORM (12 missing on a one-element array);
`scripts/__tests__/side-effects-declaration-consistency.test.ts` refuses a
named entry that has no load-time effect. This package's entry forms are pure,
so the two rules have no common solution here. Both readings taken from the
gates themselves.
- a bare top-level call in the barrel is dropped too: `"sideEffects": false` is
a package-level promise that no in-module spelling overrides. Measured with
the statement on disk and in `dist`: the probe entry still ACCEPTED the nested
off-spec node.
- removing the field closes the leak at +16,078 gzipped bytes on the console
`framework` chunk — which now FITS, since the ceiling raise landed — but it
drops the workspace census from 5 packages to 4 and fails that same pin's
population floor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(changeset): name the two follow-up cards the bundle caveat leaves open
The caveat now points at objectui#8577 (the leak and the manifest decision,
carrying every measured figure and the maintainer-floor census edit the closing
route needs) and objectui#8578 (the classifier that scores this package zero
load-time registrations because it counts top-level call statements and cannot
see an effect inside a `const` initializer).
Changeset text only. No source, no manifest, no test moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* feat(types)!: bind the component union in the getter, and narrow the chatbot arm
Implements decision batch #93 (objectui#8344 comment 5585333656), items F2, F3,
F5 and the stale-text half of items 8/9. Changeset text is NOT yet updated in
this commit; its three false "by ruling" attributions are the next push.
F3 — the tree-shake leak. `base.zod.ts` now imports `AnyComponentSchema` and
reads that binding INSIDE `SchemaNodeSchema`'s `z.lazy` getter. The option-array
write, `defineNodeComponentUnion` and its identity assertion are gone with it.
`"sideEffects": false` stays true and untouched: this module performs no
load-time write at all now. Measured, not assumed — this repo's own Vite/rollup
lib build, an entry importing ONLY `CardSchema`:
before this commit 370,652 raw / 113,887 gzip, no fill, nested off-spec
node ACCEPTED — the redirect silently inert
after 1,147,266 raw / 342,193 gzip, nested off-spec node
REFUSED — the union is retained because the binding is read
A graph that never evaluates the barrel now throws `ReferenceError: Cannot
access 'BaseSchema' before initialization` at import instead of quietly
answering as `main`. That is the ruled behaviour, and its cost is paid here: 102
`packages/types` test files entered at a category module and now carry a
barrel-first import. Whole unit project after the fix: 989 files, 16,837 tests,
0 failures.
F2 — the chatbot widening, eliminated rather than declared. The arm the getter
installs is `AnyComponentSchema.superRefine(...)`, which checks a nested
`chatbot` node's `body` against `BaseSchemaCore.shape.body`. The root mirror is
untouched, so a root `chatbot` with a record `body` still parses and the same
node one slot down does not. Both directions pinned, plus a non-vacuity leg and
a leg asserting the refusal names `body`. The discrimination objectui#8498 added
survives the wrapper (`propValues` intact), so a nested refusal still costs one
arm.
F5 — depth on the redirected path: 276 / 3,626 / 8,404 / 14,610 / 22,244 chars
at depths 0-4, all refused, none throwing. New pins cover depths 0-4 through
`safeValidateSchema`, a linear-growth ceiling at depth 4, and a legal-leaf
control.
Items 8/9 — `any-component-union-fanout.test.ts`'s rationale said a nested
document is "simply ACCEPTED"; corrected in place. The pin's identity-leg
comment and header now describe THIS head. The objectui#7918 row returns to
`TDZ_BOUND`: the getter builds the node union per call again, so
`getter() === getter()` is FALSE, and `unstableLazyExports` reads 8 again.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(changeset): state what ships, and drop three attributions that were never ruled
Batch #93 refused the routes the previous revision described, so the changeset
described a PR that does not exist. Corrected, not softened:
- the widening fact said "Declared here rather than eliminated, by ruling". No
ruling said that; #93 ordered it eliminated. It now records the nested refusal
and the untouched root, and points the root question at objectui#8572.
- the `TDZ_BOUND -> MEMOISED` fact is gone: that byproduct belonged to the
option-array spelling and the row is `TDZ_BOUND` again.
- the bundle caveat said the fix was "a maintainer-floor authorisation,
deliberately not taken here" and "Until objectui#8577 is ruled". Both false
against #93: the ruled route needs no manifest change and no census-floor
edit, and it ships in this PR. The section now states the wiring, the measured
before/after, and both byte costs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* fix(types): revert the F3 import binding — CI proved it breaks a real consumer
⛔ The `Build Docs` failure on 2ac5381 is THIS BRANCH'S CODE, not the changeset
text: `ReferenceError: Cannot access 'BaseSchema' before initialization` out of
`packages/types/dist/zod/app.zod.js`, prerendering `/docs/guide/schema-catalog`
through `plugin-view`. Reproduced locally in one line — with the binding in
place, importing `dist/zod/app.zod.js` throws; without it, it loads clean.
Mechanism, measured rather than reasoned: making `base.zod.ts` import the barrel
gives the cycle an edge that is only safe when the barrel is evaluated FIRST.
Node honours that if the entry is `./zod`; a bundler is free to order the cycle
category-module-first, and the site's build does. ⇒ the ruled F3 spelling is
sound for a module graph and unsound for a bundle, which is the opposite of the
property it was chosen for. My own docblock claim that "consumers cannot hit
that" was falsified by CI, and the 102-file barrel-first hygiene could not have
helped: the failing consumer already imports the barrel.
This commit therefore restores the wiring CI was last green on (`d375037a8`) and
KEEPS batch #93's F2 in the spelling the reviewer originally wrote it in: the
slot-0 write installs `union.superRefine(...)`, so a nested `chatbot` node with
a record `body` is refused while the published root mirror is untouched. The
identity assertion now checks the WRAPPER it installed, and the pin says why a
`toBe(AnyComponentSchema)` assertion would go green if the narrowing were
dropped. The 102 barrel-first imports are reverted with the binding that needed
them; the objectui#7918 row is `MEMOISED` again, matching this wiring.
⇒ F2 and F5 ship; F3 does NOT, and the changeset now states the gap, the CI
evidence and all four measured candidates instead of claiming a fix.
Green on this tree: build 0, type-check 0 (all three projects), packages/types
148 files / 2,824 tests / 0 failed, the four changeset gates 0, and the
category-first import that CI choked on now loads clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(types): declare the tree-shake gap as shipped, cite one measurement, point at objectui#8598
Implements decision batch #98 on objectui#8344 (comment 5587037055), Finding 3
of the contract review of `ca2037680` (PR #8501 comment 5587000173).
The byte pair `base.zod.ts` quoted (369,733 / 1,144,999) and the pair the
changeset quoted (370,652 / 1,149,749) were the same measurement taken on two
heads. Both texts now cite ONE measurement, taken on this head with a named
instrument: a Vite 8.2.1 lib build of the published `dist/zod` face, `es`,
esbuild-minified, `zod` 4.4.3 and `@objectstack/spec` external, each entry
built alone and read in a fresh Node process —
barrel, CardSchema + AnyComponentSchema 750,542 / 206,815 REFUSED fill present
barrel, CardSchema only 212,567 / 61,025 ACCEPTED fill absent
deep-link entry at layout.zod.js 212,563 / 61,030 ACCEPTED fill absent
Minified so that editing this very docblock cannot move the figure it carries.
The stale "its disposition is a ruling in flight" sentence is gone: the ruling
is in. The gap ships DECLARED, the declaration names who is exposed (an
external consumer whose bundler honours `sideEffects: false` and never reads
`AnyComponentSchema` keeps the pre-redirect accept set for NESTED nodes;
root-level enforcement and every union-reading graph get the new set), and the
changeset's leak paragraph points at objectui#8598 — the `./zod` face built as
one module — as the card that closes it. No source outside comments moved.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 86ef0c7 commit 841dd2b
11 files changed
Lines changed: 690 additions & 37 deletions
File tree
- .changeset
- content/docs
- api
- guide
- 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 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
1285 | | - | |
| 1284 | + | |
| 1285 | + | |
1286 | 1286 | | |
1287 | 1287 | | |
1288 | 1288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| |||
0 commit comments