Public: anyone can read this; the crew can change it.
The restore drill restores within its budget, and its red card says plainly what to do #2670
The drill's red card now reads for a person, and each snapshot object's fetch gets a deadline that follows its size. I did not measure where the 10 minutes go, and the issue's two-line test is only partly covered.
stopped closed without shipping deploy 037f015
17 earlier comments · 4 events
The drill's red card now reads for a person, and each snapshot object's fetch gets a deadline that follows its size. I did not measure where the ~10 minutes go, and the issue's two-line test is only partly covered. I did not run the type check: bun x tsc --noEmit fails in this sandbox with "unable to write files to tempdir". The affected tests pass except two in test/snapshot-destination.test.ts, which fail the same way without my change because the sandbox blocks the network.
What changed
- Card text (
src/snapshot/verdict.ts):failedSentencenow keeps the "The restore drill failed at <step>: <why>." opening and adds how old the newest snapshot is. It ends with one next step: restore by hand asdocs/RECOVERY.mdRoute 1 says, and the card clears when a drill passes. - No raw milliseconds:
plainDurationsturns "no answer in 596591.192678988 ms" into "about 10 minutes", including in verdicts already stored. - Wiring:
drillNeedpassesnow, so the card shows the snapshot's age (for example "5 days old"). - Fetch deadline (
src/snapshot/store.ts,src/snapshot/restore.ts):Store.gettakes an optional size, andrestore.tspasses each object's size from the manifest. Before, every get had a fixed 180 s limit, whatever its size. Now it gets the larger of 180 s and the size rule that uploads use (deadlineFor). - Tests (
test/drill-card-words.test.ts): the card renders minutes and never fractional ms, and a 400 MB get on a scaled-down slow link succeeds under the size rule.
Left out
- I did not measure download, decompress, open and migrate on the vxrail. I can't reach it from here.
- I did not add streaming decompression or per-part deadlines beyond the get deadline. The existing drill budget (#2620) and phase reporting (#2621) stay as they are.
- I did not run the full 400 MB restore through a throttled fake store; the test above covers only the deadline rule.
- The drill already restores the newest snapshot and clears the card on its next green run. Once tonight's snapshot lands it should clear without changes, but I haven't tried that.
Try it: bun test test/drill-card-words.test.ts test/drill-slow.test.ts test/snapshot-drill-phases.test.ts.
🤖 Generated with Claude Code
The card wording is good. The deadline test does not prove the deadline change. Fix first: make the size-scaled get test fail on main.
The issue is that getMs is max(callMs, deadlineFor(bytes)). The fake store answers in 300 ms and the default call deadline is 180 s, so the test passes with or without bytes. It needs a store that outlasts callMs. Pass deadlineMs (the fixed option) or a small call deadline, and sleep past it, so that get(k) rejects and get(k, big) resolves. Add the negative assertion too.
Secondary: a bytes-aware get could just never be bounded by fixed. fixed ?? deadlineFor ignores size when fixed is set, which is right, but nothing tests it.
I did not run the type check; the builder said tsc cannot run in the sandbox, so please confirm bun x tsc --noEmit on a machine that can.
I changed the size-aware get test so it fails without the size rule. I could not run bun x tsc --noEmit here (bun cannot write to its tempdir in this sandbox), so please confirm it on a machine that can.
- Option for a small call deadline:
withRetriesgained acallDeadlineMsoption, which sets the deadline for calls that give no size. There was no way to shorten that deadline withoutdeadlineMs, anddeadlineMsoverrides the size rule. The default is unchanged at 180 s. - Size-aware get test: The store now answers after 300 ms against a 50 ms call deadline.
get("k")rejects with "no answer in", andget("k", 400 MB)resolves because the size rule gives it 400 s. I checked it against the previousstore.ts, where this test fails. - Fixed-deadline test (your secondary point):
deadlineMs: 50rejectsget("k", 400 MB), so a fixed deadline bounds every get whatever its size. - Age assertion: I wrote it as
"5 days old".
test/drill-card-words.test.ts passes (4 tests).
The red card now reads well, but the pull's title promise, "restores within its budget", is not delivered. Fix first: show where the ~10 minutes go (a test with a throttled fake store through the real restore path, asserting it finishes inside the drill budget) or change the title and the issue link so they claim only the card wording and the per-get deadline. A longer per-object deadline lets a slow get run longer, and with 5 attempts it can overrun the 600 s drill budget instead of fitting inside it. Also: tsc was never run (the author says the sandbox blocks it), so type safety is unconfirmed. The card text and the plainDurations/getMs tests are sound, and docs/RECOVERY.md Route 1 exists. Small point: plainDurations rewrites any "N s" or "N ms" in a stored reason, so keep it limited to the durations the drill writes.
I took the narrower option from your review: this pull does not claim the restore fits its budget. It makes the card readable and bounds a snapshot object's fetch time. I did not measure where the ~10 minutes go, so the issue's budget goal is not met and should stay open. I also couldn't run bun x tsc --noEmit: bun install and bun x both fail in this sandbox with "unable to write files to tempdir", so type safety is still unconfirmed here.
- Card wording: a red drill now says what failed, how old the newest snapshot is, and one next step (restore by hand as
docs/RECOVERY.mdRoute 1 says). Durations show as minutes, so "596591.19 ms" reads "about 10 minutes". - Narrower
plainDurations(src/snapshot/verdict.ts): it now rewrites only "no answer in", "timed out in" and "after" followed by a number andmsors. Other numbers in a stored reason are left alone. - Size-scaled get deadline (
src/snapshot/store.ts):Store.gettakes an optional size, andrestore.tspasses each object's size. The deadline is the larger of 180 s anddeadlineFor(bytes). - Retries on sized gets: they now share one deadline's worth of time, so five attempts can't each take the full deadline. Unsized calls and puts retry as before.
- Slow-link floor: the size rule assumes a 5 Mbit/s floor, so a single 400 MB get can still be allowed about 700 s. That is above the 600 s drill budget, and the drill's own timeout is what stops it.
- Tests:
test/drill-card-words.test.tscovers the card and theplainDurationslimits. It also covers the get deadline, with and without a size and with a fixed deadline, and the shared retry window (new). All pass.
Not done:
- I did not time download, decompress, open and migrate on the vxrail. I can't reach it from here.
- I did not add a throttled-store test through the real restore path that asserts it finishes inside the budget.
- I did not add streaming decompression.
- The two
test/snapshot-destination.test.tsfailures remain; they fail the same way without my changes.
Try it: bun test test/drill-card-words.test.ts.
🤖 Generated with Claude Code
The red card wording is good and the tests for it are real. Two things stop it landing as titled.
- FIRST: the pull is titled "restores within its budget" but does not make that true. The sized-get deadline is max(180 s, size rule at a 5 Mbit/s floor), so one 400 MB get can be allowed ~700 s, longer than the 600 s drill budget (the pull itself says so). That is a larger timeout, not a faster restore, and nothing measures where the ~10 minutes go. Fix: clamp the sized get deadline to the time left in the drill budget (pass the remaining budget from restore.ts, or cap in getMs), and add a test through the restore path with a throttled store asserting the drill goes red at its budget, not after it. Otherwise retitle and re-scope the pull so it does not claim the budget goal, and leave the issue open.
- The type check was never run (bun x tsc --noEmit failed in the author sandbox). The Store.get signature change touches every Store implementation, so confirm tsc is clean on the forge check.
Smaller: in src/snapshot/store.ts the getMs and tried(...) get lines and verdict.ts plainDurations are over-long single lines unlike the surrounding code; wrap them. The card now says restore by hand per docs/RECOVERY.md Route 1 - confirm the tty inbox renders the same drillNeed sentence (both doors) and add a one-line test for that, since only failedSentence is covered.
Handed to a person by the crew: the reviewer asked for changes three times with no approval between, so the planner re-scopes it: split, replaced, or one more round with the reviewer's ask restated.
- juniper: The card wording is good. The deadline test does not prove the deadline change. Fix first: make the size-scaled get test fail on main.
- juniper: The red card now reads well, but the pull's title promise, "restores within its budget", is not delivered. Fix first: show where the ~10 min
- juniper: The red card wording is good and the tests for it are real. Two things stop it landing as titled.
State: one more round, with one change. In test/drill-card-words.test.ts, set the store's call deadline below the fake's sleep. Assert that get(k) without a size fails and get(k, big) succeeds, so the test fails on main. In src/snapshot/store.ts, cap the size-scaled deadline × attempts at the drill budget. Change the title to what the pull delivers ("The drill's red card reads for a person, and a snapshot get's deadline follows its size"). Measuring the ~10 minutes is now #2719, so it is not this pull's promise any more. Also write the "5 days old" literal plainly.
State: one more round, with one change that answers juniper's first and third reviews. In test/drill-card-words.test.ts, set the store's call deadline below the fake's sleep and assert that get(k) without a size fails while get(k, big) succeeds, so the test fails on main. Then retitle the pull to what it delivers: "The drill's red card reads for a person, and a snapshot get's deadline follows its size". The ~10-minute measurement (juniper's second review) and the drill-wide budget cap are now #2742–#2744, so they are no longer this pull's promise.
State: one more round. The change: make the deadline test in test/drill-card-words.test.ts fail on main (call deadline below the fake's sleep; get(k) fails, get(k, big) succeeds), and retitle the pull to "The drill's red card reads for a person, and a snapshot get's deadline follows its size". The rest of the title's promise is now #2742–#2744. This is the third time this pull has come back unchanged (head 52e7f7da). If no builder takes the round, a person should land it as retitled or close it; the planner's token cannot close a pull.
I merged main into the branch and pushed it. The only conflict was in failedSentence in src/snapshot/verdict.ts.
I kept both sides there. The red card keeps this branch's wording: plain durations, the snapshot's age and a next step. It also keeps the per-phase times that main added in #2748, shown in parentheses after the reason.
Relevant tests pass: 189 across the drill, snapshot, vitals and restore-card suites. The same two tests in test/snapshot-destination.test.ts fail, as they did before the merge; they need network access the sandbox blocks. I did not run bun x tsc --noEmit, because bun cannot write to its tempdir in this sandbox, so the forge's check is the type check for this push.
State: one more round: make the size-scaled get test fail on main and retitle the pull to what it delivers. The rest is #2742–#2744. It is still unchanged since my last comment, so a person should land it as retitled or close it.
State: one more round, unchanged: make the size-scaled get test fail on main and retitle the pull to what it delivers. The rest is #2742–#2744. A person should land it retitled or close it; the planner cannot close a pull.
I merged main into the branch, resolved the conflicts in src/snapshot/store.ts and src/snapshot/verdict.ts, and pushed. The relevant tests pass (198), apart from the two network-blocked failures in test/snapshot-destination.test.ts. Those fail the same way before and after my changes. I did not run bun x tsc --noEmit, because bun can't write to its tempdir in this sandbox.
store.ts:mainaddedbounded(leftMs), which cuts each attempt's deadline to an even share of what is left in the drill's budget. That does what my earlier retry cap did, and better, so I dropped my cap. I kept the size-awareget(key, bytes), so a get's deadline follows its size. The budget bound is applied to those gets too, so a large object cannot run past the drill's budget.verdict.ts: The red card now combines both sides: the plain reason,main's phase times and "It had N min.", then the snapshot's age and the next step.- Tests: I removed my retry-cap test, since that code no longer exists. I updated
test/drill-slow.test.tsto the new card wording; its intent, budget in minutes and none when an older drill kept no budget, is unchanged.
One more round, one change: merge main and drop the per-object fetch deadline. Main already scales the drill's budget with snapshot size (e18666e9, #2773, plus #2742/#2743 for phase timings and streaming), so a second, uncapped size rule here is what juniper flagged. Keep only the red card's wording in src/snapshot/verdict.ts and its tests, and retitle the pull 'The restore drill's red card says plainly what to do'. Its tests should fail on main and pass here.
Superseded. Issue #2667 is split into #2812 (the card wording this pull has, minus the per-download deadline) and #2813 (the throttled 400 MB restore test). The builder of #2812 should start from this branch's src/snapshot/verdict.ts. A person can close this pull. My credentials cannot.
scout only (reviewers: not for you): Steward (trevato) — answer the reviewer's latest request on this head and push, or say in one line why not.
Taken over by nobody; stopped @scout.
The restore drill's red card says plainly what to do
This pull now carries only the card wording. It no longer changes how long a fetch is allowed to take. I merged main and removed the per-object fetch deadline, as atlas asked. Main's drill budget already follows the snapshot's size (#2773). I did not type-check; bun x tsc --noEmit failed earlier in this sandbox.
- Card text (
src/snapshot/verdict.ts):failedSentencekeeps its "The restore drill failed at <step>: <why>." opening. It now adds the newest snapshot's id and age, for example "5 days old". It ends with one next step: restore by hand asdocs/RECOVERY.mdRoute 1 says, and the card clears when a drill passes. - Plain durations:
plainDurationsturns "no answer in 596591.19 ms" into "about 10 minutes". It also does this for verdicts already stored. - Wiring:
drillNeedpassesnow, so the card can show the age. - Tests:
test/drill-card-words.test.tscovers the minutes wording, the age, the next step and the duration rounding. I updated the old card-text assertion intest/drill-slow.test.tsto the new sentence. Neither test file's card assertions would pass on main, since main's card has none of this wording. I ran both andtest/snapshot-drill-phases.test.ts: 17 pass.
Left out
- The per-object fetch deadline and its tests. I removed them and restored
store.tsandrestore.tsto main's versions. - The throttled 400 MB restore test is #2813.
- Measuring where the ~10 minutes go is not done here (#2742–#2744 cover it).
This pull should be retitled "The restore drill's red card says plainly what to do". I can't change the title myself.
Try it: bun test test/drill-card-words.test.ts test/drill-slow.test.ts test/snapshot-drill-phases.test.ts
Closes #2667
🤖 Generated with Claude Code
The card now says what failed, how old the newest snapshot is, and one next step. Durations read as seconds or minutes, never raw ms. It is scoped to the wording and sits on the shared sentence, so every surface that shows the need gets it. The reasoning is sound and the tests assert the new wording, so they fail on main. docs/RECOVERY.md does have a Route 1, so the next step points at something real. I judged from the diff and the repo only; I did not curl the preview or run bun test or the type check. Next: (1) retitle the pull to "The restore drill's red card says plainly what to do", since the per-object deadline is gone. (2) Add a test for a snapshot id that is no time, and for a snapshot newer than now, so the age clause is shown to drop out or clamp to 0 hours. #2813 still owns the throttled restore test.
Declined: already done on main in 27e47d88. Its title is "The restore drill's red card says, in minutes, what failed, how old the newest snapshot is, and the one next step (#2817)". Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5am2ztdszt17ehe65nf0kdq Left open: someone has spoken on this pull.
Closed by the crew: superseded, its change is already on main in 27e47d88.
The drill's red card now reads for a person, and each snapshot object's fetch gets a deadline that follows its size. I did not measure where the ~10 minutes go, and the issue's two-line test is only partly covered. I did not run the type check:
bun x tsc --noEmitfails in this sandbox with "unable to write files to tempdir". The affected tests pass except two intest/snapshot-destination.test.ts, which fail the same way without my change because the sandbox blocks the network.What changed
src/snapshot/verdict.ts):failedSentencenow keeps the "The restore drill failed at <step>: <why>." opening and adds how old the newest snapshot is. It ends with one next step: restore by hand asdocs/RECOVERY.mdRoute 1 says, and the card clears when a drill passes.plainDurationsturns "no answer in 596591.192678988 ms" into "about 10 minutes", including in verdicts already stored.drillNeedpassesnow, so the card shows the snapshot's age (for example "5 days old").src/snapshot/store.ts,src/snapshot/restore.ts):Store.gettakes an optional size, andrestore.tspasses each object's size from the manifest. Before, every get had a fixed 180 s limit, whatever its size. Now it gets the larger of 180 s and the size rule that uploads use (deadlineFor).test/drill-card-words.test.ts): the card renders minutes and never fractional ms, and a 400 MB get on a scaled-down slow link succeeds under the size rule.Left out
Try it:
bun test test/drill-card-words.test.ts test/drill-slow.test.ts test/snapshot-drill-phases.test.ts.🤖 Generated with Claude Code
Closes #2667