- Cost caps: budget_caps table, MTD spend ledger, tRPC budgets router, orchestrator pause on cap - DAG viz: convoy-dag.tsx SVG for brief dependencies in Mission Control - Automation tiers: manual|assist|auto per convoy, orchestrator respects manual - Preflight: connected-repos preflight endpoint - Checks panel: forge checks stub in detail panel - Budget caps schema + tRPC router + Settings UI stub Convoy: .convoys/polish-dag-tiers-cost Co-authored-by: orchestrator
1.8 KiB
1.8 KiB
| brief | convoy | role | title | status | priority | slice_dependencies | recommended_model | model_tier |
|---|---|---|---|---|---|---|---|---|
| 1 | polish-dag-tiers-cost | role-implementer | Cost budget UI + caps — month-to-date spend and dispatch pause | ready | P1 | qwen-coder | local |
Brief 1 — Task-cost-budget-ui-and-caps (Epic 1 follow-on)
Goal
Month-to-date spend per alias/tier visible, caps pause dispatch when exceeded. Autensa benchmark row cost tracking & budget caps plans/Plan-automation-foundation/Plan-automation-foundation.md:236.
Files
packages/database/src/schema/budget_caps.tsNEW —id uuid, workspace_id fk, cap_usd numeric(12,2), period varchar monthly, enabled bool, created_at. +spend_ledgerview orconvoy_eventssum query.apps/web/server/routers/budgets.tsNEW —getSpend(workspaceId)sumsconvoy_events.estimated_cost_usdmonth-to-date grouped bymodel_alias;getCap/upsertCap/deleteCapadmin only;shouldPauseDispatchhelper for orchestrator.apps/orchestrator/src/tick.ts— callshouldPauseDispatchbeforeenqueueJob, returnpauseaction when cap exceeded.apps/web/app/(app)/[workspaceSlug]/settings/ai/budgets/page.tsxNEW — table cap + spend chart (simple bar), Test.
Acceptance
/settings/ai/budgetsshows MTD $42/$100 (example),upsertCap cap_usd:100→ orchestratortickreturnspause reason: budget capwhen sum > cap.pnpm lint && pnpm type-checkpass.
Prompt
You are role-implementer brief 1. Read plans/Plan-automation-foundation/Epic-model-provider-registry/Task-cost-budget-ui-and-caps.md, packages/database/src/schema/convoy_events.ts, apps/orchestrator/src/tick.ts, docs/adr-model-routing.md. Keep ledger query simple (sum estimated_cost_usd where occurred_at >= month_start).
Depends
None.