Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7fad675
feat: preserve Base2 context and streamline tool discovery
AnzoBenjamin Nov 29, 2026
2d3db93
docs: refresh context planning and tool discovery knowledge
AnzoBenjamin Nov 29, 2026
22e514d
test(agents): exercise parent-authorized context compaction
AnzoBenjamin Nov 29, 2026
1ec8155
feat: route static reviews from diff evidence and add runtime checks
AnzoBenjamin Nov 29, 2026
9afbdd1
docs: record static and dynamic review contracts
AnzoBenjamin Nov 29, 2026
60a7d9f
fix: accept runtime triage receipts and verify plan reachability
AnzoBenjamin Nov 29, 2026
86d2c94
fix(ci): restore eval and integration coverage
AnzoBenjamin Nov 29, 2026
deb1a0a
chore(deps): record verified npm releases
AnzoBenjamin Nov 29, 2026
c2cc43d
chore(deps): update workspaces and adopt upstream improvements
AnzoBenjamin Nov 29, 2026
92dcf95
docs: refresh CLI, common, and SDK upgrade guidance
AnzoBenjamin Nov 29, 2026
6d5364d
fix(agents): preserve the tested spawn contract wording
AnzoBenjamin Nov 29, 2026
56be5c7
fix(agents): complete tool reliability remediation
AnzoBenjamin Nov 30, 2026
391e29f
fix(agents): satisfy reliability pre-push checks
AnzoBenjamin Nov 30, 2026
e6949a9
fix(runtime): harden supervised journal delivery and bridge deadlines
AnzoBenjamin Nov 30, 2026
ee8d7ca
fix(sdk): resolve workspace SDK imports during typecheck
AnzoBenjamin Nov 30, 2026
ad20131
fix(ci): improve heading retrieval and confirm selected test cleanup
AnzoBenjamin Nov 30, 2026
a51e6ca
fix(ci): pass restricted PATH to shipped SDK tests
AnzoBenjamin Nov 30, 2026
754002f
fix(ci): validate offline lifecycle summary with Bash
AnzoBenjamin Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"type": "module",
"scripts": {
"typecheck": "bun x tsc --noEmit -p tsconfig.json",
"test": "bun test __tests__"
"test": "bun --no-env-file --no-install ../scripts/run-workspace-tests.ts .agents unit"
}
}
419 changes: 419 additions & 0 deletions .agents/sessions/agent-tool-reliability-remediation/PLAN.md

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions .agents/sessions/audit-agent-tool-coverage-2026-11/AUDIT-REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Openbuff audit: orchestrator, agents, and tool coverage

**Checkout:** `6d5364de3` · **Scope:** the shipped discovery → retention → edit → review → test lifecycle and its CLI/SDK wiring. [Full tool and spawn matrix](TOOL-MATRIX.md) · [Scope and verification](STATUS.md)

**Verdict:** The default local CLI has enough specialists and primitives for a human-directed coding workflow. It does not consistently compose them into the advertised automatic workflow. The biggest gaps are rejected handoffs, validation/review results that can overstate what happened, and unreachable tools for plan execution and explicit memory. No additional general-purpose investigator, editor, reviewer or test-writing agent is needed to fix those.

## Top 10 fixes, in priority order

