Skip to content
Like what we’re building? Star on GitHub

Process fixtures — captures, corpus copies and host state ​

Evidence for the test-author rules, linked from the machine-dependent test register.

Test / checkMachine classEvidence (log / SHA)DispositionRe-check
Claw command tests' global memoryAn operator HOME containing ~/.claude/CLAUDE.md#3285: reproduced with a synthetic ambient HOME; the old /memory test passed while printing its sentinelThe memory witness pins HOME with t.Setenv before any read, guards it with hometest.RequireNoOperatorProfile, runs in an owned working directory, expects no memory by default and reads an explicitly owned global-memory fixture. Removing HOME isolation fails the guard; removing the guard too exposes the sentinel and fails the output assertion; dropping global-memory reads fails the positive fixture. Keep TestMain's direct live-registry wrapper: its census deliberately requires that exact shape. hometest.Isolate alone isolates ITERION_HOME, not HOME.On command or TestMain changes
Relay fixture PID publicationThe reader sees the file after create but before its contents are written#3263, repeated queue/local failures on 2026-11-19waitPID waits for a positive parsed PID within its existing deadline. Virtual-time witnesses hold an empty, malformed or non-positive record before publishing the valid PID; restoring the early fatal or accepting non-positive values makes their assertions fail. Both real cancellation/parent-death paths pass 20 times under -race.On relay fixture changes
Chart render scratch and repository sweepsThe render script removes a temporary checkout while another test walks the repository#3210Scratch follows TMPDIR (default /tmp), instead of being placed under the checkout. The script witness records actual render paths and checks cleanup after equal/different renders and a renderer failure; restoring the repository location or removing the EXIT trap fails it. Keep sweep errors fatal.On render script or scratch placement changes
TestImageStagingCannotMixWorkflowRuns (internal/ciguard)A parallel test execs a fake docker it just wrote while sibling tests fork#3258: /bin/sh: bad interpreter: Text file busy, 1 red in 7 runs on 2026-11-13; 0 in 20 unloaded on 2026-11-14Corrected, verified 2026-11-14: the fake is written through testfs.WriteExecutable, which holds syscall.ForkLock while the write descriptor is open. A FIFO witness holds the helper inside its open and proves no fork can start meanwhile, at any GOMAXPROCS; the stress witness (300 fresh execs against four forking goroutines, ≥ 2 Ps) fails 10 runs in 10 on text file busy without the lock. ciguard's gate_map_test stubs, exec'd through PATH from parallel subtests, use it too.2026-11-21, and on fake-executable fixtures
Execute lost-work hook and session ledgerOwned-process sweep reports additional cleanup#3183: CI receives both npm run dev (local_bash, b1) and a stopped fake CLI processAssert the exact protocol task once and equal hook/result/ledger losses, not a single total label. Resume/fork witnesses remove the old task while retaining current cleanup. A real detached process must be stopped and named; ten targeted repetitions pass.2026-11-12, and on node-sweep or ledger changes
Pi and OpenCode test-binary re-executionParent Go test reaches its timeout while a child sleeps#3178: the parent exited after 8 s while its child remained alive; direct cancellation returned after 6.203 s with the child absent; nested cancellation with propagated test timeout returned after 4.429 s with both child test and native process absentfixtureProcessOutput uses existing proc group cancellation and immediate teardown; fixtureTestOutput propagates a shorter Go test timeout so nested fixture helpers cancel before either testing alarm. t.Context() alone does not run cleanup after that alarm. Deliberately detached groups remain their launcher's responsibility.2026-11-11, and on recursive fixture changes
Process stdout/stderr capture helpersLoaded Linux host with reduced pipe capacity#2989: projectenv snapshot hung 20 minutes writing refusals before the helper began reading; 15 pipe sites in 11 test files auditedCorrected, verified 2026-11-03: every capture uses internal/stdiotest, which drains concurrently and closes both ends, including on panic/Goexit. A >2 MiB stdout/stderr witness preserves every byte; delaying the reader until after the callback fails its own progress assertion. Repeated intervals and restoration are tested under -race.2026-11-10, and on capture helper changes
Repository sweeps rooted in compile-time pathsA test binary built in another checkout#2916, T45: a sweep read the primary checkout's private run state; f636b11b7 moved the last two sites to sweepwalk.ModuleRootVerified 2026-11-03: no runtime.Caller calls remain in repository tests. A compiled helper invoked from a different, owned module finds only that execution tree's marker; replacing its CWD origin with runtime.Caller fails the root assertion. Package and test-author docs name the rule.2026-11-10, and on sweep root changes
Authoring corpus copied with the session's runtime stateA checkout where iterion fmt has created .iterion/authoring locks#3011: the diagram corpus witness refused Vetty's copied lock permissions, while a clean CI checkout passedCorrected, verified 2026-11-03: the corpus copier excludes .iterion directories at every depth; the copy acquires its own state through the real formatter. Removing the boundary reproduces the lock refusal, limiting it to the root leaks nested state, and broadening it to prefixes drops an authored resource. Regular files named .iterion remain authored files.2026-11-10, and on corpus copying changes
TestDeliveryProbeOnlyAWellFormedAnswerCanHoldParallel ARC socket fixtures#2745 merge-group failure: a non-redirecting row's target received a request; the reservation witness proves the old refused address can be reclaimedThe shared deadAddress fixture owns a bound, non-listening socket until cleanup: no other fixture can claim it, the kernel still refuses connections. Every verdict, retry-count and zero-redirect assertion stays.2026-11-03, and on probe fixture changes
TestLaunchDetached_NamesTheDroppedOverridesOperator workstation with an installed iterion outside PATHe40def071, including its mutation recordCorrected, verified 2026-10-24: proc.SetInstallPathCandidates makes the fixed install tier injectable; the witness empties that tier and pins HOME and ITERION_BIN.2026-10-31, and on binary resolver changes
TestRepoRootFindsTheNearestRealGitEntryOperator machine with a foreign, empty /tmp/.git, recreated by an unidentified processOperator observation, #2585 mission, baseline e40def071; no archived log. Re-check 2026-10-24 (+ #2585 diff): reproduced in the jailed task check; empty, owner jo, mode 0555; rmdir: Device or resource busy, still redEnvironment parasite. Inspect ownership/type/content; before a verdict remove only the confirmed empty directory with rmdir /tmp/.git, record the purge and rerun; an rmdir refusal stops the purge. Never delete it recursively, force-unmount it or weaken repository-discovery assertions.2026-10-31, and before the next affected verdict
TestGuardFoundRefusesALiveIntruder (pkg/internal/proc)Loaded ARC race shard; an exec in progress hides /proc/<pid>/environ from a scan for an instant, longer under loadrun 40908455782 (7384a1494, 2026-10-29): guardFound accepted a live process this test did not startCorrected, verified 2026-10-29 by 8d51e9dc6: the verdict reads a scan that provably held the intruder (afterGuardScan, premiseWait) and must name the pid the helper printed; both mutants redden on their own assertions. Zero re-flakes in the 15 failed main runs since it landed (via T34; measured 2026-11-02)2026-11-05, and on the proc scan guard
TestSweepStopsAProcessThatShowsAfterAnEmptyScan, …ANonEmptyScan (pkg/internal/proc)Loaded host, crowded PID namespace: a sh-program scan without grep -z takes 4.5–8 sLocal, load 45/102: premise: … [0 1 0 1 0]; 3/3 under 300 extra processes + 48 busy loops, sibling 2/2, f5de1b70fCorrected, verified 2026-11-03: no deadline in a window's phase, waits count scans, empty-scan members must die of TERM; green 3/3 under that load. Drop mutants redden all arms2026-11-10, and on the sweep witnesses

Worked example: an installed binary defeats an empty PATH ​

TestLaunchDetached_NamesTheDroppedOverrides expects a detached launch to refuse after logging dropped overrides. An empty PATH cannot prove that: the resolver also searches fixed install paths, the operator's home among them. The fix supplies an empty install-candidate seam, an owned HOME and an empty ITERION_BIN; the production resolver and its sandbox caller share that seam — a second resolver would reopen the class.

The mutation in e40def071 disables the seam and drops the HOME pin on a machine with an installed binary: the test fails its own expected-refusal assertion (a process-leak warning only supports it). Re-check on a machine with the installation and on an isolated worker, recording SHA and elapsed time.