A test run's trees sit in the host's shared temp directory, so another repository's leftover gate reads them as its own (martha-judge-*, m724-) #199

Closed
opened 2026-11-25 19:49:21 +00:00 by pallas · 2 comments
Member

Purpose (defect): a run of martha's tests leaves nothing under the host's shared temp directory that another tool can read as its own leftovers — every tree it makes is under a root only martha's runs look at, and is gone when the run ends, however it ends.

The class

Martha's test runs put directories directly in the system temp directory (TMPDIR, /tmp here), where any process on the host that watches that directory sees them:

  • martha-judge-*: src/judge_a_checkouts_tree/the_launcher_judges_the_tree.node-test.ts:25 (mkdtempSync(join(tmpdir(), 'martha-judge-')), removed in t.after) and judgeTheCheckout in the_launcher_judges_the_tree.ts:116 (host.stores.scratch.make(null, 'martha-judge-'), removed in its finally). Both are transient by design; neither is under a run-wide root.
  • m724-: prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.ts:54 (RUN_ROOT_PREFIX), the run's one-root wrapper, which lands in a plain TMPDIR for the runs #195 item 5 names (the installer's own npm test and the *_bites.sh runs).

The instance (2026-11-25, host00, Pallas)

While proving macula-io/macula-sponsors#71 I ran the crew-code launcher tests under that repository's own leftover gate (crew-code/tests/leftover_scan.sh, macula-sponsors#380): it snapshots the temp directory, runs one child, and compares. Three of its scans went red on entries a martha run on the same host was making at that moment, not on anything the crew-code tests wrote:

::error::the launcher's install tests left fixtures in the temp directory (#380): /tmp/martha-judge-CRHN29
/tmp/claude-plugin-test-sivmBo
/tmp/m724-w6lLnf
/tmp/m724-yiS45W
::error::the reference-transaction guard's tests left fixtures in the temp directory (#380): /tmp/martha-judge-jPx12X
::error::the OpenCode adapter's tests left fixtures in the temp directory (#380): /tmp/m724-y7kCu8

Each entry was gone a minute later (martha's next run swept or removed it), so nothing was lost and martha's own suite is not red. What went red is another repository's gate on a shared host, twice in a row, and the same box runs every member's suites: the entries are indistinguishable from a real leak of the child under test.

Not the same as #195

#195 is about a test file that ignores its own end, and about what a killed run leaves. It does not name a test file that makes its own directory outside the run's root (martha-judge-*), and it does not name this harm: another repository's leftover gate, on the same host, red for martha's live entries. #70 (closed) was the leftovers that survived on host00; this is the opposite edge — trees that are meant to be temporary and are still visible to everything else while the run goes on.

Done when

  • No martha test run, clean or killed, makes a directory in the host's shared temp directory: martha-judge-* is made under the run's own root, and the m724- root never lands in a shared temp directory unnoticed.
  • A red-first test shows it: with the fix mutated away, a child that only lists the temp directory finds martha's own entry while its own run is going.
  • Items name no new check (B11).

Refs #195, #70

Purpose (defect): a run of martha's tests leaves nothing under the host's shared temp directory that another tool can read as its own leftovers — every tree it makes is under a root only martha's runs look at, and is gone when the run ends, however it ends. ## The class Martha's test runs put directories directly in the system temp directory (TMPDIR, /tmp here), where any process on the host that watches that directory sees them: - `martha-judge-*`: `src/judge_a_checkouts_tree/the_launcher_judges_the_tree.node-test.ts:25` (`mkdtempSync(join(tmpdir(), 'martha-judge-'))`, removed in `t.after`) and `judgeTheCheckout` in `the_launcher_judges_the_tree.ts:116` (`host.stores.scratch.make(null, 'martha-judge-')`, removed in its `finally`). Both are transient by design; neither is under a run-wide root. - `m724-`: `prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.ts:54` (`RUN_ROOT_PREFIX`), the run's one-root wrapper, which lands in a plain TMPDIR for the runs #195 item 5 names (the installer's own `npm test` and the `*_bites.sh` runs). ## The instance (2026-11-25, host00, Pallas) While proving macula-io/macula-sponsors#71 I ran the crew-code launcher tests under that repository's own leftover gate (`crew-code/tests/leftover_scan.sh`, macula-sponsors#380): it snapshots the temp directory, runs one child, and compares. Three of its scans went red on entries a martha run on the same host was making at that moment, not on anything the crew-code tests wrote: ``` ::error::the launcher's install tests left fixtures in the temp directory (#380): /tmp/martha-judge-CRHN29 /tmp/claude-plugin-test-sivmBo /tmp/m724-w6lLnf /tmp/m724-yiS45W ::error::the reference-transaction guard's tests left fixtures in the temp directory (#380): /tmp/martha-judge-jPx12X ::error::the OpenCode adapter's tests left fixtures in the temp directory (#380): /tmp/m724-y7kCu8 ``` Each entry was gone a minute later (martha's next run swept or removed it), so nothing was lost and martha's own suite is not red. What went red is another repository's gate on a shared host, twice in a row, and the same box runs every member's suites: the entries are indistinguishable from a real leak of the child under test. ## Not the same as #195 #195 is about a test file that ignores its own end, and about what a killed run leaves. It does not name a test file that makes its own directory outside the run's root (`martha-judge-*`), and it does not name this harm: another repository's leftover gate, on the same host, red for martha's live entries. #70 (closed) was the leftovers that survived on host00; this is the opposite edge — trees that are meant to be temporary and are still visible to everything else while the run goes on. ## Done when - No martha test run, clean or killed, makes a directory in the host's shared temp directory: `martha-judge-*` is made under the run's own root, and the `m724-` root never lands in a shared temp directory unnoticed. - A red-first test shows it: with the fix mutated away, a child that only lists the temp directory finds martha's own entry while its own run is going. - Items name no new check (B11). Refs #195, #70
Member

