Repository navigation
[NO-JIRA] Add fleet k (k_local/s) behind --fleet-k in quota-watch - #1051
Merged
Merged
Conversation
johnnymo87
marked this pull request as ready for review
December 1, 2026 15:22
johnnymo87
enabled auto-merge (squash)
December 1, 2026 15:22
… quota-replay Implements Phase 2 fleet k from docs/plans/2026-11-23-fleet-llm-ledger-design.md §2: - Compute k_fleet = k_local / s using oc_tags.opus_list_cost on both local and remote Max usage over [max(w_end - 7d, max_first_hour), w_end), where w_end is the oldest gated remote watermark (default --alert-stale-hosts = devbox so a sleeping Mac does not force holds). - Map remote emails to pool short names via --account-map (JSON in private quota-telemetry repo; null = explicit ignore for usage seat; unmapped warns and is excluded; only active pool members with non-null u7d count). - Hold last good k_fleet for up to 48h when a gated watermark lags (>3h) or when share computation fails (empty pool, unmatched remote rows, s < 1%), without refreshing its timestamp, then fall back to k_local. - Add k_fleet and k_scope as the last two columns of quota_watch_runs (preserving verdict at r[14]) with idempotent migration. k_scope distinguishes fresh vs held even when --fleet-k is off (local(fleet) / local(fleet-held)). - Keep vertex_usd on k_local; only burn_rate uses k_fleet when --fleet-k is set. - Ship --fleet-k OFF on cloudbox: 7-day forward replay (2026-11-24..2026-12-01, 2139 ticks) showed 0 verdict diffs (max |burn_h| diff 0.0013/h, max |zero_h| diff 0.083h) with k_fleet 1899..2362 (1/s = 2.28x..6.34x, latest s=0.159), because spillover was <=.51.
johnnymo87
force-pushed
the
feat/fleet-k
branch
from
December 1, 2026 15:39
ec781e9 to
fb5b768
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 2 fleet
k(k_local / s) behind--fleet-kperdocs/plans/2026-11-23-fleet-llm-ledger-design.md§2 (beadeng-agent-platform-ul4.26.8).k_fleet:k_fleet = k_local / susingoc_tags.opus_list_coston both local (hourly, minus excludedteamclaude_hourly) and remote (remote_hourly,backend='max') over[max(w_end - 7d, max_first_hour), w_end)(minimum 24h overlap), wherew_endis the oldest gated remote watermark (--alert-stale-hosts, defaultdevbox, so a sleeping Mac does not trigger holds).--account-map /var/lib/llm-fleet/telemetry/account-map.json(stored in privatejohnnymo87/quota-telemetry;null= explicit ignore for the usage seat; unmapped warns once and is excluded; only active pool members with non-nullu7dcount).s < 0.01), hold the last goodk_fleetinstate.jsonfor up to 48h without refreshing its timestamp, then fall back tok_local.k_fleetandk_scopeadded as the last two columns ofquota_watch_runs(columns 15 & 16, preservingverdictatr[14]) with idempotentALTER TABLEmigration.vertex_usdcontinues to usek_local; onlyburn_rateusesk_fleetwhen--fleet-kis set.k_fleetandk_scope(local(fleet)/local(fleet-held)/local) are still recorded for live observation.7-day forward replay (
2026-11-24..2026-12-01, 2139 ticks)--fleet-kOFF--fleet-kON11-24 15:20 ET..11-25 00:45 ET (9.4h)|burn_h diff|0.0013 / h|zero_h diff|0.083 h(1 tick)k_localrange368.7 .. 842.2(latest373.4)k_fleetrange1898.6 .. 2362.1(latest2348.6)1/srange2.28× .. 6.34×(latest6.29×,s = 0.159)Because spillover over the week was ≤ $3.51, fleet
kdid not change any verdict; shipped OFF per the bead's gate.Verification
python3 -m unittest test_quota_watch.py test_llm_ledger.py: 227 tests pass (including 8 newTestFleetKtests covering calculation,vertex_usdkeepingk_local, account map ignore/unmapped/non-pool, window coverage clipping, sleeping Mac, empty pool / tiny share hold preservation, 48h hold persistence instate.json, schema migration, andreplay --fleet-k).python3 hosts/cloudbox/check_grafana_dashboards.py: 31 self-tests + 5 dashboards pass.