Skip to content

Commit f58b1a8

Browse files
os-zhuangclaude
andauthored
fix(metadata-protocol): withhold caught driver text from the batch verbs' response payloads (#8333) (#8436)
* fix(metadata-protocol): withhold caught driver text from the batch verbs' response payloads (#8333) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012WMpuAfA2KSdDjGF6tm1bH * test(metadata-protocol,objectql): pin the batch verbs' withhold and its authoring-feedback bound (#8333) Adds protocol.batch-verb-driver-text.test.ts: the eight P6-P13 reproductions, the [GUARD] over-block bounds, the mandatory positive control (a real broken-CEL approval flow still names the offending field on publish), P9's producer-side declaration, and the operator half (the withheld line still reaches the log). Two objectql fixtures pinned pre-#8333 behaviour and are re-judged individually: the all-or-nothing publish double threw a `code` with no `status`, which the real producer never does (ITEM_LOCKED is 403) - declaration added; the throwing materializer's response-shape test keeps its shape assertion and takes the withheld string, since a bare plugin throw is indistinguishable from driver text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012WMpuAfA2KSdDjGF6tm1bH --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1d1ca8e commit f58b1a8

5 files changed

Lines changed: 1037 additions & 12 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
Stop putting caught driver text on the batch verbs' response payloads (#8333).
6+
7+
`publishPackageDrafts`, the publish side effects and their materializer, the seed
8+
apply, `duplicatePackage`, `revertCommit`, `rollbackToPackageCommit` and
9+
`migrateStoredMetadata` each reported a failure by copying the caught error's
10+
sentence onto a field of the response — `failed[].error`, `materializeApplied`'s
11+
`failures[].error`, `seedApplied.error`, `rows[].reason`. Those are DATA, not
12+
messages, so no HTTP boundary's 5xx message withhold ever reached them: a
13+
`sys_metadata` outage shipped `SQLITE_ERROR: no such table: sys_metadata` to the
14+
client on an otherwise successful-looking response.
15+
16+
All eight now follow the rule #8136 installed for the uninstall cluster: a caught
17+
sentence is quoted back only when that error **declared itself a client-facing
18+
refusal** (a 4xx `status` in the ADR-0112 envelope). Anything else gets a stable
19+
sentence and the original goes to the server log, which these sites did not
20+
previously write at all.
21+
22+
Authoring feedback is unaffected, and that was measured before anything changed
23+
rather than assumed. Every authored refusal reaching these collectors already
24+
declares 4xx, so it is still quoted verbatim — a failed package publish still
25+
tells the author which field of which draft is wrong, with its `code` and
26+
structured `issues` intact.
27+
28+
One producer needed declaring rather than converting: `applySeedBodies` parsed
29+
the seed request with `SeedLoaderRequestSchema.parse()`, so a malformed seed body
30+
surfaced as a raw `ZodError` that declared nothing. It is now a `safeParse` that
31+
raises a real `422 INVALID_METADATA` envelope, so `seedApplied.error` carries the
32+
same curated, path-pointing summary every other authoring surface produces
33+
instead of a multi-line dump of zod internals.

0 commit comments

Comments
 (0)