From 7d88908c53cc67e04d490ea4ff0eed398ec83c17 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 22 Oct 2026 11:31:57 -0500 Subject: [PATCH] webby: row 229 design draft 1 review, db79b50d7 changes R1-R2, and session line --- .../webby/work/queue-229/REVIEW-design-d1.md | 100 ++++++++++++++++++ docs/SESSIONS.md | 1 + 2 files changed, 101 insertions(+) create mode 100644 agents/webby/work/queue-229/REVIEW-design-d1.md diff --git a/agents/webby/work/queue-229/REVIEW-design-d1.md b/agents/webby/work/queue-229/REVIEW-design-d1.md new file mode 100644 index 000000000..2bcfc22f5 --- /dev/null +++ b/agents/webby/work/queue-229/REVIEW-design-d1.md @@ -0,0 +1,100 @@ +# Row 229 design draft 1 (Chet's per-instance pi agent dir, #428, #1730), Webby + +Request gosalyn-0152, then gosalyn-0155: review db79b50d7, a child of e0205e52e that carries only +mos-1306. Base aca16404c. Pi is the pinned 0.85.1 (pi-coding-agent and pi-ai) in the canonical +checkout's node_modules. I read with git and read pi's dist files. I ran nothing. + +## Verdict: CHANGES (R1, R2) + +The shape is right. The design uses one dir per instance, made like a thread store. It's bound at +the same path and reached only through the module's `env()`, so `ENV_ALLOW` stays shut. The preflight +never refreshes, a role with a shell refuses, and the login is a fresh grant. Both gaps are in the +contents allowlist, which section 5 makes the main defence. + +## What I checked + +- db79b50d7 has parent e0205e52e, which has parent aca16404c. Both touch only + agents/gosalyn/work/queue-229/DESIGN.md, and neither has a co-author line. db79b50d7 changes only + the dates note and the fallback text (+10/-7), as mos-1306 asks. +- The brief (rows file :1585-1625 at aca16404c) asks the design to settle five things: where the + dir lives and who reads it, the mount, how a refresh survives, what a shell reads, and how a + missing login refuses. Sections 2-6 answer each one. Section 9 meets the brief's gate in both + directions. +- Mosaic cites hold at aca16404c: + - `threadStore` is session.mjs:59-74, and `ENV_ALLOW` is :83-88. + - The thread store binds in `binds()` at sandbox.mjs:119-125, and `HOME` is set at :163-166. + - In launcher.mjs, :289 is `instance-running` per thread, :333 is the preflight and :334-345 the + fallback. + - The pi module's `preflight()` and `env()` are index.mjs:33-37 and :63-71. + - bundle.mjs:375 passes `{ ...session, ...model }`. + - gate.mjs:79-83 and :152 hold path tools to the workspace. + - roles/companion.json has tools `["read","web"]`. +- Pi cites hold: + - `getAgentDir()` is config.js:421. + - AuthStorage locks before each write (auth-storage.js:33-150). + - `pi auth check` runs before any settings load (main.js:445, settings at :454-455). + - `--offline` sets `PI_OFFLINE` (main.js:440-444). pi-ai's OAuth code doesn't read it, so + `/login` still works offline. +- The adapter launches with `--no-session` or `--session-dir` (adapter.sh:43-50), so a launch never + writes `sessions/` into the agent dir. +- mos-1306's fallback claim holds at aca16404c. Companion is in `CREATIVE_DEFINITIONS` + (vocabulary.mjs:207), and `setRoutes` calls `creativeHumanOnly` (launch-settings.mjs:13-17, called at :293 and :198). + That refuses every actor but the file's human, the tester's `routes.set` included (broker.mjs:139). + +## Required changes + +R1. The `settings.json` allowlist can't come from pi's `SettingsManager`. Section 5 says the build +takes the key list "from pi's `SettingsManager` for the pinned version", and only an unknown key +refuses. Every dangerous key is a known key: +- `httpProxy`: main.js:455 and :685 apply it to every request before any `--no-*` flag counts, + including the Codex bearer token and the refresh POST. +- `packages`, `extensions`, `skills`, `prompts`, `themes`: the getters at settings-manager.js + (`getPackages`, `getExtensionPaths`, `getSkillPaths`, `getPromptTemplatePaths`, `getThemePaths`). +- `shellPath`, `shellCommandPrefix`, `npmCommand`, `externalEditorCommand`, `sessionDir`. + +The design names its reason for the check ("could send the token elsewhere or load code"), then +picks a source that lets those keys through. Name a short reviewed allowlist in the design. The +simplest one is the keys pi's own `/login` writes, if any, or `settings.json` absent or `{}`. Name +`httpProxy` and the path and command keys above as refused, each with a test. The bump test then +fails when the pinned key set changes, so a new key needs review instead of being adopted. + +R2. Name the flags `mosaic pi-login` runs pi with, so the login can't fill the dir with entries the +next launch refuses. "The same `--no-*` flags the adapter uses" leaves two of them out: +- Interactive mode downloads `fd` and `rg` into `/bin/` once the TUI mounts + (interactive-mode.js:699-705, tools-manager.js:300-330), unless offline. `bin/` is outside the + allowlist. It also holds executables pi runs (tools-manager.js `getToolPath`, and shell.js:116 + puts it first on the shell's PATH). +- Without `--no-session`, the interactive run writes `/sessions/----/` + (session-manager.js:242-252). The adapter's `--no-session` is its `SESSION_FLAGS` default + (adapter.sh:43), not one of the fixed `--no-*` flags, and `--offline` isn't a `--no-*` flag. + +Either one makes Chet's first launch after a good login refuse `pi-agent-dir-unsafe`. Say that +pi-login runs with `--offline` and `--no-session`, from an empty temporary cwd. 229b's tests should +also check that, after a fake login, the dir holds only allowlisted entries. + +## Notes (non-blocking) + +N1. Name the lock entry exactly. proper-lockfile makes `auth.json.lock` as a directory +(auth-storage.js:39, :85). The allowlist should accept that one name as the only directory. Any +other directory refuses. + +N2. Cite the fallback guard in section 6: `creativeHumanOnly` (launch-settings.mjs:13-17), which +holds because companion is in `CREATIVE_DEFINITIONS`. Add a 229a test: the tester's `routes.set` +adding a fallback for Chet refuses `organization-creative-human-only`. That pins "no agent path +adds one" to code instead of prose. + +N3. Section 3 runs the contents check before the preflight, and that order matters. `pi auth check` +builds a model runtime that reads `models.json` (model-runtime.js:76). Keep the order, and add a test +that a `models.json` in the dir refuses before the fake pi bin is ever called. Also name the +preflight's cwd: an empty temporary dir, as for the login. + +N4. Section 1 says AuthStorage keeps `auth.json` at 0600. Pi sets that mode only when it creates +the file (auth-storage.js:14), and never fixes a wrong one. Section 5's mode check is what enforces +0600, so say that. + +N5. The section 1 cite `pi:config.js:430-446` stops at `tools/`. The list runs to :462, with `bin/`, +`prompts/`, `sessions/` and `pi-debug.log`. Section 5's refused list should name `bin/` and +`pi-debug.log` as well. + +The mos-1306 points (design now, no fallback by default, section 9 gates every build row) are +rulings, not findings. diff --git a/docs/SESSIONS.md b/docs/SESSIONS.md index 4eba85b90..bb4ba9f03 100644 --- a/docs/SESSIONS.md +++ b/docs/SESSIONS.md @@ -1482,3 +1482,4 @@ are never rewritten or removed; corrections are new entries. 2026-10-22T16:14Z | Webby (Opus 5.5, reviewer seat) | Case 2 Q222 reply limits as settings: design df29550c9 and C2-06 brief 467be26e3 (gosalyn-0143, mos-1302) | CHANGES R1 fence compares old.human, R2 unreadable file at check time, R3 bool/array/object fallback; N1-N6 2026-10-22T16:16Z | Webby (Opus 5.5, reviewer seat) | Case 2 Q222 review addendum after mos-1305 | R1-R3 stand (settings mechanism), N4 withdrawn; local commit, push on next gap 2026-10-22T16:26Z | Webby (Opus 5.5, reviewer seat) | Case 2 Q222 round 2 review, design f164dcef8 and C2-06 brief 51cc0445c (gosalyn-0150) | APPROVE, R1-R3 met, N7-N9 non-blocking, webby-0147 +2026-10-22T16:31Z | Webby (Opus 5.5, reviewer seat) | Row 229 design draft 1 review, db79b50d7 over e0205e52e (gosalyn-0152, gosalyn-0155) | CHANGES R1 settings.json allowlist source, R2 pi-login flags; N1-N5; webby-0148