1. **High — Keep “allowed to finish” separate from “validated.”** The SDK returns structured `no_hooks_configured` / `hooks_skipped` with messages. Base2 prefixes these with `REDUCED_ASSURANCE:` but the final branch recognizes only the original strings, so a clean review can produce `validationStatus: passed`, `hooksRan: true` when nothing ran. Confirmed in an offline generator probe for both cases. Separately, a real nonzero hook exit can be downgraded to infrastructure failure based on a word such as `timeout` in assertion text; a matched-waiver path can be called `LOOKS_GOOD`; and summarized Basher output can omit refusal/timeout fields needed by the parent. Use affirmative, typed execution evidence, preserve all terminal outcomes through summaries, and publish independent `review`, `validation`, `waiver`, and `delivery` statuses. Make headless CI acceptance opt-in based on those statuses, not generic process success. `sdk/src/tools/file-change-hooks.ts:1642–1670`; `agents/base2/base2.ts:5895–5908,6175–6200,7999–8002,8129–8170,15259–15328`; `agents/basher.ts:397–431`. [Testing](findings/testing.md) · [Review](findings/review-gate.md)
2. **High — Honor the independent reviewer and its exact evidence.** A repair receipt can make the gate suppress an ordinary finding when the next reviewer raises it again; existing tests explicitly accept this. Same-path writes by hooks can invalidate earlier security/specialist reads without triggering re-review. In-process SDK use with `cwd` different from the embedding process can also make the gate hash the wrong workspace; an outer hash has accepted an unreadable marker in a focused probe. Keep re-raised blockers open unless explicitly waived, bind evidence to the run's captured workspace and task/baseline, reject unreadable inputs and unconfirmed deletions, and refresh all risk-required reviewer credits on final bytes. `agents/base2/base2.ts:6251–6289,6670–6752,7297–7363,7863–7897,14705–14720,14771–14799`; `agents/__tests__/base2.test.ts:7435–7518`. [Review](findings/review-gate.md)
3. **High — Repair all three automatic writer handoffs.** Initial `test-writer`, coverage-only repair, and the `doc-writer` handoff name legacy standalone `str_replace` / `write_file`, which the actual writers no longer expose. The runtime rejects all three before the child starts; coverage repair omits `edit_transaction` entirely. A manual handoff with the real tools was admitted in a paired probe. Use one shared contract, scope coverage repair to legitimate new test paths, and keep explicitly requested writer deliverables pending when the child fails. Test real admission and committed child edits rather than feeding synthetic success to the parent. `agents/base2/base2.ts:2643–2650,2804–2813,7123–7130`; `packages/agent-runtime/src/tools/handlers/tool/spawn-agent-utils.ts:539–565`. [Implementation](findings/implementation.md) · [Testing](findings/testing.md)
4. **High — Bind PLAN authority to host admission, not a display label or replaceable definition.** The TUI can say PLAN while an explicit `--agent` wins selection. A same-ID user-owned or trusted project definition can also replace `base2-plan` without the marker the SDK uses to establish read-only lineage. An attached client uses the server's chosen root and should display that authority. These are admission/UX mismatches, not escapes from a run that already has enforced plan ancestry. Preserve the selected authority independently, reject conflicting choices or incompatible reserved-ID overrides, and align the `@` catalog with the actual permitted children. Separate but related: restrict imports during trusted agent discovery to agent entrypoints; recursively importing executable session artifacts before validating agent metadata adds unintended work and side effects. `cli/src/hooks/use-send-message.ts:130–142`; `cli/src/utils/local-agent-registry.ts:426–461`; `sdk/src/run.ts:2176–2186`; `sdk/src/agents/load-agents.ts:65–92,184–222`. [Root modes](findings/root-delegation.md) · [Runtime](findings/runtime-tools.md)
5. **High — Give EXECUTE_PLAN its receipt-checked checkpoint path.** Its own prompt requires `update_plan_status` to claim, checkpoint and advance, and recommends `create_plan` for larger revisions. Those tools are admitted only in PLAN, absent even after all Execute Plan tiers are unlocked. Confirmed by extracting the effective surface. Restore scoped plan tools to both modes; use the run's captured workspace and make plan revision/Markdown/timeline persistence transactional or explicitly recoverable. Generic source edits to the Markdown are not a substitute for validated transitions. `agents/base2/tool-tiers.ts:140–152,209–231`; `agents/base2/base2.ts:15550–15554`; `packages/agent-runtime/src/tools/handlers/tool/update-plan-status.ts:202–245,365–390`. [Root modes](findings/root-delegation.md) · [Memory](findings/memory-handoff.md)
6. **Medium–high — Close the memory handoff without granting the model unrestricted memory writes.** `record_decision` is registered and prompted, but unavailable to the shipped Base2 roots even with all tiers loaded. Wire it with the existing provenance guards, repair copy-on-write before enabling eligible child writers, and distinguish a retained session event from a confirmed durable observation. `memory-manager` is correctly proposal-only. There are existing manual operator and editor routes, but no first-class way to preview, approve, apply and verify the exact reviewed proposal by ID. Introduce a host-owned, revision-checked approval handoff only if that workflow is needed. Fix the `recall_context` provider schema and preserve source provenance for exact-message paging. `agents/base2/base2.ts:418–469`; `packages/agent-runtime/src/util/base2-tool-tiers.ts:29–97`; `agents/memory/contracts.ts:143–160,209–242`; `common/src/tools/provider-schema.ts:26`. [Memory](findings/memory-handoff.md)
7. **Medium — Make code discovery portable and lossless at the handoff.** The local CLI binds `query_index`; the bare SDK lacks that backend and the ACP ask-user override replaces the CLI's override map. The nested lister/picker can lose fallback paths when the subtree is rendered from a nested directory; parsing the newline payload also drops valid paths, including extensionless names and paths with spaces. Move index binding into a common admitted root or preserve the map, and return typed candidates with real project-relative paths and explicit stale, partial, empty or failed status. Also make `general-agent` distinguish explicit files from directories without a filename-extension guess. `sdk/src/client.ts:62–69`; `sdk/src/serve/bridge.ts:901–908`; `agents/file-explorer/file-lister.ts:128–165,285–313`; `agents/file-explorer/file-picker.ts:153–189`. [Retrieval](findings/context-retrieval.md)
8. **Medium–high — Make role boundaries and tool admission match what the orchestrator sees.** Handoff file scopes for test/doc/repair writers normally warn rather than prevent in-project out-of-scope edits. Some role-specific shell profiles do not bind in normal SDK execution. Optional configured MCP can fall back to an all-tools catalog when a narrowing handoff removes its last selector. Spawn alias presentation/permissions and per-entry rejection results also diverge in some custom configurations. Use explicit enforced ceilings where advertised, including move destinations, monotonic inheritance and a true empty grant. Keep native project containment, strict reads and plan-lineage protections distinct. Resolve one permitted catalog after host and child restrictions. `packages/agent-runtime/src/tools/tool-executor.ts:3344–3408`; `sdk/src/tools/terminal-profile-bound.ts:9–44`; `packages/agent-runtime/src/mcp.ts:98–160`. [Runtime](findings/runtime-tools.md) · [Implementation](findings/implementation.md)
9. **Medium–high — Improve test and dependency execution evidence rather than adding more model roles.** `get_affected_tests` and build targets are discovery hints, not an executed suite. Hooks need trusted configuration and may only typecheck. Some package targeting falls back to the wrong CLI schedule, and a writer's reported acceptance criteria are not bound to tests that actually ran. A dependency generator can accept an absent/unrecognized native error receipt as success and report attempted, not confirmed, rollback. Prefer validated command/cwd inputs, runner-attested check kinds and executed counts, per-criterion coverage when required, and confirmed mutation/rollback evidence. For UI smoke, use host-owned browser/PTy sessions with typed start, assertion, exit and cleanup evidence. `sdk/src/services/harness-intelligence.ts:1585–1596,1683–1719`; `agents/base2/base2.ts:12325–12355`; `agents/dependency-manager/dependency-manager.ts:587–622,699–726,783–817`. [Testing](findings/testing.md) · [Implementation](findings/implementation.md)
10. **High leverage — Require one offline shipped-root lifecycle test in PR/release CI.** Strong focused suites and real consumer fixtures exist, but the gate tests often inject tool results, and the default installed release smoke does not require a full shipped `base2` turn. Add an extracted CLI/packed SDK test with a scripted loopback provider, one actual delegated editor and writer, disk assertions, real test commands and an exact-snapshot reviewer receipt. Include negative cases for missing hooks, denied execution, persistent review findings, PLAN authority, and a successful post-restart checkpoint. Run the fast deterministic gate subset in normal PR CI too. `.github/workflows/ci.yml:291–306`; `.github/workflows/nightly-e2e.yml:63–69`; `agents/e2e/editor-orchestrator-contract.e2e.test.ts:94–129`. [End-to-end evidence](findings/end-to-end.md)

