Skip to content

saveMetaItem's spec-validation 422 message restates its issues[] on the envelope, but message-only faces (duplicatePackage failed[].error) forbid the #10524 trim until they declare a structured channel #10888

Description

@os-elon

Found and measured while implementing #10524 — a fourth site of that card's family, beyond the three in the PM's table there. Trial-trimmed during that card and deliberately reverted; filing with the measurement so the revert is not misread as "nothing to fix".

The duplication (real, at 4d7c5645eb)

packages/metadata-protocol/src/protocol.ts saveMetaItem overlay validation (~:13306-13318):

  • zodIssuesToMetadataIssues(parsed.error.issues)issues ({ path, message, code? })
  • the 422 message interpolates issues.slice(0, 3).map(i => ${i.path}: ${i.message}) + (+N more)
  • err.issues = issues — and the HTTP boundary carries it in details.issues.

On the HTTP 422 face both channels ride the same response: every console rendering both shows each finding twice — the exact #10524 shape, on the save door.

Why the trim was reverted there (the load-bearing measurement)

Trimming this message to the #10524 headline turned three GUARD pins red, and they were right:

So the declare-then-trim order applies one level up: first inventory the faces that quote this message (duplicatePackage.failed[], migrateStoredMetadata.rows[].reason, any other clientFacingFailureText sink) and declare/thread a structured channel on each, then trim. #10524 did exactly that for the batch-publish and seed faces; this card is the same two-step for the save-door message's remaining faces.

Also worth deciding together: a headline for this site degrades worst on root-level union failures (locators become <root> [invalid_union]; <root> [unrecognized_keys] — key names only in issues[]), so the headline grammar may want the unrecognized key names, not just paths, hoisted into the locator.

Back-link: #10524's PR carries the trial-trim diff and the red-pin evidence.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions