A test run sweep judges only roots made in its own pid namespace (martha#203) #208

Manually merged
terra merged 2 commits from uranus/203-sweep-own-pid-namespace into main 2026-11-26 01:31:49 +00:00
Member

Refs #203. Lands right after PR 201 (#195). The two touch the same file but different functions, so merging 201 first conflicts nowhere I can see.

What: owner.json names the run's pid namespace (readlink /proc/self/ns/pid). sweepOneRoot judges the owner pid only when that namespace is its own. A root from another namespace, or one with no recorded namespace, is kept with what works in it, and said on stderr. Threat model: issue comment 5165.

Proof: one run at a time, inside unshare --user --map-root-user --pid --fork --mount-proc, after pgrep showed no other run.

  • Green: the wrapped test file passed 11/11, twice.
  • Red, with if (elsewhere !== undefined) … removed:
    • Run 1: both new tests are red, along with the #70 loop test.
    • Run 2, the same mutant: 6 red, including tests that came before the new ones.
  • The mutant is main's sweep logic, so the extra reds may be main's own flake inside a namespace. I did not chase them; the green code was 11/11 both times.
  • tsc, eslint on the directory, check:restated-values and check:private (on the range) are clean.
Refs #203. Lands right after PR 201 (#195). The two touch the same file but different functions, so merging 201 first conflicts nowhere I can see. **What:** `owner.json` names the run's pid namespace (`readlink /proc/self/ns/pid`). `sweepOneRoot` judges the owner pid only when that namespace is its own. A root from another namespace, or one with no recorded namespace, is kept with what works in it, and said on stderr. Threat model: issue comment 5165. **Proof:** one run at a time, inside `unshare --user --map-root-user --pid --fork --mount-proc`, after `pgrep` showed no other run. - Green: the wrapped test file passed 11/11, twice. - Red, with `if (elsewhere !== undefined) …` removed: - Run 1: both new tests are red, along with the #70 loop test. - Run 2, the same mutant: 6 red, including tests that came before the new ones. - The mutant is main's sweep logic, so the extra reds may be main's own flake inside a namespace. I did not chase them; the green code was 11/11 both times. - `tsc`, `eslint` on the directory, `check:restated-values` and `check:private` (on the range) are clean.
A test run's sweep judges only roots made in its own pid namespace (martha#203)
All checks were successful
dependency advisories / node in . (pull_request) Successful in 12s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
dependency advisories / node in installer (pull_request) Successful in 14s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 6s
CI / links resolve (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
CI / structural floor (pull_request) Successful in 33s
CI / Martha's names are its own (pull_request) Successful in 34s
CI / no import cycle (pull_request) Successful in 33s
CI / the host drift check bites (pull_request) Successful in 1m10s
CI / the posted text check bites (pull_request) Successful in 14s
CI / the engine drift check bites (pull_request) Successful in 46s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 17s
CI / workflows are valid (pull_request) Successful in 13s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 1m11s
CI / installer (pull_request) Successful in 2m19s
CI / the pictures change only with the version (pull_request) Successful in 44s
CI / every check runs in a job (pull_request) Successful in 33s
CI / no literal restates a defined value (pull_request) Successful in 59s
CI / gate coverage (pull_request) Successful in 17m37s
CI / every job has a timeout (pull_request) Successful in 37s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 34s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 46s
CI / the relay loads in the recorded host (pull_request) Successful in 15m2s
CI / the clean-install proof removes its container (pull_request) Successful in 20m18s
b892612ecf
owner.json now names the run's pid namespace as the kernel does (/proc/self/ns/pid).
sweepOneRoot judges a root's owner pid only when that namespace is its own. A root
from another namespace, or one whose namespace cannot be told (an owner file from
before this change, a /proc that will not say), is kept with what works in it, and
said on stderr. So a run in one namespace never kills another live run's processes
and never deletes its trees mid-run.

Refs #203
Merge main 6957a0e2 (martha#195) into the pid-namespace sweep (martha#203)
All checks were successful
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 6s
CI / structural floor (pull_request) Successful in 31s
CI / Martha's names are its own (pull_request) Successful in 32s
CI / no import cycle (pull_request) Successful in 29s
CI / the host drift check bites (pull_request) Successful in 1m7s
CI / the engine drift check bites (pull_request) Successful in 41s
CI / workflows are valid (pull_request) Successful in 28s
CI / the posted text check bites (pull_request) Successful in 29s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 29s
CI / nothing private (pull_request) Has been skipped
CI / the pictures change only with the version (pull_request) Successful in 13s
CI / every check runs in a job (pull_request) Successful in 10s
CI / no test the base passed goes missing (pull_request) Successful in 31s
CI / every job has a timeout (pull_request) Successful in 10s
engine drift / the recording says what the engine says (pull_request) Successful in 20s
CI / no literal restates a defined value (pull_request) Successful in 55s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 12s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 27s
CI / installer (pull_request) Successful in 2m19s
host drift / the recording is of the host members run (pull_request) Successful in 1m54s
CI / the relay loads in the recorded host (pull_request) Successful in 15m56s
CI / the clean-install proof removes its container (pull_request) Successful in 21m7s
CI / gate coverage (pull_request) Successful in 18m11s
5fbe4c01d9
Both guards kept: #195's refusal of a non-absolute TMPDIR and #203's
sweep of a root only in its own pid namespace. The duplicate namespace
read folds into linuxProcessIdentities.pidNamespace (Neptunus r1 note).
terra manually merged commit cc867613db into main 2026-11-26 01:31:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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!208
No description provided.