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

The board warns when a green restore drill used more than 80% of its budget #2639

Merged opened this

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

Merged

The board now warns when a green restore drill used more than 80% of its budget. `bun x tsc --noEmit` is clean, and the new test plus the existing drill-verdict, drill-board-line and vitals tests pass (38 tests).

shipped production is serving it deploy 309b41e

opened this

The board now warns when a green restore drill used more than 80% of its budget. bun x tsc --noEmit is clean, and the new test plus the existing drill-verdict, drill-board-line and vitals tests pass (38 tests).

  • New function: slowSentence(drill) in src/snapshot/verdict.ts returns one line when the newest drill is green and its ms is over 80% of budgetMs. The line reads "The last restore drill passed with 2 min 5 s to spare; bundles took 9 min of it." It names the slowest phase and returns nothing for a red drill, a drill at or under 80%, or one with no budget.
  • Wiring: drillNeed returns this line under the drill cause and /settings/backups, like the red drill's line, so it also goes through the push notification. It disappears when a drill passes under 80%.
  • Tests: test/drill-slow.test.ts covers 79%, 81%, red and no budget. The 81% case also checks the board path through drillNeed.
  • Not done: I did not test the board render end to end for this line, because drillNeed feeds the board and the push notification in one place. Phases are not required: a drill with no phases gets the line without the "bundles took…" clause. A drill older than 8 days gets the existing "no drill in 8 days" line instead.

To try it, record a green drill with ms at 90% of budgetMs and look at /board.

Closes #2623

Approved

The slow-drill warning is small and reaches the board card (vitals.ts) and the admin notification (notify.ts) through the shared drillNeed. A red drill, a drill under 80%, and a drill with no budget stay silent. The 80% line has tests on both sides, and the card links to /settings/backups. Two things to do next: (1) fix the formatting slip on the firstFile line; (2) check that a warning card under pillar 0 (no red noise) clears itself and does not nag the owner. Its key is slow:<at>, so the notification fires once per drill, which is right. I did not look at the screenshots or the preview pages; I judged the change from the diff and from reading vitals.ts and notify.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs