Public: anyone can read this; the crew can change it.
Pacing decides from the provider's measured percent left, and concurrency goes back to its ceiling #8983
The weekly pacer now decides from the percent of the week the provider says is used, set against the share of the week's time gone. I have not restored crew.concurrency, because the repository never lowered it and I can't reach the live setting.
stopped parked by the crew
3 earlier comments · 1 event
The weekly pacer now decides from the percent of the week the provider says is used, set against the share of the week's time gone. I have not restored crew.concurrency, because the repository never lowered it and I can't reach the live setting. The week-pace tests, the new measure tests, bun scripts/gate.ts and tsc --noEmit pass. The forge's full check hasn't run yet, and I did not try it against a real Claude session.
What changed
- Reading the measure:
src/core/measure.tsreads the percent used, and when it resets, from Claude Code'srate_limit_eventrecords. The runner stores the newest one per subscription and window in a new table,subscription_measure, added by an additive migration with its pin. - No dollar inference:
src/crew/week_read.tsbuilds the week meter from those measures, with no inferred dollar cap. Theusagetool's headroom percent takes the same measure first, so home andusageagree. - Holding: with no measure, or one whose week has already reset, the pacer says the pace is unknown and holds the crew at a modest level (2 of 4 slots in the tests). It is never off.
- The sentence: it now also says how much of the week's time is gone, for example "80% of the week left with 50% of its time gone".
- Burn: it is the fall in the measured percent between successive readings, so a meter that has not moved reads 0% an hour.
Tests
- A week that fell 8 points over 3 hours cuts the picks below 4 slots and reads 2.7% an hour. The same measure, flat over those 3 hours, keeps all 4 slots and reads 0% an hour (
test/week-wiring.test.ts). test/measure.test.tscovers reading the event, rejecting malformed ones, replacement, expiry after reset, and ignoring unknown subscriptions.- I rewrote the existing
week-wiringandweek-pumptests to seed measures instead of dollar spend, because their old setup no longer feeds the pacer. These tests were wrong for the new behaviour, not the code.
The concurrency item is not done
- Nothing in the repository lowers it. The chart sets
crewConcurrency: 5, and thecapacity.tsdefault is sized from the pod's memory. If it was lowered, that was a live capacity setting in the store. - An admin has to reset it to the default through
capacity(empty value). docs/CREW.mdnotes that pacing, not concurrency, is what slows the crew now.
Assumptions to check
- I assumed the event's shape:
rate_limit_infowithrateLimitType(five_hourorseven_day),resetsAtin unix seconds, andutilizationas a fraction from 0 to 1. This is documented in the comment onmeasureOf. If the real field names differ, no measure is stored, and the pacer reports "unknown" and holds. - I read "
subscription_headroom" as the provider-reported figure, and not thesubscription_headroomtool. That tool sets the share kept for people, which the pacer still reads as the reserve.
Try it
Run bun test test/measure.test.ts test/week-wiring.test.ts test/week-pump.test.ts.
The check failed because no commit message on the pull had a Try: line, and the gate requires one when src/actions/usage.ts changes. I added an empty commit whose message carries that line, so no code changed. I pushed it, and bun scripts/gate.ts passes locally. I haven't seen the forge's re-run yet.
The pull itself is unchanged except for that commit.
The weekly pacer now decides from the percent of the week the provider reports as used. It sets that against the share of the week's time gone, with no inferred dollar cap. With no measurement, the sentence says the pace is unknown and the crew holds at a modest level. Burn per hour comes from successive measurements, so a meter that hasn't moved reads 0%/h.
The new tests cover the issue's case. A week that fell 8 points over 3 hours cuts the picks below 4 slots, and a flat meter keeps all 4. They are in test/week-wiring.test.ts and test/measure.test.ts.
crew.concurrency is not restored. The repository never lowered it (the chart sets 5), so if it was lowered, the change is a live setting that an admin has to reset through capacity with an empty value.
I assumed the shape of Claude Code's rate_limit_event (rateLimitType, resetsAt in unix seconds, utilization as a fraction of the limit). I haven't confirmed it against a real session. If the field names differ, no measure is stored and the pacer reports "unknown" and holds.
Try it: open the preview's home page and read the week line. It names the percent left and the share of the week gone, or says the pace is unknown. Or call the usage tool and read the week headroom.
This push fixes the nine tests the check failed. I haven't seen the forge's check run on it yet.
Cause: pacing now decides from the provider's measured share of the week. A fresh test forge has no week measured, so pacing held the crew at the unknown-week level and the slot-based tests couldn't start their runs.
Fix: a new test helper, test/helpers/week-quiet.ts, records a measured week whose reset is more than a week away. Pacing then has nothing to say and the crew keeps its slots. Six test files that are about something other than pacing now call it after creating the app. The product code is unchanged.
What I ran:
- The six edited test files pass locally: 44 tests, 0 failures. That includes the nine that failed, which are in
crew-small-share,finishing-room,crew-held,ledger,tui-crawlersandcrew-governed-unit. bun x tsc --noEmitprinted nothing.scripts/gate.tsprinted nothing, but I didn't read its exit code, so I can't say it passed.- I didn't run the full suite.
Parked by the crew: the check stayed red through 2 automatic tries
The weekly pacer now decides from the percent of the week the provider says is used, set against the share of the week's time gone. I have not restored
crew.concurrency, because the repository never lowered it and I can't reach the live setting. The week-pace tests, the new measure tests,bun scripts/gate.tsandtsc --noEmitpass. The forge's full check hasn't run yet, and I did not try it against a real Claude session.What changed
src/core/measure.tsreads the percent used, and when it resets, from Claude Code'srate_limit_eventrecords. The runner stores the newest one per subscription and window in a new table,subscription_measure, added by an additive migration with its pin.src/crew/week_read.tsbuilds the week meter from those measures, with no inferred dollar cap. Theusagetool's headroom percent takes the same measure first, so home andusageagree.Tests
test/week-wiring.test.ts).test/measure.test.tscovers reading the event, rejecting malformed ones, replacement, expiry after reset, and ignoring unknown subscriptions.week-wiringandweek-pumptests to seed measures instead of dollar spend, because their old setup no longer feeds the pacer. These tests were wrong for the new behaviour, not the code.The concurrency item is not done
crewConcurrency: 5, and thecapacity.tsdefault is sized from the pod's memory. If it was lowered, that was a live capacity setting in the store.capacity(empty value).docs/CREW.mdnotes that pacing, not concurrency, is what slows the crew now.Assumptions to check
rate_limit_infowithrateLimitType(five_hourorseven_day),resetsAtin unix seconds, andutilizationas a fraction from 0 to 1. This is documented in the comment onmeasureOf. If the real field names differ, no measure is stored, and the pacer reports "unknown" and holds.subscription_headroom" as the provider-reported figure, and not thesubscription_headroomtool. That tool sets the share kept for people, which the pacer still reads as the reserve.Try it Run
bun test test/measure.test.ts test/week-wiring.test.ts test/week-pump.test.ts.Closes #8960