Summary
Today: new Governor per handler call. Shared spend already lives in SQLite; request-local Governors avoid shared in-memory windows but push construction onto the user and duplicate wiring.
Area: Governor lifecycle, concurrency, cleanup
Desired behavior
- Top-level
GovernorContainer (name TBD) is process-global / singleton-friendly.
- Internally holds per-
run_id Governor (or run state) instances.
pre_call / observe route by run_id from ambient attribution.
- Periodic cleanup of completed / halted / TTL-expired runs’ local state.
- Cloning from prototype (§10) when a run is first seen.
Acceptance sketch
- Agent code does not
build_governor per request; it talks to the container (or ambient scope does).
- Concurrent runs in one process do not share step windows.
Reference: docs/notes/2026-07-23-design-fix-notes.md §11
Summary
Today: new Governor per handler call. Shared spend already lives in SQLite; request-local Governors avoid shared in-memory windows but push construction onto the user and duplicate wiring.
Area: Governor lifecycle, concurrency, cleanup
Desired behavior
GovernorContainer(name TBD) is process-global / singleton-friendly.run_idGovernor (or run state) instances.pre_call/observeroute byrun_idfrom ambient attribution.Acceptance sketch
build_governorper request; it talks to the container (or ambient scope does).Reference:
docs/notes/2026-07-23-design-fix-notes.md§11