A sighting of this class that the temp-root move does not cover: the runtime root still goes under the shared /tmp whenever the deepest socket does not fit under XDG_RUNTIME_DIR, and there it was removed mid-run.

Run: whole npm test through prove_the_relay_loads/run_the_tests_in_a_namespace_of_their_own.sh at nice -n 10, on host00, 2026-12-01, tip 87614d54 (martha#337, a 3-line package-lock change). The run said at its start: "the runtime root is /tmp/m724-LRRugK, not under /run/user/1000: …/relay.sock is 112 bytes, longer than the 107 a socket address holds on linux". Other members' suites were running on the box at the same time.

Result: 169 + 5674 pass, 193 fail, all one cause: ENOENT: no such file or directory, mkdtemp '/tmp/m724-<id>/<hash>/martha-relay-XXXXXX' from newShortRelayRoot (src/drive_the_recorded_host/short_relay_root.ts:27). So the run's own runtime root under /tmp was gone while the run still used it. The failures fall in the 4 files that build relay sockets: launch_a_claude_code_member 171, run_the_martha_command 13, start_an_engine_member 7, start_a_member 2. Those 4 files alone on the same tip: 381 pass, 0 fail.

The pid namespace does not isolate /tmp (it is a pid namespace only), and the start-up sweep is not the remover: it keeps roots from another namespace, and said "kept" for each it saw. So the remover is outside martha's sweep, which is the case this issue names. A done-when for this issue should cover the runtime root's /tmp fallback too, not only TMPDIR.

A sighting of this class that the temp-root move does not cover: the **runtime root** still goes under the shared `/tmp` whenever the deepest socket does not fit under `XDG_RUNTIME_DIR`, and there it was removed mid-run. Run: whole `npm test` through `prove_the_relay_loads/run_the_tests_in_a_namespace_of_their_own.sh` at `nice -n 10`, on host00, 2026-12-01, tip `87614d54` (martha#337, a 3-line package-lock change). The run said at its start: "the runtime root is /tmp/m724-LRRugK, not under /run/user/1000: …/relay.sock is 112 bytes, longer than the 107 a socket address holds on linux". Other members' suites were running on the box at the same time. Result: 169 + 5674 pass, **193 fail, all one cause**: `ENOENT: no such file or directory, mkdtemp '/tmp/m724-<id>/<hash>/martha-relay-XXXXXX'` from `newShortRelayRoot` (src/drive_the_recorded_host/short_relay_root.ts:27). So the run's own runtime root under `/tmp` was gone while the run still used it. The failures fall in the 4 files that build relay sockets: launch_a_claude_code_member 171, run_the_martha_command 13, start_an_engine_member 7, start_a_member 2. Those 4 files alone on the same tip: 381 pass, 0 fail. The pid namespace does not isolate `/tmp` (it is a pid namespace only), and the start-up sweep is not the remover: it keeps roots from another namespace, and said "kept" for each it saw. So the remover is outside martha's sweep, which is the case this issue names. A done-when for this issue should cover the runtime root's `/tmp` fallback too, not only TMPDIR.
Member

Done-when check against main 3f092f10 (landed-but-open sweep, 2026-12-01). Each commit below is an ancestor of main (git merge-base --is-ancestor).

  • No martha test run makes a directory in the shared temp directory; martha-judge-* is made under the run's own root: met, PR 213 (merge 8a90a189), prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.ts.
  • Red-first test: met, keep_a_test_run_in_one_temporary_root.node-test.ts (the martha#199 cases).
  • No new check: met, the PR adds no job or check.

Every line is met. Closing.

Done-when check against main `3f092f10` (landed-but-open sweep, 2026-12-01). Each commit below is an ancestor of main (`git merge-base --is-ancestor`). - No martha test run makes a directory in the shared temp directory; `martha-judge-*` is made under the run's own root: met, PR 213 (merge `8a90a189`), `prove_the_core/a_test_run_keeps_one_temporary_root/keep_a_test_run_in_one_temporary_root.ts`. - Red-first test: met, `keep_a_test_run_in_one_temporary_root.node-test.ts` (the martha#199 cases). - No new check: met, the PR adds no job or check. Every line is met. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha#199
No description provided.