feat(orchestrator): show token and commit rates in the header

rates.py folds the token, commit and score journals into per-hour and per-day rates for the header chips and the rates page; /api/rates drops from about 1950 ms to 380-830 ms on a year of data. Tests run once on unify/skills-20261114 after the merge (operator order 2026-11-14).

🎯 Fix: 75 %
💥 Break: 10 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 95 %
🏆 Score: 64
🚦 Gate: ⛔ fix 75 % < 90, break 10 % > 5; security 95 % < 100: ask the operator before the commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-14 21:33:22 +00:00
1 parent a2a03995cb
commit 652bc817c1
28 files changed
+1449 -102

No files matched your search

+3
View File
@@ -10,6 +10,7 @@ from urllib.parse import urlsplit
from .diffs import DIFF_BODY_LIMIT
from .engines import STT_LIMIT
from .exchange import PLAIN_CSP, Exchange
from .rates import rated
from .resources import RESOURCES, sampled
from .scores import scored
@@ -131,6 +132,8 @@ class Handler(Exchange):
self.answer(lambda: sampled(hub.kept / RESOURCES, hub.span(self.query(), time.time())), HTTPStatus.OK)
elif path == "/api/scores":
self.answer(lambda: scored(hub.council, hub.scripts.skills, hub.span(self.query(), time.time())), HTTPStatus.OK)
elif path == "/api/rates":
self.answer(lambda: rated(hub.council, hub.kept, time.time()), HTTPStatus.OK)
elif path == VIEW_ROUTE:
self.answer(hub.view_store.get, HTTPStatus.OK)
elif path == "/api/subagents":