Repository navigation
Description
Context
Tests whose fixture uses an in-memory database admit their maintenance commands through the per-user default ledger in /tmp, shared with every other process of the same user. When another process holds that 256 MiB budget, the fixture's command is refused and the test fails on whatever depended on it.
Cause, reproduced on demand on main 631bbae2c: receipt and commands.
- An in-memory
dbPathselects no admission domain (const tempDomain,packages/ui-server/src/brain/host-boundary.ts:370), so admission uses the per-UID fallback (const directory,packages/ui-sdk/src/server/maintenance-temp-budget.ts:32). createFixtureTurnHostpassesdbPath: ":memory:"(const execution,tests/fixtures/turn-host-fixture.ts:15).- A foreign holder,
sleep 86400 | bun packages/ui-server/tests/helpers/private-maintenance-test.ts --reserve, makes the unchangedtests/claude-worker.test.tsfail at its indexed-row assertion (r.indexed,:35) withMaintenance temporary storage is busy. With no holder it passes. CPU load is not needed. - test(root): test-health batch e3855-root-02 #3881 fixed one fixture this way: the policy-boundary probe's outer bubblewrap now has a private
/tmp(tests/policy-write-boundary.test.ts:26-29). Before it, the same holder failed eight of that file's cases; after it, none.
Exposed files. A run of 1,277 of the repository's 1,587 bun test files under the same live holder found seven (table and method):
| File | Cases that fail under the holder |
|---|---|
tests/claude-worker.test.ts |
indexed-row assertion |
packages/ui-server/tests/native-worker-startup-order.test.ts |
1 (scratch writable false), from #3010 |
packages/ui-server/tests/close-cancels-shared-runs.test.ts |
3 (timed out waiting for … started), from #2866 |
packages/ui-server/tests/cron-scratch-prune.test.ts |
3 |
packages/ui-server/tests/admission-sub-phases.test.ts |
1 |
packages/ui-sdk/tests/mask-scratch.test.ts |
1 |
packages/ui-backend-claude/tests/sdk-options-snapshot.test.ts |
1, seen once; probable |
packages/core and about 100 other files were not in that run.
Scope
- Give each of the seven files admission state the test owns, so a foreign holder of the default ledger cannot refuse its commands. Two existing means:
privateMaintenanceTest(packages/ui-server/tests/helpers/private-maintenance-test.ts:34), and a private/tmpfor an outer bubblewrap as in test(root): test-health batch e3855-root-02 #3881. - For
sdk-options-snapshot.test.ts, first confirm the exposure with the holder. If it does not fail in 10 runs, say so in the PR and leave the file alone. - In
close-cancels-shared-runs.test.ts, make the wait's failure report the response the request already returned (until,:69-74), so a refusal at admission is named and the test does not burn its full 15 s poll.
Out of scope
- Production admission and reservation lifetime, budget sizes, and the per-UID fallback.
- Deleting or releasing a foreign reservation; retries or sleeps to get green.
- Replacing the literal in-memory database in
createFixtureTurnHost, or adding a public or configuration seam for tests. - The indexed-document, policy, publication and cleanup assertions in these files.
- Files outside the seven. A new exposed file found later is a new issue.
Acceptance criteria
- Each listed file passes with the foreign holder live and unchanged for the whole run, and with no holder. The PR records both runs per file.
- For each isolation mechanism used, removing it from one file fails that file's named runtime assertion under the holder, and restoring it passes. The PR records the assertion.
- Two fixture processes cannot collide through a reused test identity. An intentional same-domain over-admission still refuses, with production defaults unchanged.
- Owned workers are joined and only owned reservations released, on success and on failure. The holder's reservation is still present after each run.
-
close-cancels-shared-runs.test.tsprints the request's response when its wait fails; shown once in the PR by running it under the holder before its isolation is added. - No file under
packages/*/srcchanges.
Verification
sleep 86400 | bun packages/ui-server/tests/helpers/private-maintenance-test.ts --reserve &
bun run test tests/claude-worker.test.ts
bun run test packages/ui-server/tests/native-worker-startup-order.test.ts packages/ui-server/tests/close-cancels-shared-runs.test.ts packages/ui-server/tests/cron-scratch-prune.test.ts packages/ui-server/tests/admission-sub-phases.test.ts
bun run test packages/ui-sdk/tests/mask-scratch.test.ts packages/ui-backend-claude/tests/sdk-options-snapshot.test.tsStop the holder by its PID afterwards. Several of these files need unprivileged user namespaces; a host that refuses them stops the case before its assertion, which is not a pass. Run bun run check:pr --base origin/main before marking the PR ready.
Contract impact
None. Test isolation through existing boundaries.
Triage 2026-11-14 at main c82e30ae4: rewrote the brief around the demonstrated cause and the seven exposed files, with per-file criteria. Added agent-ready. type: test, priority: p2 and no milestone are unchanged. #3010 and #2866 remain closed into this issue.
Earlier brief, receipts and triage history. The sections above replace it where they differ.
Context
During the complete unfiltered root suite for #2984 / draft #3008 at ab564787211ea88b095364326b7868b752709a2e (merged main b99489b3cbe27fa739fd4d19117cab2cc78f72f3), the ordinary real-Claude integration case failed at tests/claude-worker.test.ts:35: r.indexed was [], expected [{ path: "notes/worker-raft.md" }]. Policy bytes, the authoritative Markdown application and PNG mask application had already passed their preceding assertions.
The retained application event reports:
Maintenance temporary storage is busy: this command needs 256 MiB, 1 maintenance reservations hold 256 MiB of the separate 256 MiB budget. Nothing ran. Retry after a maintenance command finishes; no agent runtime state was lost.
This is a real runtime/index-admission failure, not a test-load failure. The original reservation owner was not captured; do not attribute it to another process, a lifetime leak, host load or the HOME change. Exact command/head/base/exit and the complete failure are retained with #3008's R2 receipts. The completed full root result and the subsequent once-per-source matched complete-file controls are retained below; none replaces the original failure or establishes its reservation owner.
The source exposes a shared-state susceptibility: createFixtureTurnHost passes literal dbPath: ":memory:" to createHostExecution (const execution, tests/fixtures/turn-host-fixture.ts:15). The boundary consequently selects no maintenance tempDomain (const tempDomain, packages/ui-server/src/brain/host-boundary.ts:370), and admission uses the production per-UID fallback (const directory, packages/ui-sdk/src/server/maintenance-temp-budget.ts:32). The probe's outer bubblewrap shares the host /tmp (probe, tests/claude-worker.test.ts:6); its later query observes the missing indexed row (const indexed, tests/fixtures/claude-worker-probe.ts:146). These source facts do not establish the original holder or prove cross-process contention caused this occurrence.
Related closed #1890 and #2651 isolated other concrete maintenance fixtures; neither scope names this root Claude fixture/shared turn-host helper. Preserve those completed deliveries. This finding is separate from #2769's ambient-provider-variable note assertions and #2701's invalid mount-record guard signature.
Additional observations in the same root run
The policy-boundary fixture also calls the same in-memory helper (tests/fixtures/policy-boundary-probe.ts:434). The run reports AREAS_WRITABLE failures in Claude interactive/voice and Pi interactive, a Claude governed typed-turn refusal, missing Pi Git serialization, an explicit maintenance-busy authoritative voice-capture refusal, and a Pi internal-alias write refusal. Some symptoms directly include the same busy diagnostic; the other failures' original admission owner/complete receipt was not captured, so their cause remains unproven. Both complete files are included in the matched main/head diagnostic controls. Their tests, fixture probes, shared helper, boundary domain selection and maintenance ledger implementation are byte-unchanged from the merged main.
The scope remains the shared createFixtureTurnHost admission environment, with an inventory of its root fixture consumers. Do not treat every policy symptom as proven to share the original cause, or the deliberately failing nested unit-worker self-tests in root stdout as root-suite failures.
Out of scope
Production admission/lifetime changes, larger budgets, deleting or releasing foreign reservations, retries/sleeps to obtain green, weakening the indexed-document/policy/publication assertions, changing Claude startup policy, and adding a public/configuration seam solely for a test.
Scope
Establish the exact admission conflict for the root real-Claude fixture, then isolate independent fixture admission through test-owned process/namespace state or an existing internal fixture boundary. Preserve literal in-memory/no-operational-state behavior and the actual Claude/worker/application/index routes. Audit other consumers of createFixtureTurnHost for the same omission and scope any additional work explicitly.
Acceptance criteria
- Retain the reported failure and one matched main/head control with source identity; distinguish an isolated pass from a causal correction.
- In an owned private outer test environment, a separate process holds the unchanged default maintenance allowance. Gate it after fixture bootstrap so the unchanged test reaches the intended queued-index assertion and reproduces the maintenance-busy outcome, with the holder's live ownership established. If that cannot reproduce this occurrence, record the remaining factual question before choosing a repair.
- With isolation present, the original indexed-row, protected-policy, authoritative Markdown, PNG mask, resume and descendant-cleanup assertions pass while the foreign holder remains live and unchanged. Removing only the isolation fails on the expected runtime assertion; restoration passes.
- Distinct fixture processes cannot collide through a reused test identity. Intentional same-domain cross-process over-admission still refuses, with production defaults, budgets and ownership checks unchanged.
- Join/drain owned workers and release only owned reservations before deleting fixture state, including failure paths. Unknown ownership remains held.
Verification
Use the repository's keyless network preload and an explicitly offline private outer harness for native CLI processes. Record failing-first/mutation/restored exact commands, source/conditions and named assertions. Run the complete Claude worker file, relevant shared-helper consumers and maintenance budget controls, the complete root ./tests suite and bun run check:pr --base origin/main via the shared heavy wrapper. A setup failure or plain retry is not isolation proof.
Contract impact
None expected: test isolation through existing boundaries. The original in-memory host and production admission contract must remain intact.
Needs reproducible ownership/timing evidence before agent-ready; no production change is requested by this report.
Completed diagnostic comparison — 2026-10-26
The complete unfiltered root run finished 1,956 pass / 10 fail across 1,966 tests. Two failures are the separately tracked #2769 note assertions; the remaining eight are the index/policy observations above. Deliberately failing nested unit-worker self-tests printed in stdout are excluded from that root failure count.
One subsequent complete-file comparison ran bun run test ./tests/claude-worker.test.ts ./tests/policy-write-boundary.test.ts once on merged main b99489b3cbe27fa739fd4d19117cab2cc78f72f3 and once on head ab564787211ea88b095364326b7868b752709a2e, serially within the existing heavy slot and with the same frozen dependencies/offline guards. Main reports 22 pass / 1 fail at the Pi interactive AREAS_WRITABLE assertion; head reports 23 pass / 0 fail. These complete-file results are retained beside the failed whole root run. They establish that one refusal signature also occurs on main, and that the head cases later pass; they do not prove the original holder/cause or that a correction was made. No guard, budget, assertion or fixture source was changed, and no full-root retry was used to replace the failed result.
The deterministic live-holder/timing control remains required before assigning a cause or selecting a fixture repair. This report does not claim the other seven original symptoms were reproduced on main.
2026-10-26 triage at main 2f10e0407769b685083c17a1c90bb43a060b94a0: Corrected the current outer-probe anchor and folded the completed-comparison status into Context. Preserve the live-holder/timing reproduction gap and p2 classification. General verification epic #736 is at its direct-child limit; remain standalone by reference.
Distinct setup-refusal observation — release round 5, 2026-10-27
The complete pre-version bun run check:pr --all on reviewed main 5eebfc6289f07f11106de5c6aec9b5abd9355358 finishes exit 1, 16,368 pass / 28 expected skip / 27 fail, 607,298 assertions, 16,423 tests in 1,265 files, 3,918.90 seconds. Complete log SHA-256: b894c1b32b57d47530eb2cdc1d2d6cc84d671679ffbdd2dc10ce0406708a0d59.
The ordinary Claude worker again fails the indexed-row assertion at tests/claude-worker.test.ts:35 (2379.29 ms), but the retained application-index event reports a different known setup refusal: maintenance admission requires an owned private directory outside the brain. The owned isolated default ledger was mistakenly created mode 0755 rather than 0700. Separate same-source native API controls reject 0755 with that exact message and admit/release at 0700, with UID/GID preserved and all capabilities zero. No foreign reservation was changed or removed. This is not reproduction or attribution of the original maintenance-busy holder.
Eight policy-boundary cases also fail in this invocation:
- Claude interactive and Pi interactive:
AREAS_WRITABLE, expected[true, true], received[false, true], at line 80. These scratch symptoms are also recorded on tests: full suites intermittently lose writable scratch #3010. - Claude voice:
r.addedhas zero entries, expected one, at line 216. - Claude governed native write:
Native writes require a governed typed turn, at line 285. - Pi governed:
SHELL_WRITE_VISIBLE_OUTSIDE_WORKER, missingnotes/shell.md, at line 287. - Pi governed lock: serialization is null, at line 297.
- Governed voice capture: explicit
application_failedwith the same ledger-directory guard, at line 311. - Pi internal-alias write:
PI_INTERNAL_ALIAS_LOCK, result is an error, at line 322.
Only the ordinary-Claude index and governed-voice application receipts above directly print the setup guard. The other symptoms are not assigned a common cause. The complete run also has the independently retained #3020, #3038, #2866 and #3010 observations. It is preserved, not replaced by a filtered replay. No setup/source/deadline/assertion was changed during it.
Bun 1.4.2, frozen copyfile dependencies, SDK 0.3.293 and unchanged lock SHA-256 5bbd5f6651f111db3fcfabeda512d44a21163cba54c58993f8878012d548cc14 are retained. No passing release proof, source correction, versioning, release PR or publication occurred. Preserve this issue's existing p2, needs: repro and milestone 0.45.0: this setup-error receipt does not establish a new commitment or resolve the original ownership investigation. Parent release coordination must reconcile the retained failures and correct preparation prerequisites before selecting further proof.
Main CI recurrence check (2026-11-03): in the window 2026-10-26 18:00 UTC to 2026-11-03 08:00 UTC, main CI ran 116 times; 97 runs were green and the failed-job logs of the other 19 contain no failure of the indexed-row assertion at tests/claude-worker.test.ts:35. Main CI selects affected suites, so this loosely bounds hosted recurrence; it is not a flake rate, a reproduction or a repair. The cited test, fixture helper and boundary lines are unchanged since 2026-10-26. The missing evidence is still the deterministic live-holder/timing control described in the acceptance criteria.
Triage 2026-11-03: added main-CI recurrence check; needs: repro, p2 and milestone unchanged.
Current reproduction evidence — 2026-11-04
The new bounded investigation at inspected main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36 established real two-process default-domain maintenance contention and independent state-domain admission with the live holder unchanged. Its existing budget/requeue controls passed 14 tests. Those are attributed investigator receipts, not a new execution by this body update.
The actual Claude case stopped at nested-namespace qualification before Markdown application or the indexed-row assertion. It therefore did not reproduce the reported fixture/application/index ordering. Preserve literal :memory: and the existing scope: the remaining evidence must gate an acknowledged holder after fixture bootstrap and correlate the real index admission and assertion while that holder is live. The independently demonstrated ledger conflict is not authority to choose a fixture or production correction. Keep needs: repro, no readiness, all original policy/publication/cleanup assertions and owned-only teardown. Refreshed the two current source-owner pointers; historical receipts retain their original identities.
Hosted observation, 2026-11-10 triage: the same held by: command refusal text appears in passing ui-server cases on main CI. Job 128983721784 at 4d376943c logged it twice in ws tests (scratch qualification refused, so the turn ran with scratch read-only). Job 128614069929 at 1619741f2 logged the governed profile is unavailable (worker_host_unavailable): Maintenance temporary storage is busy. So default-domain maintenance contention recurs in hosted unit shards. The log does not name the inner holder, so this is not the missing owner witness.
Triage 2026-11-10 at main 3aadc8df5: repaired three current-source pointers (const execution at turn-host-fixture.ts:15, const tempDomain at host-boundary.ts:370 after #3458, const indexed at claude-worker-probe.ts:146). The indexed-row assertion (claude-worker.test.ts:35) is unchanged. No failed main CI job from 2026-11-08 to 2026-11-10 shows it. needs: repro, p2 and 0.45.0 kept.
Test-health push evidence — 2026-11-10
Push #3855 shard e3855-root-02 at base 0129244ad, shared host at load average 30-38: tests/policy-write-boundary.test.ts failed in 5 of 10 baseline runs, one of them with the held by: command maintenance-busy refusal. Giving that probe's outer bubblewrap a private /tmp (so its in-memory turn host no longer shares the host-wide per-UID ledger) gave 20 of 20 passing runs. Open PR #3881 carries that probe-level change and says Refs #3019.
Effect on this issue: cross-process contention through the shared per-UID ledger is now a demonstrated cause for the policy-boundary probe's maintenance-busy refusal. It is not yet attributed for the ordinary-Claude indexed-row assertion (claude-worker.test.ts:35): a 20-run cluster audit at the same base failed that case once without retaining which assertion failed. tests/claude-worker.test.ts and tests/fixtures/turn-host-fixture.ts are unchanged, so the remaining scope is the shared createFixtureTurnHost consumers outside the policy-boundary probe.
Triage 2026-11-10 at main 91e54be37: folded the push receipts above. needs: repro stays for the indexed-row attribution; labels unchanged.
Deterministic reproduction — 2026-11-13
A live foreign reservation in the per-UID default ledger reproduces the indexed-row failure on demand on main 631bbae2c, with nothing else running: receipt and commands. The holder is bun packages/ui-server/tests/helpers/private-maintenance-test.ts --reserve, kept alive on its stdin. The unchanged tests/claude-worker.test.ts reaches line 35 with the holder live and fails there (r.indexed is [], application event Maintenance temporary storage is busy). It passes with no holder. The cause is cross-process contention on the shared ledger by any process of the same user, not CPU load. The same holder reproduces the eight policy-boundary failures on the tree before #3881 and none of them after it.
Folded in — 2026-11-13
Two issues are closed into this one, because the same holder reproduces their signatures on main and their fixtures are not covered by #3881:
- tests: full suites intermittently lose writable scratch #3010, startup-order case.
packages/ui-server/tests/native-worker-startup-order.test.ts,a first strict admission refreshes sealed inputs only after trusted scratch creation: scratch writable expectedtrue, receivedfalse, in about 8 ms. - ui-server: close-grace fixture times out waiting for stats during the package suite #2866, close-grace cases.
packages/ui-server/tests/close-cancels-shared-runs.test.ts:timed out waiting for stats startedandtimed out waiting for add startedafter about 15.7 s. The fitting reading is that the command is refused at admission, so no process appears in/procand the fixture waits out its full 15 s poll; the run's output does not print the refusal. A fix should make that failure report the response the request already returned.
Scope and acceptance criteria above apply to these fixtures as well: isolate their admission through test-owned state, keep the foreign holder live and unchanged while they pass, and keep a removal mutation that fails on the named runtime assertion.
Triage 2026-11-13 at main 631bbae2c: added the deterministic reproduction, folded in #3010 and #2866, closed #2899, #2923, #2987 and #2988 as fixed by #3881, removed needs: repro. No milestone; priority unchanged.
Census of exposed fixtures — 2026-11-13
A run of 1,277 of the repository's 1,587 bun test files under the same live holder found seven exposed files: table and method. Beside the three already named above (tests/claude-worker.test.ts, native-worker-startup-order.test.ts, close-cancels-shared-runs.test.ts), they are:
packages/ui-server/tests/cron-scratch-prune.test.ts(3 cases)packages/ui-server/tests/admission-sub-phases.test.ts(1 case)packages/ui-sdk/tests/mask-scratch.test.ts(1 case)packages/ui-backend-claude/tests/sdk-options-snapshot.test.ts(1 case, seen once; probable)
This is the audit of other consumers the scope asks for. packages/core and 100 other files were not run.
Triage 2026-11-13: added the census; scope now covers these seven files.
Activity
[-]ui-server: root Claude worker fixture observes maintenance-busy during queued indexing[/-][+]ui-server: root turn fixtures observe refusals through shared maintenance admission[/+]schlessera commentedon Nov 4, 2026
Reproduction triage — 2026-11-04
Verdict: partial admission control established; the reported Claude/application/index failure is not conclusively reproduced. Retain
needs: repro; do not addagent-ready.Inspected and tested the requested snapshot
53b862123d7b8e4c9d039859fabdc9fc6ad4cd36, without changing source. Environment: Linux 7.0.0-42-generic x86_64, UID/GID 1001/1001, Bun 1.4.2 (744846f84) selected explicitly, bubblewrap 0.11.1, installed Claude SDK 0.3.293. Dependencies were installed from the existing local cache withbun install --offline --frozen-lockfile --ignore-scripts --backend=copyfileunder outer network isolation (exit 0). Lockfile SHA-256 remainedecf6986227406c1fd9d835ae3c119d561e012df5a1bedcae599907332fc20a3e. The shell's default Bun is 1.4.4; the receipts below use 1.4.2.Read the full issue and all comment pages (zero existing comments), confirmed the native parent endpoint returns 404
No parent issue found, and reviewed the relevant #3008, #1890, #2651 and later #3461 evidence. #736 is a reference, not this issue's native parent. No assignment, milestone or relationship change is proposed.Attempts and observations
All commands below ran with the repository's network preload, empty inherited environment except the fixed PATH/LANG/TMPDIR, and an outer
bwrap --unshare-netwith private/tmp. No host default maintenance ledger was inspected, released or deleted. No external provider, account or deployment was used.Unchanged ordinary Claude case:
bun run test ./tests/claude-worker.test.ts -t '^ordinary Claude worker'returned exit 1; 0 pass / 1 fail / 3 filtered out. Expected child exit 0; observed exit 1 atprobe(tests/claude-worker.test.ts:14) withbwrap: No permissions to create a new namespace, likely because the kernel does not allow non-privileged user namespaces.Outer bubblewrap succeeds with UID/GID preserved and all five capability sets zero; a nested bubblewrap smoke command produces that same refusal. A separateunshare --user --map-current-user --net --mountsmoke also refuses writinguid_mapwithOperation not permitted. These are setup limitations: this run never reached the probe, Markdown application orr.indexedat line 35. It is not reproduction of the reported bug, and no policy failure is attributed to maintenance contention.Independent real two-process admission control (script below): exit 0. A separate Bun process acknowledged a full unchanged 256 MiB default-domain reservation. Read-only inspection verified its acknowledged row, unreleased bytes, live PID/start/boot/PID-namespace identity and non-zombie state. A second default-domain reservation refused with exactly:
The existing explicit outside-brain state domain admitted at the same limits while the default holder remained live and its row byte-identical. The holder then released itself and was joined with exit 0; its row disappeared and fresh default admission/release succeeded. This proves real shared-ledger contention and existing-domain independence, not ownership/timing at the Claude fixture's application-index step. It does not select changing the fixture's literal
:memory:contract as a repair.Existing controls:
bun run test ./packages/ui-sdk/tests/maintenance-temp-budget.test.ts ./packages/ui-server/tests/automatic-index-requeue.test.tsreturned exit 0; 14 pass / 0 fail / 85 assertions. These are admission/client controls, not launched-worker or complete-root proof. In particular ui-server: the automatic index refuses as maintenance-busy when a turn's scratch-mask query admits first #3461's later correction, delivered in1ea260971e3f058c396ad9601be925fd279de1ea, keeps a marked automaticBrainClient.indexpending on busy admission. This is not proof that ui-server: root turn fixtures observe refusals through shared maintenance admission #3019 is repaired: its fixture suppliesboundaryPlanner, whose application index still directly callsboundary.run(boundaryPlanner,packages/ui-server/src/brain/application.ts:196-220).Source/caller audit at the inspected SHA
The susceptibility still has source support, with drifted pointers: literal
dbPath: ":memory:"is now on line 15 oftests/fixtures/turn-host-fixture.ts;const tempDomainispackages/ui-server/src/brain/host-boundary.ts:366;const directoryispackages/ui-sdk/src/server/maintenance-temp-budget.ts:32. The probe's indexed-row query is now line 146, and the policy probe calls the helper at line 466. Direct helper consumers areclaude-worker-probe.ts,pi-worker-probe.ts,policy-boundary-probe.ts,provider-history-host.ts,autonomous-dispatch-probe.ts,autonomous-containment-probe.tsandautonomous-runtime-probe.ts, all undertests/fixtures/. This is a source inventory; their runtime outcomes were not inferred from the admission control.Repeatable bounded control
From the inspected checkout outside
/tmp, with Bun 1.4.2 selected and frozen dependencies installed, save the following script as$proof/admission-control.ts. The script is an admission-only control and deliberately starts no Claude/maintenance worker. Run it and the two test commands with this outer harness; artifacts are outside authored source, and its private/tmpdisappears on exit:Remaining evidence / next step: run the original fixture on an offline host permitting the required nested user/network/mount namespaces. Gate a separate acknowledged holder after fixture bootstrap and before its application index admission, prove it remains live at the named indexed-row assertion, and capture the application-index event alongside the live reservation. The independent admission refusal here cannot establish that timing or the historical owner. Keep production limits,
:memory:, policy/Markdown/mask/resume/cleanup assertions and owned-only cleanup intact; do not retry into green or treat the October 27 mode-0755 setup refusal as the original busy failure. Full root/policy/native proof and a correction-removal/restoration test remain pending; this triage implements no correction.Checkout:
git diff --exit-codeandgit status --porcelain=v1are clean; no source mutation, fix, commit, PR, push, closure or assignment change was made. Before/after labels remaintype: test,area: ui-server,priority: p2,needs: repro; milestone remains0.45.0, issue open and unassigned.schlessera commentedon Nov 10, 2026
2026-11-10 triage at main
3aadc8df5: repaired three moved current-source pointers (turn-host-fixture.ts:15,host-boundary.ts:370,claude-worker-probe.ts:146). Added that theheld by: commandmaintenance-busy refusal recurs in passing hosted unit shards. No failed main CI job from 2026-11-08 to 2026-11-10 shows the indexed-row assertion.needs: repro, p2 and 0.45.0 kept.schlessera commentedon Nov 10, 2026
Test-health audit (run
th-20261110163712-7242b8, cluster 0), 2026-11-10, at0129244ad(integration branchepic/3855-test-health), Bun 1.4.2, non-root WSL2 host with other test workers sharing it.bun scripts/test-health.ts measure tests/claude-worker.test.ts --runs 10 --shuffle --together: 20 runs, 1 failure in the in-order repeat variant, failing case "ordinary Claude worker protects policy bytes, applies and indexes permitted Markdown, masks, scratch and resumes". The tool keeps the failing case but not its output, so which assertion failed (and whether it was the indexed-row assertion at line 35) is unknown.bun run test ./tests/claude-worker.test.ts12 times in a row with every log kept: 12/12 pass, 0 failures.So the ordinary case did fail once in 20 runs here, but this run did not capture which assertion failed or why. That still leaves the live-holder/timing reproduction this issue asks for open. Verdict: unreproduced.
needs: reprostays. The audit made no change to the test's assertions or timing; it only rewrote its booleansome(...)checks so a later failure prints the values.schlessera commentedon Nov 10, 2026
Test-health push (#3855), shard
e3855-root-02. Base0129244ad, on a shared Linux host with load averages of 30–38 throughout.Baseline, unchanged file:
measure tests/policy-write-boundary.test.ts --shuffle --together, 10 runs. 5 of the 10 runs failed. Failing cases and messages:claude interactive×2 andpi interactive×1:AREAS_WRITABLEreceived[false, true](tests: the voice policy-write boundary case reports the scratch area unwritable #2923, tests: Pi interactive policy boundary intermittently reports scratch unwritable #2987)claude voice×2:r.addedhad length 0, expected 1claude governed×1:PreToolUse:Write hook error: Native writes require a governed typed turn.(tests: policy-write-boundary claude governed native Write intermittently refused as not governed #2899)governed voice×1:Maintenance temporary storage is busy: this command needs 256 MiB, 1 maintenance reservations hold 256 MiB of the separate 256 MiB budget (held by: command)governed Pi internal symlink×1:PI_INTERNAL_ALIAS_LOCKOne source of contention, confirmed. The body names the in-memory turn-host path, which falls back to the per-UID ledger at
/tmp/brain-maintenance-budget-<uid>(const directory,packages/ui-sdk/src/server/maintenance-temp-budget.ts:32). The probe's outer bubblewrap ran--bind / /, so it shared the host/tmp. On this host that ledger'sreservations.dbis written continuously by other test processes, so the probe's maintenance admission competed with host-wide holders.Change (test code only,
tests/policy-write-boundary.test.ts): the outer probe gets a private/tmp(--tmpfs /tmp). Only its own temporary root is bound back in. Nothing else changed: the product's per-UID fallback, every assertion, every deadline, and the sharedcreateFixtureTurnHosthelper.After the change: two consecutive
measure --runs 5 --shufflepasses, at the same load, both clean. 20 of 20 runs passed, with every case executing its assertions.What this does and does not establish.
AREAS_WRITABLEwas not captured. I am commenting the receipts on tests: the voice policy-write boundary case reports the scratch area unwritable #2923, tests: Pi interactive policy boundary intermittently reports scratch unwritable #2987 and tests: policy-write-boundary claude governed native Write intermittently refused as not governed #2899 and leaving those issues open.tests/claude-worker.test.tsandtests/fixtures/turn-host-fixture.tswere outside this shard and are not changed. The batch PR saysRefs #3019, because the issue's scope covers every root consumer of the shared helper.test(root): test-health batch e3855-root-02 (#3881)
schlessera commentedon Nov 13, 2026
Deterministic reproduction (2026-11-13). A live foreign reservation in the per-UID default ledger reproduces this issue's indexed-row failure and the signatures of six sibling issues. Nothing else was running, so host load is not part of the cause.
Setup. A clean 4-CPU Ubuntu 24.04 VM (Bun 1.4.2, bubblewrap, unprivileged user namespaces), main
631bbae2c. One foreign process holds the whole default-domain budget, using the helper that already exists:The ledger row was
{"bytes":268435456,"released":0,"kind":"command"}before and after every run, and the holder was still alive at the end. Each file also ran once with no holder, as the control.tests/claude-worker.test.tsr.indexedis[], application event carriesMaintenance temporary storage is busypackages/ui-server/tests/native-worker-startup-order.test.tstrue, receivedfalse(#3010)packages/ui-server/tests/close-cancels-shared-runs.test.tstimed out waiting for stats startedtwice,timed out waiting for add startedonce (#2866)tests/policy-write-boundary.test.tsfcc7f99ce, the parent of #3881tests/policy-write-boundary.test.tspackages/ui-server/tests/app-state-isolation.test.tsThe eight policy-boundary failures on the tree before #3881, one run:
PreToolUse:Write hook error: Native writes require a governed typed turn.r.addedhas length 0, expected 1AREAS_WRITABLE, expectedtrue, receivedfalseSHELL_WRITE_VISIBLE_OUTSIDE_WORKER, received["notes/native.md"]AREAS_WRITABLEapplication_failed:Maintenance temporary storage is busy … (held by: command)nullPI_INTERNAL_ALIAS_LOCKThat is the same eight-case set this body recorded on 2026-10-27, now produced on demand by one variable.
What it settles.
tests/claude-worker.test.ts:35fails because another process on the same UID holds the default ledger. The unchanged test reaches that assertion with the holder live, which is the witness the acceptance criteria asked for. My holder was live from before fixture bootstrap rather than gated after it; the test still reached line 35.claude-worker.test.ts, the startup-order fixture and the close-grace fixture still take the per-UID fallback on main.scripts/unit-worker-entry.sh), which is why none of these has ever failed on main CI.Not explained by this cause. With the holder live, these passed unchanged on main, so their own sightings need another explanation:
http-supported-mounts.test.ts(130 pass, #3574),brain-application-adapters.test.ts(#2403),turn-egress.test.ts(#2924),transcript-prefix.test.tsandoutput-staging-refusal.test.ts(#3007),ui-backend-claude/tests/worker.test.ts(#1902).Consequences. I am closing #2899, #2923, #2987 and #2988 as fixed by #3881, and folding #3010 and #2866 into this issue, since their remaining cases are this cause on fixtures #3881 did not touch. The body now lists those fixtures.
needs: reprocomes off: the reproduction is no longer missing. I have not addedagent-ready; that is a readiness call for triage.A census of the root, backend and SDK suites under the same holder is running, to list every other exposed file. I will post it here.
schlessera commentedon Nov 13, 2026
Census (2026-11-13): seven test files are exposed to a foreign holder of the default ledger. The other 1,270 I ran are not, or fail for unrelated reasons listed below.
Method. Same holder as above, live for the whole run and verified alive at the end. Each file that failed under it was rerun with no holder, and the ones that matter were rerun both ways on a fresh VM. "Exposed" means it passes with no holder and fails with one.
Coverage. 1,277 of the repository's 1,587
buntest files, on clean 4-CPU Ubuntu 24.04 VMs at main631bbae2c: all of roottests/,packages/ui-sdk,packages/ui-backend-pi,packages/ui-backend-claude, thepackages/ui-reactruntime tests, andpackages/ui-server(554 files of it in four shards: 6,357 cases passed with the holder live). Not covered, 315 files:packages/core(215), thepackages/ui-reactrender tests (35),experiments/(37), two module packages (26) and the native proof's own test. The Vitest browser and layout projects are outside this run.Exposed files.
tests/claude-worker.test.tsr.indexedis[]packages/ui-server/tests/native-worker-startup-order.test.tsfalsepackages/ui-server/tests/close-cancels-shared-runs.test.tstimed out waiting for stats/add startedpackages/ui-server/tests/cron-scratch-prune.test.tsBrainUiApp.close > … boot-prune …cases, with the busy refusal in their outputpackages/ui-server/tests/admission-sub-phases.test.tsGOVERNED_ADMISSION_STEPSinreal governed admission records each step inside governedAdmissionMspackages/ui-sdk/tests/mask-scratch.test.tsSYNC_QUERY_UNAVAILABLE_IS_NOT_NONIGNOREDpackages/ui-backend-claude/tests/sdk-options-snapshot.test.tsSDK_OPTIONS_DRIFT_autonomous-summary, with the busy refusal in its outputThe first six were confirmed on a second VM. The last was seen in one run with a clean control on the same VM; treat it as probable until someone repeats it.
Failed under the holder but not because of it.
tests/ci-build-boundary.test.ts,tests/workspace-lease.test.ts,tests/odysseus.test.ts,tests/build-repeat-observation.test.ts: they fail the same way with no holder on these VMs (no builtdist, no pinned browser image).packages/ui-sdk/tests/worker-pipes.test.tsandpackages/ui-server/tests/dialogue-queue-adoption.test.ts: failed once inside a long run, and pass with and without the holder when run alone.packages/ui-server/tests/external-speech.test.ts: failed 2 cases once with the holder and once without it, on different VMs, and passed 24 of 24 with the holder elsewhere. Unrelated to the ledger, and flaky in its own right.What this means for the fix. The audit the acceptance criteria asked for is this table. Seven files need test-owned admission state; the body's scope now names them.
Three unrelated failures turned up inside the long single-process run and are worth knowing about, though I have not filed them:
parallel-sessions-runtime.test.tsat 390 px (a watched session is not tracked, 2 cases),tracker-runtime.test.tsat 390 px (a reload announces nothing, receivedThe voyage home is done.), and the duplicate exchange count now recorded in #3834.