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

The drill card names the hosted forge it restored, its size and its restore time in seconds, or says there is none #14196

Merged opened this

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

Merged

The drill card on /settings/backups now shows one line from the latest drill's hosted proof: Restored glint (1 of 4 hosted forges): 3 MiB, 2 repositories, 3 seconds, checks passed. Time is rounded to whole seconds (1 second, n seconds) and never shown as raw ms.

Notes

shipped production is serving it deploy 501b993

opened this

The drill card on /settings/backups now shows one line from the latest drill's hosted proof: Restored glint (1 of 4 hosted forges): 3 MiB, 2 repositories, 3 seconds, checks passed. Time is rounded to whole seconds (1 second, n seconds) and never shown as raw ms. When the drill held no hosted forge, the card says No hosted forges to drill. on one line. Drills recorded before the hosted step still show nothing.

The wording comes from hostedDrillWords in src/snapshot/drill_hosted_words.ts, which already fed the card. I changed that function rather than adding a second one. That means the Resilience terminal screen and the recovery issue comment (- hosted:) also use the new wording, so all three stay the same. Two small choices:

  • Which forge: the drill restores only one forge per run and keeps only the total, so the line always reads "1 of N".
  • Old drills: a drill recorded before restore time was tracked leaves the seconds out rather than showing a wrong number.

The page adds no query, and a control character in a forge's name still prints as ?.

Tests: test/drill-hosted-card.test.ts covers both wordings, rounding to whole seconds, a drill without the field, and a new case: a forge named <b>x&y</b> is escaped on the card. I also updated the expected wording in test/snapshot-hosted-chunks.test.ts and in docs/features/hosted-backup.md. gate --fix, tsc --noEmit, design-lint and ten covering test files pass (69 tests). scripts/fast.ts picked 197 test files, an estimated 16 minutes against a 5-minute budget, so I chose those ten myself.

Not done: the before/after screenshot of the card. This sandbox has no browser. To get it, open the preview's /settings/backups and press "Run a drill".

🤖 Generated with Claude Code

Closes #14185

2 earlier comments · 2 events
commented

The drill card on /settings/backups now shows one line from the latest drill's hosted proof: Restored glint (1 of 4 hosted forges): 3 MiB, 2 repositories, 3 seconds, checks passed. Time is rounded to whole seconds (1 second, n seconds) and never shown as raw ms. When the drill held no hosted forge, the card says No hosted forges to drill. on one line. Drills recorded before the hosted step still show nothing.

The wording comes from hostedDrillWords in src/snapshot/drill_hosted_words.ts, which already fed the card. I changed that function rather than adding a second one. That means the Resilience terminal screen and the recovery issue comment (- hosted:) also use the new wording, so all three stay the same. Two small choices:

  • Which forge: the drill restores only one forge per run and keeps only the total, so the line always reads "1 of N".
  • Old drills: a drill recorded before restore time was tracked leaves the seconds out rather than showing a wrong number.

The page adds no query, and a control character in a forge's name still prints as ?.

Tests: test/drill-hosted-card.test.ts covers both wordings, rounding to whole seconds, a drill without the field, and a new case: a forge named <b>x&y</b> is escaped on the card. I also updated the expected wording in test/snapshot-hosted-chunks.test.ts and in docs/features/hosted-backup.md. gate --fix, tsc --noEmit, design-lint and ten covering test files pass (69 tests). scripts/fast.ts picked 197 test files, an estimated 16 minutes against a 5-minute budget, so I chose those ten myself.

Not done: the before/after screenshot of the card. This sandbox has no browser. To get it, open the preview's /settings/backups and press "Run a drill".

🤖 Generated with Claude Code

Changes requested — before the latest push

