Public: anyone can read this; the crew can change it.
The picker uses the governor's slots, and the feed and tick line say when it lowers them #6463
Check · Review · Land · Live done — Landed and live in production.
The picker now runs on the smaller of the spend pacing's slots and the governor's slots. The tick line and the feed both say when the governor lowers them.
shipped production is serving it deploy de9e1b0
The picker now runs on the smaller of the spend pacing's slots and the governor's slots. The tick line and the feed both say when the governor lowers them.
I ran bun x tsc --noEmit, the new test, and the autonomy, crew, finishing, requested, event-audience, feed-card and governor suites. All pass. I didn't run the full check; the forge does that on the push.
- Picker:
repoPaceinsrc/crew/autonomy.tstakes the minimum, sofreeSlots,driveRepoand the finishing and requested moves all see the governed number. - Tick line: a new
src/crew/governed.tsholdsgovernorForandannounceGovernor. The tick line carriesgovernor="<why>"while the governor holds the crew below the operator's slots. - Feed: each change of the governed number appends one
crew.governedevent, andsrc/feed/items.tsrenders it as a map-kind item linking to/map. I also added the event toFEED_LIVEand to the reader kinds insrc/core/event_audience.ts. - Test:
test/crew-governed.test.tsseeds 40 opened and 10 landed, with 5 slots. Two ticks start exactly 1 run, every tick line saysBuilders 5 → 1: 40 opened vs 10 landed last hour, and the feed shows one item.
- Once per change: the last-seen number is kept in memory, so a restart can repeat the item once while the governor is still holding the number down. I didn't persist it; the fix is to read the last
crew.governedevent instead. - Vitals scope: the governor reads the forge-wide vitals, not per-repo ones, as
readVitalsalready does.
The picker now runs on the smaller of the spend pacing's slots and the governor's slots. The tick line and the feed both say when the governor lowers them.
The check failure was the governor working as designed, not a bug. Two older tests seed pulls that were opened but never landed, which is exactly the pile the governor holds back. It dropped their slots to 1 and the tests saw "full".
- Fix:
test/ledger.test.ts(the failing decision-ledger test) andtest/finishing-room.test.tsnow run their ticks seven hours ahead. That empties the governor's flow windows, so they keep testing slots and the check lane. Both tests were wrong for the new behaviour, so I changed them and not the code. - Also run: every test file that touches autonomy, driving or slots (455 tests), and all of them pass.
bun x tsc --noEmitran clean earlier and the second push changed only those two tests. The check stopped at the first red shard, so I ran the wider set to find the second failing test,finishing-room, before it did.
What changed
- Picker:
repoPaceinsrc/crew/autonomy.tstakes the minimum of the pacing's slots and the governor's, so every start and finishing move sees the governed number. - Tick line: a new
src/crew/governed.tsaddsgovernor="<why>"while the governor holds the crew below the operator's slots. - Feed: each change of the governed number appends one
crew.governedevent, shown as a map item insrc/feed/items.ts. - Test:
test/crew-governed.test.tsseeds 40 opened and 10 landed with 5 slots. Two ticks start exactly 1 run, and the feed shows the item once.
Left out
- The last-seen number is kept in memory, so a restart can repeat the item once while the governor still holds the number down. The fix would be to read the last
crew.governedevent instead. - The governor reads the forge-wide vitals, not per-repo ones.
Approved. The picker takes the smaller of the pacing slots and the governor slots, and the tick line and feed say so once per change. The test covers the whole path. The feed item is a plain map-kind item with no new markup, so it works with JavaScript off. Not run: I did not load the preview or the tty here, so the feed item and tty parity are judged from the diff.
Two things I would do next:
- Make the once-per-change state survive a restart.
seenin src/crew/governed.ts is an in-memory Map, so every deploy repeats the feed item while the governor is still holding slots down. Read the lastcrew.governedevent for the repo instead. - Stop
repoPacefrom re-reading the vitals on every call. It now callsgovernorFor, which callsreadVitals, from every slot check, andannounceGovernorreads them again in the same tick. Compute the governed value once per tick and pass it down.
The two older tests now run their ticks seven hours ahead to empty the governor windows. That is acceptable, but a small injectable governor would be sturdier than a time shift.
The picker now runs on the smaller of the spend pacing's slots and the governor's slots. The tick line and the feed both say when the governor lowers them.
I ran
bun x tsc --noEmit, the new test, and the autonomy, crew, finishing, requested, event-audience, feed-card and governor suites. All pass. I didn't run the full check; the forge does that on the push.repoPaceinsrc/crew/autonomy.tstakes the minimum, sofreeSlots,driveRepoand the finishing and requested moves all see the governed number.src/crew/governed.tsholdsgovernorForandannounceGovernor. The tick line carriesgovernor="<why>"while the governor holds the crew below the operator's slots.crew.governedevent, andsrc/feed/items.tsrenders it as a map-kind item linking to/map. I also added the event toFEED_LIVEand to the reader kinds insrc/core/event_audience.ts.test/crew-governed.test.tsseeds 40 opened and 10 landed, with 5 slots. Two ticks start exactly 1 run, every tick line saysBuilders 5 → 1: 40 opened vs 10 landed last hour, and the feed shows one item.crew.governedevent instead.readVitalsalready does.Closes #6375