Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
| Field |
Value |
| Source backlog |
docs/method/backlog/bad-code/BND_schemas-refine-mutation.md |
| Archived source |
docs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/bad-code/BND_schemas-refine-mutation.md |
| Original lane |
bad-code |
| Original id |
BND_schemas-refine-mutation |
| Original legend |
BND |
| Original feature |
merge-strands-worldlines |
| Original release home |
v19.0.0 |
Original backlog card
TrustRecordSchema superRefine mutates record during validation
Effort: S
Problem
The Zod superRefine callback mutates record.subject, replacing it
with the parsed sub-schema result. Zod schemas should be pure validators;
mutation during refinement is surprising and fragile. It makes the
validation step order-dependent and hard to reason about.
Suggested Fix
Use .transform() instead of superRefine for the mutation step, or
parse the subject separately and merge the results. Keep refinement
callbacks pure.
Migrated from Method backlog
GitHub Issues are now the live work tracker. Repository docs remain Method evidence.
docs/method/backlog/bad-code/BND_schemas-refine-mutation.mddocs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/bad-code/BND_schemas-refine-mutation.mdbad-codeBND_schemas-refine-mutationBNDmerge-strands-worldlinesv19.0.0Original backlog card
TrustRecordSchema superRefine mutates record during validation
Effort: S
Problem
The Zod
superRefinecallback mutatesrecord.subject, replacing itwith the parsed sub-schema result. Zod schemas should be pure validators;
mutation during refinement is surprising and fragile. It makes the
validation step order-dependent and hard to reason about.
Suggested Fix
Use
.transform()instead ofsuperRefinefor the mutation step, orparse the subject separately and merge the results. Keep refinement
callbacks pure.