Public: anyone can read this; the crew can change it.
The restore drill's result keeps how long the hosted forge took to restore, in whole seconds #14189
Merged 16d 21h ago, live in production
The restore drill's proof of a hosted forge now records how long that forge's restore and checks took, as ms. Drills saved before this change still read. src/snapshot/drillhosted.ts: HostedProof gains an optional ms.
-
Reviews
ApprovedMeets all three boxes: proveHosted times itself on an injectable monotonic clock and returns whole ms, the drill passes its own clock through and only falls back to outside timing when a stubbed prove gives none, and parseHosted drops a missing or malformed ms and still reads the rest. No page change, no new dependency, no README edit, and the preview is unaffected. Two things I would do next: (1) test runDrill itself with a fake clock so the proof.ms ?? fallback is pinned in both directions; drill-hosted-ms.test.ts passes on main already, since parseHosted read ms there, so only the proveHosted test guards this change. (2) Put proveHosted options on one line per field, since the new multi-line type is formatted unlike its neighbours, and show the time in seconds on the card in the next issue.
-
Checks
shipped production is serving it deploy de6ec9b
-
History
- Merge main: proveHosted times itself; the drill's own timing stays for a proof that did not 2d900ee
- The restore drill restores one hosted forge from its backup file and proves its database and repositories open (#14181) 430fbe2
- A forge link that is about to expire says so to its owner, and renews in one tap (#14175) 16f7213
- A session's list on the account page shows each signed-in browser with when it last acted, and signs one out in one tap (#14166) cbf5fa8
- A line sent from /talk that becomes work answers with a receipt: the issue number as a link (#13956) 5ac4f27
- A weekly duty lists branches with no open pull and no push for 14 days (#14164) 9d6a06e
- /llms.txt names the OpenAPI description's address and the MCP endpoint in its first five lines (#14151) 2ed525d
- A .ics calendar file opens as a dated list of events with title, start, end and place (#14170) fd2f82a
- /talk keeps an unsent line across a reload and clears it once sent (#14152) c00b436
- A person who claimed with a passkey and loses the device has a way back in (#13803) 5a1d7a4
- A /talk line that starts with a slash runs a short command: /issue, /pull, /wallet (#13982) d226509
- A weekly maintenance duty lists the five slowest test files in the last check (#13980) ac3767e
- A .ics calendar file opens as a list of its events with date, title and place (#14145) d31e7ff
- A missing /assets/ file answers no-store, so the edge never keeps a 404 for a file the next release ships (#14033) 4495327
- The offline page and the waking page share one sentence and show when the forge will answer (#13022) 33b4937
- Automate a review finding as a lint or test: Fix first: item 1, the terminal door, then the tests in item 2. (#14041) e13f72d
- The explorer ranks forks of the same app under their parent instead of beside it (#14113) 6c288bf
- A signed-out visit to /feed shows what shipped on public apps, with the ask box behind sign-in (#13893) d40d05f
- The owner's home says how many days the included credit lasts at the current rate (#14110) 323fc94
- A .tsv file opens as a table the way .csv does (#14109) 751373a
The restore drill's proof of a hosted forge now records how long that forge's restore and checks took, as ms. Drills saved before this change still read.
src/snapshot/drill_hosted.ts:HostedProofgains an optionalms.proveHostedtakes a newticksclock option (it defaults toperformance.now). It reads the clock before the restore and after the lastgit fsck, and returns the difference rounded to whole milliseconds.src/snapshot/drill.ts:runDrillpasses its owntickclock asticks, so a drill run with a fake clock times the hosted forge with that clock too.src/snapshot/drills.ts:parseHostedreadsmsback only when it is a whole, non-negative safe integer. Otherwise it leavesmsout and still returns the rest of the proof. This field lives in the existing phases JSON, so there is no migration.
I stored whole milliseconds rather than the whole seconds the issue title mentions, because the issue's checklist asks for ms. The card can round to seconds when it shows the value. There is no page change; the card is the next issue.
Tests:
test/snapshot-hosted-chunks.test.ts: a new test callsproveHostedwith a fake clock that reads 1000 then 13,400.6, and expectsms: 12_401. The existing drill test that compares the whole proof now also expects an integerms.- New
test/drill-hosted-ms.test.ts: a stored row withmsreads it back. A stored row withoutmsparses with nomskey. Bad values (-1,1.5,"12",null,Number.MAX_VALUE) are dropped and the rest of the proof still reads.
Checks run: scripts/gate.ts --fix (its comment rewrap is in the commit), tsc --noEmit, and the drill, snapshot, admin-drill and MCP drill tests (165 tests across 25 files) all passed. scripts/fast.ts named 2,369 files, over its budget, so I picked those test files by hand rather than run the full suite.
🤖 Generated with Claude Code
proveHosted now times its own restore and proof and returns ms, in whole milliseconds. Drills saved before this change still read.
main had already added the same ms field in #14181, timed from outside by the drill. The merge keeps both:
src/snapshot/drill_hosted.ts:proveHostedtakes an injectable clock,ticks, which defaults toperformance.now. It reads it before the restore and after the lastgit fsck, and returns the difference rounded. Thems?: number | undefinedfield frommainstays, with one comment covering both ways it gets set.src/snapshot/drill.ts: the drill passes its own clock toproveHosted. It usesproof.ms ?? Math.round(tick() - from), so its own outside timing from #13919 now only fills in when the proof has no time, as with a stubbedprovein tests.src/snapshot/drills.ts:parseHostedreadsmsonly when it is a whole number of zero or more; otherwise it leaves it out and the rest still reads.main'sparseHostedSkippedis kept.
Tests:
test/snapshot-hosted-chunks.test.tscallsproveHostedwith a fake clock that reads 1000 then 13,400.6 and expectsms: 12_401.main's assertions on the drill's wording and the skipped hosted step are kept.test/drill-hosted-ms.test.tschecks that a stored drill withmsreads it back, and one without it still parses. Bad values (-1,1.5,"12",null,Number.MAX_VALUE) are dropped and the rest of the proof still reads.
There is no page change; the card is the next issue.
scripts/gate.ts --fix and tsc --noEmit are clean. The drill, snapshot and hosted-forge test files, including the ones main changed, pass: 168 tests in 25 files. scripts/fast.ts named 2,369 files, over its time limit, so I chose those test files by hand.
🤖 Generated with Claude Code
The restore drill's proof of a hosted forge now records how long that forge's restore and checks took, as
ms. Drills saved before this change still read.src/snapshot/drill_hosted.ts:HostedProofgains an optionalms.proveHostedtakes a newticksclock option (it defaults toperformance.now). It reads the clock before the restore and after the lastgit fsck, and returns the difference rounded to whole milliseconds.src/snapshot/drill.ts:runDrillpasses its owntickclock asticks, so a drill run with a fake clock times the hosted forge with that clock too.src/snapshot/drills.ts:parseHostedreadsmsback only when it is a whole, non-negative safe integer. Otherwise it leavesmsout and still returns the rest of the proof. This field lives in the existing phases JSON, so there is no migration.I stored whole milliseconds rather than the whole seconds the issue title mentions, because the issue's checklist asks for
ms. The card can round to seconds when it shows the value. There is no page change; the card is the next issue.Tests:
test/snapshot-hosted-chunks.test.ts: a new test callsproveHostedwith a fake clock that reads 1000 then 13,400.6, and expectsms: 12_401. The existing drill test that compares the whole proof now also expects an integerms.test/drill-hosted-ms.test.ts: a stored row withmsreads it back. A stored row withoutmsparses with nomskey. Bad values (-1,1.5,"12",null,Number.MAX_VALUE) are dropped and the rest of the proof still reads.Checks run:
scripts/gate.ts --fix(its comment rewrap is in the commit),tsc --noEmit, and the drill, snapshot, admin-drill and MCP drill tests (165 tests across 25 files) all passed.scripts/fast.tsnamed 2,369 files, over its budget, so I picked those test files by hand rather than run the full suite.🤖 Generated with Claude Code
Closes #14184