summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/PLAN.md71
1 files changed, 46 insertions, 25 deletions
diff --git a/docs/PLAN.md b/docs/PLAN.md
index 2766664..b1273b1 100644
--- a/docs/PLAN.md
+++ b/docs/PLAN.md
@@ -73,37 +73,58 @@ Verified: `cargo test` 8/8; 2.0 MB stripped i686 binary, max symbol
73streams correctly; `scripts/check-glibc.sh` passes and fails as expected; 73streams correctly; `scripts/check-glibc.sh` passes and fails as expected;
74`scripts/mock-provider.py` gives a no-key provider for manual work. 74`scripts/mock-provider.py` gives a no-key provider for manual work.
75 75
76**M1 — Sessions, status line, abort.** JSONL append/load, session id, `--continue`, 76**M1 — Sessions, status line, abort.** ✅ Done.
77`--resume <id>`, status line, SIGINT handling. 77
78*Done when:* a turn survives `kill -9` between steps, `--continue` resumes it, and 78JSONL append/load, session id, `--continue`, `--session <id>`, status line,
79Ctrl-C returns the prompt without losing the transcript. 79SIGINT handling (first Ctrl-C aborts the turn, second exits). Verified: a
80 809-step turn writes 19 lines (header + 18 messages, reasoning stored under
81**M2 — Read-side tools and edits.** `read`, `write`, `edit`, `grep`, `glob`, the 81`_reasoning`), `--continue` replays all 18 messages and answers from history
82agent loop, tool-call accumulation, the approval prompt with diff. 82without reading files.
83*Done when:* a canned mock session writes a C file, greps it, edits it, and the 83
84transcript replays byte-identically. 84**M2 — Read-side tools and edits.** ✅ Done.
85 85
86**M3 — `bash`.** Command execution, timeout, output capping, per-call approval, 86`read`, `write`, `edit`, `grep`, `glob`, the agent loop, tool-call accumulation,
87head/tail rendering. 87diff preview plus approval. Verified by `tests/tools.rs` (uniqueness, ambiguity
88*Done when:* the mock session compiles the C file and handles a non-zero exit as 88with line numbers, no implicit `mkdir`, truncation, glob `**`, grep case) and
89data rather than an error. 89`tests/loop.rs` (tool call executed and recorded; a denial returned as data).
90 90The approval prompt was also driven through a real pty.
91**M4 — Prompt and input.** System prompt, environment block, `AGENTS.md` 91
92snapshot, `/paste`, TTY detection, real-API smoke test. 92**M3 — `bash`.** ✅ Done.
93*Done when:* one real turn against OpenCode Go works end to end. 93
94 94Fresh shell per call, 120 s timeout that kills the process, capped output
95**M5 — Target gate.** `scripts/check-glibc.sh` (max symbol version ≤ 2.36), 95(64 KiB head, 16 KiB tail), exit code or signal reported. Verified: exit codes,
96`cargo check --target i686` clean, release run inside 96timeout, missing `cwd`, and real `gcc` invocations.
97`docker run --platform linux/386 debian:12`, binary copied to the i386 box. 97
98*Done when:* the acceptance test runs there. 98**M4 — Prompt and input.** ✅ Done.
99
100System prompt with cwd/platform/arch/branch, `AGENTS.md` snapshot frozen at
101session start with a change warning, `/paste`, TTY-aware colour. Verified
102against the live API: streaming, tool calls, `reasoning_content`, usage and
103`opencode.allowance` in the final chunk, and a 401 surfaced as
104`api_key_expired`.
105
106**M5 — Target gate.** ✅ Done.
107
108`scripts/check-glibc.sh` (required symbols ≤ 2.36; weak symbols such as glibc
1092.39's `pidfd_spawnp` are reported but ignored, since they resolve to NULL).
1102.0 MB stripped i686 binary, `GLIBC_2.34` required. Verified by running the
111whole acceptance test inside `--platform linux/386 debian:12`.
99 112
100## Acceptance test (v1) 113## Acceptance test (v1)
101 114
102> "Make a simple calculator in C" — run on the i386 box, from an empty directory. 115> "Make a simple calculator in C" — run on the i386 box, from an empty directory.
103 116
104Exercises `write` (create files), `bash` (compile, run), `read` (inspect what it 117Exercises `write` (create files), `bash` (compile, run), `read` (inspect what it
105wrote), and terminates on its own. Success is: it compiles, it runs, it does 118wrote), and terminates on its own.
106addition and division, and it did not need more than a handful of files. 119
120Two runs, both with `--yolo`:
121
122| Where | Steps | Wall | Allowance | Result |
123|---|---|---|---|---|
124| x86-64 dev host | 9 | 55.7 s | $0.000214 | `calc.c` (115 lines), clean `-Wall -Wextra` build, 18 cases tested |
125| `linux/386 debian:12` | 8 | 32.1 s | $0.000182 | `calc.c` + `Makefile`, `3 + 4 = 7`, `7 / 2 = 3.5`, `5 / 0` → error, exit 1 |
126
127Independently rebuilt and re-run outside the agent both times.
107 128
108## Layout 129## Layout
109 130