Public: anyone can read this; the crew can change it.
An admin runs a restore drill from the terminal's Resilience dialog with `r`, after a y/n, and reads the verdict there in the Backups page's words #8018
Check · Review · Land · Live done — Landed and live in production.
A forge admin can now run a restore drill from the terminal's Resilience dialog with `r`. The page's "Run a drill" button and the terminal now share one action, so both say the same sentences.
shipped production is serving it deploy 2d10bf9
A forge admin can now run a restore drill from the terminal's Resilience dialog with r. The page's "Run a drill" button and the terminal now share one action, so both say the same sentences.
src/actions/backups_now.ts: newdrillNow(app, actor), shaped likesnapshotNow.
- Anyone but a forge admin gets not_found.
- A forge with no store gets no_store and "This forge has no snapshots to drill."
- A drill that throws gets failed and "The drill could not run: …".
- Otherwise it returns { verdict, failedStep, says }, where says is "The drill restored green." or "The drill failed at <step>.". A red drill comes back as an answer, not a refusal.
src/web/pages/backups.ts:backupsDrillcallsdrillNowand shows itssays, in the danger tone unless green. What the page answers is unchanged.src/tui/screens/resilience.ts:
- r run a restore drill sits next to n and l, and asks "run a restore drill now? y/n" the same way.
- y shows "Running a restore drill…" and then the answer. n or esc runs nothing.
- While a drill runs, busy hides n/l/r, so a second key cannot start a second drill.
- The key-to-question mapping is now one Map.
- Worth a look: the three action keys are now offered only to admins (mayAct). Before, only the actions themselves refused a non-admin.
test/tui-resilience-drill.test.ts: stubs the drill throughstartSnapshots'drilloption. It proves:
- r,y shows the green sentence and runs one drill.
- A red drill names its step.
- r,n and r,esc run nothing.
- A non-admin has no dialog and drillNow refuses them.
- A forge with no store says the no-snapshots sentence.
Without the dialog change, 4 of its 5 tests fail.
Checks run: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 1125 test files (it estimated 97 minutes against a 5-minute budget), so I picked the covering tests myself. These passed, 84 tests in all:
- the two Resilience tests named in the issue
- the existing
tui-resilience,tui-mirror-set,tui-backups*andsnapshot-drill-pagetests - the tests that touch
/settings/backups
Left out: there is no MCP drill_now tool. The issue only asked for the terminal and the page, and drillNow is ready for one.
To try it: in the terminal as a forge admin, press Ctrl-K, choose Resilience, then press r and y.
🤖 Generated with Claude Code
The code is sound: drillNow is shaped like snapshotNow, the page and the terminal share its wording, admin gating is kept, and the tests cover green, red, cancel, non-admin and no-store. One change is needed before this lands: the docs still describe the old dialog. docs/TOUR.md:216 says the dialog has n and l, and that while an action runs "neither key is offered". Add r (restore drill, y/n, same words as the Backups page) and say that none of the keys is offered while one runs. Also state that the three keys are now shown only to admins. Smaller points: the header comment in src/actions/backups_now.ts is now over-long on its second line, so rewrap it. The new test file cites #8007 but the pull is #8018, so make the reference consistent. I did not run the preview; this review is from the diff and the repo docs.
An admin can now run a restore drill from the terminal's Resilience dialog (ctrl+k, Resilience). They press r and answer y/n. The drill runs through drillNow in src/actions/backups_now.ts, the same action as the Backups page's button, so the verdict reads the same in both places.
- Dialog (
src/tui/screens/resilience.ts):rsits next ton(take a snapshot) andl(bring the mirror level). The three keys are shown only to a forge admin, and none of them is offered while an action is running. The actions still refuse anyone else withnot_found. - Backups page (
src/web/pages/backups.ts): the page's drill now callsdrillNow, so the drill's wording is written in one place. - Docs:
docs/TOUR.mdnow listsrwith itsy/n, says the three keys are admin-only, and says none is offered while one runs. - Review fixes: the header comment in
src/actions/backups_now.tsis rewrapped to match its neighbours. - Test reference: #8007 is the issue and #8018 is the pull, so citing #8007 was right. The test file now names both (
issue #8007, pull #8018) instead of switching to #8018.
test/tui-resilience-drill.test.ts covers a passing drill, a failing drill, cancelling at the y/n, a non-admin, and a forge with no snapshot store. The drill is stubbed there, because a real one restores a snapshot and can take minutes. The gate, bun x tsc --noEmit and that test file pass.
Left out: no new MCP tool for the drill; the issue asked for the terminal only. I have not checked the dialog on the preview.
To try it: open the terminal as an admin, press ctrl+k, choose Resilience, press r, then y.
🤖 Generated with Claude Code
Security review: clean. drillNow checks forge admin and answers not_found to anyone else. The page keeps its admin form gate and now calls the same action. The terminal dialog only offers the keys to admins, and the action refuses non-admins again. No new input, secret, shell or SQL. Output goes through the existing flash and terminal text paths. The tests cover green, red, cancel, non-admin and no-store, and TOUR.md is updated. There are no web markup changes, so the design system is untouched. The only gap is that the preview was not exercised; the page behaviour is unchanged.
A forge admin can now run a restore drill from the terminal's Resilience dialog with
r. The page's "Run a drill" button and the terminal now share one action, so both say the same sentences.src/actions/backups_now.ts: newdrillNow(app, actor), shaped likesnapshotNow.- Anyone but a forge admin gets
not_found. - A forge with no store getsno_storeand "This forge has no snapshots to drill." - A drill that throws getsfailedand "The drill could not run: …". - Otherwise it returns{ verdict, failedStep, says }, wheresaysis "The drill restored green." or "The drill failed at <step>.". A red drill comes back as an answer, not a refusal.src/web/pages/backups.ts:backupsDrillcallsdrillNowand shows itssays, in the danger tone unless green. What the page answers is unchanged.src/tui/screens/resilience.ts:-
r run a restore drillsits next tonandl, and asks "run a restore drill now? y/n" the same way. -yshows "Running a restore drill…" and then the answer.nor esc runs nothing. - While a drill runs,busyhidesn/l/r, so a second key cannot start a second drill. - The key-to-question mapping is now oneMap. - Worth a look: the three action keys are now offered only to admins (mayAct). Before, only the actions themselves refused a non-admin.test/tui-resilience-drill.test.ts: stubs the drill throughstartSnapshots'drilloption. It proves:-
r,yshows the green sentence and runs one drill. - A red drill names its step. -r,nandr,esc run nothing. - A non-admin has no dialog anddrillNowrefuses them. - A forge with no store says the no-snapshots sentence.Without the dialog change, 4 of its 5 tests fail.
Checks run:
bun scripts/gate.tsandbun x tsc --noEmitare clean.scripts/fast.tsnamed 1125 test files (it estimated 97 minutes against a 5-minute budget), so I picked the covering tests myself. These passed, 84 tests in all:tui-resilience,tui-mirror-set,tui-backups*andsnapshot-drill-pagetests/settings/backupsLeft out: there is no MCP
drill_nowtool. The issue only asked for the terminal and the page, anddrillNowis ready for one.To try it: in the terminal as a forge admin, press Ctrl-K, choose Resilience, then press
randy.🤖 Generated with Claude Code
Closes #8007