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

Release keeper: measure the write pause per release and let it set the cadence #13201

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The keeper now times the new forge's write pause per release, and the next cut waits max(30 min, 10 × the last release's pause). bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and test/mcp-size.test.ts pass.

Notes

shipped production is serving it deploy 59903fa

opened this

The keeper now times the new forge's write pause per release, and the next cut waits max(30 min, 10 × the last release's pause).

bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and test/mcp-size.test.ts pass. The new test and the keeper, release and maintenance tests that exercise this change also pass, apart from one assertion I updated. I did not run the full suite; the forge runs it on this push. The first schema-migrations run timed out under load and passed when I reran it alone. I did not look at the /releases card, the terminal screen or the Maintenance panel in a running app; they are covered by render tests only.

What changed

  • Measurement: src/main.ts times waitForPeer and notes it in the new src/keeper/pause.ts. The keeper hands it to markLive, which stores it as write_pause_ms when the verify begins. The migration 20261115110000-keeper-write-pause is additive and pinned.
  • Cadence: decideCut takes the pause and waits PAUSE_CADENCE_FACTOR (10) × it when that exceeds the floor. The refusal then reads "…the interval is 120 min, 10 × the last release's write pause of 720 s". Swap mode keeps its 60 s floor, so a 720 s pause there also waits 120 min. A hotfix still skips the spacing.
  • Surfaces:

- A "Write pause" column on the /releases keeper card. - A "write pause N ms" entry in the terminal's keeper rows. - writePauseMs on MCP release_keeper and GET /api/v1/keeper, one clause added to the existing tool doc and no new tool. - A folded "Write pause per release (ms)" panel on /maintenance (src/web/pages/maintenance_pause.ts): bars in inline SVG and the wait the next cut will keep, drawn only once a release has measured a pause.

  • Tests: test/release-keeper-write-pause.test.ts covers a recorded 720 s pause making the next cut wait 120 min and say so, an unmeasured pause leaving 30 min, and a short pause not lengthening it. It also covers storing the pause at markLive, the keeper passing its process's pause through, and the card, terminal and panel showing it. I updated test/keeper-language.test.ts, which pinned the old table header; the new column is the intended change.

What I chose not to do

  • No cap on the wait. A stuck 12-minute drain means 2 h between cuts, as the issue asks.
  • The pause is not backfilled, so older releases show "–".
  • Commit b6315b1e from the earlier branch was not reachable, so this is written fresh against the current code.

Try it: open /releases and read the Write pause column. As an admin, open /maintenance and the "Write pause per release (ms)" fold. Run bun test test/release-keeper-write-pause.test.ts.

The second commit is an empty one that only holds the "Try:" line the pre-push hook asks for.

🤖 Generated with Claude Code

Closes #7836

4 earlier comments · 1 event
commented

The keeper now times the new forge's write pause per release, and the next cut waits max(30 min, 10 × the last release's pause).

bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and test/mcp-size.test.ts pass. The new test and the keeper, release and maintenance tests that exercise this change also pass, apart from one assertion I updated. I did not run the full suite; the forge runs it on this push. The first schema-migrations run timed out under load and passed when I reran it alone. I did not look at the /releases card, the terminal screen or the Maintenance panel in a running app; they are covered by render tests only.

What changed

  • Measurement: src/main.ts times waitForPeer and notes it in the new src/keeper/pause.ts. The keeper hands it to markLive, which stores it as write_pause_ms when the verify begins. The migration 20261115110000-keeper-write-pause is additive and pinned.
  • Cadence: decideCut takes the pause and waits PAUSE_CADENCE_FACTOR (10) × it when that exceeds the floor. The refusal then reads "…the interval is 120 min, 10 × the last release's write pause of 720 s". Swap mode keeps its 60 s floor, so a 720 s pause there also waits 120 min. A hotfix still skips the spacing.
  • Surfaces:

- A "Write pause" column on the /releases keeper card. - A "write pause N ms" entry in the terminal's keeper rows. - writePauseMs on MCP release_keeper and GET /api/v1/keeper, one clause added to the existing tool doc and no new tool. - A folded "Write pause per release (ms)" panel on /maintenance (src/web/pages/maintenance_pause.ts): bars in inline SVG and the wait the next cut will keep, drawn only once a release has measured a pause.

  • Tests: test/release-keeper-write-pause.test.ts covers a recorded 720 s pause making the next cut wait 120 min and say so, an unmeasured pause leaving 30 min, and a short pause not lengthening it. It also covers storing the pause at markLive, the keeper passing its process's pause through, and the card, terminal and panel showing it. I updated test/keeper-language.test.ts, which pinned the old table header; the new column is the intended change.

What I chose not to do

  • No cap on the wait. A stuck 12-minute drain means 2 h between cuts, as the issue asks.
  • The pause is not backfilled, so older releases show "–".
  • Commit b6315b1e from the earlier branch was not reachable, so this is written fresh against the current code.

Try it: open /releases and read the Write pause column. As an admin, open /maintenance and the "Write pause per release (ms)" fold. Run bun test test/release-keeper-write-pause.test.ts.

The second commit is an empty one that only holds the "Try:" line the pre-push hook asks for.

🤖 Generated with Claude Code

commented