## Role and tool coverage

| Phase | Shipped coverage | What the orchestrator still owns |
|---|---|---|
| Gather | Root search, index, reads and language navigation; `file-picker` → `file-lister`; `general-agent`, `thinker`; `researcher-docs`, `researcher-web`, `librarian`. | Scope and verify evidence; use native search/read fallback when index or external research is unavailable. Context7 and browser/research tools have independent prerequisites. |
| Retain and share | Root `recall_context`, internal compaction, per-child handoffs/structured output, repository knowledge, durable plan/audit artifacts, CLI memory; `memory-manager` → knowledge retriever and reviewer. | Choose the right durability layer. Child output is not canonical memory; explicit proposal acceptance and publication remain operator-owned. Bare SDK hosts do not automatically get CLI SQLite memory. |
| Change | `editor`, `repair-editor`, `test-writer`, `doc-writer`, guarded `dependency-manager`, plus root `edit_transaction` for scoped inline changes. `debugger` investigates, not repairs. | Supply a brief and explicit ownership, join actual mutation results, re-read stale bases. Ordinary sibling spawns share a worktree; isolated parallel mutation is not a default spawn feature. |
| Review | Independent `code-reviewer`, `security-reviewer`, `review-triage`, and domain specialists for accessibility, UX, API compatibility, migrations, reliability, performance and more. | Compare against exact changes and requirements, enforce vetoes, and re-review drift. A static verdict is not command/test proof. |
| Test | Separate author (`test-writer`), command runner (`basher`), diagnosis (`debugger`), browser (`browser-use`) and terminal UI (`tmux-cli`). Root has programmatic file hooks and loadable targeted validation/test-build intelligence. | Choose commands/assertions and join execution receipts. `run_targeted_validation` cannot clear the review gate. A successful spawn or zero exit is not proof of a particular test suite. |

