From d14d6b22327d545d6a253f932165b63e48d7f9c8 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 1 Sep 2026 18:16:25 +0200 Subject: [PATCH] fix(agent): finalize bounded shell output integration --- .../mobile-handoff/01-harness/01-delta/delta.md | 2 +- packages/agent/docs/mobile-handoff/README.md | 15 +++++++-------- scripts/check-entry-graphs.mjs | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/agent/docs/mobile-handoff/01-harness/01-delta/delta.md b/packages/agent/docs/mobile-handoff/01-harness/01-delta/delta.md index de102e539..506f7e4c9 100644 --- a/packages/agent/docs/mobile-handoff/01-harness/01-delta/delta.md +++ b/packages/agent/docs/mobile-handoff/01-harness/01-delta/delta.md @@ -476,7 +476,7 @@ Two further measures on the same hazard: What prototype pollution actually buys an attacker here is narrower than it first appears: **it flips defaults, it does not overwrite explicit values.** An own property shadows. So `{name:"bob", isAdmin:false}` is unaffected; an option bag read -as `opts.skipSandbox` is not. Our own `ShellExecOptions`, `CaptureOptions`, +as `opts.skipSandbox` is not. Our own `ShellExecOptions`, `ShellOutputCaptureOptions`, `ListReadOptions` and `TrackerOptions` are exactly that shape. Note also that `"x" in {}` and `const {x = false} = {}` both lie under pollution — which is why the applier uses `Object.hasOwn`. diff --git a/packages/agent/docs/mobile-handoff/README.md b/packages/agent/docs/mobile-handoff/README.md index 2ba287c69..8ac7c5c1f 100644 --- a/packages/agent/docs/mobile-handoff/README.md +++ b/packages/agent/docs/mobile-handoff/README.md @@ -6,8 +6,8 @@ later units consume earlier ones. ``` 01-harness/ 01-delta/ op vocabulary, tracker, applier, codec [LANDED IN CHORD] - 02-scopes/ storage scopes, list tags, JSONL encoding [SPEC + type check] - 03-execenv/ bounded Shell output, capture, spill [CODE + 29 tests] + 02-scopes/ storage scopes and list tags [STEP 1 ACTIONABLE] + 03-execenv/ bounded Shell output, capture, spill [PRODUCTION CODE + TESTS] 04-tool-output/ the ToolOutput sink [SPEC ONLY] 05-assistant-output/ assistant partials, symmetric with 04 [SPEC ONLY] 02-plugins/ @@ -40,8 +40,8 @@ five more measurement traps, each of which produced a confident wrong conclusion | unit | ships | state | | --- | --- | --- | | **01-delta** | production implementation and tests in `packages/chord`; prototype evidence here | landed; D1 fixed, explicit text API rejected after production remeasurement | -| **02-scopes** | spec + `scopes.variance.ts` | spec aligned to code; not implemented. The variance check compiles. | -| **03-execenv** | impl, rewritten bash, 2 diffs, spec | ran green (29 tests). **Its checkpoint policy is wrong** — see `04-tool-output/rate-limiting.md` §5 | +| **02-scopes** | spec + [actionable Step 1 handoff](01-harness/02-scopes/implementation-handoff.md) + `scopes.variance.ts` | Step 1 scopes/list tags actionable, not implemented; JSONL Chord encoding/address interning deferred to separately approved Step 2 | +| **03-execenv** | production implementation in `packages/agent`; prototype evidence here | source-bounded adaptive output, lazy spill backpressure, and bash migration landed; bash's temporary checkpoint cadence moves to `ToolOutput` next | | **04-tool-output** | spec + design notes | **not built.** The piece every measurement of the op encoding depends on | | **05-assistant-output** | spec | not built. Same shape as 04; do it after | | **02-plugins/01-facets** | spec, ~1800 lines | not built. §14 rewritten to match the sandbox PoC | @@ -49,10 +49,9 @@ five more measurement traps, each of which produced a confident wrong conclusion ## Suggested order -1. **`03-execenv`** — land the shipped code, minus the checkpoint policy and the two redundant knobs (`rate-limiting.md` §5). -2. **`02-scopes`** — the compiler finds the call sites for you once `Write` is invariant. -3. **`04-tool-output`** — decide the cadence question first (`rate-limiting.md` §4.3 lists what is undecided), then build. -4. **05**, then **02-plugins**. +1. **`02-scopes` Step 1** — follow the [actionable implementation handoff](01-harness/02-scopes/implementation-handoff.md); stop for approval before its separate Step 2. +2. **`04-tool-output`** — reuse the landed adaptive publisher for generic tools, Chord event/durable batches, terminal flushes, and atomic memo checkpoints. +3. **05**, then **02-plugins**. ## Live bugs on `origin/dev`, independent of this design diff --git a/scripts/check-entry-graphs.mjs b/scripts/check-entry-graphs.mjs index dc6f640c4..fdbf5d330 100644 --- a/scripts/check-entry-graphs.mjs +++ b/scripts/check-entry-graphs.mjs @@ -37,7 +37,7 @@ const BUDGETS = { "packages/agent": { "./harness/runtime/reducer": { maxFiles: 1 }, "./harness/context": { maxFiles: 6, forbid: ["harness/runtime/", "harness/execution/", "packages/ai/"] }, - "./harness/env/nodejs": { maxFiles: 3, forbid: ["packages/ai/", "harness/runtime/"] }, + "./harness/env/nodejs": { maxFiles: 5, forbid: ["packages/ai/", "harness/runtime/"] }, "./harness/session": { maxFiles: 25, forbid: ["harness/runtime/", "harness/execution/", "packages/ai/src/index.ts"] }, }, };