fix(local-ci): per-leg TMPDIR so concurrent legs cannot fail each other's temp-root hygiene scans - #112
Conversation
…ach other's temp-root hygiene scans Four concurrent legs shared the system /tmp, so cli.test.ts's hygiene assertion (snapshot agent-bundle-artifact-* under os.tmpdir(), fail on new ones) could see a sibling leg's legitimate in-flight artifact-inspection directory and fail. Each leg now gets a private TMPDIR under the run's scratch root (.worktrees/local-ci/tmp/<leg>), recreated every run, so every leg's temp traffic — and the test's scan — is naturally scoped. The assertion keeps its strictness: a directory leaked by the leg's own process tree still lands in the leg's temp root and still fails its scan. Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Landing attempt blocked: repo-nested per-leg TMPDIR breaks Chrome's AF_UNIX socket path limitThe gate run at 219e2c5 failed deterministically on all three verify legs (Node 22.19 / 24 / 26). Every browser integration test crashed at Chrome launch because the per-leg TMPDIR was placed under the repo worktree ( Key evidence (from the node22 leg; node24/node26 are identical): and the same fatal on node24/node26: Fix being pushed: keep the per-leg private TMPDIR (the #110 isolation is correct), but relocate it to a short, stable path under the system temp root: |
…yte limit) Chrome creates AF_UNIX sockets inside TMPDIR; the repo-nested .worktrees/local-ci/tmp/<leg> path overflowed the kernel's 108-byte sun_path limit (126 chars measured) and crashed every browser integration test at launch on all three verify legs. Keep the per-leg private TMPDIR (#110 isolation unchanged) but place it at os.tmpdir()/abci-<hash8>-<leg>, where <hash8> is SHA-256 of the repo root — stable per repo so reruns reuse (and rm -rf + mkdir reset) it, and concurrent runs from different checkouts cannot collide. Longest leg path is 32 chars, leaving ~35 bytes of socket-name headroom.
Gate evidence: GREEN at b1261a3Full
Merging. |
Fixes #110
Problem
pnpm check:local-ciruns four legs concurrently (verify on Node 22.19/24/26 plus the gates leg) on one machine, and all of them shared the system/tmp.packages/agent-bundle/tests/cli.test.tsasserts temp-root hygiene: it snapshotsagent-bundle-artifact-*directories underos.tmpdir()and fails if new ones appear during its scan window. A sibling leg's legitimate in-flight artifact-inspection directory could land inside another leg's window and fail the assertion — cross-leg contamination, not a product defect (observed while landing #86).Fix
Each leg now gets a private
TMPDIRunder the run's scratch root —.worktrees/local-ci/tmp/<leg>, recreated at the start of every run — applied through the samebuildLegEnvironmentoverrides that carry the leg's worker caps. Every leg's temp traffic, and the test'sos.tmpdir()scan (Node resolves it fromTMPDIR), is naturally scoped to the leg; this also isolates any other shared-/tmpassumptions.cli.test.tsis untouched and keeps its strictness: a directory leaked by the leg's own process tree still lands in the leg's temp root and still fails its own scan. Recreating the directory each run also drops anything a killed prior run left behind.docs/local-ci.md(the workflow contract the script header says to keep in sync) documents the per-leg temp root. No changeset: this is repo tooling, not a user-visible package change (.changeset/README.mdscopes changesets to package changes; prior scripts/tests-only PRs such as #109 carry none).Acceptance evidence
Simulated the two-concurrent-legs topology directly against the real integration pool on Node 22.19.0 (a full four-leg
check:local-cineeds Node 22.19/24/26 installs the verification machine doesn't carry):pnpm test:integration:run packages/agent-bundle/tests/cli.test.tsruns, each with its own scopedTMPDIRexactly as the runner now sets it, while a contaminator process created a freshagent-bundle-artifact-*directory in the shared/tmpevery 50 ms (318 directories over the run — guaranteed to land inside any/tmpscan window, i.e. the old failure mode). Both runs green, exit 0.TMPDIR— the suite fails on exactly the hygiene assertion (expect(after).toEqual(before), cli.test.ts:269) inruns MCP and hook operations from a packed consumer with explicit and temporary artifacts, exit 1. A directory created inside the leg's temp root (what a real leak from the leg's process tree now looks like) is still caught.Also green after the change: a lone
cli.test.tsrun under a scopedTMPDIR, andpnpm lint(0 errors, 0 warnings).