xonecas.io
64875
Mc

mini-coder / commit 1580443

refactor: remove /plan mode and deduplicate anchor error tests

xonecas2026-03-14 1580443edcc214f0da0d64be067627d4c0dccb57 parent 7c5dced

14 files changed

mini-coder-idea.md+3−1
@@ -12,7 +12,7 @@ A coding agent via a augmented shell prompt, small and fast that doesn't get in
1212 ## Philosophy:
1313
1414 Very focused on dev flow, simple setup steps and fast to coding.
15-Elegant output that focus on the conversation with the agent and their actions. Ensure an accurate cronological conversation log that is very readable for the user.
15+Elegant output that focus on the conversation with the agent and their actions. Ensure an accurate cronological conversation log that is very readable for the user. Keep a visible hierchy of actions -> results and assistant reasoning and responses.
1616 Accurate and reliable core set of features.
1717 Fast and performant, instant feedback shell like output. Performance first style second.
1818 Community oriented, all of the inspirations have their own dotfile format, try to follow the existing
@@ -22,12 +22,14 @@ conventions and not introduce more specs. (`.agents` / `AGENTS.md`, while also s
2222
2323 - Auto discovery of providers via ENV (Example: OPENCODE_API_KEY), or local servers (Example: ollama)
2424 - Session management and command to create new/resume/list with local sqlite file.
25+- Multi-line prompt, shift enter adds a newline. Enter sends.
2526 - Seamless shell integration with `!` in prompt input.
2627 - Reference files and skills from the working directory and global configs with `@` in prompt input, plus autocomplete for files, skills, and agents.
2728 - Press `ESC` at any point during an assistant response to interrupt it: the partial response is preserved in history with an interrupt stub appended (so the LLM retains context), and the user is returned to the prompt silently. `ctrl+c` exits forcefully. `ctrl+d` (EOF) gracefully exits.
2829 - Elegantly handles hitting max context size for the model. Also handles max tool calls, gracefully finishing the turn with an update from the agent
2930 - Feature parity with community configs like custom agents, skill and commands.
3031 - `read`, `replace`,`insert`, `create`, `shell`, and `subagent` tools for LLMs
32+- read/write tools are streamlined, easy to use and rely on hashline editting pattern.
3133 - Optional `webSearch` and `webContent` tools when `EXA_API_KEY` is set.
3234 - `subagent` tool spawns a fresh `mc` subprocess — full capability parity with the main agent, support for recursive subagents (up to 10 levels). Custom agents and custom commands from `.agents` and `.claude` are supported in subagents.
3335 - tool hooks support for supported built-in tools
performance-plan.md+0−194
@@ -1,194 +0,0 @@
1-# Performance Improvement Plan
2-
3-Based on the audit in the previous session. Three high-impact fixes, three medium fixes, four low/deferred items.
4-
5----
6-
7-## High Impact
8-
9-### P1 — Wrap `saveMessages` in a transaction
10-
11-**File:** `src/session/db/message-repo.ts`
12-
13-Each `stmt.run()` without an explicit transaction triggers its own implicit WAL flush.
14-`saveMessages` is called twice per turn (user message + model messages), each time potentially
15-writing multiple rows. `saveSnapshot` already does this correctly with `db.transaction`.
16-
17-**Change:** Wrap the insert loop in `db.transaction(() => { ... })`.
18-
19----
20-
21-### P2 — Cache `buildSystemPrompt` on `SessionRunner`
22-
23-**Files:** `src/agent/session-runner.ts`, `src/agent/system-prompt.ts`
24-
25-`buildSystemPrompt` is called on every `processUserInput`. It does:
26-- Up to 5 `existsSync` + 2 `readFileSync` calls for context files
27-- `loadSkillsIndex` → directory walk (`readdirSync` + `statSync` + `openSync`/`readSync`/`closeSync`) across 4 locations
28-
29-None of these inputs change between turns. The system prompt is fixed for the lifetime of
30-a `SessionRunner` instance (only `extraSystemPrompt` changes, and that has a setter).
31-
32-**Change:**
33-- Compute the prompt once in the `SessionRunner` constructor and store it.
34-- Re-compute only when `extraSystemPrompt` is mutated (already a public setter property).
35-- No change to the `buildSystemPrompt` function signature.
36-
37----
38-
39-### P3 — Remove intermediate diff from `applyFileEdit`
40-
41-**Files:** `src/tools/shared.ts`, `src/tools/write-result.ts`, `src/agent/tools.ts`
42-
43-Current flow for any write tool when hooks are active (the default config):
44-1. `applyFileEdit` writes the file and calls `generateDiff(original, written)` → **diff #1**
45-2. Hook runs (reformatter rewrites the file)
46-3. `finalizeWriteResult` re-reads and calls `generateDiff(original, reformatted)` → **diff #2**
47-
48-Diff #1 is always discarded when a hook fires. `generateDiff` runs an LCS O(m×n) algorithm;
49-computing it twice wastes CPU on every write in a repo with hooks.
50-
51-When no hook fires, `stripWriteResultMeta` is used, which keeps diff #1 — so that path stays correct.
52-
53-**Change:**
54-- Remove `generateDiff` call from `applyFileEdit`; store only `_before` + `_filePath`.
55-- Move diff computation into `finalizeWriteResult` (already reads the post-hook file).
56-- For the no-hook path (`stripWriteResultMeta`), add the diff computation there too so callers still receive a populated `diff` field.
57-- Update `WriteResultMeta` and `applyFileEdit` return type accordingly.
58-
59----
60-
61-## Medium Impact
62-
63-### P4 — Gate `getMessageDiagnostics` behind API log being enabled
64-
65-**File:** `src/llm-api/turn.ts`
66-
67-`getMessageDiagnostics` is called 2–3× per turn. It calls `JSON.stringify` + `Buffer.byteLength`
68-on every message in history. For long sessions (100+ messages) this serialises megabytes of data
69-just to produce numbers for the API log.
70-
71-**Change:**
72-- Check whether the API log is enabled before computing diagnostics.
73-- If disabled, skip all three `getMessageDiagnostics` calls entirely.
74-- `api-log.ts` already has the flag; expose a `isApiLogEnabled()` helper or check the env directly.
75-
76----
77-
78-### P5 — Hoist `db.prepare` to a module-level lazy singleton in `saveMessages`
79-
80-**File:** `src/session/db/message-repo.ts`
81-
82-`db.prepare(...)` compiles the SQL statement on every `saveMessages` call (twice per turn).
83-SQLite statement preparation is cheap but non-trivial; it is unnecessary to repeat it.
84-
85-**Change:**
86-- Store the prepared statement in a module-level `let` variable, initialised lazily on first use
87- (same pattern as `getDb()`).
88-- Apply the same treatment to `addPromptHistory` and `getPromptHistory` if they are on hot paths.
89-
90----
91-
92-### P6 — Avoid object spread in `withCwdDefault` per tool invocation
93-
94-**File:** `src/agent/tools.ts`
95-
96-`withCwdDefault` wraps every tool call in a new object spread:
97-```ts
98-const withDefault = { cwd, ...snapshotCallback ? {snapshotCallback} : {}, ...input };
99-```
100-This allocates a new plain object on every invocation and spreads all tool arguments.
101-
102-**Change:**
103-- Mutate `cwd` as a default on the input object only when absent:
104- ```ts
105- const patched = input as Record<string, unknown>;
106- if (patched.cwd === undefined) patched.cwd = cwd;
107- if (snapshotCallback && patched.snapshotCallback === undefined)
108- patched.snapshotCallback = snapshotCallback;
109- return originalExecute(patched);
110- ```
111-- This avoids the spread allocation entirely.
112-
113----
114-
115-## Low / Deferred
116-
117-### P7 — Replace string concatenation in `consumeTail` with chunk accumulation
118-
119-**File:** `src/agent/subagent-runner.ts`
120-
121-`tail += decoder.decode(...)` in a loop is O(n²) in theory, bounded to ~16 KB by the slicing
122-guard. Still wasteful: each iteration copies the whole accumulated string.
123-
124-**Change:**
125-- Accumulate `Uint8Array` chunks into an array.
126-- After the loop, call `new TextDecoder().decode(Buffer.concat(chunks))` once.
127-- Then slice to `maxBytes` if needed.
128-- Remove the mid-loop `tail.slice(-maxBytes)` guard; it is no longer necessary.
129-
130----
131-
132-### P8 — Replace LCS diff with Myers diff to reduce memory
133-
134-**File:** `src/tools/diff.ts`
135-
136-`lcsTable` allocates a flat `number[]` of `(m+1)*(n+1)` entries. Two 1000-line files produce ~1M
137-entries (~8 MB) per diff call. Every `replace`, `insert`, and `create` invocation pays this cost.
138-
139-**Change:**
140-- Implement Myers diff (Eugene Myers, 1986) in place of `lcsTable` / `editScript`.
141-- Myers requires only O(n·d) space where d is the number of edits — typically a small fraction of
142- file size.
143-- The public API (`generateDiff`) and unified-diff output format are unchanged; only the internal
144- `lcsTable` + `editScript` functions are replaced.
145-
146----
147-
148-### P9 — Combine sequential message-history transforms in `runTurn`
149-
150-**File:** `src/llm-api/turn.ts`
151-
152-Five separate O(n) passes over the full message history per turn:
153-`sanitizeGemini` → `stripGPTCommentary` → `stripOpenAIItemIds` → `applyContextPruning` →
154-`compactToolResultPayloads`. Each allocates a new array even when returning the same messages
155-unchanged.
156-
157-**Change:**
158-- Merge `stripGPTCommentary` and `stripOpenAIItemIds` into a single pass: both are
159- OpenAI-only, both iterate messages looking for assistant content parts to filter. They can share
160- one `messages.map(...)` call with both predicates applied per message.
161-- `sanitizeGemini`, `applyContextPruning`, and `compactToolResultPayloads` operate on different
162- structural concerns and keep their fast-path early exits; leave them as separate named functions
163- but note the combined pass reduces allocations on OpenAI sessions by one full array copy.
164-
165----
166-
167-### P10 — Move `VACUUM` off the synchronous startup path
168-
169-**File:** `src/session/db/connection.ts`
170-
171-`pruneOldData` calls `db.exec("VACUUM;")` synchronously before the CLI prompt is shown. With a
172-large or fragmented DB this can add measurable latency to startup.
173-
174-**Change:**
175-- Replace the synchronous `VACUUM` call with `setImmediate(() => db.exec("VACUUM;"))` so it runs
176- after the event loop yields control back to the CLI render path.
177-- The WAL checkpoint (`wal_checkpoint(TRUNCATE)`) is fast and can remain synchronous.
178-
179----
180-
181-## Execution Order
182-
183-```
184-P1 saveMessages transaction — 5 min, isolated, zero risk
185-P5 hoist db.prepare — 10 min, isolated, zero risk
186-P10 defer VACUUM off startup path — 10 min, isolated, zero risk
187-P7 consumeTail chunk accumulation — 15 min, isolated
188-P3 remove intermediate diff — 30 min, touches shared.ts + write-result.ts + tools.ts
189-P8 Myers diff — 60 min, self-contained in diff.ts, existing tests cover it
190-P2 cache system prompt — 45 min, touches session-runner.ts
191-P6 withCwdDefault spread — 20 min, touches tools.ts
192-P4 gate diagnostics on log flag — 20 min, touches turn.ts
193-P9 merge OpenAI message transforms — 30 min, touches turn.ts
194-```
remove-plan-mode-plan.md+0−20
@@ -1,20 +0,0 @@
1-# Remove `/plan` Mode
2-
3-## Goal
4-Remove `/plan` mode entirely from mini-coder so there is no CLI command, runtime state, prompt decoration, or read-only tool path associated with it.
5-
6-## Scope
7-- Remove the `/plan` slash command and help/manpage references.
8-- Remove `planMode` state and setters from CLI/runtime wiring.
9-- Remove the read-only toolset branch used only by `/plan` mode.
10-- Update or remove tests that cover `/plan` mode.
11-- Keep `/ralph` behavior intact.
12-
13-## Validation
14-Run:
15-- `bun run jscpd`
16-- `bun run knip`
17-- `bun run typecheck`
18-- `bun run format`
19-- `bun run lint`
20-- `bun run test`
src/agent/agent.ts+0−6
@@ -196,18 +196,12 @@ export async function initAgent(opts: AgentOptions): Promise<{
196196 runner.googleCachedContent = contentId;
197197 setPreferredGoogleCachedContent(contentId);
198198 },
199- get planMode() {
200- return runner.planMode;
201- },
202199 get ralphMode() {
203200 return runner.ralphMode;
204201 },
205202 setRalphMode: (v) => {
206203 runner.ralphMode = v;
207204 },
208- setPlanMode: (v) => {
209- runner.planMode = v;
210- },
211205 cwd,
212206 runSubagent: (prompt, agentName?, model?, abortSignal?) =>
213207 runSubagent(prompt, agentName, model, abortSignal),
src/agent/session-runner.ts+2−8
@@ -21,7 +21,6 @@ import { snapshotBeforeEdit } from "../tools/snapshot.ts";
2121 import { extractAssistantText, makeInterruptMessage } from "./agent-helpers.ts";
2222 import type { AgentReporter } from "./reporter.ts";
2323 import { buildSystemPrompt } from "./system-prompt.ts";
24-import { buildReadOnlyToolSet } from "./tools.ts";
2524
2625 interface SessionRunnerOptions {
2726 cwd: string;
@@ -76,7 +75,6 @@ export class SessionRunner {
7675 }
7776 }
7877
79- public planMode = false;
8078 public ralphMode = false;
8179
8280 public totalIn = 0;
@@ -189,9 +187,7 @@ export class SessionRunner {
189187
190188 this.currentTurn = thisTurn;
191189 this.currentSnappedPaths = new Set<string>();
192- const coreContent = this.planMode
193- ? `${text}\n\n<system-message>PLAN MODE ACTIVE: Help the user gather context for the plan -- READ ONLY</system-message>`
194- : text;
190+ const coreContent = text;
195191
196192 const userMsg: CoreMessage =
197193 allImages.length > 0
@@ -227,9 +223,7 @@ export class SessionRunner {
227223 model: llm,
228224 modelString: this.currentModel,
229225 messages: this.coreHistory,
230- tools: this.planMode
231- ? [...buildReadOnlyToolSet({ cwd: this.cwd }), ...this.mcpTools]
232- : this.tools,
226+ tools: this.tools,
233227 ...(systemPrompt ? { systemPrompt } : {}),
234228 signal: abortController.signal,
235229 pruningMode: this.pruningMode,
src/agent/tools.test.ts+1−7
@@ -3,7 +3,7 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
33 import { tmpdir } from "node:os";
44 import { join } from "node:path";
55 import { hashLine } from "../tools/hashline.ts";
6-import { buildReadOnlyToolSet, buildToolSet } from "./tools.ts";
6+import { buildToolSet } from "./tools.ts";
77
88 let cwd = "";
99
@@ -118,10 +118,4 @@ describe("skills tools registration", () => {
118118 expect(names).toContain("listSkills");
119119 expect(names).toContain("readSkill");
120120 });
121-
122- test("includes listSkills and readSkill in read-only tool set", () => {
123- const names = buildReadOnlyToolSet({ cwd }).map((tool) => tool.name);
124- expect(names).toContain("listSkills");
125- expect(names).toContain("readSkill");
126- });
127121 });
src/agent/tools.ts+0−16
@@ -198,19 +198,3 @@ export function buildToolSet(opts: {
198198
199199 return tools;
200200 }
201-
202-// Plan mode: read-only tools only, no hooks (hooks are a write-tool concern).
203-export function buildReadOnlyToolSet(opts: { cwd: string }): ToolDef[] {
204- const { cwd } = opts;
205- const tools: ToolDef[] = [
206- withCwdDefault(readTool as ToolDef, cwd),
207- withCwdDefault(listSkillsTool as ToolDef, cwd),
208- withCwdDefault(readSkillTool as ToolDef, cwd),
209- ];
210-
211- if (process.env.EXA_API_KEY) {
212- tools.push(webSearchTool as ToolDef, webContentTool as ToolDef);
213- }
214-
215- return tools;
216-}
src/cli/commands.ts+1−20
@@ -299,22 +299,9 @@ function handleCache(ctx: CommandContext, args: string): void {
299299 writeln(`${PREFIX.error} usage: /cache <on|off|openai|gemini> ...`);
300300 }
301301
302-function handlePlan(ctx: CommandContext): void {
303- ctx.setPlanMode(!ctx.planMode);
304- if (ctx.planMode) {
305- if (ctx.ralphMode) ctx.setRalphMode(false);
306- writeln(
307- `${PREFIX.info} ${c.yellow("plan mode")} ${c.dim("— read-only tools + MCP, no writes or shell")}`,
308- );
309- } else {
310- writeln(`${PREFIX.info} ${c.dim("plan mode off")}`);
311- }
312-}
313-
314302 function handleRalph(ctx: CommandContext): void {
315303 ctx.setRalphMode(!ctx.ralphMode);
316304 if (ctx.ralphMode) {
317- if (ctx.planMode) ctx.setPlanMode(false);
318305 writeln(
319306 `${PREFIX.info} ${c.magenta("ralph mode")} ${c.dim("— loops until done, fresh context each iteration")}`,
320307 );
@@ -579,7 +566,6 @@ function handleHelp(
579566 ["/undo", "remove the last turn from conversation history"],
580567 ["/reasoning [on|off]", "toggle display of model reasoning output"],
581568 ["/context [prune|cap]", "configure context pruning and tool-result caps"],
582- ["/plan", "toggle plan mode (read-only tools + MCP)"],
583569 [
584570 "/ralph",
585571 "toggle ralph mode (autonomous loop, fresh context each iteration)",
@@ -669,8 +655,7 @@ export async function handleCommand(
669655 args: string,
670656 ctx: CommandContext,
671657 ): Promise<CommandResult> {
672- // Custom commands take precedence over built-ins — a local /review or
673- // /plan in .agents/commands/ will shadow the built-in with that name.
658+ // Custom commands take precedence over built-ins.
674659 const custom = loadCustomCommands(ctx.cwd);
675660 const customCmd = custom.get(command.toLowerCase());
676661 if (customCmd) {
@@ -698,10 +683,6 @@ export async function handleCommand(
698683 handleCache(ctx, args);
699684 return { type: "handled" };
700685
701- case "plan":
702- handlePlan(ctx);
703- return { type: "handled" };
704-
705686 case "ralph":
706687 handleRalph(ctx);
707688 return { type: "handled" };
src/cli/input-loop.ts+0−1
@@ -53,7 +53,6 @@ export async function runInputLoop(opts: InputLoopOptions): Promise<void> {
5353 try {
5454 input = await readline({
5555 cwd,
56- planMode: runner.planMode,
5756 ralphMode: runner.ralphMode,
5857 });
5958 } catch {
src/cli/input.ts+1−7
@@ -384,14 +384,12 @@ export function buildPromptDisplay(
384384 // ─── Main readline function ───────────────────────────────────────────────────
385385
386386 const PROMPT = c.green("▶ ");
387-const PROMPT_PLAN = c.yellow("⬢ ");
388387 const PROMPT_RALPH = c.magenta("↻ ");
389388
390389 const PROMPT_RAW_LEN = 2; // both prompts are 2 visible chars
391390
392391 export async function readline(opts: {
393392 cwd?: string;
394- planMode?: boolean;
395393 ralphMode?: boolean;
396394 }): Promise<InputResult> {
397395 const cwd = opts.cwd ?? process.cwd();
@@ -450,11 +448,7 @@ export async function readline(opts: {
450448 Math.max(1, cols - PROMPT_RAW_LEN - 2),
451449 );
452450
453- const prompt = opts.planMode
454- ? PROMPT_PLAN
455- : opts.ralphMode
456- ? PROMPT_RALPH
457- : PROMPT;
451+ const prompt = opts.ralphMode ? PROMPT_RALPH : PROMPT;
458452
459453 process.stdout.write(
460454 `${CLEAR_LINE}${prompt}${display}${CSI}${PROMPT_RAW_LEN + displayCursor + 1}G`,
src/cli/types.ts+0−2
@@ -19,8 +19,6 @@ export interface CommandContext {
1919 setOpenAIPromptCacheRetention: (retention: "in_memory" | "24h") => void;
2020 googleCachedContent: string | null;
2121 setGoogleCachedContent: (contentId: string | null) => void;
22- planMode: boolean;
23- setPlanMode: (enabled: boolean) => void;
2422 ralphMode: boolean;
2523 setRalphMode: (enabled: boolean) => void;
2624 undoLastTurn: () => Promise<boolean>;
src/tools/insert.test.ts+7−12
@@ -1,6 +1,6 @@
11 import { afterEach, beforeEach, describe, expect, test } from "bun:test";
22 import { insertTool } from "./insert.ts";
3-import { createTestHelpers } from "./test-helpers.ts";
3+import { createTestHelpers, registerAnchorErrorTests } from "./test-helpers.ts";
44 import { stripWriteResultMeta } from "./write-result.ts";
55
66 const { setup, teardown, write, read, anchor, getDir } = createTestHelpers();
@@ -122,29 +122,24 @@ describe("insertTool", () => {
122122 expect(result.diff).not.toMatch(/^-[^-]/m);
123123 });
124124
125- test("throws when file does not exist", async () => {
126- await expect(
125+ registerAnchorErrorTests({
126+ missingFileCall: (a) =>
127127 execute({
128128 path: "missing.txt",
129129 cwd: getDir(),
130- anchor: "1:00",
130+ anchor: a,
131131 position: "after",
132132 content: "X",
133133 }),
134- ).rejects.toThrow("File not found");
135- });
136-
137- test("throws when anchor hash does not match", async () => {
138- const name = await write("f.txt", "a\nb\nc\n");
139- await expect(
134+ badAnchorCall: (name, a) =>
140135 execute({
141136 path: name,
142137 cwd: getDir(),
143- anchor: "2:ff", // wrong hash for "b"
138+ anchor: a, // wrong hash for "b"
144139 position: "after",
145140 content: "X",
146141 }),
147- ).rejects.toThrow("Hash not found");
142+ write,
148143 });
149144
150145 test("throws on malformed anchor format", async () => {
src/tools/replace.test.ts+7−20
@@ -1,6 +1,6 @@
11 import { afterEach, beforeEach, describe, expect, test } from "bun:test";
22 import { replaceTool } from "./replace.ts";
3-import { createTestHelpers } from "./test-helpers.ts";
3+import { createTestHelpers, registerAnchorErrorTests } from "./test-helpers.ts";
44 import { stripWriteResultMeta } from "./write-result.ts";
55
66 const { setup, teardown, write, read, anchor, getDir } = createTestHelpers();
@@ -107,25 +107,12 @@ describe("replaceTool", () => {
107107 expect(result.path).toBe(name);
108108 });
109109
110- test("throws when file does not exist", async () => {
111- await expect(
112- execute({
113- path: "missing.txt",
114- cwd: getDir(),
115- startAnchor: "1:00",
116- }),
117- ).rejects.toThrow("File not found");
118- });
119-
120- test("throws when anchor hash does not match", async () => {
121- const name = await write("f.txt", "a\nb\nc\n");
122- await expect(
123- execute({
124- path: name,
125- cwd: getDir(),
126- startAnchor: "2:ff", // wrong hash for "b"
127- }),
128- ).rejects.toThrow("Hash not found");
110+ registerAnchorErrorTests({
111+ missingFileCall: (a) =>
112+ execute({ path: "missing.txt", cwd: getDir(), startAnchor: a }),
113+ badAnchorCall: (name, a) =>
114+ execute({ path: name, cwd: getDir(), startAnchor: a }), // wrong hash for "b"
115+ write,
129116 });
130117
131118 test("throws when endAnchor is before startAnchor", async () => {
src/tools/test-helpers.ts+24−0
@@ -1,3 +1,4 @@
1+import { expect, test } from "bun:test";
12 import { mkdtemp, rm, writeFile } from "node:fs/promises";
23 import { tmpdir } from "node:os";
34 import { join } from "node:path";
@@ -36,3 +37,26 @@ export function createTestHelpers() {
3637
3738 return { setup, teardown, write, read, anchor, getDir };
3839 }
40+
41+/**
42+ * Shared anchor-error tests for tools that accept an anchor parameter.
43+ * Call inside a describe block; the two tests are registered under it.
44+ */
45+export function registerAnchorErrorTests(opts: {
46+ missingFileCall: (anchor: string) => Promise<unknown>;
47+ badAnchorCall: (name: string, anchor: string) => Promise<unknown>;
48+ write: (name: string, content: string) => Promise<string>;
49+}): void {
50+ test("throws when file does not exist", async () => {
51+ await expect(opts.missingFileCall("1:00")).rejects.toThrow(
52+ "File not found",
53+ );
54+ });
55+
56+ test("throws when anchor hash does not match", async () => {
57+ const name = await opts.write("f.txt", "a\nb\nc\n");
58+ await expect(opts.badAnchorCall(name, "2:ff")).rejects.toThrow(
59+ "Hash not found",
60+ );
61+ });
62+}