Follow-up filed by the domain:spec seat from the contract review of PR #14714 (#14192). Filed unassigned and unlabelled for triage.
What was measured (isolated reviewer, PR head 1efaac767, and origin/main)
packages/spec/src/stack.zod.ts:751 declares devPlugins: z.array(z.union([ManifestSchema, z.string()])).optional(). Since #14192 closed ManifestSchema against unknown keys, an unknown key inside a devPlugins manifest IS refused — but the refusal arrives as one invalid_union issue at ['devPlugins', N] whose message is the literal Invalid input, with the real unrecognized_keys issue (the key name, the surface, the Did you mean rename) nested in issue.errors[]. formatZodError flattens that away, so at this one door the author gets a loud but keyless message. PR #14714 pins the nested shape as observed (manifest-unknown-keys.test.ts, the ['devPlugins', 0] case) rather than fixing it, because stack.zod.ts was read-only for that card (#14124 owned it).
This is the same flattening the strictness ledger already records on its state-machine.zod.ts row for ActionRef / GuardRef unions — reported there, not fixed.
Suggested direction
Discriminate or reorder the union so the object branch's own issues surface (e.g. z.union([z.string(), ManifestSchema]) with a superRefine that re-raises the object branch's issues, or a discriminated shape keyed on typeof), then flip the ['devPlugins', 0] pin from "nested inside invalid_union" to "the named unrecognized_keys issue at ['devPlugins', 0, …]". Any fix lands in stack.zod.ts and waits for #14124 (PR #14686) to merge.
Follow-up filed by the
domain:specseat from the contract review of PR #14714 (#14192). Filed unassigned and unlabelled for triage.What was measured (isolated reviewer, PR head
1efaac767, andorigin/main)packages/spec/src/stack.zod.ts:751declaresdevPlugins: z.array(z.union([ManifestSchema, z.string()])).optional(). Since #14192 closedManifestSchemaagainst unknown keys, an unknown key inside adevPluginsmanifest IS refused — but the refusal arrives as oneinvalid_unionissue at['devPlugins', N]whose message is the literalInvalid input, with the realunrecognized_keysissue (the key name, the surface, theDid you meanrename) nested inissue.errors[].formatZodErrorflattens that away, so at this one door the author gets a loud but keyless message. PR #14714 pins the nested shape as observed (manifest-unknown-keys.test.ts, the['devPlugins', 0]case) rather than fixing it, becausestack.zod.tswas read-only for that card (#14124 owned it).This is the same flattening the strictness ledger already records on its
state-machine.zod.tsrow forActionRef/GuardRefunions — reported there, not fixed.Suggested direction
Discriminate or reorder the union so the object branch's own issues surface (e.g.
z.union([z.string(), ManifestSchema])with asuperRefinethat re-raises the object branch's issues, or a discriminated shape keyed ontypeof), then flip the['devPlugins', 0]pin from "nested insideinvalid_union" to "the namedunrecognized_keysissue at['devPlugins', 0, …]". Any fix lands instack.zod.tsand waits for #14124 (PR #14686) to merge.