The stock default root has 23 initial built-ins (before optional host substitutions), 19 additional loadable tools and 8 generator declarations; the inventories overlap. It declares 38 spawn targets including the internal pruner. Not every specialist should receive every root tool: read-only review, writer/executor separation, and user-owned approval are the right design. `base-deep` shares the primary roster; FAST drops editor/repair/thinker and uses inline editing. FAST currently runs the automatic gate when the serialized config is used despite prompts/tests that expect the lighter path; align those policies. PLAN intentionally withholds source mutations and only permits terminal descendants with verified native read-only enforcement. Headless CLI includes the shipped registry; the plain SDK requires a selected host-known definition and any necessary client tool bindings. See [the exact per-definition matrix](TOOL-MATRIX.md).

## Additional findings by area

- **Retrieval and performance:** documents research cannot pin an exact dependency version through `read_docs`; librarian has clone-success/custody reporting gaps. Repeated synchronous broad-audit feature scans can do avoidable whole-snapshot work.
- **Memory and broad-audit evidence:** an identical audit artifact retry can report `alreadyPersisted` without the structural receipt needed for the coverage evaluator. Completion of source inspection is not release readiness. Plan-only/read-only instructions conflict with parts of the durable synthesizer flow, and the synthesizer's assigned-session read/write scope is not strongly enforced. Inventory/feature byte reads also need matching symlink semantics.
- **Review and delivery:** risk selection misses some config-only paths; `/review` requests static analysis but does not itself enforce a read-only tool set or require a child verdict. Explicit bypass and ordinary acceptance need distinct machine-readable states.
- **Runtime/API:** pre-dispatch refusals and invalid members of mixed spawn batches are not consistently present in joined structured results. Process supervision may degrade to in-process when requested; that behavior should be explicit and distinct from a strict execution boundary. `ask_user` is registered but needs a host integration in the standalone SDK.

## Coverage and limits

Eight vertical shard reports are indexed in [STATUS.md](STATUS.md). All 49 shipped definitions matched the local generated registry's tool and roster inventory. The audit lead ran **1,140 focused tests across 52 files, zero failures**, plus deterministic handoff, tool-ceiling and gate-outcome probes. The green tests do not contradict the audit: some pin individual seams or the current behavior rather than the advertised whole workflow. No live remote-provider performance, complete monorepo test pass, published-release lifecycle, or live browser/TUI/native sandbox result is claimed. Only audit artifacts were written; no tracked sources changed.
Loading
Loading