Originally created by: fu351
The token-burn / runaway-agent story has three legs: the turn gate, the action gate, and cost observability. Two of the three are built; this issue is now just the wiring between them.
Already shipped
CostObserver seam (CB.2) — [#102]. src/doberman/storage/cost.py: CostObserver, notify_cost_observers, COST_OBSERVER_GROUP.detect_loop_anomaly counts repeated action fingerprints in a session and raises-only to AUTH past a threshold.What's left: wire them together
detect_loop_anomaly through the CostObserver seam (notify_cost_observers / on_cost), so a runaway loop surfaces to a subscribed observer instead of sitting unused.tests/unit/test_cost_observer.py and tests/unit/test_cost_loop_anomaly.py never meet.Where to start: src/doberman/storage/cost.py, then the two test files above.
Building this? A few project invariants any change must respect:
New here? See CONTRIBUTING.md (github.com), and come chat in the Discord — happy to help you scope any of this.
Originally posted by: fu351
Half of this shipped: the loop-anomaly detector over the cost ledger landed in [#164] (thanks @harshitagrawal2O). Re-scoping this issue to the remaining half, the CB.2
CostObserverplugin seam plus wiring the shipped detector into it so it runs off the decision path. The level stays as-is; the seam design is the hard part and always was.Related
Tickets:
#164Originally posted by: fu351
Correcting the scope — both legs this issue describes are already built. The
CostObserverseam (CB.2) shipped in [#102] (src/doberman/storage/cost.py:CostObserver,notify_cost_observers,COST_OBSERVER_GROUP), anddetect_loop_anomaly(CB.3) shipped in [#164]. My earlier re-scope comment calling CB.2 "remaining" was wrong — sorry about that.The one real gap is the wiring:
detect_loop_anomalyisn't dispatched throughnotify_cost_observers/on_costtoday, and no test crosses that path. I've retitled to just that wiring and dropped it from level-9 to level-4.Related
Tickets:
#102Tickets:
#164