fix(runtime): recover the published startup diagnostic after the ready budget #7743
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7743"
general
weight: 0.35
JasonBuildAI
Goal and source
The
windows-powershelllane fails intermittently on operations that start theEffect runtime and wait for it to become ready. One retrievable run of that
lane (
1e3401591) failed withThat assertion is the whole subject of this PR: the runtime computed the exact
typed code, and the host reported a generic timeout instead.
The
S2/S12 startup diagnostic checkpoint
of 2026-10-04 established that a live mutation lock must fail with the exact
mutation_lock_timeoutcode, and explicitly did not qualify Windows.The gap
The TypeScript runtime publishes its typed startup envelope to stderr when it
gives up. Python reads that envelope only when
process.poll()shows the childhas already exited; otherwise it terminates the child at the ready budget and
reports the generic
runtime_startup_timeout.The envelope is published at the moment the child exits, so there is nothing
typed to read while the child is still running: at one second, three seconds
and five seconds the child is still running and stderr holds zero bytes, and
the envelope appears only once it exits, at about 5.8 s, together with exit
code 2.
runtime_startup_timeoutis produced whenever the parent does not observe thechild's exit inside the ready loop. The baseline reads the published envelope
only when a poll within that loop reports an exit; after the loop it polls
once more, but only to decide whether to terminate the child, and it then
always reports the generic timeout. The historical run therefore does not
distinguish two situations: the child had not published yet when the budget
expired, or the child had already published and exited and the parent had not
observed that exit before it left the loop. The same job's pytest step ran 439
cases in 5 min 31 s, and the chunk holding the failure took two minutes
against six seconds for the chunk before it, so the runner was heavily loaded —
a plausible contributor to a late publication, not a demonstrated cause.
The repair below covers both situations, so it does not depend on knowing which
one the recorded failure was.
The startup cost itself has ample headroom — measured on the Windows runner at
2f544f9692and on macOS atd3d9ad209d:| Host | Ready startup | Live-lock total | Diagnostic delivered |
| --- | --- | --- | --- |
| Windows (
nt) | 0.406 s | 5.813 s |mutation_lock_timeout|| macOS (
posix) | 0.170 s | 5.140 s |mutation_lock_timeout|STARTUP_READY_TIMEOUT_SECONDSis 15.0 and the TypeScriptMUTATION_LOCK_TIMEOUT_MSis 5,000. Neither budget is the constraint, andneither is widened here. The lock in this path is held by a live owner, so the
owner-liveness check behaves correctly for it and is not touched.
The repair
loopx/control_plane/effect_runtime.pynow gives a runtime that is stillrunning when the ready budget expires a bounded window in which it may publish
either its locator or its typed diagnostic. The host reads the published
envelope during that window and reports the exact code it carries.
The window is bounded by a budget the repository already owns rather than by a
new number:
STARTUP_DIAGNOSTIC_GRACE_SECONDSis one more ready budget, so asingle startup attempt waits at most twice
STARTUP_READY_TIMEOUT_SECONDS.When the window closes with nothing published, the runtime is terminated and
the generic
runtime_startup_timeoutis reported, so the wait stays bounded.A runtime that publishes its locator inside the window is now accepted instead
of terminated. Before the repair, a runtime that was merely slow was killed at
the ready budget; that outcome is unchanged in kind, only later in time.
Two consequences a reviewer should read as intended rather than as regressions:
exact
mutation_lock_timeoutis now told to repair or reinstall LoopX,where it was previously told that startup timed out, because
loopx/cli_commands/start_goal.pygivesruntime_startup_timeoutits ownremediation text and
mutation_lock_timeoutfalls through to the shareddefault.
instead of once, and
effect_runtime_requestretries a startup failure oncefor a retry-safe call. The retry policy is unchanged here. That is the wait
this startup path adds, not an absolute ceiling for the whole call: the
startup lock, the Node probe and the outer retry each carry their own cost.
Acceptance evidence
The repair is pinned by a test that reproduces the observed failure without a
Windows runner. With the ready budget shortened and a live mutation lock held
by the current process, the pre-repair host reports the generic timeout, and
the assertion is the one the Windows lane produced:
After the repair the same fixture delivers the exact
mutation_lock_timeout,the published envelope, and the preserved live lock.
A second test pins the other situation the historical record cannot separate:
an envelope the runtime published before the deadline, whose exit the parent's
poll missed, is still read — the parent polls once more after the loop, but
the baseline never reads the capture again. Both tests report the generic
timeout on the baseline.
A third test pins the bound: a runtime that publishes nothing is terminated and
still reports
runtime_startup_timeoutafter exactly one ready budget plus onegrace window.
Validation
The maintainability ratchet caught the first form of this change: the grace
window had pushed
_start_runtimepast the repository's decision-functionlimit. The window now lives in
_await_startup_publication, and the ratchetreports no oversized decision function.
Changed surfaces and boundary notes
loopx/control_plane/effect_runtime.py— runtime startup path. No publicprotocol, schema or state vocabulary changes; the diagnostic codes involved
(
runtime_startup_timeout,mutation_lock_timeout) already existed.tests/control_plane/test_effect_runtime_integration.py— the file theWindows lane runs explicitly, so both new tests run on that lane.
docs/architecture/rfcs/ledger/loopx-overall-roadmap-v0/2026-10-30-s2-s12-startup-diagnostic-grace.mdand its Chinese mirror, plus the derived status index.
No first screen changed: this is a runtime startup path, and there is no user
interface, screenshot or preview to show for it.
The measurement that motivated the repair is re-derivable rather than taken on
trust: the commit that produced the two figures is reachable as
codex/measurement-archiveon the fork, and it raises a deliberateAssertionErrorcarrying the measurement, because the Windows lane runs pytestwithout
-sand would otherwise capture the output.