You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tests): isolate Claude host storage from the invoking home - #4042
The test launcher supplies a disposable invoking HOME before starting Bun. The shared preload assigns a separate working HOME and CLAUDE_CONFIG_DIR, restores the environment descriptors, and removes its storage after all files finish. After the test process and its children settle, the launcher checks that the invoking Claude sentinel tree has unchanged path membership and exact metadata, then removes it. This covers filesystem writes without modifying filesystem functions or observing another session's user storage.
Default profiles, empty profile environments and explicit owned config overrides retain actual observation records in temporary storage. The Bash confirmation fixture owns a brain directory rather than using all of /tmp, and copied test harnesses carry the home helper.
Why this shape
The issue allows shared-preload isolation, which covers future tests. Assigning the invoking home before Bun starts also fences native HOME fallbacks. The guard runs outside the child process, so fixture spies can save real originals and restore complete descriptors, and native children cannot bypass the filesystem comparison. Production fallback, observation settlement and redirected/aliased-storage refusals remain unchanged. Existing user directories are neither cleaned nor migrated.
Proof
Isolation mutation: disabling installTestHome leaves the real-turn fixture's own test green, but the launcher exits 1 at TEST_WROTE_INVOKING_CLAUDE_HOME because observations reached its sentinel tree. Restoring isolation exits 0. All mutant writes use owned disposable storage.
Spy compatibility regression: the new home isolation leaves filesystem originals and descriptors available to fixture spies test fails with the previous preload at Cannot replace module namespace object's binding's value and passes after removing the global spies.
The same-size overwrite test preserves path count and byte count and still trips the invoking-home guard. Descriptor restoration, sentinel bytes and home removal are asserted.
Pinned Bun 1.4.2 focused checks: 106 pass / 0 fail across home isolation, scratch publication, storage inventory, scratch races and worker-state refusals. Final current-head home/profile/spy probes: 5 pass / 0 fail.
Current-head NODE_OPTIONS=--max-old-space-size=8192 bunx tsc --noEmit passes. Final bun run check:pr --base origin/main passes all gates and 1,208 fast invariants.
Earlier full Claude run at head 722c47ce2c1cb23b415b04b4e0ec4cf2be157b6b: invoking transcript-archive directory count 13,996 before; 13,996 after. Its local native prerequisites were not green; current-head hosted runtime and unit feedback now pass after the guard correction.
Current-head hosted feedback: https://github.com/schlessera/brain-kit/actions/runs/43792329398succeeded. Resource receipts identify actual checkout 0c059885f53c46baa599164fe9c8bb16b2f6d59f; the workflow-dispatch revision is distinct. All selected proof jobs passed: verify, pack, runtime, runtime_host, unit (4/4 shards), browser (3/3), layout (2/2), captures and endurance. All 30 actual cases that failed in the preceding run now have passing log entries. Only the supersede control job was intentionally skipped; no selected proof job was skipped. This is draft feedback, not candidate-confirmation proof.
{"version":1,"kind":"brain-check-pr-receipt","head":"2ba3ca8c733ccba891d349843e462c478d74fe97","base":"origin/main","mode":"focused","startedAt":"2026-11-16T03:56:02.176Z","finishedAt":"2026-11-16T03:57:29.530Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12749.044455},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":135.71615399999973},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":112.36635799999931},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":18.30554999999913},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":74317.87495699999}]}
Checklist
Current-head local checks and behavioral/mutation receipts are recorded.
Fresh hosted feedback passes at the current head.
Candidate confirmation and landing remain owned by the orchestrator.
PR and issue have verified release milestone 0.45.0.
Test-only change; no consumer-visible changeset is needed.
Leakage gates pass; machine contracts and production provider history are unchanged.
Testing documentation describes the isolation and cleanup.
Test containment is limited to owned homes: a mismatch fails the invocation with its cause, then cleanup removes owned state. Production guards are unchanged.
Anything left open
Orchestrator-owned candidate confirmation and landing only. Implementation, local proof and current-head heavy feedback are complete. The worktree is clean, the matching local receipt appears once above, and both release milestones are verified as 0.45.0. The claim remains held for landing. No new follow-up issue was filed; the existing local container limitation is #3318.
schlessera
added
type: fix
Something is broken and must behave the way it is documented.
area: backends
AgentBackend implementations and the seam they share.
area: ci
CI workflows, the gates they run, release scripts, packaging.
labels
Nov 15, 2026
The workflow-dispatch revision was main e1ce188d79dd47c88a4478359d38277098444a21, but the unit resource receipts identify the actual tested checkout as PR #4042 head 722c47ce2c1cb23b415b04b4e0ec4cf2be157b6b. Proof jobs ran after admission; this was not an admission-slot timeout.
Regressions from this PR's global filesystem spies. Captured originals pointed at shared spy objects, causing recursion, stale call histories (including 1,461 calls), wrong race timing and descriptor restoration failures. Removed global filesystem interception entirely and moved verification into the launcher outside the test process. A focused regression fails with the old preload and passes with the corrected one; pinned-Bun filesystem coverage passes 106 tests.
Nineteen subsequent runtime, freeze/resource-accounting, bridge, attachment and budget test timeouts
Conservatively treated as potentially caused by the preceding shared-spy corruption, not waived as unrelated flakes. Fresh hosted feedback is required before declaring these resolved; unsupported local namespaces cannot settle those runtime claims.
Expected negative fixture controls, not additional enclosing-suite failures.
Final draft-heavy-feedback aggregate
Propagates the four failing unit shards; no independent failure.
Runtime, runtime_host, verify, pack, browser, layout, captures and endurance
Passed for the old head only; not relabelled as current-head proof.
The current head is 0c059885f53c46baa599164fe9c8bb16b2f6d59f. Current-head typecheck, pinned-Bun home/profile probes and all local preflight gates pass. Main-preload controls also distinguish the host's native prerequisite failures from the new spy regression: the seven-file control passed 165 tests and failed 27 native cases under local namespace restrictions. A wider local harness run additionally encountered those restrictions and a temporary-filesystem EDQUOT; it is not claimed as hosted proof.
The required one-time heavy-slot check returned three in-progress workflows. No replacement run was dispatched. The branch and claim are retained for the orchestrator: WAITING pr=4042 on=heavy-slot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area: backendsAgentBackend implementations and the seam they share.area: ciCI workflows, the gates they run, release scripts, packaging.type: fixSomething is broken and must behave the way it is documented.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2902
What changed
The test launcher supplies a disposable invoking HOME before starting Bun. The shared preload assigns a separate working HOME and CLAUDE_CONFIG_DIR, restores the environment descriptors, and removes its storage after all files finish. After the test process and its children settle, the launcher checks that the invoking Claude sentinel tree has unchanged path membership and exact metadata, then removes it. This covers filesystem writes without modifying filesystem functions or observing another session's user storage.
Default profiles, empty profile environments and explicit owned config overrides retain actual observation records in temporary storage. The Bash confirmation fixture owns a brain directory rather than using all of
/tmp, and copied test harnesses carry the home helper.Why this shape
The issue allows shared-preload isolation, which covers future tests. Assigning the invoking home before Bun starts also fences native HOME fallbacks. The guard runs outside the child process, so fixture spies can save real originals and restore complete descriptors, and native children cannot bypass the filesystem comparison. Production fallback, observation settlement and redirected/aliased-storage refusals remain unchanged. Existing user directories are neither cleaned nor migrated.
Proof
installTestHomeleaves the real-turn fixture's own test green, but the launcher exits 1 atTEST_WROTE_INVOKING_CLAUDE_HOMEbecause observations reached its sentinel tree. Restoring isolation exits 0. All mutant writes use owned disposable storage.home isolation leaves filesystem originals and descriptors available to fixture spiestest fails with the previous preload atCannot replace module namespace object's binding's valueand passes after removing the global spies.NODE_OPTIONS=--max-old-space-size=8192 bunx tsc --noEmitpasses. Finalbun run check:pr --base origin/mainpasses all gates and 1,208 fast invariants.722c47ce2c1cb23b415b04b4e0ec4cf2be157b6b: invoking transcript-archive directory count 13,996 before; 13,996 after. Its local native prerequisites were not green; current-head hosted runtime and unit feedback now pass after the guard correction.0c059885f53c46baa599164fe9c8bb16b2f6d59f; the workflow-dispatch revision is distinct. All selected proof jobs passed: verify, pack, runtime, runtime_host, unit (4/4 shards), browser (3/3), layout (2/2), captures and endurance. All 30 actual cases that failed in the preceding run now have passing log entries. Only the supersede control job was intentionally skipped; no selected proof job was skipped. This is draft feedback, not candidate-confirmation proof.0c059885f53c46baa599164fe9c8bb16b2f6d59f: 31 proof-closure overlaps, no direct-path or unknown collision. Overlapping PR closures: test(ui-react): characterize audible interruption recovery limits #3054, CONTRACT: feat(ui-react): EVALUATION ONLY bounded recovery / DO NOT MERGE #3056, CONTRACT: chore(ui-react): EVALUATION ONLY voice-tail diagnostics — DO NOT MERGE #3059, test(voice): Gemini finality research — TEST ONLY / DO NOT MERGE #3069, test: scaffold pinned Android audio boundary measurements #3581, CONTRACT: feat(ui-server): add durable owner trust Settings publication #3622, CONTRACT: feat(ui-server): bind managed source to turn authority #4002, test(experiments): assert synchronous Git revision refusal #4036, fix(ci): isolate dependency diagnostic installations #4038, fix(ui-server): hold conversation intake writes across a journal observation or scope pause (#2869) #4041, fix(ui-react): preserve newer principal outcome after cancellation #4046, CONTRACT: feat(ui-sdk,ui-server): place a turn's data tree on the managed volume by reflink (#2911) #4050, chore(ci): retain job creation and report runner-slot wait #4052, chore(ci): publish orchestrator events to the hosted archive #4053, test(ui-react): record the held-module receipt for the lazy file panel waits #4055, feat(backends): prove a discovering pi worker extension-free from what its loader loaded (#2874) #4056, chore(ci): re-audit cold-capture reader and shared producers #4057, test(ui-react): cut B's recovery read short in the parallel-sessions case #4058, fix(ui-server): never retain a worktree checkpoint refused before its pool lease (#3528) #4060, test(ui-server): keep the real storage budget out of queue-adoption holds (#3561) #4062, CONTRACT: feat(ui-sdk): read-only reference pool growth status (#3515) #4064, fix(ui-kit): end the ghost handoff on its fades' own end (#3425) #4065, CONTRACT: refactor(ui-react,ui-sdk): route voice-owned frames through the handler map and drop pong from the consumer union #4067, CONTRACT: fix(ui-server): version a kept draft when an acceptance releases its snapshot (#3733) #4068, test(modules): finish Odysseus fixture migration #4070, test(evals): measure an extraction classifier for tainted sessions' outgoing calls (#3434) #4071, test(ui-server): qualify EDQUOT, cancellation and crash recovery under the Git workload (#3513) #4072, chore(ui-sdk): remove twelve unused internal entry names #4073, docs(backends): record why Claude reports no tool execution evidence (#2875) #4074, test(ci): isolate environment-scoped signing in Git fixtures #4075, CONTRACT: feat(ui-sdk,ui-server,ui-react): serve on-demand GitHub detail pages and avatars outside the model's context #4077.{"version":1,"kind":"brain-check-pr-receipt","head":"2ba3ca8c733ccba891d349843e462c478d74fe97","base":"origin/main","mode":"focused","startedAt":"2026-11-16T03:56:02.176Z","finishedAt":"2026-11-16T03:57:29.530Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12749.044455},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":135.71615399999973},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":112.36635799999931},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":18.30554999999913},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":74317.87495699999}]}Checklist
Anything left open
Orchestrator-owned candidate confirmation and landing only. Implementation, local proof and current-head heavy feedback are complete. The worktree is clean, the matching local receipt appears once above, and both release milestones are verified as 0.45.0. The claim remains held for landing. No new follow-up issue was filed; the existing local container limitation is #3318.