Repository navigation
fix(types): the @object-ui/types/zod mirrors keep an unknown key instead of silently dropping it - #26019
Conversation
…oseObject at 145 sites Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
…ll; pin no strip-mode object Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
Two consumer tests used a strip-mode mirror's silent key drop as their
instrument ("call .parse and see what survives"). The mirrors are
passthrough since objectstack#25923, so every key survives a parse; the
tests now ask deriveStrictAuthoringSchema(...) whether a key is declared,
which refuses an undeclared key by name.
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE
Co-authored-by: Claude <noreply@anthropic.com>
The registry sources changed under objectstack#25923 (the zod mirrors are passthrough); the generated sdui.manifest.json is byte-identical, only the source digest in the record moves. Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
…rip-mirrors # Conflicts: # scripts/sdui-manifest.record.json
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
`[T] extends [{}]` tripped @typescript-eslint/no-empty-object-type in
Lint UI. `keyof unknown` is `never` while `keyof any` is not, so the
operator reads the same without it.
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE
Co-authored-by: Claude <noreply@anthropic.com>
…rip-mirrors # Conflicts: # scripts/sdui-manifest.record.json
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Face: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
席位核对ACCEPT · domain:spec seat 2 · 2026-10-26T10:26Z · head
|
…rip-mirrors # Conflicts: # scripts/sdui-manifest.record.json
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Face: ① Derived judgmentsThe PR's own diff against ② Semver levelUnchanged: ③ Boundary flagsNo new flag. Check-runs on this head: 54 success, 7 skipped, 0 failed. Implemented-by: VERDICT: PASS |
…rip-mirrors # Conflicts: # scripts/sdui-manifest.record.json
Claude-Session: https://claude.ai/code/session_01UDxCk99USU7v77odNZ66qE Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Face: ① Derived judgmentsThe PR's own diff against ② Semver levelUnchanged: ③ Boundary flagsNo new flag. Check-runs on this head: 54 success, 7 skipped, 0 failed. Implemented-by: VERDICT: PASS |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 40325012039 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SMJGPXxFBpbgAgXdnsXKVS
Requested by Steedos · project thread
Part of #25923 — work item 2 (strip-mode mirrors) only. Items 1 (the flat calendar / gantt keys) and 3 (the
optionsbag, which needs the stored-row census first) stay on the card for later dispatches, and #25923 remains open after this merges.Clause-②: yes
Metadata-protocol: none
What changed
The
@object-ui/types/zodmirrors held strip-mode objects (plainz.object()): a misspelled key parsed green and was silently dropped, soFormFieldSchema.safeParse({ name, type, labell: 'oops' })succeeded withlabellgone, while@objectstack/specrefuses it by name. Every one of them is now.passthrough()(z.looseObject), likeBaseSchemaalready was. The strict authoring face (StrictAnyComponentSchema/deriveStrictAuthoringSchema, whatobjectui validateuses) is unchanged and still refuses an unknown key by name, so the two faces now disagree only on keep-or-refuse, never on silently dropping.Re-measured with the card's probe
38050ced)*Schemaexports ofindex.zod.tsin strip mode (the card's probe)ui/packages/typesz.object(call sites inui/packages/types/src/zod/*.zod.tsconvertedThe one remaining strip export is
HttpRequestSchema, and the three remaining reachable nodes (HttpRequestSchema, the$and/$or/$notfilter group, a filter-field object) are all spec-derived clones made bystripImportedDefaultsfrom@objectstack/specsubschemas: they are not authored in this package,HttpRequestSchemais already in the parity file'sEXCLUSIONS, and the new census reads source sites, which they are not.Landing point
As expected by the card:
ui/packages/types/src/zod/*.zod.ts(16 files) andui/packages/types/src/__tests__/zod-mirror-parity.test.ts. No producer lives outside the package.The guard (beside
assertionNoVacuousEntry)A new
describeinzod-mirror-parity.test.ts, "no object in ../zod/ strips an unknown key (objectstack#25923)":z.object/z.looseObject/z.strictObjectcall in../zod/, classifying each by its method chain (.passthrough(),.strict(),.strip(),.catchall()), fails on any site whose mode is strip;form.zod.ts, at least one strict site);MIRRORSvalue is an object with an undefined catchall.It is runtime, not a type-level
assertion…like its neighbour, and the docblock says why: zod 4 types$stripand$strictidentically, so a type-level "no strip" pin cannot tell them apart (measured: it flagged exactly the five strict entries). This is the existing instrument the card named, not a new gate.Type-surface consequence, and how the pins absorb it
zod 4 gives a passthrough object's
z.input/z.infera[k: string]: unknownindex signature. A declaredinterfaceis not assignable to a type carrying one, so the parity file's narrower-direction pin read every nested object member as narrower than its declaration (22 pins went red). The fix is one test-only operator,WithoutCatchall(ui/packages/types/src/__tests__/zod-catchall-type.ts), which removes exactly that signature (an index signature ofunknownon an object that also has literal keys) and is the identity everywhere else. It is applied to the narrower direction only (AcceptedOf), so the wider direction still compares the raw input.KnownDriftmoves from 55 entries / 93 keys to 53 / 90:AppSchemaRendererNodeSchemaandReportSectionSchemaleave the ledger,DashboardWidgetSchemaandReportComponentSchemachange their keys, each with a "LEFT / JOINED under objectstack#25923" note.Downstream:
pnpm exec turbo run type-check --filter='...@object-ui/types'was 112/112 tasks green with the passthrough mirrors.Held back: the
FormFieldindex signature inform.tsThe card also recommends dropping
FormField's[key: string]: any. It was measured on this branch and reverted, because it breaks consumers outside this dispatch's file surface:@object-ui/componentssrc/renderers/form/form.tsxlines 1884, 1959, 2055, 2195, 3228:FormFieldis not assignable toFieldWithDeclaredDefault(index signature missing);@object-ui/plugin-formsrc/ObjectForm.tsx:1068writesgroup, whichFormFielddoes not declare;src/WizardForm.tsx:845, the sameFieldWithDeclaredDefaulterror;@object-ui/plugin-gridsrc/ObjectGrid.tsxlines 5963 and 6016, plus the type-check cascade of every package depending on those.Removing a published index signature also narrows what a TypeScript caller may write on
FormField, so it is a(narrowing)Clause-② change on its own. It is reported to the seat as an open question rather than folded in here;form.tsis unchanged in this PR.File surface beyond the claim
The claim named the strip-mode zod files,
form.ts, the parity test and one changeset. The diff also touches:ui/packages/types/src/__tests__/zod-catchall-type.ts(new, test-only; excluded from the build) and five sibling type tests that comparez.inputwith a declaration and now read it through the same operator (ai-zod-arms-10859,designer-zod-arms-10859,registered-type-arms-10859-b2,sort-string-arm-retired-8221,base-schema-predicate-envelope-7530);ui/packages/typestests that pinned the old strip behaviour ("the unknown key is dropped") and now pin passthrough ("the key is kept and still not refused"), each with a comment citing objectstack#25923;deriveStrictAuthoringSchema), which refuses an undeclared key by name:ui/examples/schema-catalog/test/component-fixture-declared-keys.test.tsandui/packages/plugin-kanban/src/__tests__/columnCollapsedHonoured-9628.test.tsx;scripts/sdui-manifest.record.json: the registry-source digest moves because the registry sources changed;sdui.manifest.jsonitself is byte-identical.Each of these is a consequence of the mirrors no longer stripping; none changes runtime code outside
ui/packages/types/src/zod/.Verification
All on the final head
0d70f7e3(branch merged withmainat6a6ebff9); tests and type-checks ran underscripts/pm/os-verify-lock.sh:pnpm --dir ui exec vitest run --maxWorkers=2 packages/types/plus the 120ui/test files that import@object-ui/types/zodor a mirror schema: 510 files, 12867 tests, all passed. Before the two instrument tests moved to the strict twin, that consumer set read 118 passed, 2 failed (5 tests). The full consumer battery is CI's.pnpm --filter @object-ui/types type-check: exit 0. Downstreamturbo run type-check --filter='...@object-ui/types': 112/112 tasks successful (pre-merge head);@object-ui/plugin-kanbanand@object-ui/example-schema-catalogtype-check clean after the test edits.node scripts/pm/dispatch-gates.mjs --commands, 46 commands): all exit 0, reconciled with--ran: 46 derived, 46 run, 0 NOT-MEASURED, 0 UNRUN.Acceptance notes
@objectstack/specsubschemas that the mirrors import by reference. They are the spec's, not this package's, and are out of scope here.exportConfigsresidue:WithoutCatchalldoes not walk into an object that has no catchall of its own (a partial record keyed by export format), because walking those was measured to hit TS2589 on the node tree. The residue is ledgered inKnownDriftonReportComponentSchema,ReportBuilderSchemaandReportViewerSchema.ObjectForm.tsx:1068writing an undeclaredgroupkey on aFormFieldis only visible once the index signature goes; it belongs to theFormFieldfollow-up above.Serial note: #25926 waits for this PR, because both edit
ui/packages/types/src/zod/base.zod.ts.Generated by Claude Code