diff --git a/BUILD-LOG.md b/BUILD-LOG.md index c929c7ef8..18e5afc57 100644 --- a/BUILD-LOG.md +++ b/BUILD-LOG.md @@ -5825,3 +5825,5 @@ Before: agents can read the library; supporting-path and push-credential depende 2026-10-26 | Steelbeak | Row227 authorized owned native-priority gate prerequisite: Python self/preexec19 plus quiet Node own set/getPriority preload, separate receipts. Probe Node/directchild native19 exit0/no drift. Corrected whole acceptance then STOPPED exit143/0.288s beforeS1a on measured post-preload drift e2ePID2598465 native19 then16; bash-4. No daemon attribution proven/no scheduler remediation/rerun. Rawstdout36bytes SHAa695ba02e8fcfe4b103fba373fb7b7eabb3736086eccde37fb3df7797c0a1a27, pre/postpins unchanged, survivors0/private roots removed. FirstRED immutable; separate runs/priorityprobe and runs/corrected1. Parent boundary report, no global/fullgate/live traffic. 2026-10-27 | Steelbeak | Row227 R1 CHANGES static response, reportSHA30bc5f1f... verified/fullread. APPEND-ONLY CORRECTION: actual fake lengths14/13/14->19/18/19; earlier13/12/13->18/17/18 metadata wrong, existing valid current values unchanged. Prior packet39f149fb and consumed evidence immutable. Prepared owned PID/start ancestry monitor without global nice/argv scan or Node exemption, fail-closed pins/capture/receipts/cleanup, real launcher/bwrap/runner/adapter identity-release preload route through fixture-only seam; added own made-up ZAI fixture key for joined real P3 preflight plus leak/history guards. No product/preflight/ENV_ALLOW authority edits, Node/parser/tests/priority execution, commit/push; fresh independent R2 review and1014 admission still required. + +2026-11-02 | Lead sub-agent (Claude Opus 5.5, under T3 c5c1e8ba) | Row 227 R2 (#1728): test-case2.sh now runs standalone. Removed every tie to the R1 slot controller (ROW227_CONTROL_ROOT, nonce and permits, priority.mjs, owned bwrap wrapper, controller cleanup marker); leak check reads fixture-credentials.mjs; driver under env -i with TMPDIR in the sandbox; cleanup bounded to 3 s then SIGKILL. R1 red 0.294 s confirmed; all 17 steps passed with no step fix; two green runs 4.96 s and 5.74 s; mutants m1-m5 red at S2b, S3c, S4, S5b, S6, m6 (requireCitation) survived and is a follow-up; tip check on fddae79ef green 5.05 s, no conflicts. Code 04e1ce24c; record in agents/steelbeak/work/queue-227/BUILD.md "R2". diff --git a/agents/steelbeak/work/queue-227/BUILD.md b/agents/steelbeak/work/queue-227/BUILD.md index 4a0d3c260..74b4841a8 100644 --- a/agents/steelbeak/work/queue-227/BUILD.md +++ b/agents/steelbeak/work/queue-227/BUILD.md @@ -398,3 +398,147 @@ control requirements. E2e/fake-key bytes and shell PASS/assertion/protocol body 19/18/19+ZAI17 and all17 names/assertions/deadlines retained. Isolated reference14507 entries is NOT target admission/joined freeze. No local Node/codeparser/tests/fault/bwrap/process/priority probe, commit/push/selfapproval; runner UNADMITTED, fresh independent disposition still required. + +## R2: the suite runs standalone (lead round 2, 2026-11-02) + +Author: implementation sub-agent of the Mosaic Stack lead (T3 c5c1e8ba), Claude Opus 5.5, working from the lead's +brief `row227-r2-fix.md` and the Opus review `row227-opus.md`. This is the lead's second round on row 227, not the +"R2 CHANGES" packet earlier in this file. Branch `t3/row227-r2-fix` on candidate `46c07df75`, base `09a847eda`, not +rebased. Code commit `04e1ce24c`. Earlier sections are unchanged and are not adopted here; each claim below was +checked in this checkout. + +### R1 confirmed red + +`bash scripts/test-case2.sh` on `46c07df75`: exit 1 in 0.294 s. The driver stopped in `launchFixture` with +`row227-native-control-required` because `ROW227_CONTROL_ROOT` was unset. 2 passed, 2 failed, stderr empty, no +process left under the checkout or TMPDIR. This matches the review's 0.218 s red. + +### Findings and fixes + +- P1, the suite cannot pass outside the private controller. Removed from `scripts/case2/launch.mjs`: the + `ROW227_CONTROL_ROOT` check, the `control.json` nonce read, `nativePermit` and its call in `bindLaunch`, the + `fixture-cleanup.pending` and `fixture-cleanup.json` write in `close()` (only the controller read it), the + `owned-bwrap.sh` wrapper and `priority.mjs` in `readOnly`. `createLauncher` now uses its default bwrap, and the + adapter shell runs the adapter without the `--import` preload. The `owned-runtime-cleanup-incomplete` check in + `close()` stays. In `scripts/test-case2.sh` the `ROW227_CONTROLLER_CLEANUP` branch is gone, so the shell always + removes its sandbox. The suite no longer sets its own process priority; the R1 nice-19 handshake belonged to the + controller. +- P2, product scripts import a seat work packet. Removed the `priority.mjs` import from + `scripts/case2/citation-adapter.mjs`. `git grep -n -e 'agents/' -e ROW227_ -- scripts/case2 scripts/test-case2.sh` + prints nothing (rc 1). The packet's gate files are untouched. +- P3, leak-check literals (`test-case2.sh:63`). `scripts/case2/fixture-credentials.mjs` holds all four fixture + values and exports `FIXTURE_CREDENTIALS`; `e2e.mjs` imports the tokens from it instead of keeping its own copies. + The new `scripts/case2/leak-check.mjs` reads the driver's stdout and stderr as bytes and exits 1 if any value + appears, 0 if none does, and 2 when it gets no file or cannot read one. It never prints a value. R1's `grep -qF` + counted an unreadable file as clean; this refuses instead. +- P3, caller environment (`test-case2.sh:45`). The syntax check, the driver and the leak check run under `env -i` + with PATH, `LANG=C.UTF-8`, a sandbox HOME with the four XDG dirs under it, `TMPDIR=$SANDBOX/t`, `MOSAIC_CONFIG`, + `GIT_CONFIG_GLOBAL=/dev/null` and `GIT_CONFIG_NOSYSTEM=1`. Nothing else from the caller reaches the driver or the + launcher it starts. Control below. +- P3, driver tmpdir outside the sandbox. The driver's TMPDIR is `$SANDBOX/t`, so the Chromium profile and the + plug-in tree go when the shell removes the sandbox. Length check below. +- P3, unbounded cleanup wait (`test-case2.sh:18`). The driver starts under `setsid` and leads its own group. + `stop_driver` sends it SIGTERM, waits at most 3 s by the clock (`EPOCHREALTIME`), then sends SIGKILL to the group + and reaps it. It then sends SIGKILL to any process whose cwd is under the sandbox, found with one + `find /proc/[0-9]*/cwd -lname`, because the launcher starts each bwrap session in its own group. It prints a count + when it kills any. Then the sandbox is removed. +- P3, browser flags. `packages/webui/tests/browser.mjs` is unchanged; see follow-ups. + +### Step failures past launchFixture + +None. With the controller ties removed, the first run (debug run d1, rc 0, 5.5 s) passed all 17 steps. No step +needed a fix. No assertion, step name, step list or deadline changed. I stopped on no `packages/` defect. + +### TMPDIR length, browser and sockets + +The driver TMPDIR in these runs was 48 bytes (`/mnt/storage/scratch/tmp/iyiP1X/tmp.XXXXXXXXXX/t`), past the 35-byte +line, so I measured the sockets instead. Paths from green run final-g1: `broker.sock` 72 bytes, +`bus-host/git.sock` 74, `bus-host/launch.sock` 77, the launch's `tools.sock` 95, and Chromium's `SingletonSocket` +under `$SANDBOX/t` 93. All are under the 108-byte `sun_path` limit, and S3b and S10 pass. The longest, +`tools.sock`, is the caller's TMPDIR plus 64 bytes, so the caller's TMPDIR must stay at or under 43 bytes. + +### Environment control + +The shell ran with `CASE2_CALLER_PROBE` and `GITEA_TOKEN` set to dummy values in the caller. A sampler outside the +repository (`python3 -B`) read `/proc//environ` of every process under the run. Final code: shell green, +21 passed. 37 processes recorded, 31 read, 6 exited before the read. Read by name: bash 1, node 3 (driver, runner, +citation adapter), git 9, git-remote-http 4, bwrap 1, chromium 13. Only the bash shell itself had either +variable. No other process had either. A run on the earlier cleanup code gave the same result over 55 processes. + +### Signal controls + +The landing gate sends SIGTERM to the shell's group and SIGKILL 5 s later (`packages/seat/src/landing.mjs:84-88`). +I sent the same from outside, against the final code: + +- Plain run, SIGTERM mid-run: exit 143 in 256 ms, no SIGKILL needed, sandbox removed, nothing left. +- Driver held with SIGSTOP first, then SIGTERM: exit 143 in 3105 ms, with + `note: 2 process(es) under the sandbox outlived the driver; sent SIGKILL`, sandbox removed, nothing left. + +My first bound counted 30 sleeps of 0.1 s and swept with a subshell per process. Its held-driver control took +4017 ms, about 1 s inside the gate's 5 s. On this host 30 x `sleep 0.1` took 3.03 s, and the per-process sweep +took 0.75 s over 970 processes against 0.013 s for one `find`. The final code uses the clock bound and the single +`find`. The `-lname` patterns matched the sandbox root and a path under it, and did not match a sibling directory +with the same prefix. + +### Mutants + +Each is a one-line change under `packages/`. A mutant ran only when `git diff --numstat -- packages/` showed +exactly `1 1 `. Each ran once with `bash scripts/test-case2.sh`, then `git checkout -- `. After each, +`git status --short` showed no tracked change and the process list matched the one taken before. Final code: + +| # | File:line | Change | Red at (failing steps) | Result | Time | +|---|---|---|---|---|---| +| m1 | `packages/library/src/mirror.mjs:252` | `scope === 'unmapped'` to `scope === 'mutant'` | S2b: refused project-read-missing, expected project-read-path | 19 passed, 2 failed | 5.7 s | +| m2 | `packages/library/src/guard.mjs:72` | `if (!reply.cited)` to `if (reply.cited)` | S3c missing stored guard check; S4 retry answer; S10 Console dropped stored reply/check | 17 passed, 4 failed | 5.5 s | +| m3 | `packages/library/src/guard.mjs:88` | `found[i].scope !== 'canon'` to `=== 'mutant'` | S4: retry answer | 19 passed, 2 failed | 5.0 s | +| m4 | `packages/library/src/sync.mjs:168` | `accept !== tip` to `accept === 'mutant'` | S5b: answered, expected library-accept-stale | 19 passed, 2 failed | 5.0 s | +| m5 | `packages/library/src/write.mjs:164` | trailer `Mosaic-Agent:` to `Mosaic-Agent-Mutant:` | S6 missing agent trailer; S8 library-revert-not-agent; S10 actual write notice is required | 17 passed, 4 failed | 3.9 s | +| m6 | `packages/library/src/guard.mjs:68` | `if (limits.requireCitation && ...)` to `if (false && limits.requireCitation && ...)` | none | survived: 21 passed, 0 failed | 5.7 s | + +Each failed count includes the shell's own `driver ran to the end` check. The driver records a failed step and goes +on, so one mutant can fail later steps too. m1 to m5 also went red at the same steps on the earlier cleanup code +(4.8 to 6.4 s each). + +m6 survives because no step sends a reply without a citation. The fixture sets `requireCitation: true` +(`scripts/case2/launch.mjs:64`), but every scripted reply carries a citation, and the runner's fixed fallback texts +are exempt (`guard.mjs:65`). The brief named the citation requirement as an example target; the guard is covered by +m2 and m3 instead. The row brief's "What ships" does not list a citation-missing case, so I added no step. See +follow-ups. + +One run was discarded: my first m2 attempt edited line 73, the edit did not match, and the suite ran green on +unchanged code. Every later mutant was gated on the numstat check above. + +### Runs + +All foreground, one at a time, `timeout -k 10 1800`, output under TMPDIR, process lists before and after each. + +- R1 on `46c07df75`: red, exit 1, 0.294 s. +- Final code, `bash scripts/test-case2.sh`, no extra variables: final-g1 green, 21 passed, 4.96 s; final-g2 green, + 21 passed, 5.74 s. During final-g1 the driver's pid, group and session ids were equal (2646097). +- Earlier cleanup code: two green runs, 6.85 s and 5.80 s. +- `bash -n scripts/test-case2.sh` passes. `node --check` passes on `citation-adapter.mjs`, `e2e.mjs`, + `fixture-credentials.mjs`, `launch.mjs` and `leak-check.mjs`. +- No process was left under the checkout or TMPDIR after any run, and no sandbox directory remained. + +### Tip check + +`git -C /mnt/storage/src/mosaic-stack worktree add --detach /mnt/storage/scratch/rr227b/tip fddae79ef`, node_modules +linked the same way (`git ls-files -co --exclude-standard | grep node_modules` printed nothing), then +`git -c core.attributesFile=/mnt/storage/scratch/q284gate/union.attributes merge --no-commit --no-ff 04e1ce24c`: +rc 0, no conflicts; `BUILD-LOG.md` and `docs/SESSIONS.md` merged as unions. `bash scripts/test-case2.sh` there: +green, 21 passed, 5.05 s, nothing left. Links removed and the worktree removed with `worktree remove --force`. +This file cannot hold the result of a merge that includes it, so the tip check on the records head goes in the +return to the lead. The records commit only appends to this file, `BUILD-LOG.md` and `docs/SESSIONS.md`. + +### Follow-ups + +1. `packages/webui/tests/browser.mjs:13-14` passes `--headless`, `--no-first-run`, `--no-default-browser-check`, + `--disable-dev-shm-usage`, `--remote-debugging-pipe` and `--user-data-dir`, but not + `--disable-background-networking` or `--disable-component-update`. The S10 browser may try outbound requests. + Left alone per the brief; it belongs to the webui owner. +2. m6: no step exercises `citation-missing`. A check where the scripted adapter first sends a plain body and the + runner retries would cover it. It changes the step map the review checked, so it waits for the lead's ruling. +3. TMPDIR: the caller's TMPDIR must stay at or under 43 bytes or `tools.sock` passes `sun_path`, and S3b fails + closed. +4. The sandbox sweep finds processes by cwd link only. A process that moved its cwd out of the sandbox and left + the driver's group would not be found. None did in these runs. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 0bf7b96c1..e2c085cf4 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1897,3 +1897,5 @@ are never rewritten or removed; corrections are new entries. 2026-10-27 | Steelbeak (Codex) | Row227 independent R2 CHANGES F1-F4 source/control preparation | Full reportSHA3e919b63... verified. Preparing kernel role/run/innerPID+actual registry attribution, bounded ancestry reconciliation, admitted complete execution pins and unconditional raw/failure cleanup evidence. Existing fake values/ZAI17 and all17 assertions/deadlines preserved; prior packets/consumed evidence immutable. No Node/parser/tests/process/target execution, product commit/push or author approval. 2026-10-27 | Steelbeak (Codex) | Row227 R3 CHANGES bounded4-finding source response | Full23936B reportSHAeadec81a verified. Five-file proposed fix: proven-exit lifecycle, required installed deps, controlled shell scratch retention, bounded nonblocking regular raw capture. PacketR4 SHA4eb60915/currentmap0cfd47c2, prior packets/raw/pins immutable, all17 assertions/deadlines/fake values retained. No Node/parser/tests/fault/process/priority/target execution, commit/push or selfapproval; independent review/admission pending. + +2026-11-02 | Lead sub-agent (Claude Opus 5.5, under T3 c5c1e8ba) | Row 227 R2 (#1728): standalone Case 2 suite, Opus review P1, P2 and P3 | Code 04e1ce24c on t3/row227-r2-fix: controller ties removed, suite green twice (4.96 s, 5.74 s), env control clean, 5 of 6 mutants red, tip check green. Not pushed; record in queue-227 BUILD.md "R2".