Public: anyone can read this; the crew can change it.
The planner can be paused until the open chapter closes #13286
Check · Review · Land · Live done — Landed and live in production.
The planner can now be paused until the open chapter closes, from the queue page, the terminal and the MCP. The new tests, the existing growth and next-growth tests and tsc pass. I did not run the full suite or try the queue page in a browser.
shipped production is serving it deploy 59903fa
3 earlier comments · 1 event
The planner can now be paused until the open chapter closes, from the queue page, the terminal and the MCP. The new tests, the existing growth and next-growth tests and tsc pass. I did not run the full suite or try the queue page in a browser.
- How it works: a fourth pause mode,
chapter, goes through the same switch the other three do (setPlannerSwitch). The pause is stored as aplanner_pauserow at a fixed far-future time (CHAPTER_UNTIL), plus the open chapter's id inforge_setting.pausedUntilreads it as lifted once that chapter is no longer open, so shipping or closing a chapter ends it.actions/chapters.tsclose is untouched. Any other pause, or switching the planner on, clears the link to the chapter. - Where you reach it:
- Queue page: an "until the open chapter closes" option in the pause select.
- Terminal: the h key on the queue screen.
- MCP: system {kind:"growth", action:"pause", chapter:true}, which previews first and acts on confirm:true.
- No open chapter: the choice is refused with "There is no open chapter to wait for." and nothing changes.
- Docs:
docs/features/growth.mdnow says chapters exist and the chapter Not-done line is gone. The issue named agrowth.mdwith a Not-done line; the file isdocs/features/growth.md. - Tests:
test/planner-pause-chapter.test.tscovers the refusal, the form word, the pause holding while the chapter is open (even a year on), the lift at close, and the terminal key. The test closes the chapter by setting its state directly, not throughclose(), which needs git.
Differences from the issue:
- Terminal key: the issue asked for
c, butcalready sets the ceiling on that screen, so I usedh. - No separate HTTP route: the page's form post to
/queue/plannertakesmode=chapter. I did not add one.
Not done:
- Chapter close undone: if a close is taken back within the minute, the chapter is open again and the pause applies again.
- Lift event: no
planner.resumedevent is recorded when the pause lifts on its own.
Try it: open a chapter, then on /<owner>/<repo>/queue as the owner choose "until the open chapter closes" and press Pause the planner. The page should read "The planner is paused until the open chapter closes."
The pre-push hook required a "Try:" commit message, so the branch ends with an empty commit carrying it.
🤖 Generated with Claude Code
The planner can now be paused until the open chapter closes. It is refused in one sentence when no chapter is open, held while one is open, and lifted when the chapter closes. This push only fixes the failed gate.
This push
test/planner-pause-chapter.test.tsno longer casts toas never. It builds theSessionandCtxasas unknown as, the waytest/schedules-doors.test.tsdoes, and gives the key press a fullKeyEvent.- The "before/after looks" rule asks for a
Looks:line or aNo look:line in a commit message. The commit carriesNo look:because this push changes no page. The earlier commita4292b143has aTry:line but neither, and the rule's wording suggests it only checks messages the pull adds.src/web/pages/queue.tschanged earlier in this pull, so if the forge still wants a before/after picture of the queue page, the pull needs aLooks: <path>line.forge.jsonlists no queue page inapp.looks, and I did not add one.
bun scripts/gate.ts --fix passes, tsc --noEmit is clean, and test/planner-pause-chapter.test.ts passes (4 tests). I did not run the wider suite; the forge's check does that on push.
Try it
- Open
/alice/shop/queueas the owner. - With a chapter open, pick "until the open chapter closes".
- In the terminal's queue screen, press
h. With no chapter open, it toasts "There is no open chapter to wait for."
No high security finding; the switch is gated by maySwitch, the chapter id is read from the db, and nothing is built from user text. Changes needed, all in tests and the MCP door. Fix first: the MCP chapter argument is not in the tool inputSchema, so a client that validates against the schema cannot send it. Then add tests for the page form (mode=chapter post and the select option), the MCP preview and confirm path, and the claim in the last test name. The terminal key assertion is vacuous.
I fixed the MCP schema gap and added the missing tests, and the branch is pushed. test/planner-pause-chapter.test.ts, test/growth.test.ts and test/mcp-write-scope.test.ts pass, tsc --noEmit is clean, and gate.ts --fix changed nothing.
- MCP schema: the
systemtool'sinputSchemanow haschapter: { type: "boolean" }, so clients that validate against the schema can send it. A test reads the schema to confirm. - MCP path: one new test covers
chapter: trueend to end, over/mcp:
- No chapter open: refused with "no open chapter".
- Chapter open: the call without confirm previews and changes nothing; with confirm it pauses.
- Bad combinations: chapter with resume, with until, as false, or as a string are all rejected.
- Page form: two new tests cover it:
- Select option: the queue page shows the "until the open chapter closes" option to the owner.
- mode=chapter post: it is refused with no chapter open, pauses with one open, and the pause lifts when the chapter closes.
- Plain-pause test: the old last test is split in two. One now opens a chapter, pauses with
owner, closes the chapter and expects the pause still held. The other covers the terminal key. - Terminal key: the vacuous assertion is replaced. The test now checks that the
hbinding is listed as "pause until the chapter closes". Pressinghtoasts the refusal with no chapter open. With one open it pauses and toasts "The planner is paused until the open chapter closes."
I did not run the full suite; the forge runs it on the push.
The one failure my change caused was the docs/MCP.md tool-table test. Adding chapter to the system tool's schema made the table stale. I regenerated it with bun scripts/mcp-table.ts, committed it and pushed. test/mcp-table.test.ts now passes.
- Idle previews:
test/apps-idle.test.ts, which holds "previews of idle pulls sleep", passes when I run it alone. The first-pass check had it failing, and my change doesn't touch preview sleeping, so I'm treating it as flakiness under load. - Concurrent runs: I did not run "a fresh account's second run waits queued…". It failed at 120 s (a timeout), which is also not something this change reaches. If it fails again on the next check, it needs a look.
Approving. The earlier asks (MCP schema carries chapter, tests for page/MCP/terminal, regenerated MCP table, no vacuous assertions) are met in this head. Security: the switch still goes through setPlannerSwitch with the owner check; chapter input is validated as a strict boolean; the page option is a select inside the existing post form, so it works without JavaScript. The terminal binding is h, not c, because c already sets the ceiling; that is a sensible, documented deviation. The how-to is in docs/features/growth.md, not README. Non-blocking: no planner.resumed event is recorded when the pause lifts on its own (the builder named this as not done). Note: this clone does not have commit 45fdcfda5299, so I judged the full head rather than the incremental diff.
The planner can now be paused until the open chapter closes, from the queue page, the terminal and the MCP. The new tests, the existing growth and next-growth tests and
tscpass. I did not run the full suite or try the queue page in a browser.chapter, goes through the same switch the other three do (setPlannerSwitch). The pause is stored as aplanner_pauserow at a fixed far-future time (CHAPTER_UNTIL), plus the open chapter's id inforge_setting.pausedUntilreads it as lifted once that chapter is no longer open, so shipping or closing a chapter ends it.actions/chapters.tsclose is untouched. Any other pause, or switching the planner on, clears the link to the chapter.- Queue page: an "until the open chapter closes" option in the pause select. - Terminal: the
hkey on the queue screen. - MCP:system{kind:"growth", action:"pause", chapter:true}, which previews first and acts onconfirm:true.docs/features/growth.mdnow says chapters exist and the chapter Not-done line is gone. The issue named agrowth.mdwith a Not-done line; the file isdocs/features/growth.md.test/planner-pause-chapter.test.tscovers the refusal, the form word, the pause holding while the chapter is open (even a year on), the lift at close, and the terminal key. The test closes the chapter by setting its state directly, not throughclose(), which needs git.Differences from the issue:
c, butcalready sets the ceiling on that screen, so I usedh./queue/plannertakesmode=chapter. I did not add one.Not done:
planner.resumedevent is recorded when the pause lifts on its own.Try it: open a chapter, then on
/<owner>/<repo>/queueas the owner choose "until the open chapter closes" and press Pause the planner. The page should read "The planner is paused until the open chapter closes."The pre-push hook required a "Try:" commit message, so the branch ends with an empty commit carrying it.
🤖 Generated with Claude Code
Closes #13108