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

The restore drill result is on /system as one line: last pass, how long, and the age of the snapshot restored #13057

Merged opened this

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

Merged

/system now has a "Restore" section of one sentence, placed above the off-site backup section and visible without opening anything. It reads either Restore proven 2 days ago, 45 seconds, snapshot 3 hours old. or Restore never proven..

Notes

shipped production is serving it deploy 59903fa

opened this

/system now has a "Restore" section of one sentence, placed above the off-site backup section and visible without opening anything. It reads either Restore proven 2 days ago, 45 seconds, snapshot 3 hours old. or Restore never proven.. If a drill failed after the last pass, the sentence adds ; the last drill failed 2 hours ago at restore. instead of hiding it.

  • src/snapshot/drills.ts: a new lastPass(db) returns the newest passing drill. It shares the row reader with lastDrill, which now calls the same helper.
  • src/snapshot/restore_line.ts (new) builds the sentence:

- How long: the time is said in seconds under a minute and a half and in minutes above that, never in milliseconds. - Snapshot age: it is the age at the moment the drill restored it, worked out from the snapshot's name. That is how stale the proven snapshot was, and it does not keep growing on later page loads.

  • src/web/pages/system.ts: restoreSection draws the sentence, with id="sys-restore" and data-proven.
  • test/restore-line.test.ts covers a pass, a failure after a pass, a failure with no pass, no record at all, the duration wording, and reading from the real drill table, where a newer failed drill is skipped when looking for the last pass.
  • test/system-parts.test.ts lists the new "Restore" heading. It names every section by design, so it had to change; it was not wrong.
  • docs/design/attention-budget.json raises the /system first-view budget by 4 words and 2 blocks, with a note in the same form as earlier raises: a heading and one sentence, so the owner sees it without a click.

Not done: no change to the terminal screen or the MCP restore_drill answer; they already report the last verdict. I didn't call the keep_plan or estimate tools because neither was available in this run, and no time estimate is given.

Checks: scripts/gate.ts, tsc --noEmit and design-lint pass. fast.ts named 1995 files, too broad to run here, so I ran the /system, drill, off-site, attention and new tests myself (43 files); all pass after the two updates above.

To try it, sign in as an admin and open /system: it says "Restore never proven." Run a drill from /settings/backups and reload to see "Restore proven just now, …".

🤖 Generated with Claude Code

Closes #13052

commented

/system now has a "Restore" section of one sentence, placed above the off-site backup section and visible without opening anything. It reads either Restore proven 2 days ago, 45 seconds, snapshot 3 hours old. or Restore never proven.. If a drill failed after the last pass, the sentence adds ; the last drill failed 2 hours ago at restore. instead of hiding it.

  • src/snapshot/drills.ts: a new lastPass(db) returns the newest passing drill. It shares the row reader with lastDrill, which now calls the same helper.
  • src/snapshot/restore_line.ts (new) builds the sentence:

- How long: the time is said in seconds under a minute and a half and in minutes above that, never in milliseconds. - Snapshot age: it is the age at the moment the drill restored it, worked out from the snapshot's name. That is how stale the proven snapshot was, and it does not keep growing on later page loads.

  • src/web/pages/system.ts: restoreSection draws the sentence, with id="sys-restore" and data-proven.
  • test/restore-line.test.ts covers a pass, a failure after a pass, a failure with no pass, no record at all, the duration wording, and reading from the real drill table, where a newer failed drill is skipped when looking for the last pass.
  • test/system-parts.test.ts lists the new "Restore" heading. It names every section by design, so it had to change; it was not wrong.
  • docs/design/attention-budget.json raises the /system first-view budget by 4 words and 2 blocks, with a note in the same form as earlier raises: a heading and one sentence, so the owner sees it without a click.

Not done: no change to the terminal screen or the MCP restore_drill answer; they already report the last verdict. I didn't call the keep_plan or estimate tools because neither was available in this run, and no time estimate is given.

Checks: scripts/gate.ts, tsc --noEmit and design-lint pass. fast.ts named 1995 files, too broad to run here, so I ran the /system, drill, off-site, attention and new tests myself (43 files); all pass after the two updates above.

To try it, sign in as an admin and open /system: it says "Restore never proven." Run a drill from /settings/backups and reload to see "Restore proven just now, …".

🤖 Generated with Claude Code

commented

/system now has a Restore section with one sentence saying when a restore drill last passed. The terminal's System screen shows the same sentence under the forge's health line:

  • Restore never proven. until a drill has passed.
  • After a pass, when it passed, how long it took and how old the snapshot was, e.g. Restore proven 2 days ago, 45 seconds, snapshot 3 hours old. Durations are given in seconds or minutes, never milliseconds.
  • If a drill failed after the last pass, the sentence adds ; the last drill failed 2 hours ago at restore. (when the failure happened and the step it failed at).

What to look at:

  • src/snapshot/restore_line.ts builds the sentence from the newest passing drill and the newest drill. lastPass and lastDrill in src/snapshot/drills.ts read those from the drill table.
  • restoreSection in src/web/pages/system.ts and restoreLines in src/tui/screens/system.ts both print that one sentence.
  • How to use it is a new section of docs/features/resilience-backups.md.
  • This push rewraps three comment lines that the gate flagged for going past 100 columns.

What I left out:

  • No new terminal screen: the line goes on the existing System screen, and a commit says so with a No door: line.
  • No separate feature doc: a new docs/features/ file would also need a pipeline change under the gate's "pipeline first" rule, so the how-to went into the existing backups doc.
  • A Looks: /system line asks the forge for before/after pictures of /system.

scripts/gate.ts, tsc --noEmit and scripts/design-lint.ts pass. So do test/restore-line.test.ts, test/calm-banners.test.ts and test/system-parts.test.ts. The restore-line tests cover the terminal line both before and after a drill passes.

To try it: sign in as an admin and open /system, or the System screen in the terminal. Then run a drill from /settings/backups and reload: the line reads Restore proven just now, ….

🤖 Generated with Claude Code

Approved

The sentence is plain, one line, seen without a click, same on the terminal System screen, with a how-to in docs/features. I could not see /system on the preview as a guest (admin only), so I judged it from source and tests. Two things I would do next: (1) data-proven on #sys-restore is read by nothing but the test; give it a style (e.g. muted when never proven) or drop it. (2) The heading Restore and the sentence Restore proven repeat the word; start the sentence with the fact (Proven 2 days ago...) or drop the heading. Note: this is a feature pull while the pipeline-first list stands; it is small and green, so I let it land.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs