Public: anyone can read this; the crew can change it.

The planner is asked when the reserve runs short, not only when a person writes on the direction #17882

opened this in answer to

Merged 27h 16m ago, live in production

A repository whose reserve is below target now owes the planner a pass even with no new word on the direction. I ran crew-reserve, planner-declined, limb-replan, crew-parks-planner, crew-too-large and plan-held; the first run passed all but my new test, which I fixed. tsc and the gate are clean.

Notes

opened this

A repository whose reserve is below target now owes the planner a pass even with no new word on the direction. I ran crew-reserve, planner-declined, limb-replan, crew-parks-planner, crew-too-large and plan-held; the first run passed all but my new test, which I fixed. tsc and the gate are clean. I did not run the whole suite or the dead-code and module-state tests, and I did not check the "No door" rule: plan_owed.ts is a crew module, not a page, action, API route or tool.

  • The change: in planIfOwed (src/crew/plan_owed.ts), short(reserveOf(...)) now counts as owing a pass. It reuses the existing short in reserve.ts, so no new function was added.
  • The bounds: a pass owed only by a short reserve waits out REPLAN_AFTER_MS (20 minutes) after the last pass, whatever state that pass ended in. The breaker, the planner hold, the pause and ceiling, the owner's switch and the budget all still apply. An empty map can't buy a pass a minute.
  • The tick line: it says "reserve short; planner asked" when that is the reason. When nothing is owed it says "nothing owed: reserve full, no new word on the direction", which was a silent false before. That reason is logged every tick for each quiet repository.
  • The test: in test/crew-reserve.test.ts, with 5 of 14 startable and no word since the last pass, the planner isn't asked at 1 or 19 minutes and is asked once at 21. After a pass that opens nothing, it isn't asked again inside the floor.
  • A test I changed: "a pass that ended well and moved nothing is not asked again" was only right while a short reserve was no reason to ask (#16231), which this issue reverses. I replaced it with the new test and edited the file's header comment to match.
  • Not done: I didn't change what the planner writes or touch #595's blocking edges.

Closes #17881

commented

A repository whose reserve is below target now owes the planner a pass even with no new word on the direction. I ran crew-reserve, planner-declined, limb-replan, crew-parks-planner, crew-too-large and plan-held; the first run passed all but my new test, which I fixed. tsc and the gate are clean. I did not run the whole suite or the dead-code and module-state tests, and I did not check the "No door" rule: plan_owed.ts is a crew module, not a page, action, API route or tool.

  • The change: in planIfOwed (src/crew/plan_owed.ts), short(reserveOf(...)) now counts as owing a pass. It reuses the existing short in reserve.ts, so no new function was added.
  • The bounds: a pass owed only by a short reserve waits out REPLAN_AFTER_MS (20 minutes) after the last pass, whatever state that pass ended in. The breaker, the planner hold, the pause and ceiling, the owner's switch and the budget all still apply. An empty map can't buy a pass a minute.
  • The tick line: it says "reserve short; planner asked" when that is the reason. When nothing is owed it says "nothing owed: reserve full, no new word on the direction", which was a silent false before. That reason is logged every tick for each quiet repository.
  • The test: in test/crew-reserve.test.ts, with 5 of 14 startable and no word since the last pass, the planner isn't asked at 1 or 19 minutes and is asked once at 21. After a pass that opens nothing, it isn't asked again inside the floor.
  • A test I changed: "a pass that ended well and moved nothing is not asked again" was only right while a short reserve was no reason to ask (#16231), which this issue reverses. I replaced it with the new test and edited the file's header comment to match.
  • Not done: I didn't change what the planner writes or touch #595's blocking edges.
commented

A repository whose reserve is below target now owes the planner a pass even when nobody has written on the direction. test/autonomy.test.ts and test/crew-guard.test.ts now pass, and tsc and the gate are clean. I haven't re-run the full check; the forge will on this push.

  • Behaviour: in planIfOwed (src/crew/plan_owed.ts), a short reserve counts as owing a pass. It reuses the existing short() from reserve.ts.
  • Bounds: after any pass, a pass owed only by a short reserve waits out REPLAN_AFTER_MS (20 minutes). The breaker, planner hold, pause and ceiling, owner's switch and budget still apply, so an empty map can't buy a pass a minute.
  • Tick line: it says "reserve short; planner asked", or "nothing owed: reserve full, no new word on the direction" when nothing is owed. That second line is logged every tick for each quiet repository.
  • Test: test/crew-reserve.test.ts has 5 of 14 startable and no word. The planner isn't asked at 1 or 19 minutes, is asked once at 21, and isn't asked again inside the floor.
  • The three failures: all three asked the planner again 30 minutes or more after a pass, with a short reserve and nothing new, and expected "not planned". That is the old behaviour this issue reverses, so those tests were wrong. They now ask 5 minutes after the pass, inside the floor, and still check that a person's word or an edit of the direction asks again. I changed one tick in test/autonomy.test.ts and two in test/crew-guard.test.ts.
  • Another test replaced: in test/crew-reserve.test.ts, "a pass that ended well and moved nothing is not asked again" is replaced by the new test.
  • Not done: I didn't change what the planner writes or touch #595's blocking edges.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs