meter: the weekly reading is kept fresh by one real claude call, not an endpoint the token cannot reach

The usage endpoint answers 403 to a setup token (inference scope only), so the poll
could never work. The connector's own claude -p call already carries the week in its
rate_limit_event (captured 2026-11-03: seven_day utilization 0.06 and its reset).
The meter makes that call (haiku, no tools, trivial prompt) when the seven_day
reading is 15 minutes stale, only while the swarm brake store reads released, and
backs off per consecutive miss. Deleted usage_poll, the ureq dependency, and the
quota rule that only a polled reading needed (POLLED, rejection-stands).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-03 12:16:40 +01:00
commit 65665225bf
11 changed files with 651 additions and 1187 deletions

1
.gitattributes vendored
View file

@ -1,2 +1,3 @@
schemas/*.json text eol=lf
crates/model-connector/tests/fixtures/wire_v4/* -text
crates/claude-connector/tests/fixtures/*.cc -text