LazyBoy2/docs/ACCEPTANCE.md

81 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GrokBoy acceptance
## P0 — streaming chat
- [x] Cargo workspace `grokboy-core` + `grokboy`
- [x] Env: `GROKBOY_API_KEY` / `XAI_API_KEY` / `OPENAI_API_KEY`
- [x] Default base `https://api.x.ai/v1`
- [x] `grokboy chat` streams assistant tokens
- [x] `cargo test` passes without API key
## P1 — tools + ReAct
- [x] `shell`, `list_dir`, `read_file`, `write_file`
- [x] Multi-step tool loop
- [x] Sessions under `~/.grokboy/sessions/`
- [x] `grokboy run` / `grokboy smoke`
- [x] Default model `grok-4.6`
## P2 — completion contract
- [x] `report_done` / `report_blocked` stop the loop with a clear verdict
- [x] Loop guard (identical tool rounds ×3 → blocked)
- [x] Context truncation (`GROKBOY_CONTEXT_CHARS`, default ~100k)
- [x] Offline smoke/tests cover P2 without API key
## P3 — browser
- [x] Playwright DOM path (no screenshot-first)
- [x] Tools: `browser_navigate`, `browser_snapshot`, `browser_click`, `browser_type`, `browser_eval`
- [x] Thin Node helper under `tools/playwright/` (JSONL / one-shot JSON)
- [x] Fail closed with install hint when Node/Playwright/Chromium missing
- [x] `cargo test` / `grokboy smoke` pass without Playwright browsers installed
## P4 — human browser handoff
- [x] Spec: `docs/PRODUCT.md` (north star, P0P3, P4, non-goals)
- [x] Tool `browser_handoff` (`reason` required, optional `timeout_secs`)
- [x] Headed Chromium for handoff (`handoff_prepare`; relaunch if was headless)
- [x] Bilingual (繁中 + EN) terminal instructions; Enter continue / `abort` / timeout → fail-closed
- [x] After resume: DOM snapshot returned as tool result
- [x] Env docs: `GROKBOY_BROWSER_HEADED`, `GROKBOY_HANDOFF_AUTO`
- [x] Wired into tool defs + agent system prompt; fail-closed if no browser
- [x] Offline tests / smoke without API key or interactive stdin (`GROKBOY_HANDOFF_AUTO`)
- [x] README status table updated
## P5 — interactive multi-turn agent
- [x] `grokboy agent` REPL: read line → ReAct with tools → print verdict → save session
- [x] `/exit` `/quit` leave; `/session` show id; empty line ignored
- [x] `--session <id>` resume; auto-create + print session id when omitted
- [x] Keep `run` one-shot; keep `chat` streaming no-tools
- [x] Same tool-capable system prompt (`AGENT_SYSTEM`); Traditional Chinese welcome
- [x] Docs: ACCEPTANCE P5, PRODUCT.md note, README commands/status
- [x] Offline smoke/tests: agent parses / help lists it; multi-turn session plumbing without API
- [x] `cargo test` green without API key
## P6 — scenario playbooks + confirm-before-post
- [x] Reusable pattern docs: `docs/scenarios/README.md`, `docs/SCENARIO-TEMPLATE.md`
- [x] Template prompts: `prompts/templates/phase-a.txt`, `phase-b.txt` (placeholders)
- [x] Example (not sole path): Shopee→Threads under `docs/scenarios/examples/` + `prompts/examples/`
- [x] Tool `request_user_confirm` (`reason`, optional `prompt`, optional `timeout_secs`)
- [x] Bilingual banner; yes/y/Enter approve; no/abort deny; timeout = deny (fail-closed)
- [x] Env: `GROKBOY_CONFIRM_AUTO` (fallback `GROKBOY_HANDOFF_AUTO`)
- [x] AGENT_SYSTEM: never irreversible public social publish without explicit approval this turn or confirm approved; prefer draft → confirm → act; handoff for auth only
- [x] Wired in tools.rs / confirm.rs; offline unit + smoke
- [x] PRODUCT.md / README pointer to scenario playbooks
- [x] `cargo test` / `grokboy smoke` green without API key
## P7 slice — agent UX polish
- [x] AGENT_SYSTEM: natural text for greetings/small talk/no-tools; `report_done` only for finished tool workflows; `report_blocked` when stuck
- [x] Max-rounds: progress summary via final no-tools complete (fallback to bare message); offline injectable completer covered in unit tests
- [x] Env `GROKBOY_MAX_ROUNDS` (default 12) used by CLI `run`/`agent`; keep `DEFAULT_MAX_ROUNDS = 12`
- [x] CLI Blocked recovery hint (Traditional Chinese) for `run` and `agent`; agent REPL stays open on blocked
- [x] Docs note in PRODUCT.md / ACCEPTANCE; `cargo test` / `grokboy smoke` green without API key
## P8 — auto-continue chunks like Grok Bot
- [x] `GROKBOY_MAX_ROUNDS` = rounds per chunk (default 12); auto-continue another chunk in same `run_agent` when chunk ends without completion
- [x] Progress summary between chunks (no-tools); stderr `〔續跑〕…` unless `GROKBOY_PROGRESS=0`
- [x] Absolute ceiling `GROKBOY_MAX_ROUNDS_TOTAL` (default 48) → Blocked + progress + exhausted note
- [x] Loop guard / identical tool rounds ×3 still Blocked without auto-continue
- [x] AGENT_SYSTEM: large work may continue in chunks; still `report_done` when finished; don't stop early to "save rounds"
- [x] CLI `run`/`agent` use per-chunk budget; recovery hint only on true stop (loop / total ceiling)
- [x] Offline tests: >chunk then Done; total ceiling Blocked; loop guard unchanged
- [x] Docs PRODUCT / ACCEPTANCE / README; `cargo test` / `grokboy smoke` green without API key