3.9 KiB
3.9 KiB
GrokBoy acceptance
P0 — streaming chat
- Cargo workspace
grokboy-core+grokboy - Env:
GROKBOY_API_KEY/XAI_API_KEY/OPENAI_API_KEY - Default base
https://api.x.ai/v1 grokboy chatstreams assistant tokenscargo testpasses without API key
P1 — tools + ReAct
shell,list_dir,read_file,write_file- Multi-step tool loop
- Sessions under
~/.grokboy/sessions/ grokboy run/grokboy smoke- Default model
grok-4.6
P2 — completion contract
report_done/report_blockedstop the loop with a clear verdict- Loop guard (identical tool rounds ×3 → blocked)
- Context truncation (
GROKBOY_CONTEXT_CHARS, default ~100k) - Offline smoke/tests cover P2 without API key
P3 — browser
- Playwright DOM path (no screenshot-first)
- Tools:
browser_navigate,browser_snapshot,browser_click,browser_type,browser_eval - Thin Node helper under
tools/playwright/(JSONL / one-shot JSON) - Fail closed with install hint when Node/Playwright/Chromium missing
cargo test/grokboy smokepass without Playwright browsers installed
P4 — human browser handoff
- Spec:
docs/PRODUCT.md(north star, P0–P3, P4, non-goals) - Tool
browser_handoff(reasonrequired, optionaltimeout_secs) - Headed Chromium for handoff (
handoff_prepare; relaunch if was headless) - Bilingual (繁中 + EN) terminal instructions; Enter continue /
abort/ timeout → fail-closed - After resume: DOM snapshot returned as tool result
- Env docs:
GROKBOY_BROWSER_HEADED,GROKBOY_HANDOFF_AUTO - Wired into tool defs + agent system prompt; fail-closed if no browser
- Offline tests / smoke without API key or interactive stdin (
GROKBOY_HANDOFF_AUTO) - README status table updated
P5 — interactive multi-turn agent
grokboy agentREPL: read line → ReAct with tools → print verdict → save session/exit/quitleave;/sessionshow id; empty line ignored--session <id>resume; auto-create + print session id when omitted- Keep
runone-shot; keepchatstreaming no-tools - Same tool-capable system prompt (
AGENT_SYSTEM); Traditional Chinese welcome - Docs: ACCEPTANCE P5, PRODUCT.md note, README commands/status
- Offline smoke/tests: agent parses / help lists it; multi-turn session plumbing without API
cargo testgreen without API key
P6 — scenario playbooks + confirm-before-post
- Reusable pattern docs:
docs/scenarios/README.md,docs/SCENARIO-TEMPLATE.md - Template prompts:
prompts/templates/phase-a.txt,phase-b.txt(placeholders) - Example (not sole path): Shopee→Threads under
docs/scenarios/examples/+prompts/examples/ - Tool
request_user_confirm(reason, optionalprompt, optionaltimeout_secs) - Bilingual banner; yes/y/Enter approve; no/abort deny; timeout = deny (fail-closed)
- Env:
GROKBOY_CONFIRM_AUTO(fallbackGROKBOY_HANDOFF_AUTO) - AGENT_SYSTEM: never irreversible public social publish without explicit approval this turn or confirm approved; prefer draft → confirm → act; handoff for auth only
- Wired in tools.rs / confirm.rs; offline unit + smoke
- PRODUCT.md / README pointer to scenario playbooks
cargo test/grokboy smokegreen without API key
P7 slice — agent UX polish
- AGENT_SYSTEM: natural text for greetings/small talk/no-tools;
report_doneonly for finished tool workflows;report_blockedwhen stuck - Max-rounds: progress summary via final no-tools complete (fallback to bare message); offline injectable completer covered in unit tests
- Env
GROKBOY_MAX_ROUNDS(default 12) used by CLIrun/agent; keepDEFAULT_MAX_ROUNDS = 12 - CLI Blocked recovery hint (Traditional Chinese) for
runandagent; agent REPL stays open on blocked - Docs note in PRODUCT.md / ACCEPTANCE;
cargo test/grokboy smokegreen without API key