Commit 1d1a180
committed
fix(runtime): strip read-time decorations before the route-level seed apply's closed parse
`POST /packages/:id/publish-drafts` reads each just-published `seed` body back
through `protocol.getMetaItem` and hands it to `SeedLoaderRequestSchema`. That
read exits through `decorateMetadataItem`, which stamps `_diagnostics` on every
body whose type has a registered schema, and `SeedSchema` is closed — so the
door refused the document it had just served, on a 200, as
`seedApplied.error`: zero rows loaded and the author told their seed body
failed spec validation.
The direction is settled by the contract, not by judgement.
`METADATA_READ_DECORATIONS` declares `_diagnostics` a key the read path derives
and attaches to the response, and its module names "any re-parse of a served
document" as a consumer that must strip. `_packageId` is deliberately NOT a
member and `SeedSchema` accepts it via `MetadataProtectionFields` — measured on
the real producer, the served body carries both and the schema refuses exactly
one. So the fix is the declared helper, not a widened schema and not the
export path's blanket underscore strip, which would drop provenance this
schema allowlists on purpose.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N1 parent 1f2a02b commit 1d1a180
3 files changed
Lines changed: 480 additions & 1 deletion
File tree
- .changeset
- packages/runtime/src/domains
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments