Repository navigation
Wave 3 — budgets, cyclic rework, first-class approvals, budget dashboard - #4
Merged
Merged
Conversation
…04, ENG-009, ENG-005) ENG-004: bearer-token auth middleware on /api/* (apps/server/src/auth.ts) — mutating requests require Authorization: Bearer $API_AUTH_TOKEN (timing-safe), GET read views open; principal from X-Actor; approval endpoints append an approval_decided audit event stamped with the principal; open dev-mode + startup warning when unset. ENG-009: WorkerInput.outputSchema; API backend emits output_config.format (json_schema); hand-written schemas for proposal/tickets/verdict; CLI keeps prose fallback; ProposedChanges.parsed distinguishes parse failure from empty change set. ENG-005: sandboxEnv() forwards only an allow-list to the claude -p child, withholding host secrets. typecheck + lint + 73 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… ENG-001) ENG-013: two-root workspace (workspace.ts) — persistent working-code root for cloned target repos (AGENT_CODE_WORKSPACE), distinct from throwaway agent-state sandboxes; PM granted git/gh (ROLES.pm.tools + prompt); sandboxEnv(source, role) forwards a PM-scoped AGENT_PM_GITHUB_TOKEN only to the PM sandbox (host token never forwarded); idempotent ensureRepoCloned (provision.ts) shallow clone/ff-pull with token via http.extraheader, no-op when unconfigured, wired+audited in implementTicket. ENG-001: WorkerInput.workdir — CLI backend runs the agent in the cloned repo cwd (persistent, not cleaned up) so it reads/edits real source; implementTicket passes the clone path; product tree never touched. typecheck + lint + 85 tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dashboard (ENG-007/008/006/010)
ENG-007: monthly budget reset (period_start, migration 0003, lazy rollover) + atomic reserveBudget/reconcileSpend wired across all agent activities; estimateRunCostCents sizes the hold; pure periodExpired/canReserve tested. ENG-008: bounded implement->review->QA rework loop in ticketLifecycle with QA feedback threaded into re-implementation, then blocked; verifyTicket returns {passed,feedback}; harness tests. ENG-006: first-class persisted approvals (added epic_id, migration 0004); createApproval/resolveApproval/listPendingApprovals; pending records per gate resolved with decidedBy; /api/approvals covers roadmap/merge/deploy; web Approvals handles all kinds. ENG-010: /api/budgets + web Budgets page. typecheck + lint + 94 tests + build green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Wave 3 — governance & observability
Implements Wave 3 of the roadmap — and completes the whole backlog (Waves 0–3, all 16 tickets).
Stacked on #3 (base
wave-2-repo-context); this diff is Wave 3 only. Merge order: #1 ← #2 ← #3 ← #4.ENG-007 — Budget model (reset + reservation)
period_startcolumn (migration0003) + lazyrolloverIfExpiredingetBudgetRemaining, somonthlyBudgetCentsis a true monthly window rather than an ever-growingtotal. Applies to every activity automatically.
reserveBudget(conditional UPDATE that can't exceed the limit) +reconcileSpend(settle hold → actual);estimateRunCostCentssizes the worst-case hold. All fouragent activities now reserve→run→reconcile (release on failure, skip on exhaustion), closing the
read-then-spend TOCTOU. Pure helpers
periodExpired/canReserveunit-tested.ENG-008 — Cyclic rework routing
ticketLifecycleruns a bounded rework loop: implement → review → QA, bouncing back toin_progresswith the QA feedback on a fail, up toMAX_IMPLEMENT_ATTEMPTS(2), thenblocked.verifyTicketreturns{ passed, feedback };implementTicketthreads the feedback into the nextcoding prompt. New
@temporalio/testingtests: rework-once-then-pass, exhaust-then-blocked.ENG-006 — First-class approvals
epic_idto theapprovalstable (core schema + migration0004) so roadmap/epic gates fit.Repo
createApproval/resolveApproval/listPendingApprovals. Each gate persists a pendingrecord (roadmap + a new
requestApprovalactivity before the merge and deploy conditions), resolvedwith
decidedBy(the ENG-004 principal)./api/approvalsnow covers all gate kinds; the webApprovals page dispatches the right approve call per kind.
ENG-010 — Budget/cost dashboard
listBudgetsrepo helper + typed/api/budgets; a new web Budgets page (per-rolelimit/spent/remaining + unit total) with nav link and route.
Verification
pnpm typecheck·pnpm lint·pnpm test(94 tests) ·pnpm buildall green.Deferred (noted in the tickets)
repo.ts).🤖 Generated with Claude Code