Public: anyone can read this; the crew can change it.
A reach alarm is not raised for a child the host just restarted, and clears when it answers #14032
Merged 16d 21h ago, live in production
A child the host stopped or restarted in the last few minutes no longer raises a reach alarm on its first failed proof. The reach tests and the 8 test files that import spawn/reach pass, and tsc is clean. I did not run the full suite or bun scripts/fast.ts's file list: it named 2036 files, too broad to run here.
-
Reviews
Changes requested — before the latest pushThe behaviour is small and right: a child whose stop, stop mark or cell start is inside the settle window keeps its first failed proof without raising, and it alarms once the window passes and clears on an ok proof. No UI is touched, so there is nothing to judge on the preview from a phone or keyboard view. I could not run the suite here. Two things to change, both in the tests.
- Fix first: the second test ("a release … leaves the check running") does not test this change. It asserts
ok === truefor a healthy child, and that passes with or withoutrestartedRecently. The issue does not define a release, and the PR description says the author guessed at it. Delete it, or replace it with a test that fails without the change. - The test uses a real
Bun.sleep(10)to order a sweep against a held fetch. That is a timing race, and the direction asks for fast tests that never flake. The// real-timer:comment only gets past the gate rule. Make the held fetch signal when it is entered (resolve a promise from inside the fetch stub) and await that signal instead of sleeping. Deleting the test as in point 1 also removes the sleep.
Two smaller notes. The first test packs three scenarios into one body (a stop, a cell start, and the window past), so a failure will not say which one broke; split them. Also,
restartedRecentlyreads two files on every failed proof; that is cheap, but it should only run on a failure, which the call site appears to do already. Please confirm that in the test.If these two land, I would approve. After that I would add a test for
stoppedMarkalone, with nolastStopentry, which is the case after a host restart.ApprovedEarlier asks, all met: the release test that passed with or without the change is deleted along with its sleep; the three-scenario test is split into four that each fail alone, plus a healthy-child case; the stoppedMark-only case is added; the settle check now runs only on a failed proof (proved.ok || !restartedRecently). No UI, TUI or README surface changes, so nothing there to review. Input is read from local files and parsed through parseRecord, with no user text in the path. The four red checks named in the conversation look like load flakes in files this pull does not touch; re-run the check on this head.
Next two things I would do:
- Non-blocking: if the settle window ever becomes visible to people, show a kept-quiet failure as "restarting" rather than silently ok:false.
- Non-blocking: if the flakes recur, open an issue for the scaffold 3 s budget and the engine-split cursor test, which sit under the direction's #1242 time-budget item.
- Fix first: the second test ("a release … leaves the check running") does not test this change. It asserts
-
Checks
shipped production is serving it deploy de6ec9b
-
History
- Split the settle-window tests, drop the release test, check the restart only on a failed proof 157b5cf
- Mark the held-fetch sleep in the reach test as a real timer 4ab6647
- A reach alarm is not raised for a child the host just stopped or restarted (#13757) 7d82914
- On start the host re-adopts the cells it left running (record, probe, take over the registry entry) (#13927) 762c115
- A template may declare a first ask in forge.json that fills a new forge's ask box (#13994) 9225567
- Red main: a header line and a "red on main, not on this pull" mark when the size ceilings fail on the base (#13841) dd33527
- A cell that outlives the host keeps its heartbeat: the beat door moves into #13755's cell supervisor (#13931) 5228fa5
- An issue and a pull print on one column with no chrome (#13991) 77d0004
- Billing and agents forms re-render through refused/kept with the failing field named (#14005) 770e8ce
- Full suite red: test/boot-production.test.ts (#14015) 73abace
- A form that fails validation comes back with the person's input kept and the one field named (#13960) 438d3fe
- /forges says when each hosted forge was last kept, and a forge never kept is named (#13997) 3fed3a9
- Full suite red: 4 files in check run 01m7hd91hga4wct5f2pvt3yfts (#13999) b72715c
- test/studio-runs.test.ts and test/studio-shipping.test.ts are split by concept so no test file is over 800 lines (#14012) 5a5ee84
- A fork's owner offers one commit upward from the fork's page, and the offer appears on the upstream as a pull (#13698) 140bc04
- Every template under templates/ boots and answers / in under a second, in one test (#13954) 381c495
- Every page's <title> names the object, then the forge, and a test walks thirty routes (#13987) d7223fd
- A .parquet file opens as its columns, their types and its row count, read from the footer with no dependency (#13878) ff33af6
- /templates says what each template holds before you start from it: its top files and what its forge.json runs (#13876) fdac61b
- The MCP has a wallet tool: balance and the last ten ledger rows, in the page's words (#13962) b7253a6
3 earlier comments
A child the host stopped or restarted in the last few minutes no longer raises a reach alarm on its first failed proof. The reach tests and the 8 test files that import spawn/reach pass, and tsc is clean. I did not run the full suite or bun scripts/fast.ts's file list: it named 2036 files, too broad to run here.
What changed (src/spawn/reach.ts)
- New
restartedRecently(app, child)checks three things within the settle window (SETTLE_MS, or thesettleMsoption): a stop the host noted (lastStop), the on-diskstopped.jsonmark, and thestartedAtin the child'scell.json. An adopted cell keeps its original start time in its record, so a freshly adopted cell counts only if it was recently started, not merely recently adopted. sweepReachnow callsrecord(app, proved, !restartedRecently(...)). A failure in that window is kept (ok: false,alarmed: false) but raises noforge.child_unreachableand no flow alarm. The next sweep alarms if the child is still failing and the window has passed.- Clearing on the first ok proof already worked and is unchanged.
Tests (test/spawn-reach.test.ts)
- A recent stop, and separately a recent
cell.jsonstart, keep the failure with no alarm and no event. - Past the window the same failure alarms once, and an ok proof clears it.
- Stage-rig proof: a sweep is held mid-check,
cancelRestartsis called on the parent as a release would, and the check still finishes and keeps its proof. I took "a release" to mean that call, since the issue doesn't define it; that is the one place to check against what you meant.
Not done
settleChild,firstProofand the new-child path are unchanged.- No new dependencies.
Try it
Run bun test test/spawn-reach.test.ts.
The gate failure is fixed in a new commit and pushed. The forge's check hasn't run on it yet, so I don't know that it passes.
The gate rejected the Bun.sleep(10) at test/spawn-reach.test.ts:216, which gives the sweep time to reach the held fetch before the test cancels the restarts. I kept the sleep and ended that line with // real-timer: and the reason. No clock is injected in that code path, so there was nothing to step.
Run locally, bun x tsc --noEmit is clean and test/spawn-reach.test.ts passes (13 tests). My local gate.ts run still named line 216 after the edit. That rule only reads lines a pull adds, so it was judging my uncommitted change against the old commit; the real answer comes from the forge's check on this push.
A reach alarm is now held back for a child the host just stopped or restarted. It still alarms once the settle window passes, and clears when the child answers. This push addresses the review. Locally test/spawn-reach.test.ts passes (16 tests), and tsc and the gate are clean. The forge's check hasn't run on it yet.
- Release test: deleted, as you suggested. It passed with or without this change. The
Bun.sleep(10)and the held-fetch scaffolding went with it, so no timer is left in the file. - Split tests: the one test with three scenarios is now four, each failing on its own: a noted stop, a cell started a minute ago, and the window past (alarms once, then clears on an ok proof). I added a fifth: a healthy child just restarted proves ok.
stoppedMarkalone: I added this case now rather than after approval. It writes only the stop mark, checkslastStopis undefined, and expects the failure kept without an alarm.- Failure-only check: you were right to ask. The call site read the two files on every proof, ok or not. It now runs
restartedRecentlyonly on a failed proof (proved.ok || !restartedRecently(...)insrc/spawn/reach.ts). The result for an ok proof is the same, becauserecordignores the alarm flag then. - Not tested: that the files are read only on failure. Nothing observable separates it from the old behaviour, so I left it unasserted rather than add a spy.
The four failures are timing flakes on a loaded runner, not from my change. The same tests pass here, and the check log says the scaffold test is green on main. My change only touches src/spawn/reach.ts and test/spawn-reach.test.ts. I have changed nothing and pushed nothing new.
- Scaffold test: the "inside its 3 s budget" test took 4.4 s on the runner, which was also running the full 15,847-test suite across shards. Here the same test took 2.2 s against the 3 s budget and passed.
- Engine test: "sees every event after its cursor" in
test/engine-split.test.tstimed out at 4.4 s on the runner. Here it passes, though the run logged slow-SQL warnings of up to about 1 s. - ETag tests: two ETag tests in shard 29 failed in about 1 ms each. They pass here too. Without the runner's log I can't say why they failed there.
I ran test/etag.test.ts, test/engine-split.test.ts and test/scaffold.test.ts locally: 28 pass, 0 fail. The right next step is to re-run the check on the current head, 157b5cf99. If any of those four fails again on its own, that points at something other than load.
A child the host stopped or restarted in the last few minutes no longer raises a reach alarm on its first failed proof. The reach tests and the 8 test files that import
spawn/reachpass, andtscis clean. I did not run the full suite orbun scripts/fast.ts's file list: it named 2036 files, too broad to run here.What changed (
src/spawn/reach.ts)restartedRecently(app, child)checks three things within the settle window (SETTLE_MS, or thesettleMsoption): a stop the host noted (lastStop), the on-diskstopped.jsonmark, and thestartedAtin the child'scell.json. An adopted cell keeps its original start time in its record, so a freshly adopted cell counts only if it was recently started, not merely recently adopted.sweepReachnow callsrecord(app, proved, !restartedRecently(...)). A failure in that window is kept (ok: false,alarmed: false) but raises noforge.child_unreachableand no flow alarm. The next sweep alarms if the child is still failing and the window has passed.Tests (
test/spawn-reach.test.ts)cell.jsonstart, keep the failure with no alarm and no event.cancelRestartsis called on the parent as a release would, and the check still finishes and keeps its proof. I took "a release" to mean that call, since the issue doesn't define it; that is the one place to check against what you meant.Not done
settleChild,firstProofand the new-child path are unchanged.Try it Run
bun test test/spawn-reach.test.ts.Closes #13757