Merged main into the branch and pushed it. One gate rule still fails locally: "small and single-purpose". The merge and the wrapping fix I ran bring the diff to 24 files, against a limit of 20 when a change goes ahead of the pipeline. The forge's check will give the verdict; I did not split the pull.

  • Conflict: the only one was in src/web/pages/maintenance.ts. I kept main's budgetRows(...) for the Budgets fold and kept my writePauseFold below it. The old budgetOfRow import is gone, since main replaced it.
  • Wrapping: bun scripts/gate.ts --fix rewrapped comments, which touched some files I had not changed.
  • Gate trailers: the gate also asked for "Looks", "No door" and "Direction" lines. I put them in the merge commit message. The "No door" reason is my own wording: the write pause is a column and a fold on pages that already have terminal and docs doors.
  • Checks run: tsc --noEmit is clean. The 7 test files that differ from main pass (57 tests, 0 fail), including test/release-keeper-write-pause.test.ts. scripts/fast.ts reported the diff as too broad to name tests, so I ran those files instead of the whole suite.
commented

The branch is pushed (cbbf159ee). I expect the "small and single-purpose" gate to pass now, because the pull changes 16 files against a limit of 20. I haven't seen the forge's check result yet. Locally the gate and tsc --noEmit are clean, and the three test files covering the change pass (28 tests).

The gate counted 22 files because my earlier gate --fix comment rewrap had rewritten six files this pull doesn't own. I restored those to main's versions:

  • src/maintain/budget.ts
  • src/snapshot/outcome.ts
  • src/snapshot/service.ts
  • src/spawn/cores.ts
  • src/web/pages/maintenance_budgets.ts
  • test/maintain.test.ts

src/main.ts still shows a 65-line diff against main, though only 4 lines (the noteWritePause import, the timer and the call) are mine. The rest is the comment rewrap. I left it, because the gate's 100-column comment rule needs those comments wrapped in any file the pull touches.

commented

I fixed the dead-code failure, merged current main and pushed. The other two failures did not reproduce here.

  • Dead-code test: forgetWritePause in src/keeper/pause.ts is only called from test/release-keeper-write-pause.test.ts, so the dead-code check flagged it. I added it to scripts/unused-exports-allow.json, the way forgetStagger is.
  • "Stays out of the fold" test: it lives in test/thread-window.test.ts. The branch was behind main, whose version of that file differs. I merged origin/main with no conflicts, and test/thread-window.test.ts now passes.
  • "Signed-in home" test: this is in test/home-frame.test.ts. It passed on its own, and it passed again after the merge. The failing run took 5.6 s, which looks like load on that shard rather than a fault in this change. If it fails again on the forge, I'll look at it.

After the merge, gate.ts --fix changed nothing and tsc --noEmit is clean. The four test files I ran all pass: thread-window, unused-exports, home-frame and release-keeper-write-pause.

Changes requested — before the latest push

Changes requested. The cadence logic is sound and tested, but: (1) this is not on the pipeline-first list in the direction (#6534, #6611, #5276, #3316, #6217, #6428, #1242, #1073); say in the pull why a release-cadence feature goes ahead of them, or park it. (2) The /maintenance fold draws a hand-rolled fixed-width inline SVG bar chart; DESIGN.md wants rows (a dl row with the number), not a picture of them, and 240 px bars overflow a phone. Drop the SVG. (3) Pause values print as raw ms ('720000 ms') while the cadence line says '720 s'; show seconds everywhere in plain words. (4) The diff rewraps unrelated comments in main.ts, keeper.ts, record.ts, wire.ts, tui/keeper.ts and maintenance.ts (main.ts is 65 lines for 4 of substance); keep the pull single-purpose. (5) The unused-exports-allow entry is out of order next to its neighbours. No security findings: no new input, writes or secrets.

commented

Four of the five points are done and pushed. I'm keeping the comment rewrapping (point 4) and explain why below. I answer point 1 below. I did not run the full suite. The keeper, write-pause, comment-wrap and unused-exports tests pass, tsc --noEmit is clean and design-lint is clean.

What changed

  • SVG gone (point 2): /maintenance now shows the write pause per release as plain dl rows, one per version with its pause as the value. The line above them says "The next cut waits N min." and no longer explains the formula. A test checks that the fold contains no <svg.
  • Seconds everywhere (point 3): a new pauseWords(ms) in src/keeper/pause.ts gives whole seconds such as 720 s. The fold title, the fold rows, the keeper panel's "Write pause" cell, the TUI row (write pause 720 s) and the cadence reason all use it. I updated the test expectations.
  • Panel column (point 3): I kept the "Write pause" column in the keeper panel's table, now in seconds like "Dark". I did not move it to the notes row.
  • Allow-list order (point 5): the unused-exports-allow.json entry now sits just before src/kernel/…, in order.

Point 4: rewrapped comments. I reverted the rewraps to unrelated comments and re-applied only the substantive hunks. bun scripts/gate.ts then failed. Its rule is that every file a pull touches must be what rewrap returns, and the check enforces it. So main.ts, keeper.ts, record.ts, wire.ts, cadence.ts, tui/keeper.ts and maintenance.ts have to be rewrapped to pass. That is the separate last commit, d8dc221a7. main.ts is still 65 lines for 4 of substance, and the only way to shrink it is to stop touching the file.

Point 1: ordering. I can't judge whether this feature should go ahead of the pipeline-first items. I only did the issue as assigned. A person should decide whether to park the pull.

Approved

Earlier asks: the SVG bars are gone and /maintenance uses plain dl rows (met). Seconds are used everywhere through pauseWords (met). The allow-list entry is in order (met). The comment rewrap in touched files is required by gate.ts (accepted). The Write pause column is a plain table cell with a no-JS fallback, so no new design break. Security: no new input or write surface; the pause is measured in-process and stored as a rounded, clamped integer. Tests cover the cadence, markLive, the keeper passing the pause through, and the card, terminal and fold. Both doors and the feature doc are covered. Non-blocking: this is a feature ahead of the pipeline-first list, and a person should decide whether to park it. Non-blocking: main.ts shows 65 lines of diff for 4 lines of substance because of the rewrap.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs