@andares/pi-toolkits 0.12.4 → 0.13.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 (65) hide show
  1. package/README.md +100 -15
  2. package/README.zh-CN.md +94 -14
  3. package/package.json +19 -10
  4. package/src/features/ask/index.ts +6 -0
  5. package/src/features/init/apply.ts +32 -12
  6. package/src/features/init/audit-uat.test.ts +103 -0
  7. package/src/features/init/audit.ts +148 -0
  8. package/src/features/init/detect.ts +4 -0
  9. package/src/features/init/index.ts +47 -2
  10. package/src/features/init/plan.ts +11 -0
  11. package/src/features/init/refresh.test.ts +208 -0
  12. package/src/features/init/refresh.ts +255 -0
  13. package/src/features/init/spec.ts +20 -0
  14. package/src/features/init/templates/agents-skeleton.md +2 -0
  15. package/src/features/init/templates/uat-readme.md +53 -0
  16. package/src/features/init/templates/workflow-block.md +21 -0
  17. package/src/features/init/templates.test.ts +3 -1
  18. package/src/features/init/templates.ts +2 -0
  19. package/src/features/init/types.ts +12 -1
  20. package/src/features/permission/index.ts +32 -0
  21. package/src/features/plan/assets/index-C1YLIi4I.js +1 -0
  22. package/src/features/plan/assets/index-DMEpYC3V.css +1 -0
  23. package/src/features/plan/assets/index.html +14 -0
  24. package/src/features/plan/assets.test.ts +64 -0
  25. package/src/features/plan/blocks.test.ts +77 -0
  26. package/src/features/plan/blocks.ts +153 -0
  27. package/src/features/plan/diff.test.ts +144 -0
  28. package/src/features/plan/diff.ts +193 -0
  29. package/src/features/plan/feedback.test.ts +233 -0
  30. package/src/features/plan/feedback.ts +182 -0
  31. package/src/features/plan/index.test.ts +385 -0
  32. package/src/features/plan/index.ts +433 -0
  33. package/src/features/plan/prompt.test.ts +91 -0
  34. package/src/features/plan/prompt.ts +110 -0
  35. package/src/features/plan/render.test.ts +94 -0
  36. package/src/features/plan/render.ts +131 -0
  37. package/src/features/plan/server.test.ts +374 -0
  38. package/src/features/plan/server.ts +272 -0
  39. package/src/features/plan/store.test.ts +145 -0
  40. package/src/features/plan/store.ts +244 -0
  41. package/src/features/review/index.ts +54 -28
  42. package/src/features/review/review.test.ts +46 -1
  43. package/src/features/uat/assets/index-D-W9zj0w.css +1 -0
  44. package/src/features/uat/assets/index-DCBQCsli.js +1 -0
  45. package/src/features/uat/assets/index.html +14 -0
  46. package/src/features/uat/constants.ts +23 -0
  47. package/src/features/uat/index.test.ts +404 -0
  48. package/src/features/uat/index.ts +329 -0
  49. package/src/features/uat/item-tool.ts +280 -0
  50. package/src/features/uat/ledger.test.ts +249 -0
  51. package/src/features/uat/ledger.ts +504 -0
  52. package/src/features/uat/prompt.ts +78 -0
  53. package/src/features/uat/record-tool.ts +167 -0
  54. package/src/features/uat/records.test.ts +145 -0
  55. package/src/features/uat/records.ts +268 -0
  56. package/src/features/uat/server.ts +181 -0
  57. package/src/features/uat/state.test.ts +41 -0
  58. package/src/features/uat/state.ts +67 -0
  59. package/src/index.ts +10 -1
  60. package/src/lib/ask-control.ts +25 -0
  61. package/src/lib/opener.test.ts +72 -0
  62. package/src/lib/opener.ts +121 -0
  63. package/src/lib/permission-control.ts +39 -0
  64. package/src/lib/startup.test.ts +1 -1
  65. package/src/lib/web-review.ts +341 -0
@@ -0,0 +1,385 @@
1
+ /**
2
+ * ask-plan wiring: command, tool, gate, prompt, decision round-trip.
3
+ *
4
+ * The server is real here (it is the only way to prove the non-blocking submit
5
+ * actually resolves into a message), the browser opener and the permission
6
+ * control are fakes.
7
+ */
8
+ import { mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
9
+ import { request } from "node:http";
10
+ import { tmpdir } from "node:os";
11
+ import { dirname, join } from "node:path";
12
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
13
+ import type { ExtensionAPI, ExtensionContext, ToolCallEvent } from "@earendil-works/pi-coding-agent";
14
+ import type { GateHub, GateVerdict } from "../../lib/gates.js";
15
+ import { setPermissionControl, type PermissionControl } from "../../lib/permission-control.js";
16
+ import { setAskControl } from "../../lib/ask-control.js";
17
+ import { registerPlan, PLAN_COMMAND, PLAN_SUBMIT_TOOL } from "./index.js";
18
+
19
+ let agentDir: string;
20
+ let workDir: string;
21
+
22
+ beforeEach(() => {
23
+ agentDir = mkdtempSync(join(tmpdir(), "plan-agent-"));
24
+ workDir = mkdtempSync(join(tmpdir(), "plan-work-"));
25
+ });
26
+
27
+ afterEach(() => {
28
+ setPermissionControl(undefined);
29
+ setAskControl(undefined);
30
+ rmSync(agentDir, { recursive: true, force: true });
31
+ rmSync(workDir, { recursive: true, force: true });
32
+ });
33
+
34
+ /** Write a file inside the temp work dir, creating its parents. */
35
+ function writeSpec(relativePath: string, text: string): void {
36
+ const path = join(workDir, relativePath);
37
+ mkdirSync(dirname(path), { recursive: true });
38
+ writeFileSync(path, text);
39
+ }
40
+
41
+ interface Harness {
42
+ pi: ExtensionAPI;
43
+ commands: Map<string, { description: string; handler: (args: string, ctx: ExtensionContext) => Promise<void> }>;
44
+ tools: Map<string, { name: string; execute: (id: string, params: { path?: string }) => Promise<{ content: Array<{ text: string }>; details: unknown }> }>;
45
+ handlers: Record<string, Array<(event: { systemPrompt: string }, ctx?: ExtensionContext) => { systemPrompt?: string } | undefined>>;
46
+ gates: Array<{ name: string; order?: number; evaluate: (event: ToolCallEvent) => GateVerdict | undefined }>;
47
+ sendUserMessage: ReturnType<typeof vi.fn>;
48
+ activeTools: () => string[];
49
+ openBrowser: ReturnType<typeof vi.fn>;
50
+ notify: ReturnType<typeof vi.fn>;
51
+ ctx: ExtensionContext;
52
+ control: { enableDefaults: ReturnType<typeof vi.fn>; restore: ReturnType<typeof vi.fn>; disable: ReturnType<typeof vi.fn>; snapshot: ReturnType<typeof vi.fn> };
53
+ }
54
+
55
+ function harness(): Harness {
56
+ const commands = new Map<string, { description: string; handler: (args: string, ctx: ExtensionContext) => Promise<void> }>();
57
+ const tools = new Map<string, { name: string; execute: (id: string, params: { path?: string }) => Promise<{ content: Array<{ text: string }>; details: unknown }> }>();
58
+ const gates: Harness["gates"] = [];
59
+ const handlers: Harness["handlers"] = {};
60
+ let activeTools = ["read", "grep", "bash", "write", "edit"];
61
+ const sendUserMessage = vi.fn();
62
+ const pi = {
63
+ registerCommand: (name: string, def: never) => commands.set(name, def),
64
+ registerTool: (def: { name: string } & { execute: unknown }) => {
65
+ tools.set(def.name, def as never);
66
+ },
67
+ on: (type: string, handler: (event: { systemPrompt: string }, ctx?: ExtensionContext) => { systemPrompt?: string } | undefined) => {
68
+ handlers[type] = [...(handlers[type] ?? []), handler];
69
+ },
70
+ getActiveTools: () => activeTools,
71
+ getAllTools: () => [
72
+ { name: "read" },
73
+ { name: "bash" },
74
+ { name: "write" },
75
+ { name: "edit" },
76
+ { name: "ask_user_question" },
77
+ // Registered does not mean callable: this tool is deliberately absent
78
+ // from the active set, and approval must not recommend it.
79
+ { name: "record_change" },
80
+ ],
81
+ setActiveTools: (names: string[]) => {
82
+ activeTools = names;
83
+ },
84
+ sendUserMessage,
85
+ } as unknown as ExtensionAPI;
86
+ const notify = vi.fn();
87
+ const ctx = {
88
+ cwd: workDir,
89
+ hasUI: true,
90
+ isIdle: () => true,
91
+ ui: { notify },
92
+ } as unknown as ExtensionContext;
93
+ const openBrowser = vi.fn();
94
+ const control = {
95
+ snapshot: vi.fn(() => ({ enabled: false, modes: { inRead: "allow", inWrite: "allow", outRead: "allow", outWrite: "ask" } })),
96
+ enableDefaults: vi.fn(),
97
+ restore: vi.fn(),
98
+ disable: vi.fn(),
99
+ };
100
+ setPermissionControl(control as unknown as PermissionControl);
101
+ registerPlan(pi, { register: (def: never) => gates.push(def as never) } as unknown as GateHub, {
102
+ agentDir,
103
+ openBrowser,
104
+ portStart: 46_000 + Math.floor(Math.random() * 1000),
105
+ closeDelayMs: 25,
106
+ });
107
+ return { pi, commands, tools, gates, handlers, sendUserMessage, activeTools: () => activeTools, openBrowser, notify, ctx, control };
108
+ }
109
+
110
+ /** Talk to the review server the way the page does. */
111
+ async function decide(url: string, action: "approve" | "deny"): Promise<number> {
112
+ const parsed = new URL(url);
113
+ const token = parsed.searchParams.get("t") ?? "";
114
+ return new Promise((resolve, reject) => {
115
+ const req = request(
116
+ {
117
+ host: "127.0.0.1",
118
+ port: Number(parsed.port),
119
+ path: "/api/decide",
120
+ method: "POST",
121
+ headers: { "content-type": "application/json", "x-plan-token": token },
122
+ },
123
+ (res) => {
124
+ res.resume();
125
+ resolve(res.statusCode ?? 0);
126
+ },
127
+ );
128
+ req.on("error", reject);
129
+ req.write(JSON.stringify({ action }));
130
+ req.end();
131
+ });
132
+ }
133
+
134
+ describe("ask-plan command", () => {
135
+ it("enters plan mode: permission on, submit tool active, kickoff sent", async () => {
136
+ const h = harness();
137
+ const command = h.commands.get(PLAN_COMMAND);
138
+ expect(command).toBeDefined();
139
+ await command!.handler("ask-plan work", h.ctx);
140
+
141
+ expect(h.control.enableDefaults).toHaveBeenCalledWith(h.ctx);
142
+ expect(h.activeTools()).toContain(PLAN_SUBMIT_TOOL);
143
+ expect(h.sendUserMessage).toHaveBeenCalledWith(expect.stringContaining("Task: ask-plan work"));
144
+ expect(h.notify).toHaveBeenCalledWith(expect.stringContaining("specs/ask-plan-work.md"), "info");
145
+ });
146
+
147
+ it("refuses to start twice and can be turned off", async () => {
148
+ const h = harness();
149
+ const handler = h.commands.get(PLAN_COMMAND)!.handler;
150
+ await handler("topic", h.ctx);
151
+ await handler("topic", h.ctx);
152
+ expect(h.notify).toHaveBeenLastCalledWith(expect.stringContaining("already planning"), "warning");
153
+
154
+ await handler("off", h.ctx);
155
+ expect(h.control.restore).toHaveBeenCalled();
156
+ expect(h.activeTools()).not.toContain(PLAN_SUBMIT_TOOL);
157
+ });
158
+ });
159
+
160
+ describe("phase integration", () => {
161
+ it("exits ask mode before enabling the broader planning tool surface", async () => {
162
+ const h = harness();
163
+ const exit = vi.fn();
164
+ setAskControl({ isActive: () => true, exit });
165
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
166
+ expect(exit).toHaveBeenCalledWith(h.ctx);
167
+ expect(h.activeTools()).toContain(PLAN_SUBMIT_TOOL);
168
+ });
169
+
170
+ it("does not overwrite a permission policy the operator changed mid-plan", async () => {
171
+ const h = harness();
172
+ const off = { enabled: false, modes: { inRead: "allow", inWrite: "allow", outRead: "allow", outWrite: "ask" } };
173
+ const defaults = { enabled: true, modes: { inRead: "allow", inWrite: "allow", outRead: "allow", outWrite: "ask" } };
174
+ const manual = { enabled: true, modes: { inRead: "ask", inWrite: "ask", outRead: "deny", outWrite: "deny" } };
175
+ h.control.snapshot
176
+ .mockReturnValueOnce(off as never)
177
+ .mockReturnValueOnce(defaults as never)
178
+ .mockReturnValueOnce(manual as never);
179
+ const handler = h.commands.get(PLAN_COMMAND)!.handler;
180
+ await handler("topic", h.ctx);
181
+ await handler("off", h.ctx);
182
+ expect(h.control.restore).not.toHaveBeenCalled();
183
+ expect(h.control.disable).not.toHaveBeenCalled();
184
+ });
185
+
186
+ it("starts a fresh review session for the next plan after leaving", async () => {
187
+ const h = harness();
188
+ const handler = h.commands.get(PLAN_COMMAND)!.handler;
189
+ await handler("first", h.ctx);
190
+ writeSpec("specs/first.md", "# SPEC: first");
191
+ const first = await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/first.md" });
192
+ expect(first.content[0].text).toContain("Submitted v1 of 1");
193
+ await handler("off", h.ctx);
194
+ await handler("second", h.ctx);
195
+ writeSpec("specs/second.md", "# SPEC: second");
196
+ const second = await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/second.md" });
197
+ expect(second.content[0].text).toContain("Submitted v1 of 1");
198
+ expect(h.openBrowser).toHaveBeenCalledTimes(2);
199
+ });
200
+
201
+ it("drops plan state and closes the review when the pi session changes", async () => {
202
+ const h = harness();
203
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
204
+ writeSpec("specs/topic.md", "# SPEC: topic");
205
+ await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/topic.md" });
206
+ const nextCtx = {
207
+ ...h.ctx,
208
+ sessionManager: { getSessionId: () => "next-session" },
209
+ } as unknown as ExtensionContext;
210
+ h.handlers.session_start![0]!({ systemPrompt: "" }, nextCtx);
211
+ expect(h.activeTools()).not.toContain(PLAN_SUBMIT_TOOL);
212
+ expect(h.control.restore).not.toHaveBeenCalled();
213
+ });
214
+ });
215
+
216
+ describe("plan gate", () => {
217
+ const gate = (h: Harness) => h.gates.find((entry) => entry.name === "plan");
218
+
219
+ it("blocks writing anything but markdown while planning", async () => {
220
+ const h = harness();
221
+ const evaluate = gate(h)!.evaluate;
222
+ const write = (path: string): ToolCallEvent => ({ toolName: "write", input: { path } }) as unknown as ToolCallEvent;
223
+
224
+ expect(evaluate(write("src/features/x.ts"))).toBeUndefined();
225
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
226
+ expect(evaluate(write("src/features/x.ts"))).toMatchObject({ kind: "block" });
227
+ expect(evaluate(write("specs/topic.md"))).toBeUndefined();
228
+ expect(evaluate(write("/tmp/outside.md"))).toMatchObject({ kind: "block" });
229
+ expect(evaluate(write("../outside.md"))).toMatchObject({ kind: "block" });
230
+ symlinkSync(agentDir, join(workDir, "linked"), "dir");
231
+ expect(evaluate(write("linked/escape.md"))).toMatchObject({ kind: "block" });
232
+ });
233
+
234
+ it("stays out of the way when plan mode is off", () => {
235
+ const h = harness();
236
+ const event = { toolName: "edit", input: { path: "src/a.ts" } } as unknown as ToolCallEvent;
237
+ expect(gate(h)!.evaluate(event)).toBeUndefined();
238
+ });
239
+ });
240
+
241
+ describe("plan_submit", () => {
242
+ it("reads the file, snapshots a revision and opens the review once", async () => {
243
+ const h = harness();
244
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
245
+ writeSpec("specs/topic.md", "# SPEC: topic\n\nfirst step");
246
+ const tool = h.tools.get(PLAN_SUBMIT_TOOL)!;
247
+
248
+ const first = await tool.execute("id", { path: "specs/topic.md" });
249
+ expect(first.content[0].text).toContain("Submitted v1 of 1");
250
+ expect(h.openBrowser).toHaveBeenCalledTimes(1);
251
+
252
+ writeSpec("specs/topic.md", "# SPEC: topic\n\nsecond step");
253
+ const second = await tool.execute("id", { path: "specs/topic.md" });
254
+ expect(second.content[0].text).toContain("Submitted v2 of 2");
255
+ expect(h.openBrowser).toHaveBeenCalledTimes(1);
256
+ });
257
+
258
+ it("tells the model to write the file when it does not exist", async () => {
259
+ const h = harness();
260
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
261
+ const result = await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/missing.md" });
262
+ expect(result.content[0].text).toContain("Write the spec file first");
263
+ });
264
+
265
+ it("refuses to submit non-markdown or out-of-workspace files", async () => {
266
+ const h = harness();
267
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
268
+ const tool = h.tools.get(PLAN_SUBMIT_TOOL)!;
269
+ expect((await tool.execute("id", { path: "src/a.ts" })).content[0].text).toContain("inside the workspace");
270
+ expect((await tool.execute("id", { path: "/tmp/outside.md" })).content[0].text).toContain("inside the workspace");
271
+ });
272
+
273
+ it("refuses to submit outside plan mode", async () => {
274
+ const h = harness();
275
+ const result = await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/x.md" });
276
+ expect(result.content[0].text).toContain("Plan mode is off");
277
+ });
278
+
279
+ it("turns an approval into a message and leaves the phase", async () => {
280
+ const h = harness();
281
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
282
+ writeSpec("specs/topic.md", "# SPEC: topic\n\nfirst step");
283
+ await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/topic.md" });
284
+ const url = h.openBrowser.mock.calls[0][0] as string;
285
+
286
+ expect(await decide(url, "approve")).toBe(200);
287
+ await vi.waitFor(() => expect(h.sendUserMessage).toHaveBeenCalledTimes(2), { timeout: 5000 });
288
+ const message = h.sendUserMessage.mock.calls[1][0] as string;
289
+ expect(message).toContain("## Plan approved");
290
+ expect(message).toContain("start implementing");
291
+ // The approved revision is quoted back (the file may have changed since
292
+ // the submit), and the model is told to track the work in the todo list.
293
+ expect(message).toContain("### Approved plan (specs/topic.md)");
294
+ expect(message).toContain("# SPEC: topic\n\nfirst step");
295
+ expect(message).toContain("Record the implementation work in the todo list");
296
+ expect(message).not.toContain("call `record_change`");
297
+ expect(h.control.restore).toHaveBeenCalled();
298
+ expect(h.activeTools()).not.toContain(PLAN_SUBMIT_TOOL);
299
+ });
300
+
301
+ it("drops a browser decision that arrives after plan mode was closed", async () => {
302
+ const h = harness();
303
+ const handler = h.commands.get(PLAN_COMMAND)!.handler;
304
+ await handler("topic", h.ctx);
305
+ writeSpec("specs/topic.md", "# SPEC: topic");
306
+ await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/topic.md" });
307
+ const url = h.openBrowser.mock.calls[0][0] as string;
308
+ expect(await decide(url, "deny")).toBe(200);
309
+ await handler("off", h.ctx);
310
+ await new Promise((resolve) => setTimeout(resolve, 100));
311
+ // Only the kickoff was sent; the stale review cannot start another turn.
312
+ expect(h.sendUserMessage).toHaveBeenCalledTimes(1);
313
+ });
314
+
315
+ it("turns a denial into feedback but keeps planning", async () => {
316
+ const h = harness();
317
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
318
+ writeSpec("specs/topic.md", "# SPEC: topic\n\nfirst step");
319
+ await h.tools.get(PLAN_SUBMIT_TOOL)!.execute("id", { path: "specs/topic.md" });
320
+ const url = h.openBrowser.mock.calls[0][0] as string;
321
+
322
+ expect(await decide(url, "deny")).toBe(200);
323
+ await vi.waitFor(() => expect(h.sendUserMessage).toHaveBeenCalledTimes(2), { timeout: 5000 });
324
+ const message = h.sendUserMessage.mock.calls[1][0] as string;
325
+ expect(message).toContain("## Plan feedback");
326
+ expect(message).toContain("No specific annotations were left");
327
+ expect(h.activeTools()).toContain(PLAN_SUBMIT_TOOL);
328
+ expect(h.control.restore).not.toHaveBeenCalled();
329
+ });
330
+ });
331
+
332
+ describe("prompt injection", () => {
333
+ const start = (h: Harness, prompt: string) => {
334
+ const handler = h.handlers.before_agent_start?.[0];
335
+ expect(handler).toBeDefined();
336
+ return handler!({ systemPrompt: prompt });
337
+ };
338
+
339
+ it("appends the plan framework only while planning", async () => {
340
+ const h = harness();
341
+ expect(start(h, "base")).toBeUndefined();
342
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
343
+ const injected = start(h, "base");
344
+ expect(injected?.systemPrompt).toContain("base");
345
+ expect(injected?.systemPrompt).toContain("[ASK-PLAN — PLANNING]");
346
+ expect(injected?.systemPrompt).toContain("plan_submit");
347
+ expect(injected?.systemPrompt).toContain("[ASK-PLAN — INTERVIEW]");
348
+ expect(injected?.systemPrompt).toContain("ask in plain text");
349
+ });
350
+
351
+ it("names the question tool only when it is active", async () => {
352
+ const h = harness();
353
+ h.pi.setActiveTools([...h.activeTools(), "ask_user_question"]);
354
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
355
+ const injected = start(h, "base");
356
+ expect(injected?.systemPrompt).toContain("`ask_user_question` is available");
357
+ });
358
+ });
359
+
360
+ describe("plan write boundary", () => {
361
+ it("blocks a bash write to a non-markdown project path", async () => {
362
+ const h = harness();
363
+ await h.commands.get(PLAN_COMMAND)!.handler("topic", h.ctx);
364
+ const gate = h.gates.find((entry) => entry.name === "plan");
365
+ expect(gate).toBeDefined();
366
+ const evaluate = (command: string) =>
367
+ gate!.evaluate({ toolName: "bash", input: { command } } as ToolCallEvent);
368
+
369
+ expect(evaluate("echo x > src/a.ts")?.kind).toBe("block");
370
+ expect(evaluate("cp a.ts b.ts")?.kind).toBe("block");
371
+ expect(evaluate("echo x > specs/notes.md")).toBeUndefined();
372
+ expect(evaluate("echo x > /tmp/scratch.txt")).toBeUndefined();
373
+ expect(evaluate("ls src")).toBeUndefined();
374
+ });
375
+ });
376
+
377
+ describe("model policy", () => {
378
+ it("contains no model-switching call in production code", () => {
379
+ const root = join(process.cwd(), "src", "features", "plan");
380
+ for (const file of readdirSync(root)) {
381
+ if (!file.endsWith(".ts") || file.endsWith(".test.ts")) continue;
382
+ expect(readFileSync(join(root, file), "utf8"), file).not.toContain("setModel");
383
+ }
384
+ });
385
+ });