The wording change is right and well placed (one function, shared by card, terminal and issue comment; tests cover both wordings, escaping, whole seconds and the absent field). Two things to fix in one round:

  1. docs/features/hosted-backup.md line 37 lost its full stop: "in whole seconds Terminal:" runs two sentences together. Put ". " after "seconds".
  2. Box 4 (before/after screenshot) is not delivered. If the sandbox has no browser, put the before and after lines as text in the pull description, taken from curl of the preview at /settings/backups after a drill (I got a 303 from the preview without a session, so I could not see the card myself), so the reviewer can see the card showing the new line.

Minor: seconds() rounds 400 ms to "0 seconds"; consider a floor of 1 second for a proof that took time, or leave and say so.

commented

The drill card on /settings/backups now shows one line about the hosted forge the latest drill restored: its name, how many hosted forges there were, its size, its repository count and its restore time in whole seconds. When the drill had no hosted forge, the line reads "No hosted forges to drill."

The wording comes from hostedDrillWords in src/snapshot/drill_hosted_words.ts, which the card already used. The Resilience terminal screen and the recovery issue comment (- hosted:) use the same function, so they now say the same thing.

Edge cases:

  • Short restores: a restore that took any time shows at least "1 second", so 400 ms no longer reads "0 seconds".
  • Older drills: a proof saved before restores were timed leaves the seconds out. A drill saved before the hosted step existed shows no line.
  • Forge names: names are escaped on the page, and control characters print as ?.
  • Cost: the page runs no extra query.

test/drill-hosted-card.test.ts covers both wordings, the seconds rounding (including the 1-second floor), a forge named <b>x&y</b> being escaped on the card, and a drill without the field. docs/features/hosted-backup.md uses the new wording.

Card text, before and after. I captured this as text instead of a screenshot. The sandbox has no browser, and the preview's /settings/backups needs a signed-in session I don't have. It comes from a local server built from this branch, after recording a drill and fetching the page as a signed-in admin, with HTML tags removed.

Before (main), hosted forge restored:

Last drill: 1d ago, 60000 ms, all counts matched — snapshot s, key opened — 1 users, 1 repositories, 0 issues, 0 pulls, 0 apps. Hosted forge glint (3 MiB, 1 of 4) restored alone in 3.2 s: its database passed the integrity check and its 2 repositories git fsck. 1 min of its 10 min budget.

After, hosted forge restored:

Last drill: 1d ago, 60000 ms, all counts matched — snapshot s, key opened — 1 users, 1 repositories, 0 issues, 0 pulls, 0 apps. Restored glint (1 of 4 hosted forges): 3 MiB, 2 repositories, 3 seconds, checks passed. 1 min of its 10 min budget.

Before, no hosted forge:

… 0 apps. No hosted forge was whole in the snapshot, so the hosted restore was skipped. 1 min of its 10 min budget.

After, no hosted forge:

… 0 apps. No hosted forges to drill. 1 min of its 10 min budget.

The drill's overall time on the same card ("60000 ms") is still shown in milliseconds. That figure was outside this issue's hosted line, so I left it alone; it could be its own follow-up.

Verified: gate --fix, tsc --noEmit, test/drill-hosted-card.test.ts and test/snapshot-hosted-chunks.test.ts all pass. This round only changed the docs, one function and its test file, so I did not rerun design-lint.

🤖 Generated with Claude Code

Approved

Earlier asks are met: the line now reads in the issue words, in whole seconds with a 1 second floor, and a forge name is escaped on the card with a test. One function (hostedDrillWords) feeds the card, the Resilience terminal screen and the recovery comment, so both doors say the same. The docs/features how-to is updated and README is untouched. I did not fetch the preview, since the card needs a signed-in session; this verdict rests on the diff and its tests.

Two things I would do next:

  1. Add a real before/after screenshot of the card from the preview (box 4); a text capture is not a screenshot.
  2. Non-blocking: the same card still prints the drill total as raw ms ("60000 ms"). Open a small follow-up to say it in seconds.
commented

Left #14185 open: 1 unticked item remain (Before and after screenshot of the card.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs