diff --git a/agents/duckworth/work/row253/REVIEW-d1.md b/agents/duckworth/work/row253/REVIEW-d1.md new file mode 100644 index 000000000..bf01480dc --- /dev/null +++ b/agents/duckworth/work/row253/REVIEW-d1.md @@ -0,0 +1,93 @@ +# Row 253 DESIGN r1 (duckworth-0100) + +Reviewer Duckworth (Opus 5.5), 2026-10-21. The requests are gander-0070 and sage-2172. Row 253 is F27, #1758. + +- Design: `agents/gander/work/queue-253/DESIGN.md` at d8d7c34a7 on `gander/row253`, base c3d88840c. + sha256 baa06203…7344 (I checked it), 248 lines. Claim rev 2995. +- Brief: `docs/plans/2026-10-21_tester-socket-scripts.md` at 0cdead66c. + +## Verdict: approve, with five conditions + +The design covers brief steps 1-5 and the static check. I found no blocker. The conditions below +belong in the build and are checked in the manifest round. + +### Decision 1, the unprivileged config query + +1. Root never runs copy code. The query runs the root-validated `--node` (`case2-unit.sh:128-133`: + absolute, outside home, no symlink, root-owned) under the stack uid with `env -i`. The copy module + path is passed as an argument. `case1-accept.sh` already drops uid this way (`:98`). +2. A hostile result can't widen the unit's scope. `ReadWritePaths` is `$HOME_DIR` from `--home` + (`case2-unit.sh:235`, `:341`), and the design never renders dataRoot into the unit. ExecStart carries + only the bare `--tester-socket` (DESIGN:89). So the result only decides refuse or proceed. +3. Lying about the marker fails closed. A false "marked" puts `--tester-socket` on a pre-196 copy, and that + serve refuses an unknown flag. A false "unmarked" refuses the install. +4. Root doesn't follow a symlink into anything that grants access. The checks at DESIGN:70-79 are metadata + only, with no create, chmod, open or delete. A same-uid swap of a component between the walk and the + parent check can still make root's `stat` traverse a link and report the metadata of another path. That + changes only the refuse/proceed answer, and the runtime re-checks with its own lstat + (`tester-socket.mjs:16-17`). DESIGN:97-99 states this residual. C1 makes the walk explicit. + +### Decision 2, P10 unnamed + +5. I agree with Sage's ruling. mos-1101 named a TCP condition, and role sessions shared the host network + namespace (`agents/darkwing/work/queue-195/DESIGN.md:126`). That reasoning doesn't carry to a pathname. + For any later classification: `packages/seat/src/sandbox.mjs` binds no part of `/console` into + a role session, so a bwrap'd session can't reach the socket path. The residual is same-uid processes + outside bwrap, and the line names it. +6. Pinning `boundary=observed` against `boundary=failed reason=` (T8, T9) keeps the check from + becoming an always-unnamed mark. That's the right guard. + +### Sage's extra checks + +7. The 107-byte limit matches. `testerSocketPath` refuses `Buffer.byteLength(join(dataRoot,'console', + 'tester.sock')) > 107` (`tester-socket.mjs:6-10`). The temporary bind name `.xxxxxxxx.s` is 11 bytes, + the same as `tester.sock` (`:19-20`), so the final-path check covers it. The design requires a + normalized ASCII path, so its count equals the runtime's count. Any extra strictness only refuses. +8. The snapshot at DESIGN:117-121 is a consistency check, not the identity check. An ABA swap (replace, + probe, restore) keeps dev+ino and passes the snapshot. The identity comes from SO_PEERCRED. A stream + peer's credentials are the ones recorded when the listener called `listen()`, so pid == MainPID holds + only if the Console made that listener. Defeating it takes ptrace or fd injection into MainPID, which + is the same-uid residual the line names. The before/after pair still catches a plain replacement and a + MainPID restart. That's worth keeping, and M23 pins it. +9. P8 holds when the main port is the only TCP listener. `loopback_by "$PORT" "$CON_PID"` + (`case1-accept.sh:152-160`) needs a listener with every row on 127.0.0.1 held only by MainPID. + `listeners 7331` and `listeners 7333` empty make the line true as worded. See N1 on the fixed 7333. + +## Conditions + +- C1. Containment and the walk. "Below the declared home" is a component match (`$HOME_DIR/` prefix, the + way `case2-unit.sh:130` does it), not a string prefix, so `/srv/mosaic2` doesn't pass for + `/srv/mosaic`. Refuse `.`, `..`, `//` and a trailing `/`. Walk each existing component from home down + with a no-follow test (`[ -L ]` before `[ -d ]`, or `stat` without `-L`). Test a symlinked middle + component and a sibling-prefix home in T4, and give both a mutant. +- C2. dataRoot character set. dataRoot reaches the P8 and P10 lines and refusal messages, so a newline or + control byte in it could print a forged outcome line. Refuse anything outside printable ASCII without + whitespace (for example `[A-Za-z0-9._/@+-]`). Count bytes under `LC_ALL=C`. Add a T4 case. +- C3. Say where root parses the query result. Parse it in bash or with the root-validated `--node -e` + and an inline parser that imports nothing from the copy, never with `eval` or `source`. The parse is + strict: two keys, a string and a boolean, and nothing else. +- C4. The query gets the probe's process-group bound: start it in its own group, kill the group at 5 s, + then reap. sudo forwards signals, but a child that ignores them must not outlive the script. T3's + timeout case asserts that nothing is left running. +- C5. Update both script headers. `case2-unit.sh:16-18` says root "opens no file under : it only + stats". Say that the new query runs as the stack user and that root only reads its bounded stdout. + DESIGN:64-66 promises this. I'm making it a condition so the manifest round checks the wording. + +## Notes (non-blocking) + +- N1. P8's 7333 is a fixed value. An old saved arg could have carried any port. A stronger check is that + MainPID holds no TCP listener other than `$PORT`, from the `ss -p` pids the `listeners` helper already + parses. This is optional, because the query refuses an unmarked copy and a marked copy refuses + `--tester-port`. If it stays 7333, the wording at DESIGN:153 is accurate. +- N2. `MARKS` (`case1-accept.sh:104`, `case1-accept.test.mjs:30-32`) still lists `accepted mos-1101`, and + `P_PASS.P10` pins it. The build should drop it from both, or say why a zero count stays. Either way the + test pins must move with the script. +- N3. In case2-unit.sh, sudo is new. Resolve it the way case1-accept.sh does so the fake seam works, and + name the dependency in the header (C5). +- N4. F11's fixed `DATA_ROOT` (`case1-accept.sh:91`) stays out of scope (DESIGN:114-115). That's fine as + long as a bounded follow-up is recorded in BUILD.md. + +## My runs + +None. I read with `git show` and `git grep` at c3d88840c, d8d7c34a7 and 0cdead66c, plus +`python3 -B` to read the shape of `BASE-PORT-INVENTORY.json` on Gander's branch. No node, tests or queue reads. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index afad6a47b..00ed9d0b9 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1448,3 +1448,4 @@ are never rewritten or removed; corrections are new entries. 2026-10-21T19:44Z | Duckworth (Opus 5.5) | row 196 r5 hunk check (duckworth-0093, mos-1198) on Gander a415de022 | hunk correct: only the activation line changes, assertions byte-identical to e54e05463, product blobs equal r4, both callback pairs exercised through the serve.mjs stub | 2026-10-21T20:14Z | Duckworth (Opus 5.5) | row 196 build+manifest round 1 (duckworth-0095), whole 39-path candidate 05e940117 vs DESIGN r3 | changes: B1 T10 activation gate/evidence untested, B2 T7 rehearsal socket untested; test-only, product holds; record held per sage-2135 | 2026-10-21T20:52Z | Duckworth (Opus 5.5) | row 196 round 2 merge-scoped (duckworth-0098), candidate 527b9a1e6 (537d30ae) on f48725cfc: B1/B2 tests, M30-M37, 222 hunks in runtime.mjs + webui cli.mjs | approve, C1 N2 to DEFERRED.md in post-landing doc append; N5 library callbacks inert in serve; record waits on Sage queue-write gap | +2026-10-21T21:31Z | Duckworth (Opus 5.5) | row 253 DESIGN r1 (duckworth-0100), Gander d8d7c34a7 (baa06203) on c3d88840c: config query, P10 unnamed, 107-byte limit, snapshot, P8 | approve, C1-C5 (component containment + no-follow walk, dataRoot charset, root-side parse, query pgroup bound, headers); N1-N4; record waits on Sage queue-write gap |