Phase 2: compensation saga, manifest gate fix, runbook - #37
Open
cryptoxdog wants to merge 1 commit into
Open
Conversation
…e, runbook R-03: activate CompensationRegistry in the surpass-plan executor. Each gap advanced to 'executing' on a real dispatch now registers a status-rollback compensation; if the batched Vercel deploy throws, compensations run LIFO to revert those gaps to 'planned' (so the next run retries) before the job rethrows. Adds unit tests for CompensationRegistry and AgentBudgetGuard and an end-to-end deploy-failure saga test in plan-executor. AgentBudgetGuard is unit-tested but intentionally left unwired: the executor path carries no real per-call USD signal, and inventing costs would be a fabrication. Recorded as an externally-gated item in TODO.md with its activation trigger; per-run TokenBudget remains the active token safety control. R-08: fix the manifest gate. MANIFEST.json was missing from the tree, so `npm run manifest:check` crashed with ENOENT on every clean checkout. Generated MANIFEST.json (144 entries) and refreshed MANIFEST.md via manifest:generate; the gate now passes. R-06: document the migration --check dry-run, the compensation saga, the budget guard status, and the manifest gate in RUNBOOK.md. Validated: tsc --noEmit 0 errors, eslint src/ 0 errors, vitest 145/145, manifest:check clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjcHn8jZErKo37ZJi6qybX
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Stacked PR — 2 of 3
Stacked on #36 (Phase 1). Base is
claude/new-session-br7qjb-phase-1; this PR's diff shows only Phase 2. Merge #36 first (or retarget this tomainonce #36 lands).What this does
Phase 2 of the remediation (R-03, R-08, R-06).
R-03 — activate
CompensationRegistry(saga rollback)Wires a compensation saga into
serp:execute-surpass-plans(src/services/plan-executor.ts). Each gap advanced toexecutingon the strength of a real dispatch registers a status-rollback; if the batched Vercel deploy throws, compensations run LIFO to revert those gaps toplannedbefore the job rethrows, so the next run retries. This fixes a genuine pre-existing bug — a deploy failure previously stranded planned work silently. Proven by an end-to-end deploy-failure test plus new unit suites for bothCompensationRegistryandAgentBudgetGuard.AgentBudgetGuardis unit-tested here but intentionally left unwired in this phase — the executor path has no real per-call USD signal, and inventing costs would be a fabrication. Recorded inTODO.mdwith its activation trigger. (It gets wired to the real LLM cost seam in Phase 3 / #38.)R-08 — fix the manifest gate
MANIFEST.jsonwas missing from the tree, sonpm run manifest:checkcrashed with ENOENT on every clean checkout. GeneratedMANIFEST.json(144 entries) and refreshedMANIFEST.md; the gate now passes.R-06 — RUNBOOK
Documents the migration
--checkdry-run, the compensation saga, the budget-guard status, and the manifest gate.Validation
tsc --noEmit0 errors ·eslint src/0 errors ·vitest145/145 ·manifest:checkcleanGenerated by Claude Code