---
created: 2026-05-06
gap: G01
order: 8
severity: P0
category: planner
estimate: L
issue: "https://github.com/lidge-jun/agbrowse/issues/64"
depends_on: ['G02', 'G03', 'G06', 'G11', 'G04']
---

# G01 — First-party autonomous planner loop (vs Stagehand, browser-use)

> Severity **P0** · Category `planner` · Estimate **L** ·
> Tracking issue [#64](https://github.com/lidge-jun/agbrowse/issues/64) · Depends on **G02, G03, G06, G11, G04**

## GPT Pro evidence

Evidence (competitor side): URL: https://github.com/browserbase/stagehand — quote: “Use agent() for multi-step tasks.” Stagehand also frames agent() beside act() and extract() in its example workflow. 
GitHub

Evidence (agbrowse side): README.md:491-495 documents the manual “snapshot → act → snapshot → verify” loop; README.md:509-516 documents web-ai render/status/send/poll/query, but no first-party local planner command. 
GitHub
+1

Why this matters: Mainstream browser-agent users expect a single task-level loop, not just primitives. Without a planner loop, agbrowse is strong as a browser remote/control layer but weaker as an end-to-end web agent.
Proposed scope, respecting forbidden list:

web-ai/planner-loop.mjs — add an experimental local-only observe/act/verify loop with max-step, timeout, and stop-condition controls.

web-ai/planner-contract.mjs — define JSON schema for objective, observationId, candidateAction, expectedSignal, verification, and finalAnswer.

skills/browser/browser.mjs — add task-run --experimental --max-steps N --json, using only local CDP.

web-ai/policy/planner-policy.mjs — require policy checks before mutating actions and fail closed on destructive forms/uploads.

structure/commands.md — document the planner as experimental and explicitly not a hosted/cloud/stealth runtime.

structure/release_gates.md — add gate:planner-loop-local with fixture tasks and no external credentials.
Test surface: test/unit + test/integration + test/eval.
cli-jaw mirror impact: parity required if marketed cross-repo; otherwise parity optional while experimental.
Acceptance gate: keep gate:truth-table-fresh; add gate:planner-loop-local and gate:no-cloud-claims.
Estimate: L, 4+ days.

## Diff-level work breakdown

> Fill in concrete diffs (NEW / MODIFY / DELETE with file:line) once this gap
> reaches the active sprint. Until then, the bullets in **Proposed scope**
> above are the agreed shape; do not implement before the depending gaps
> (G02, G03, G06, G11, G04) ship and `gate:all` stays green.

### NEW files
- _to be filled before implementation_

### MODIFY
- _to be filled before implementation_

### DELETE
- _to be filled before implementation_

## Tests
- `test/unit/...` — _list test files once written_

## Truth-table update
- `structure/CAPABILITY_TRUTH_TABLE.md` — add row or update status when this
  gap reaches `ready` in agbrowse.
- `cli-jaw/structure/CAPABILITY_TRUTH_TABLE.md` — mirror entry per the
  `cli-jaw mirror impact` line above.

## Release gates touched
- Existing: `gate:typecheck`, `gate:tests`, `gate:truth-table-fresh`,
  `gate:mcp-scope-frozen`, `gate:no-experimental-in-readme-ready-section`.
- Added by this gap: see **Acceptance gate** in the GPT Pro evidence block.
