Repository navigation
Description
Context
Ready-candidate run 41622134234, job 125870809756 for PR #3456 (merge ref dd4eec8919eafa9ca6881daf6a4e1b30b3bd36bc = base d38eb1eb5b3a9b1f3228d8e317990dc14471be08 + head 3cbdf5a3e93e32f272ef19e9d371f57ded957240) failed runtime_host. The native hosted Claude UID-1000 cell failed its queued-refresh drain (const failed, scripts/native-proof/hosted-app.test.ts:404-405):
NATIVE_AUTOMATIC_INDEX_COMPLETED: WorkerStateError: Maintenance temporary storage is busy: this command needs 256 MiB, 1 maintenance reservations hold 256 MiB of the separate 256 MiB budget. Nothing ran.
That PR changes no file under packages/ui-sdk, packages/ui-server/src/brain or scripts/native-proof. It changes only a ui.db write on session creation. Main's runtime_host passed on the same base and on later main commits (runs 41613050490, 41609299806, 41617586180).
What the retained artifact shows (runtime-host-proof, run-claude-uid1000-2CXSm0/run/)
events.jsonl (wall-clock ms):
| wallAt | event |
|---|---|
| …999220 | worker_exit attempt 1 |
| …999276 | automatic_index_started ordinal 1 |
| …000393 | automatic_index_failed ordinal 1: maintenance-busy, as above |
| …000476 | fake_provider_enter attempt 2 |
| …000740 | automatic_index_started ordinal 2 |
| …001193 | backend_log warn: worker scratch area is read-only this turn: .brain/scratch/ could not be checked (Maintenance temporary storage is busy …) |
| …001201 | fake_provider_enter attempt 3 |
| …012462 | automatic_index_failed ordinal 2: Server shutting down |
In native-operations.jsonl, the checkpoint release before the index's admission ran subvolume sync /brain-fixture 263 for 1006 ms (…999278 → …000284), and a concurrent filesystem sync ended with code 137. Every other subvolume sync in this run took under 5 ms. In all five cells of passing main run 41617586180, the first subvolume sync after automatic_index_started ordinal 1 took 1.4–1.7 ms. (Two of main's Pi cells had ~30 s syncs later in the run, so a long sync on its own is not unusual; its position ahead of the index's admission is what differs here.)
The two consumers of one 256 MiB budget
- The automatic index admits only after it has prepared its native input (
view = await prepareInput(...),packages/ui-server/src/brain/host-boundary.ts:717, thenworker = await launchMaintenanceWorkerAsync,packages/ui-server/src/brain/host-boundary.ts:727, which reserves atfunction* launchMaintenanceWorkerSteps,packages/ui-sdk/src/server/maintenance-worker.ts:261-263). - Every turn's scratch-mask query is also a maintenance worker (
const result = await runMaintenanceWorker,packages/ui-server/src/brain/scratch-mask-query.ts:37-39). Its comment says it "serializes with its existing owner". - Admission is immediate and refusing, with no queue (
export function reserveMaintenanceTemp,packages/ui-sdk/src/server/maintenance-temp-budget.ts:163-181). With a 256 MiB allowance in a 256 MiB budget, the two commands cannot overlap; whichever admits second is refused.
Passing main hits the same race in the other direction. In run 41617586180, all five cells (Claude UID 0/1000, Pi UID 0 ×2, Pi UID 1000) log the same scratch-area could not be checked (Maintenance temporary storage is busy …) warning on attempts 2 and 3. There the index admitted first and the turn's scratch check lost, which the proof tolerates. In the failing run, the 1006 ms checkpoint sync delayed the index's admission past attempt 2's scratch query, so the index lost, and the drain treats that as fatal.
The ledger does not record which command held the reservation. Attempt 2's scratch query is the only maintenance consumer this run's evidence places in that window, and the opposite collision is visible on every passing run. That is an inference, not a captured owner.
Distinct from open #3019 (root createFixtureTurnHost fixtures on the per-UID fallback ledger) and open #2921 (NativeBrainManagerError / AbortError index aborts). Related closed #1967 (checkpoint release sync aborting index completion).
Out of scope
- Raising the budget or allowance, or giving either consumer a separate budget, without a maintainer ruling.
- Retrying or rerunning the proof into green, or weakening the queued-refresh drain or the scratch-area assertions.
- Releasing or deleting another process's reservation.
- Changing CONTRACT: feat(ui-server): bind typed chats to their creating owner so the owner can delete them #3456 or ui-server: decide owner bindings so typed-only chats can be deleted #3337's behaviour.
Scope
Decide how the automatic index and the per-turn scratch-mask query should share maintenance admission. Options include: the index waits or queues for admission rather than refusing; the scratch query yields to a pending index; a refused automatic index is requeued as pending work rather than recorded as a failure. Then implement the chosen correction. Record the reservation owner kind in the busy diagnostic so the next occurrence is attributable.
Acceptance criteria
- A deterministic keyless test holds a live scratch-query-shaped maintenance reservation while an automatic index reaches admission. Before the fix it reproduces
automatic_index_failedwith the maintenance-busy message; after the fix the index completes, or stays pending and later completes, with production budgets unchanged. A mutation that removes the correction fails the test on the named assertion. - The opposite order (index holds, a turn's scratch check arrives) keeps its documented outcome, or changes it only under the ruling.
- The maintenance-busy diagnostic names the holder kind (for example index, scratch query, git, sync) without paths or identities.
- The native hosted proof's queued-refresh drain passes with the existing assertions unchanged.
Verification
Use the retained artifact of run 41622134234 (runtime-host-proof) and the passing main control 41617586180 as the starting evidence. Run the new unit/integration test failing-first and with a mutation, then bun run check:pr --base origin/main. Hosted runtime_host is the native receipt.
Contract impact
None expected for admission semantics. A changed diagnostic string, or a changed automatic-index status that consumers can see, needs its own assessment against docs/integration-contract.md.
Activity
schlessera commentedon Nov 3, 2026
Decision (maintainer, 2026-11-03): requeue a refused automatic index.
automatic_index_failed.Assess any status a consumer can see against the integration contract, and use
CONTRACT:if it changes.schlessera commentedon Nov 3, 2026
Claiming (token
wi-3461-0778), branchfix/maintenance-admission-requeuefromorigin/maind990c0ab3. Implementing the 2026-11-03 ruling: a refused automatic index is requeued as pending and retried when the budget frees; the busy diagnostic names the holder kind. Path collisions onpackages/ui-server/src/brain/host-boundary.tswith open #3393, #3443, #3448; closure-only overlap with several others.schlessera commentedon Nov 3, 2026
Another occurrence, on ready-candidate run 41625377355, job 125881852728 for landing PR #3443 (merge ref = base
d990c0ab3418e4446c76e8c3c1f08c2c91c41740+ headf3b97e31d9275963a0a0c27173224b646d8a5c40). The native hosted Claude UID-1000 cell failed the queued-refresh drain with the sameNATIVE_AUTOMATIC_INDEX_COMPLETED: WorkerStateError: Maintenance temporary storage is busy: this command needs 256 MiB, 1 maintenance reservations hold 256 MiB of the separate 256 MiB budget.The retained
runtime-host-proofartifact (run-claude-uid1000-6WymmA/run/) has the same sequence this issue describes:worker_exitattempt 1automatic_index_startedordinal 1subvolume sync /brain-fixture 263, 1007.7 ms; a concurrentfilesystem syncends with code 137automatic_index_failedordinal 1: maintenance-busyautomatic_index_startedordinal 2backend_logwarn: scratch areacould not be checked (Maintenance temporary storage is busy …)automatic_index_failedordinal 2:Server shutting downEvery other
subvolume syncin the run took 1.2–2.9 ms. The batch (#3282, #3335, #3394) touches the turn path. #3335 refuses unmanaged governed and strict turn views (assertManagedTurnStartupView), and #3394 tags egress-proxy operations by relay. Neither adds, moves or holds a maintenance reservation, and neither touchesmaintenance-temp-budget.ts,maintenance-worker.ts,scratch-mask-query.tsor the automatic index. Per the strict-flake rule this is not being rerun into green. The landing of #2745, #3314 and #3246 now waits on this fix, so this issue is raised topriority: p0to match #2745 (a blocker carries at least the priority of what it blocks).schlessera commentedon Nov 3, 2026
Implemented in draft #3467 (head
89bb5dd22), per the 2026-11-03 ruling. A refused automatic index stays pending insidebrainClient.indexand runs once the budget frees. The busy refusal names holder kinds. Turn behaviour, a requested index and production budgets are unchanged, and there is no contract change (assessment in the PR). Local receipts: failing-first, requeue and diagnostic mutations, opposite order, andcheck:prpassing. Remaining: hosted ready-candidate confirmation, including nativeruntime_host.