Uh oh!
There was an error while loading. Please reload this page.
fix(spec,types,rest,runtime): one ADR-0114 D3 mapper in @objectstack/spec — fieldsFromZodIssues stops leaking Zod issue codes onto fields[].code - #8335
Conversation
…tack/spec and map fieldsFromZodIssues through it (#8124) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Euoy6wyfzgiWtgCg4s6JK2
…; add changeset Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Euoy6wyfzgiWtgCg4s6JK2
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 4 package(s): 113 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also reference the affected code. These are read-only:
|
…against a raw-code pass-through (#8124) Reverse verification showed the membership test's fixtures produced only invalid_type — spelled identically in Zod's vocabulary and the catalog — so the test stayed green against the exact leak it exists to refuse. The unknown-node-key fixture makes it red under a pass-through on its own. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Euoy6wyfzgiWtgCg4s6JK2
hotlong
commented
Aug 13, 2026
Audit (spec-seat PM, session Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
…tree (#8116 x #8341/#8335) Discharges the os-regen deferral from the preceding merge commit: the data.json shards regenerate with both sides present — this PR's 10 new provenance exports and main's landed entries (zodIssuesToFields intact in the api.json shards). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Euoy6wyfzgiWtgCg4s6JK2
Fixes#8124
What
fields[].codeis declared as the closed ADR-0114 D2 catalog (FieldErrorCode), butfieldsFromZodIssues— the helper the runtime/analytics,/notificationsand/automationentry refusals emit through (moved to@objectstack/typesby #8016) — assigned Zod's ownissue.codeverbatim, sounrecognized_keys/too_smallreached the wire on a position the spec gives clients a schema for. Per the PM ruling on the issue (route 2), the compliant D3 mapper now lives in@objectstack/spec, beside the catalog it is total over, and is the ONE implementation of D3's table in the repo.@objectstack/spec: newapi/zod-issues-to-fields.ts— the mapper moved verbatim fromrest-server.ts(code table, union 分支里的 unknown-key 处方永远到不了作者:zodIssuesToFields只映射顶层 issue,失败的 union 只剩Invalid input#5014 union-branch expansion, 休眠:invalid_key/invalid_element把真实 issue 挂在issue.issues上,union 家族的三个消费者一个都不下降 #5389 container descent), exported aszodIssuesToFieldsfrom@objectstack/spec/api.api-surface/andexport-origins/regenerated: exactly 1 added / 0 removed.@objectstack/types:fieldsFromZodIssuesmaps through the shared mapper. Signature preserved, plus an optional trailinginputthat upgrades a missing required property frominvalid_typetorequired(the D3 split); callers without the input degrade per the D3 table. The'(body)'spelling for root-level failures is preserved.@objectstack/rest:rest-server.tsdeletes its module-local copy and re-exports the shared one. Behavior-identical — proven by the pre-existing pins (zod-field-codes.test.ts,zod-union-fields.test.ts, 29 tests, untouched and green against the re-export).@objectstack/runtime: two hand-spelledunrecognized_keysliterals on the same wire slot (the analyticsfiltershint, the automation toggle unknown-key refusal) now sayunknown_field, the catalog member; the automation comment that deferred tofieldsFromZodIssuesleaks Zod's issue codes onto the wire'sfields[].code— the exact pass-through ADR-0114 D3 closed, still live in@objectstack/runtime#8124 is updated. These two files sit outside the dispatch's declared file surface — rationale in the dev report on the issue (the dispatch's own acceptance line requires that nothing outside the mapper writes a raw Zod code ontofields[].code, and no test pinned the old literals).content/docs/api/error-handling-server.mdximportedzodIssuesToFieldsfrom@objectstack/rest, which never exported it from its index — the example now imports from@objectstack/spec/api, which this PR makes true.Tests
Per ADR-0114 D3's own discipline, all new tests drive REAL
safeParsecalls (the realFlowSchema— the #8055 fixture source — andMarkNotificationsReadRequestSchema), no hand-written issue fixtures, and assert catalog membership of every emitted code.packages/spec/src/api/zod-issues-to-fields.test.ts(7),packages/types/src/validation-failure.test.ts(4)code: issue.codein@objectstack/typesturns the new types tests red on exactly the leak assertions while the'(body)'pin stays green — details in the dev reportOut of scope
#8318 (filed): the union-branch selection policy is now duplicated INSIDE spec (string renderer vs structural mapper) — observation-class, not fixed here to keep the move behavior-identical.
Generated by Claude Code