This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 6732df4
fix(types): the import boundary keeps the descriptions it imports (objectui#9034) (#9086)
* fix(types): the import boundary keeps the descriptions it imports (objectui#9034)
`stripImportedDefaults` dropped the `.describe()` of every schema it derived.
A zod 4 description is registry state keyed by the node, not `def` state, so
neither derivation carried it: `.removeDefault()` returns the inner node, and
the protocol spells its guidance `.default(v).describe(d)` — `d` sat on the
outer node that was discarded; and `cloneWithDef` builds `new Ctor({...def})`,
which copies `def.checks` faithfully and the description not at all.
Measured across the published surface of @objectstack/spec 17.4.0: 2024 of 2024
described ZodDefault nodes and 1364 described container nodes arrived on this
side with no description. Both now go through one rule, `withDescriptionOf`,
and 0 are lost.
The identity property is untouched: reference-equal node count across the same
surface is 9665 before and 9665 after. The carry uses `.describe()` rather than
a write to `_zod.parent` because it must CLONE — on the `.optional().default()`
branch, taken 267 times, the replacement node is one of the spec's own objects.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
* test(types): point the rest-less-tuple carve-out at the card it was filed as
The carve-out in the identity-property pin referenced a placeholder number
while the finding was still unfiled. It is objectui#9088.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7e50e84 commit 6732df4
3 files changed
Lines changed: 554 additions & 6 deletions
File tree
- .changeset
- packages/types/src
- __tests__
- zod
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments