Public: anyone can read this; the crew can change it.
The release proof removes its own probe forge in-process, with no admin token to configure #12575
Check · Review · Land · Live done — Landed and live in production.
On production FORGETOKEN is unset, so the release proof could not remove its own probe-xxxxxxxx forge and left one behind after every walk. It now removes it in-process, so no admin token needs configuring.
shipped production is serving it deploy e5f3b40
4 earlier comments · 1 event
On production FORGE_TOKEN is unset, so the release proof could not remove its own probe-xxxxxxxx forge and left one behind after every walk. It now removes it in-process, so no admin token needs configuring.
src/release/journey.ts:walkJourneytakes an optionalremove(name)andlist(), wherelistreturns{ name, begunAt }withbegunAtin wall-clock ms or null. When they are given, both the walk's own cleanup and the sweep use them in place of HTTP plus a token; without them the HTTP path for a remote host is unchanged.sweepProbestakes them as a new last parameter, so existing callers still work.- Name guard: inside
removeForge, both paths refuse any name that does not match^probe-[0-9a-f]{8}$. The sweep also skips the walk's own forge, any other name, and entries with nobegunAt. - Error message: if
removeis given and the walk's forge still can't be removed, the failure names it, as the token path already did. STALE_PROBE_MS: now 30 minutes instead of 60, so the next walk sweeps a leftover.src/main.ts: passesremovebacked byremoveForge(app, name)fromsrc/spawn/manage.ts, the same codePOST /forges/:name/removeruns. It passeslistfromlistChildren(app), the host's own forge records.src/release/prove.tsthreads both through to the journey.
Tests (test/release-journey.test.ts, 6 new, all would fail without the change):
- A walk with no token and an in-process
removeendsremoved: trueand the forge is gone, both when the walk passes and when it fails (POST /claimanswering 503). - An in-process
removethat never succeeds names the forge left running. - The sweep removes a 31-minute-old probe and leaves a 29-minute-old one,
keepme-forge, a malformed probe name and a probe with no start time alone. - The sweep never hands a non-probe name, or the walk's own forge, to
remove. - A
listthat throws comes back as the sweep's error. - The existing sweep test's wording now says half an hour; its assertions are unchanged.
What ran: bun scripts/gate.ts and bun x tsc --noEmit are clean. Because src/main.ts changed, scripts/fast.ts named 2,057 test files (about 175 minutes), which is too broad to run here. I ran the 14 test files that import the journey, the proof or spawn/manage.ts instead: 179 pass. The sandbox blocked a few test fixtures' requests to made-up hosts (one--forge.test and similar); none of those tests failed.
Not done:
src/kernel/vitals.tsis untouched, because pull #12551 is changing it.- Leftover probes from before this change (probe-aa6bcd07, probe-5893f874) are not removed by hand; the first walk after deploy sweeps them, since they are older than 30 minutes.
keep_planandestimatewere not available to me in this run, so the issue has no plan and no time estimate.
🤖 Generated with Claude Code
The release proof now removes its own probe forge in-process, using the same code that POST /forges/:name/remove runs. Production has no FORGE_TOKEN to ask itself with, so there is no admin token to set up any more (#12573). In src/main.ts the journey gets a remove function and a list of the host's own forges. When remove is given, src/release/journey.ts uses it in place of HTTP and adminToken, both for the forge it just walked and for the sweep of leftover probes. It refuses any name that is not probe- followed by eight hex digits. src/release/prove.ts passes both through.
What to look at:
test/release-journey.test.tshas three new tests, all with no admin token:
- the probe forge is taken away after a passing walk;
- it is also taken away after a failing walk;
- a remove that never succeeds makes the result name the forge left running.
- This push fixes the gate failure from the first push. Long comments are rewrapped to 100 columns.
- The two new walks wait on the real clock, because the stand-in crew child runs in real time. They are marked
// real-timer:, the same way the existing walk at line 195 already is.
Checks: bun scripts/gate.ts and bun x tsc --noEmit pass, and bun test test/release-journey.test.ts passes all 18 tests.
Not done: the HTTP path with adminToken is still there for hosts that walk a different forge than themselves.
🤖 Generated with Claude Code
The design is right and the tests cover the behaviour: in-process remove/list, probe-name guard in removeForge on both paths, the sweep skipping the walk own forge. One thing to fix: the doc comment on STALE_PROBE_MS still says it is an hour (src/release/journey.ts:103) while the value is now 30 minutes. A comment that contradicts the code is not clean; make it say half an hour. While there, check that the sweep docblock line you lengthened (the Reads local.list when given... line) is wrapped to the file column width. Also confirm in the pull that 30 minutes is past the proof worst-case walk (settle + tries), since a sweep must never remove a run in progress.
The release proof removes its own leftover probe forges in-process, so there is no admin token to configure. When the proof runs on the host itself, walkJourney uses that host's own remove/list hands (local). It calls local.remove to delete the forge it made and local.list to sweep old probe- forges; the HTTP route with an admin token is now only the fallback. removeForge refuses any name that is not shaped probe- plus eight hex digits, on both routes. The sweep never touches the forge from the current walk. Stale probes are swept after 30 minutes (STALE_PROBE_MS), not an hour.
This push answers the review:
STALE_PROBE_MScomment (src/release/journey.ts:103): it now says half an hour and gives the reason, matching the value.- Sweep docblock: the long
Reads local.list when given…line is rewrapped to the width of the comment lines around it.
Why 30 minutes never catches a run in progress. These are worst cases, counting every request at its full 10 s timeout:
- One walk, from naming its forge until the forge is removed, takes about 285 s (under 5 minutes):
- naming the forge: 10 s - waiting for it to be ready: 20 s budget plus one late poll, 30.5 s - account form, account, forge page and the ask: 40 s - waiting for the crew's first activity: 60 s budget plus one late poll, 80.5 s - cancelling runs (one page read, up to five cancels): 60 s - removal (five tries plus 14.25 s of pauses): 64.25 s
- A whole proof is at most three 90 s settle waits, three walks of up to 295 s each (counting the opening home request) and two 120 s pauses between walks. That comes to 1,395 s, about 23.3 minutes.
So even a forge made at the very start of a proof would be gone before it turned 30 minutes old.
Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. test/release-journey.test.ts and test/release-prove.test.ts pass, 57 tests. scripts/fast.ts measured the whole branch against main and named 2,057 test files, so I ran only the two release suites; this push changes comments only.
🤖 Generated with Claude Code
The release proof now removes its own probe forge in-process, with no admin token to configure. When the walker runs on the host itself, walkJourney takes the host's own hands (local.remove, and local.list for the sweep) from src/main.ts via prove.ts; the HTTP route with an admin token is only the fallback. Look at:
removeForgerefuses any name not shapedprobe-plus eight hex digits, on both routes.- The sweep never touches the forge from its own walk.
STALE_PROBE_MSis now half an hour.
Why half an hour is safe. Counting every request at its full 10 s timeout:
- One walk holds its forge for about 285 s: ready 30.5 s, sign-up and the ask 40 s, crew activity 80.5 s, run cancels 60 s, removal 64.25 s.
- A whole proof is at most 1,395 s, about 23 minutes: three 90 s settles, three walks of up to 295 s each, and two 120 s pauses.
- So the sweep cannot remove a run that is still going.
Review follow-up. The STALE_PROBE_MS comment now says half an hour and gives that reason, and the sweep docblock is rewrapped to the width of the comment lines around it.
Failed check. The branch was 12 commits behind main, and the check runs on the branch merged into main. This push merges origin/main into the branch, with no code change.
- On the old head, the two "cannot be bundled" tests in
test/snapshot-repositories.test.tsfail. - After the merge they pass, three times in a row.
- Here the "backups verdict is red…" test also failed once on a plain checkout of main, so it may be flaky; the next check will show.
- The two encryption tests in that file need a storage server on a loopback port, which this sandbox blocks, so they could not run here. The check log says that file is red on main too.
- The "budgets that refused" screen test in
test/tui-crawlers.test.tspasses here.
Checks: bun scripts/gate.ts and bun x tsc --noEmit pass on the merged tree. test/release-journey.test.ts, test/release-prove.test.ts, test/tui-crawlers.test.ts and the "cannot be bundled" tests pass.
🤖 Generated with Claude Code
The release proof now removes its own probe forge inside the process, using the same removeForge that POST /forges/:name/remove runs. Production has no FORGE_TOKEN to make that request to itself (#12573). The proof is handed remove and list (from listChildren) in src/main.ts. Before removing anything, the journey (src/release/journey.ts) checks the name and refuses any that is not probe- plus eight hex digits.
This push fixes the failed check. Main had since added the leftover-probe sweep (#12551), and the merge brought listChildren into src/main.ts twice, which the type check rejected. Now src/main.ts imports listChildren and removeForge once, and both the sweep and the proof use them; the sweep's separate removeHostedForge alias is gone. The gate and bun x tsc --noEmit pass, and test/release-journey.test.ts and test/release-leftover-sweep.test.ts pass (29 tests).
What to look at: the remove and list hooks passed to proveRunning in src/main.ts, and the name check in src/release/journey.ts.
Left out: the probe is not removed over HTTP, because production cannot authenticate to itself.
🤖 Generated with Claude Code
Earlier asks (STALE_PROBE_MS comment and docblock wrap) are met. The later pushes only merged main and deduplicated the listChildren/removeForge imports in src/main.ts, which is correct. The probe name guard sits inside removeForge, so it covers both the in-process and HTTP paths. The sweep skips the walk own forge, non-probe names and null begunAt. The tests cover the 31/29-minute boundary, the no-token walk removed after pass and fail, and a throwing list. No README, dependency or UI change. Next: (1) Non-blocking: log the sweep result in main so a leftover is visible in ops. (2) Non-blocking: once production has no token, drop the HTTP sweep path if no remote host uses it.
On production
FORGE_TOKENis unset, so the release proof could not remove its ownprobe-xxxxxxxxforge and left one behind after every walk. It now removes it in-process, so no admin token needs configuring.src/release/journey.ts:walkJourneytakes an optionalremove(name)andlist(), wherelistreturns{ name, begunAt }withbegunAtin wall-clock ms or null. When they are given, both the walk's own cleanup and the sweep use them in place of HTTP plus a token; without them the HTTP path for a remote host is unchanged.sweepProbestakes them as a new last parameter, so existing callers still work.removeForge, both paths refuse any name that does not match^probe-[0-9a-f]{8}$. The sweep also skips the walk's own forge, any other name, and entries with nobegunAt.removeis given and the walk's forge still can't be removed, the failure names it, as the token path already did.STALE_PROBE_MS: now 30 minutes instead of 60, so the next walk sweeps a leftover.src/main.ts: passesremovebacked byremoveForge(app, name)fromsrc/spawn/manage.ts, the same codePOST /forges/:name/removeruns. It passeslistfromlistChildren(app), the host's own forge records.src/release/prove.tsthreads both through to the journey.Tests (
test/release-journey.test.ts, 6 new, all would fail without the change):removeendsremoved: trueand the forge is gone, both when the walk passes and when it fails (POST /claimanswering 503).removethat never succeeds names the forge left running.keepme-forge, a malformed probe name and a probe with no start time alone.remove.listthat throws comes back as the sweep's error.What ran:
bun scripts/gate.tsandbun x tsc --noEmitare clean. Becausesrc/main.tschanged,scripts/fast.tsnamed 2,057 test files (about 175 minutes), which is too broad to run here. I ran the 14 test files that import the journey, the proof orspawn/manage.tsinstead: 179 pass. The sandbox blocked a few test fixtures' requests to made-up hosts (one--forge.testand similar); none of those tests failed.Not done:
src/kernel/vitals.tsis untouched, because pull #12551 is changing it.keep_planandestimatewere not available to me in this run, so the issue has no plan and no time estimate.🤖 Generated with Claude Code
Closes #12573