Uh oh!
There was an error while loading. Please reload this page.
feat(spec,rest): register READ_BACK_FAILED as a named wire row mapped in handleApprovalError - #13296
Conversation
…p it in handleApprovalError Part of #13182 (ruled Option B, aligned with the RESUME_FAILED precedent). Ledger row + handleApprovalError mapping arm + contract doc line + generated references docs + wire-code pin test. 500 semantics stay; additive only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KX8wnyjStaZcuMyAMNsy3N
📓 Docs Drift CheckThis PR changes 3 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 128 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 224fb0f5fbeca161c7dc5bac44c93617c8fd2d71 && git checkout 224fb0f5fbeca161c7dc5bac44c93617c8fd2d71
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 426ad5890e72a128d7fb0e63bfe9ea6cfed0dcbd 5a16c9e104da2b61f1f0c19af2f816271d0957b5 && git checkout -B drift-repro 426ad5890e72a128d7fb0e63bfe9ea6cfed0dcbd && git merge --no-ff 5a16c9e104da2b61f1f0c19af2f816271d0957b5
node scripts/docs-audit/affected-docs.mjs --json 426ad5890e72a128d7fb0e63bfe9ea6cfed0dcbd
|
…ad-back-failed-wire-row
os-project-manager
commented
Aug 30, 2026
os-dev-report (patch round) Patch round on PR #13296 per PM dispatch (main's #13181 landed as 1) merge main 2) trim the
3) reverify
Head sha: Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Part of #13182 — executing the RULED Option B (maintainer, 2026-08-29, verbatim 「同意」): register
READ_BACK_FAILEDas a named wire row, aligned with theRESUME_FAILEDprecedent. This PR deliberately does not close the card — a residual noted below lands as a follow-up commit on this branch once PR #13181 merges. #12769 is not addressed here (it belongs to PR #13181); #13181 remains open territory of its own review.What this delivers (ruling point 1 — complete)
READ_BACK_FAILEDregistered under@objectstack/restinpackages/spec/src/api/error-code-ledger.zod.ts, trailing provenance comment carrying the substance (write recorded, read-back filtered by the caller's org scope, NOT rolled back), no tracker id — mirroring theRESUME_FAILEDrow shape.handleApprovalErrormapping arm —packages/rest/src/rest-server.tsmaps theREAD_BACK_FAILED:message prefix to HTTP 500 withcode: 'READ_BACK_FAILED'on the wire, directly under theRESUME_FAILEDarm it mirrors (same dispatch mechanism: message-prefix regex, measured, not assumed). 500 semantics stay (ruling point 2): it is genuinely a server-side inconsistency.IApprovalServicecontract docblock (packages/spec/src/contracts/approval-service.ts) now states the refusal contract: the write is recorded and NOT rolled back; read the request back with a system or matching-organization context. Substance without tracker ids, per the doc-authoring rule; verified against the precedent —RESUME_FAILED's ledger row and thrown messages carry no tracker ids either.error-code-ledger.mdxandcontract.mdxregenerated viacheck:generated --fix(the only artifact proved stale; diff is exactly the two list lines plus the enum count).rest-approvals-wire-codes.test.tsgains an org-filtered read-back case: 500,code: 'READ_BACK_FAILED', prefix-stripped body sentence, closed-union membership. Reverse-verified by ablation: with the mapping arm removed the case goes red in the predicted direction (the throw falls through to the template-generatedAPPROVAL_APPROVE_FAILEDarm — exactly the misnamed-code state the card describes); restore proved byte-identical against HEAD by blob hash.minorfor@objectstack/specand@objectstack/rest, matching howRESUME_FAILEDwas introduced. Wire vocabulary change is ADDITIVE only (ruling point 4): no existing code, status, or message changes.Sequencing — do NOT land before PR #13181
The thrower (
ApprovalService.readBackRequestthrowing theREAD_BACK_FAILED:prefix, from #12769) is NOT on origin/main yet: measured at dispatch,git grep READ_BACK_FAILED origin/mainanswers zero hits, and PR #13181 sits in the merge queue (page state QUEUED, unmerged). Until #13181 lands, this row would be registered-but-unemittable — the exact class the ledger header names as ADR-0112's "no silent fourth state" read backwards (the OVERLAY_PERSISTENCE_FAILED precedent). The review chain owns enqueue for this clause-② PR; it must land only after #13181 is on main.Residual — pending follow-up commit on this branch, blocked on #13181 landing
Ruling point 3 plus the standing doc-authoring rule: the thrown message on PR #13181's branch ends with a "(#12769)" tracker-id suffix, and customer-facing prose carries no internal tracker ids (the
RESUME_FAILEDthrown messages carry none — verified). Once #13181 is on main, this branch merges main and trims that suffix (substance unchanged, one line inpackages/plugins/plugin-approvals/src/approval-service.ts). Authoring that edit now would mean importing an unlanded PR's diff, which the dispatch forbids.Verification (all at commit 21f8c61)
pnpm --filter @objectstack/spec run test— 443 files, 11776 tests, all passpnpm --filter @objectstack/rest run test— 158 files, 2624 tests, all passpnpm --filter @objectstack/plugin-approvals run test— 34 files, 626 tests, all passtypecheckgreen for spec, rest, plugin-approvals (note: rest's tsc excludes test files by config; the edited test file is covered by thecheck:test-typecheckhalf of the same script, and by the vitest run itself)check:error-code-casing,check:dispatcher-error-vocabulary,check:generated,check:docs,check:authorable-surface, andcheck:dual-build-cjs-loads(after a fullpnpm build; its earlier refusal was PREREQUISITE NOT MET, not a red) — pluscheck:nul-bytesexpected READ_BACK_FAILED, received APPROVAL_APPROVE_FAILED, restore viagit checkout HEADverified byte-identical (blob hash d538f059 matches HEAD), suite re-run green on the restored treeSession: https://claude.ai/code/session_01KX8wnyjStaZcuMyAMNsy3N
Generated by Claude Code
Generated by Claude Code