diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..562058a --- /dev/null +++ b/README.md | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | # agent686 | ||
| 2 | |||
| 3 | A small coding agent for a 32-bit Debian box: one binary, six tools, line mode. | ||
| 4 | |||
| 5 | Built because the existing harnesses are TypeScript bundles that need a modern | ||
| 6 | CPU, and the target here is a Debian 12 i386 machine with 2 cores and 4 GB. | ||
| 7 | |||
| 8 | ``` | ||
| 9 | 2.0 MB ELF 32-bit LSB pie, Intel i386 | ||
| 10 | GLIBC_2.34 required (target has 2.36) | ||
| 11 | ``` | ||
| 12 | |||
| 13 | ## Build | ||
| 14 | |||
| 15 | ```sh | ||
| 16 | cargo build --release --target i686-unknown-linux-gnu | ||
| 17 | ./scripts/check-glibc.sh target/i686-unknown-linux-gnu/release/agent686 | ||
| 18 | ``` | ||
| 19 | |||
| 20 | The gate matters: the dev host's 32-bit glibc is newer than the target's, so a | ||
| 21 | dependency can silently raise the required symbol version. | ||
| 22 | |||
| 23 | ## Run | ||
| 24 | |||
| 25 | ```sh | ||
| 26 | export OPENCODE_API_KEY=... # or write it to ~/.config/agent686/key | ||
| 27 | ./agent686 "make a calculator in C" # one turn, then exit | ||
| 28 | ./agent686 # interactive, one prompt per line | ||
| 29 | ./agent686 -c # continue the most recent session | ||
| 30 | ./agent686 --session <id> # resume a specific one | ||
| 31 | ./agent686 --yolo "..." # approve every tool call | ||
| 32 | ``` | ||
| 33 | |||
| 34 | Provider is OpenCode Go, `chat/completions`, model `deepseek-v4.1-flash` by | ||
| 35 | default. Every request carries a stable `x-opencode-session` header, which the | ||
| 36 | service uses for routing and prompt caching. | ||
| 37 | |||
| 38 | ## Tools | ||
| 39 | |||
| 40 | `read` (numbered lines), `write` (never creates directories), `edit` (exact | ||
| 41 | match, must be unique), `bash` (fresh shell per call, 120 s timeout, capped | ||
| 42 | output), `grep` (literal, recursive), `glob` (`*`, `?`, `**`). | ||
| 43 | |||
| 44 | Reads never prompt. The first `write`/`edit` of a session shows a diff and asks; | ||
| 45 | answering `a` allows the rest of the session. Every `bash` call asks, because | ||
| 46 | that is where `rm -rf` lives. | ||
| 47 | |||
| 48 | ## Tests | ||
| 49 | |||
| 50 | ```sh | ||
| 51 | cargo test # 19 tests, no network | ||
| 52 | python3 scripts/mock-provider.py & # canned SSE provider | ||
| 53 | docker run --rm --platform linux/386 debian:12 /b/agent686 # target-shaped gate | ||
| 54 | ``` | ||
| 55 | |||
| 56 | `tests/sse.rs` feeds the stream one byte at a time, so splits inside lines and | ||
| 57 | inside UTF-8 characters are covered. `tests/loop.rs` proves a tool call is | ||
| 58 | executed, recorded, and that a denial is returned to the model as data. | ||
| 59 | |||
| 60 | ## Design notes | ||
| 61 | |||
| 62 | - [CONTEXT.md](CONTEXT.md) — what the words mean (session, turn, step, approval). | ||
| 63 | - [docs/PLAN.md](docs/PLAN.md) — decisions, non-goals, milestones, acceptance test. | ||
| 64 | - [docs/adr/0001](docs/adr/0001-dynamic-glibc-i686.md) — why dynamic glibc, not | ||
| 65 | a static binary: static glibc plus NSS modules segfaults on DNS. | ||
| 66 | - [docs/adr/0002](docs/adr/0002-append-only-sessions.md) — why history is never | ||
| 67 | rewritten: cached prompt reads are ~50× cheaper, and they require a | ||
| 68 | byte-identical prefix. | ||
| 69 | |||
| 70 | No async runtime, no TUI, no MCP, no subagents, no compaction. Those are | ||
| 71 | choices, not gaps: see the non-goals. | ||
