PRD: Egress control plane — metering, budgets, and forced cutoff #285
Reference in New Issue
Block a user
Delete Branch "prd-egress-control-plane"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #251.
PRD:
99ba532783/docs/prds/prd-new-egress-control-plane.mdSummary
Drafts the design for an out-of-band egress enforcement & cost-control plane (Plane A), distinct from the agent-initiated supervise sidecar (Plane B, PRD 0013). The egress proxy meters authoritative token usage per bottle/provider, budgets are evaluated with agent → bottle → parent → global precedence, and budget exhaustion fires a per-bottle cutoff policy (
cutoff/freeze/kill) host-side — never via the supervise queue.Captures the decisions from the #251 thread:
~/.bot-bottle/bot-bottle.dbbehind a thin repository API;sqlite3is stdlib so it doesn't break the stdlib-first stance. Existing per-bottle flat-file state is not migrated.usage(via the existing egressresponsehook, with SSE final-usage tailing); acount_tokensestimator/endpoint is reserved for an optional pre-flight gate.~/.bot-bottle/settings.yml(host root, not per-repo) for budgets keyed by provider + default shutdown policy, within theyaml_subset.pysubset.Open questions
Carried in the PRD: SSE usage-tailing robustness, mid-request budget crossing vs. pre-flight gate, provider↔host attribution, parent-bottle budget semantics for
extendschains, and the dashboard↔controller transport seam.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.