Commit 4c0b22b
fix(runtime): strip read-time decorations before the route-level seed apply's closed parse (#16162)
* 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_01D47qPfEWVPmhguWgBZCi5N
* chore(gates): re-anchor the system-context census and record the new engine double
Both are mechanical regenerations the gates asked for by name, not hand edits:
- `check:check-system-context-census` reported pure LINE ROT — the three
`domains/packages.ts` anchors on `content/docs/permissions/system-context.mdx`
each moved by exactly the +9 lines this branch's import block added. Repaired
with the gate's own `--fix`; it now reports OK over 105 sites and 140 anchors.
- `check:engine-double-contract` reported the new test file's engine double as
RETAINED-but-unrecorded on all three scanned verbs. Regenerated with
`--write` (736 rows, 3 added, 0 lost), so the pin protects the file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* chore(gates): re-anchor the system-context census after merging origin/main
The merge brought main's re-anchoring of `system-context.mdx` and this branch's
own +9-line import block in `domains/packages.ts`. `merge=os-regen` resolved the
page with exit 0 and no markers while silently keeping one side, so the page had
to be regenerated from the merged tree rather than text-merged.
`pnpm gen:system-context-census` (= `check-system-context-census.mjs --fix`)
rewrote 3 anchors, all `domains/packages.ts`, all by exactly +9:
`:241`->`:250`, `:274`->`:283`, `:543`->`:552`.
Delta is line-anchor numbers only: with every digit run normalized the page is
byte-identical before and after, at the same 423 lines and the same 65 rows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 159dbad commit 4c0b22b
5 files changed
Lines changed: 497 additions & 3 deletions
File tree
- .changeset
- content/docs/permissions
- packages/runtime/src/domains
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments