Compare commits

..
Author SHA1 Message Date
Meta Vens
c298d9d07d quota: asking_at is crate-visible for the meter's tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:45:55 +01:00
Meta Vens
a98594ed39 meter: driven by the connector's own lease state, not the brake store (findings brake-store-broken-reads-as-held, braked-bounce-unobserved, rejected-reading-backs-off-six-hours, meter-failure-kind-read-by-nobody)
The meter reads the week only while a lease is held or was asked for less
than a staleness period ago. A held swarm brake stops the units, so a braked
or quiet swarm spends nothing; the brake path, the duplicate brake type, the
store read, the frozen store fixture and the chrono serde feature are gone.
A request is noted by the QuotaCell for as long as it lives (a 4 h lease
counts) and wakes the meter. A lease asked of a metered cell with no weekly
reading (every restart) waits up to 10 s for the meter's first read before it
is lent, so it is not lent unobserved for its whole life.

A call is a miss only if it left the reading unrefreshed: a rejected turn
that reports its windows and then errors is no miss, so a rejected reading is
kept fresh every period. The failure kind is logged on change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:45:21 +01:00
Meta Vens
877f7a92cd meter: the call leaves no transcript (finding meter-transcripts-need-no-keeping)
--no-session-persistence on the meter's call only: it keeps no handle and
resumes nothing, and every other call is resumed by its session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:45:21 +01:00
Meta Vens
98e3ae458f stream: the cell keeps only the five_hour and seven_day windows (finding rejected-reading-backs-off-six-hours, per-model bucket)
A rate_limit_event also names per-model buckets such as
seven_day_overage_included; one of them reading rejected would have closed
every lease through provider_rejects. The old poll took only these two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:45:13 +01:00
Meta Vens
21feb71304 meter: pin the log's words and the clock (mutation survivors State::line, unix_ms)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:24:17 +01:00
Meta Vens
ccfc957bb5 Cargo.lock: ureq and its TLS and ICU closure leave the graph with the usage poll (377 lines)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:19:34 +01:00
Meta Vens
9144fc7019 quota: restore the observe_at signature the doc rewrite swallowed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:18:25 +01:00
Meta Vens
65665225bf 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>
2026-11-03 12:16:40 +01:00

Diff content is not available