@slowcook-ai/cli 0.6.14 → 0.7.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.
- package/dist/commands/init/plan.d.ts.map +1 -1
- package/dist/commands/init/plan.js +10 -17
- package/dist/commands/init/plan.js.map +1 -1
- package/dist/commands/init/templates.d.ts +0 -5
- package/dist/commands/init/templates.d.ts.map +1 -1
- package/dist/commands/init/templates.js +0 -229
- package/dist/commands/init/templates.js.map +1 -1
- package/dist/commands/testgen/agent.d.ts +33 -0
- package/dist/commands/testgen/agent.d.ts.map +1 -1
- package/dist/commands/testgen/agent.js +185 -14
- package/dist/commands/testgen/agent.js.map +1 -1
- package/dist/commands/testgen/prompts.d.ts +10 -12
- package/dist/commands/testgen/prompts.d.ts.map +1 -1
- package/dist/commands/testgen/prompts.js +150 -87
- package/dist/commands/testgen/prompts.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/init/plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/init/plan.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qDAAqD;AACrD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,IAAI,CAAC,IAAI,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for `slowcook init`. Takes a snapshot of the filesystem
|
|
2
2
|
// (via an injected reader), returns the planned actions. No I/O side effects
|
|
3
3
|
// here — all writes happen in the CLI wrapper so this is trivially testable.
|
|
4
|
-
import { frozenPathsJson,
|
|
4
|
+
import { frozenPathsJson, brewingReadme, contextMdTemplate, slowcookCliVersionFile, preCommitHook, codeownersFullFile, codeownersSection, gitkeep, CLI_VERSION_FOR_TEMPLATES, SLOWCOOK_CLI_VERSION_FILE, SLOWCOOK_CODEOWNERS_MARKER_BEGIN, SLOWCOOK_CODEOWNERS_MARKER_END, } from "./templates.js";
|
|
5
|
+
import { getGitHubCiArtifacts } from "@slowcook-ai/forge-github";
|
|
6
|
+
import { getTsStackConfig } from "@slowcook-ai/stack-ts";
|
|
5
7
|
const TARGETS = {
|
|
6
8
|
frozenPaths: ".brewing/frozen-paths.json",
|
|
7
9
|
stack: ".brewing/stack.json",
|
|
@@ -9,10 +11,6 @@ const TARGETS = {
|
|
|
9
11
|
contextMd: ".brewing/context.md",
|
|
10
12
|
cliVersion: SLOWCOOK_CLI_VERSION_FILE,
|
|
11
13
|
manifestsGitkeep: ".brewing/manifests/.gitkeep",
|
|
12
|
-
workflow: ".github/workflows/slowcook.yml",
|
|
13
|
-
specMergedWorkflow: ".github/workflows/slowcook-spec-merged.yml",
|
|
14
|
-
testgenWorkflow: ".github/workflows/slowcook-testgen.yml",
|
|
15
|
-
brewAutoWorkflow: ".github/workflows/slowcook-brew-auto.yml",
|
|
16
14
|
preCommitHook: ".githooks/pre-commit",
|
|
17
15
|
codeowners: "CODEOWNERS",
|
|
18
16
|
packageJson: "package.json",
|
|
@@ -62,7 +60,7 @@ export function buildPlan(reader, options) {
|
|
|
62
60
|
// 1. .brewing/frozen-paths.json
|
|
63
61
|
addSimpleFile(actions, reader, options.force, TARGETS.frozenPaths, frozenPathsJson());
|
|
64
62
|
// 2. .brewing/stack.json
|
|
65
|
-
addSimpleFile(actions, reader, options.force, TARGETS.stack,
|
|
63
|
+
addSimpleFile(actions, reader, options.force, TARGETS.stack, getTsStackConfig({ hasPlaywright: tmplParams.hasPlaywright }));
|
|
66
64
|
// 3. .brewing/README.md
|
|
67
65
|
addSimpleFile(actions, reader, options.force, TARGETS.brewingReadme, brewingReadme());
|
|
68
66
|
// 3b. .brewing/context.md (project context for agents)
|
|
@@ -75,17 +73,12 @@ export function buildPlan(reader, options) {
|
|
|
75
73
|
if (!reader.exists(".brewing/manifests/")) {
|
|
76
74
|
actions.push({ kind: "create", path: TARGETS.manifestsGitkeep, contents: gitkeep() });
|
|
77
75
|
}
|
|
78
|
-
// 5.
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// 5d. .github/workflows/slowcook-brew-auto.yml — auto-trigger brew when a
|
|
85
|
-
// tests PR merges. Consumers who want humans-in-the-loop before every brew
|
|
86
|
-
// can delete this file; `slowcook-brew.yml` (workflow_dispatch) is the
|
|
87
|
-
// manual alternative.
|
|
88
|
-
addSimpleFile(actions, reader, options.force, TARGETS.brewAutoWorkflow, slowcookBrewAutoWorkflow());
|
|
76
|
+
// 5. CI workflows are provided by the forge adapter. Today only GitHub
|
|
77
|
+
// is wired; future forges (GitLab, Gitea) supply their own via a
|
|
78
|
+
// similar static export. See packages/forge-github/src/templates.ts.
|
|
79
|
+
for (const artifact of getGitHubCiArtifacts({ cliVersion })) {
|
|
80
|
+
addSimpleFile(actions, reader, options.force, artifact.path, artifact.contents);
|
|
81
|
+
}
|
|
89
82
|
// 5e. .githooks/pre-commit — forces code-map regen on src/ commits.
|
|
90
83
|
// Activation per clone: `git config core.hooksPath .githooks`. Without
|
|
91
84
|
// this hook, contributors hit the stale-map CI failure on every PR
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/commands/init/plan.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAE7E,OAAO,EACL,eAAe,EACf,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AG,cAAc,GAAG,8BAA8B,CAAC,MAAM,CAAC;IAC5E,0CAA0C;IAC1C,MAAM,KAAK,GACT,QAAQ,CAAC,YAAY,CAAC,KAAK,IAAI;QAC7B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;QAClC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AACtE,CAAC"}
|
|
@@ -15,13 +15,8 @@ export interface TemplateParams {
|
|
|
15
15
|
export declare const SLOWCOOK_CODEOWNERS_MARKER_BEGIN = "# --- slowcook:frozen-paths BEGIN ---";
|
|
16
16
|
export declare const SLOWCOOK_CODEOWNERS_MARKER_END = "# --- slowcook:frozen-paths END ---";
|
|
17
17
|
export declare function frozenPathsJson(): string;
|
|
18
|
-
export declare function stackJson(params: TemplateParams): string;
|
|
19
18
|
export declare function contextMdTemplate(): string;
|
|
20
19
|
export declare function brewingReadme(): string;
|
|
21
|
-
export declare function slowcookTestgenWorkflow(cliVersion: string): string;
|
|
22
|
-
export declare function slowcookSpecMergedWorkflow(cliVersion: string): string;
|
|
23
|
-
export declare function slowcookBrewAutoWorkflow(): string;
|
|
24
|
-
export declare function slowcookWorkflow(cliVersion: string): string;
|
|
25
20
|
export declare function codeownersSection(params: TemplateParams): string;
|
|
26
21
|
export declare function codeownersFullFile(params: TemplateParams): string;
|
|
27
22
|
export declare function gitkeep(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAEzE,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE;AAaD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AACxF,eAAO,MAAM,8BAA8B,wCAAwC,CAAC;AAEpF,wBAAgB,eAAe,IAAI,MAAM,CAoCxC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,kCAAkC,CAAC;AAEzE,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE;AAaD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AACxF,eAAO,MAAM,8BAA8B,wCAAwC,CAAC;AAEpF,wBAAgB,eAAe,IAAI,MAAM,CAoCxC;AAGD,wBAAgB,iBAAiB,IAAI,MAAM,CAmD1C;AAED,wBAAgB,aAAa,IAAI,MAAM,CA0CtC;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAehE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAQjE;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAqCtC"}
|
|
@@ -52,33 +52,6 @@ export function frozenPathsJson() {
|
|
|
52
52
|
},
|
|
53
53
|
}, null, 2) + "\n");
|
|
54
54
|
}
|
|
55
|
-
export function stackJson(params) {
|
|
56
|
-
const doc = "Project-level stack configuration consumed by slowcook (@slowcook-ai/stack-ts). " +
|
|
57
|
-
"Tells the harness how to discover and run tests. Only include suites that are " +
|
|
58
|
-
"actually runnable — slowcook refuses to record an incomplete manifest." +
|
|
59
|
-
(params.hasPlaywright
|
|
60
|
-
? " (Playwright detected in package.json; slowcook's playwright discovery is not yet " +
|
|
61
|
-
"implemented, so the e2e suite is intentionally omitted. Add it back post-upgrade.)"
|
|
62
|
-
: "");
|
|
63
|
-
return (JSON.stringify({
|
|
64
|
-
$schema: "./stack.schema.json",
|
|
65
|
-
$doc: doc,
|
|
66
|
-
language: "typescript",
|
|
67
|
-
package_manager: "npm",
|
|
68
|
-
test: {
|
|
69
|
-
backend: {
|
|
70
|
-
runner: "vitest",
|
|
71
|
-
run_command: "npx vitest run",
|
|
72
|
-
discover_command: "npx vitest list",
|
|
73
|
-
reporter_format: "vitest-list-lines",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
lint: {
|
|
77
|
-
lint_command: "npm run lint",
|
|
78
|
-
typecheck_command: "npm run typecheck",
|
|
79
|
-
},
|
|
80
|
-
}, null, 2) + "\n");
|
|
81
|
-
}
|
|
82
55
|
export function contextMdTemplate() {
|
|
83
56
|
return `# Project context for slowcook agents
|
|
84
57
|
|
|
@@ -174,208 +147,6 @@ npx --yes @slowcook-ai/cli@latest map generate # refresh .brewing/code-map.*
|
|
|
174
147
|
Deliberately slightly inconvenient. Frozen-path changes are rare events that deserve a reviewer's eyes.
|
|
175
148
|
`;
|
|
176
149
|
}
|
|
177
|
-
export function slowcookTestgenWorkflow(cliVersion) {
|
|
178
|
-
void cliVersion;
|
|
179
|
-
return `name: slowcook testgen
|
|
180
|
-
|
|
181
|
-
# Generates Vitest integration tests whenever a new spec lands on main
|
|
182
|
-
# (specs/story-*.yaml touched in the push). Idempotent — skips specs that
|
|
183
|
-
# already have tests. Output is a draft PR containing the new test files,
|
|
184
|
-
# per-story manifests, and (if the spec supersedes others) removal of
|
|
185
|
-
# the superseded stories' tests.
|
|
186
|
-
|
|
187
|
-
on:
|
|
188
|
-
push:
|
|
189
|
-
branches: [main]
|
|
190
|
-
paths:
|
|
191
|
-
- 'specs/story-*.yaml'
|
|
192
|
-
- 'specs/_index.yaml'
|
|
193
|
-
|
|
194
|
-
concurrency:
|
|
195
|
-
group: slowcook-testgen-main
|
|
196
|
-
cancel-in-progress: false
|
|
197
|
-
|
|
198
|
-
jobs:
|
|
199
|
-
testgen:
|
|
200
|
-
runs-on: ubuntu-latest
|
|
201
|
-
permissions:
|
|
202
|
-
contents: write
|
|
203
|
-
pull-requests: write
|
|
204
|
-
steps:
|
|
205
|
-
- uses: actions/checkout@v4
|
|
206
|
-
with:
|
|
207
|
-
fetch-depth: 0
|
|
208
|
-
|
|
209
|
-
${RESOLVE_PIN_STEP}
|
|
210
|
-
|
|
211
|
-
- name: Configure git identity for agent commits
|
|
212
|
-
run: |
|
|
213
|
-
git config user.name "slowcook-testgen[bot]"
|
|
214
|
-
git config user.email "slowcook-testgen@users.noreply.github.com"
|
|
215
|
-
|
|
216
|
-
- uses: actions/setup-node@v4
|
|
217
|
-
with:
|
|
218
|
-
node-version: 20
|
|
219
|
-
|
|
220
|
-
- name: Generate tests
|
|
221
|
-
env:
|
|
222
|
-
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
223
|
-
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
224
|
-
SLOWCOOK_DEBUG: "1"
|
|
225
|
-
run: |
|
|
226
|
-
npx --yes "$SLOWCOOK_CLI" testgen --all
|
|
227
|
-
`;
|
|
228
|
-
}
|
|
229
|
-
export function slowcookSpecMergedWorkflow(cliVersion) {
|
|
230
|
-
void cliVersion;
|
|
231
|
-
return `name: slowcook — spec merged
|
|
232
|
-
|
|
233
|
-
# Transitions source-issue labels from \`spec-submitted\` → \`spec-ready\` when
|
|
234
|
-
# a spec PR merges. Detects spec PRs by the \`slowcook-spec\` label.
|
|
235
|
-
|
|
236
|
-
on:
|
|
237
|
-
pull_request:
|
|
238
|
-
types: [closed]
|
|
239
|
-
|
|
240
|
-
jobs:
|
|
241
|
-
transition:
|
|
242
|
-
if: >-
|
|
243
|
-
github.event.pull_request.merged == true &&
|
|
244
|
-
contains(github.event.pull_request.labels.*.name, 'slowcook-spec')
|
|
245
|
-
runs-on: ubuntu-latest
|
|
246
|
-
permissions:
|
|
247
|
-
issues: write
|
|
248
|
-
contents: read
|
|
249
|
-
pull-requests: read
|
|
250
|
-
steps:
|
|
251
|
-
- uses: actions/checkout@v4
|
|
252
|
-
with:
|
|
253
|
-
ref: \${{ github.event.pull_request.merge_commit_sha }}
|
|
254
|
-
|
|
255
|
-
${RESOLVE_PIN_STEP}
|
|
256
|
-
|
|
257
|
-
- uses: actions/setup-node@v4
|
|
258
|
-
with:
|
|
259
|
-
node-version: 20
|
|
260
|
-
|
|
261
|
-
- name: Transition labels
|
|
262
|
-
env:
|
|
263
|
-
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
264
|
-
run: |
|
|
265
|
-
npx --yes "$SLOWCOOK_CLI" on-spec-merged --pr \${{ github.event.pull_request.number }}
|
|
266
|
-
`;
|
|
267
|
-
}
|
|
268
|
-
export function slowcookBrewAutoWorkflow() {
|
|
269
|
-
return `name: slowcook brew — auto on tests merged
|
|
270
|
-
|
|
271
|
-
# Auto-triggers the \`slowcook-brew\` workflow when a tests PR (label
|
|
272
|
-
# \`slowcook-tests\`) merges to main. Extracts the story id(s) from the
|
|
273
|
-
# PR title and fires one brew run per story. Sonnet 4.6 default keeps
|
|
274
|
-
# cost around $0.05–$0.50 per story; \`slowcook-brew.yml\`'s concurrency
|
|
275
|
-
# rules serialize runs per story.
|
|
276
|
-
#
|
|
277
|
-
# Manual dispatch of \`slowcook-brew.yml\` remains available for explicit
|
|
278
|
-
# re-runs and for stories that need a non-default model/budget.
|
|
279
|
-
|
|
280
|
-
on:
|
|
281
|
-
pull_request:
|
|
282
|
-
types: [closed]
|
|
283
|
-
|
|
284
|
-
jobs:
|
|
285
|
-
trigger:
|
|
286
|
-
if: >-
|
|
287
|
-
github.event.pull_request.merged == true &&
|
|
288
|
-
contains(github.event.pull_request.labels.*.name, 'slowcook-tests')
|
|
289
|
-
runs-on: ubuntu-latest
|
|
290
|
-
permissions:
|
|
291
|
-
actions: write
|
|
292
|
-
contents: read
|
|
293
|
-
steps:
|
|
294
|
-
- name: Extract story ids from PR title
|
|
295
|
-
id: parse
|
|
296
|
-
env:
|
|
297
|
-
TITLE: \${{ github.event.pull_request.title }}
|
|
298
|
-
run: |
|
|
299
|
-
set -eu
|
|
300
|
-
IDS=$(printf '%s\\n' "$TITLE" | grep -oE 'story-[0-9]+' | sed 's/story-//' | sort -u | tr '\\n' ' ' || true)
|
|
301
|
-
if [ -z "$IDS" ]; then
|
|
302
|
-
echo "::notice::No story ids found in PR title '$TITLE' — skipping auto-brew."
|
|
303
|
-
fi
|
|
304
|
-
echo "story_ids=$IDS" >> "$GITHUB_OUTPUT"
|
|
305
|
-
|
|
306
|
-
- name: Dispatch brew per story
|
|
307
|
-
if: steps.parse.outputs.story_ids != ''
|
|
308
|
-
env:
|
|
309
|
-
GH_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
310
|
-
run: |
|
|
311
|
-
set -eu
|
|
312
|
-
for id in \${{ steps.parse.outputs.story_ids }}; do
|
|
313
|
-
echo "Dispatching slowcook-brew.yml for story-$id"
|
|
314
|
-
gh workflow run slowcook-brew.yml \\
|
|
315
|
-
--repo \${{ github.repository }} \\
|
|
316
|
-
-f story_id=$id \\
|
|
317
|
-
-f budget_usd=10 \\
|
|
318
|
-
-f max_iterations=10 \\
|
|
319
|
-
-f model=claude-sonnet-4-6
|
|
320
|
-
done
|
|
321
|
-
`;
|
|
322
|
-
}
|
|
323
|
-
export function slowcookWorkflow(cliVersion) {
|
|
324
|
-
void cliVersion;
|
|
325
|
-
return `name: slowcook
|
|
326
|
-
|
|
327
|
-
on:
|
|
328
|
-
pull_request:
|
|
329
|
-
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
330
|
-
|
|
331
|
-
concurrency:
|
|
332
|
-
group: slowcook-\${{ github.event.pull_request.number }}
|
|
333
|
-
cancel-in-progress: true
|
|
334
|
-
|
|
335
|
-
jobs:
|
|
336
|
-
check:
|
|
337
|
-
name: slowcook checks
|
|
338
|
-
runs-on: ubuntu-latest
|
|
339
|
-
steps:
|
|
340
|
-
- uses: actions/checkout@v4
|
|
341
|
-
with:
|
|
342
|
-
fetch-depth: 0
|
|
343
|
-
|
|
344
|
-
${RESOLVE_PIN_STEP}
|
|
345
|
-
|
|
346
|
-
- uses: actions/setup-node@v4
|
|
347
|
-
with:
|
|
348
|
-
node-version: 20
|
|
349
|
-
cache: npm
|
|
350
|
-
|
|
351
|
-
- name: Install consumer deps
|
|
352
|
-
# \`manifest verify\` shells out to the consumer's own test runner
|
|
353
|
-
# (e.g. \`npx vitest list\`) which loads the project's test config.
|
|
354
|
-
# Installing node_modules ensures that config can resolve its imports.
|
|
355
|
-
run: npm ci
|
|
356
|
-
|
|
357
|
-
- name: Guard — frozen paths
|
|
358
|
-
env:
|
|
359
|
-
HAS_OVERRIDE: \${{ contains(github.event.pull_request.labels.*.name, 'override-freeze') }}
|
|
360
|
-
run: |
|
|
361
|
-
set -eu
|
|
362
|
-
ARGS="--base origin/\${{ github.base_ref }} --head HEAD"
|
|
363
|
-
if [ "$HAS_OVERRIDE" = "true" ]; then
|
|
364
|
-
ARGS="$ARGS --override"
|
|
365
|
-
echo "::notice::'override-freeze' label present — guard runs in advisory mode."
|
|
366
|
-
fi
|
|
367
|
-
npx --yes "$SLOWCOOK_CLI" guard $ARGS
|
|
368
|
-
|
|
369
|
-
- name: Manifest — verify discoverable tests
|
|
370
|
-
run: npx --yes "$SLOWCOOK_CLI" manifest verify
|
|
371
|
-
|
|
372
|
-
- name: Code map — check it's up to date
|
|
373
|
-
# Fails if the committed .brewing/code-map.{json,md} differs from a
|
|
374
|
-
# fresh regeneration. Fix by running \`npx slowcook map generate\`
|
|
375
|
-
# locally, commit the result, and push.
|
|
376
|
-
run: npx --yes "$SLOWCOOK_CLI" map check
|
|
377
|
-
`;
|
|
378
|
-
}
|
|
379
150
|
export function codeownersSection(params) {
|
|
380
151
|
return `${SLOWCOOK_CODEOWNERS_MARKER_BEGIN}
|
|
381
152
|
# Paths frozen by slowcook. Agent-authored PRs cannot modify them;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sDAAsD;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AAEzE,MAAM,UAAU,sBAAsB,CAAC,UAAkB;IACvD,OAAO,UAAU,GAAG,IAAI,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG;;;0HAGiG,CAAC;AAS3H,MAAM,CAAC,MAAM,gCAAgC,GAAG,uCAAuC,CAAC;AACxF,MAAM,CAAC,MAAM,8BAA8B,GAAG,qCAAqC,CAAC;AAEpF,MAAM,UAAU,eAAe;IAC7B,OAAO,CACL,IAAI,CAAC,SAAS,CACZ;QACE,OAAO,EAAE,4BAA4B;QACrC,IAAI,EACF,qFAAqF;YACrF,6FAA6F;YAC7F,iEAAiE;QACnE,WAAW,EAAE;YACX,QAAQ;YACR,iBAAiB;YACjB,gBAAgB;YAChB,qBAAqB;SACtB;QACD,KAAK,EAAE;YACL,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,4BAA4B;YAC5B,qBAAqB;YACrB,qBAAqB;YACrB,gCAAgC;YAChC,4CAA4C;YAC5C,wCAAwC;SACzC;QACD,OAAO,EAAE;YACP,cAAc,EAAE;gBACd,gBAAgB,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;aACzD;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CACT,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sDAAsD;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AAEzE,MAAM,UAAU,sBAAsB,CAAC,UAAkB;IACvD,OAAO,UAAU,GAAG,IAAI,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG;;;0HAGiG,CAAC;AAS3H,MAAM,CAAC,MAAM,gCAAgC,GAAG,uCAAuC,CAAC;AACxF,MAAM,CAAC,MAAM,8BAA8B,GAAG,qCAAqC,CAAC;AAEpF,MAAM,UAAU,eAAe;IAC7B,OAAO,CACL,IAAI,CAAC,SAAS,CACZ;QACE,OAAO,EAAE,4BAA4B;QACrC,IAAI,EACF,qFAAqF;YACrF,6FAA6F;YAC7F,iEAAiE;QACnE,WAAW,EAAE;YACX,QAAQ;YACR,iBAAiB;YACjB,gBAAgB;YAChB,qBAAqB;SACtB;QACD,KAAK,EAAE;YACL,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,4BAA4B;YAC5B,qBAAqB;YACrB,qBAAqB;YACrB,gCAAgC;YAChC,4CAA4C;YAC5C,wCAAwC;SACzC;QACD,OAAO,EAAE;YACP,cAAc,EAAE;gBACd,gBAAgB,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;aACzD;SACF;KACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CACT,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCR,CAAC;AACF,CAAC;AAGD,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,OAAO,GAAG,gCAAgC;;;;kCAIV,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;kCACZ,MAAM,CAAC,KAAK;8CACA,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;8CACZ,MAAM,CAAC,KAAK;EACxD,8BAA8B;CAC/B,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,qEAAqE;IACrE,OAAO;;;;;EAKP,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCR,CAAC;AACF,CAAC"}
|
|
@@ -43,6 +43,39 @@ export type TestgenOutcome = {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function runTestgen(ctx: TestgenContext): Promise<TestgenOutcome>;
|
|
45
45
|
export declare function buildProjectContext(repoRoot: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Phase B2 (0.7.0) testgen output: one test file, zero-or-more route stubs,
|
|
48
|
+
* zero-or-more mock helpers. The LLM emits these as XML-tagged blocks
|
|
49
|
+
* (see TESTGEN_SYSTEM for the exact format); slowcook parses, de-duplicates
|
|
50
|
+
* against existing files, and writes only what's new.
|
|
51
|
+
*/
|
|
52
|
+
export interface TestgenBundle {
|
|
53
|
+
testContent: string;
|
|
54
|
+
stubs: Array<{
|
|
55
|
+
path: string;
|
|
56
|
+
contents: string;
|
|
57
|
+
}>;
|
|
58
|
+
helpers: Array<{
|
|
59
|
+
path: string;
|
|
60
|
+
contents: string;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse XML-tagged multi-artifact output into a TestgenBundle.
|
|
65
|
+
*
|
|
66
|
+
* Accepted shape (from the prompt):
|
|
67
|
+
* <test_file>...</test_file>
|
|
68
|
+
* <stub path="src/app/api/foo/route.ts">...</stub> (zero or more)
|
|
69
|
+
* <helper path="tests/helpers/mocks/bar.ts">...</helper> (zero or more)
|
|
70
|
+
*
|
|
71
|
+
* Tolerant of code-fenced output: if the LLM wraps the whole thing in
|
|
72
|
+
* ```, we strip it. If a block's contents are themselves code-fenced,
|
|
73
|
+
* we strip those too — tier-1 test / helper / stub files are raw TS.
|
|
74
|
+
*
|
|
75
|
+
* Throws if `<test_file>` is missing or empty — that's the one mandatory
|
|
76
|
+
* artifact.
|
|
77
|
+
*/
|
|
78
|
+
export declare function parseTestgenBundle(raw: string, storyId: string): TestgenBundle;
|
|
46
79
|
/**
|
|
47
80
|
* Tier-1 conformance lint. Run on every generated test file before commit.
|
|
48
81
|
* Catches patterns the prompt forbids — inline `vi.mock`, `fetch(...)`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/testgen/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/testgen/agent.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAQ,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AASlD,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,MAAM,WAAW,cAAc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pD;AAqBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAiC9E;AASD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AA6DD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAepF;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BjF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, readdirSync, } from "node:fs";
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync, readdirSync, statSync, } from "node:fs";
|
|
2
2
|
import { join, dirname } from "node:path";
|
|
3
3
|
import YAML from "yaml";
|
|
4
4
|
import { buildManifest, } from "@slowcook-ai/core";
|
|
@@ -26,14 +26,14 @@ export async function runTestgen(ctx) {
|
|
|
26
26
|
const toRemove = [];
|
|
27
27
|
for (const spec of specs) {
|
|
28
28
|
const projectContext = buildProjectContext(ctx.repoRoot);
|
|
29
|
-
const
|
|
29
|
+
const bundle = await generateTestBundle(spec, ctx, projectContext);
|
|
30
30
|
const testPath = join(TESTS_INTEGRATION_DIR, `story-${spec.story_id}.test.ts`);
|
|
31
31
|
// Tier-1 conformance gate: if the LLM slipped back to tier-0 habits
|
|
32
32
|
// (inline vi.mock, fetch(), etc.), we refuse to ship the file. Halts
|
|
33
33
|
// loudly here rather than quietly producing HTTP-loopback tests the
|
|
34
34
|
// brewing loop can't ratchet against. The caller can re-run with a
|
|
35
35
|
// different seed or hand-edit and re-run testgen.
|
|
36
|
-
const violations = lintTierOneTest(testPath,
|
|
36
|
+
const violations = lintTierOneTest(testPath, bundle.testContent);
|
|
37
37
|
if (violations.length > 0) {
|
|
38
38
|
const details = violations
|
|
39
39
|
.slice(0, 10)
|
|
@@ -44,7 +44,12 @@ export async function runTestgen(ctx) {
|
|
|
44
44
|
`The LLM emitted patterns banned by docs/plans/0.7-testgen-two-tier.md §4.1-§7.3. ` +
|
|
45
45
|
`Re-run testgen with a different model/seed, or hand-edit the generated file to use project mock helpers.`);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
// De-dupe stubs + helpers: skip anything whose target file exists and
|
|
48
|
+
// isn't a @slowcook-stub (for stubs) or isn't empty (for helpers). This
|
|
49
|
+
// lets testgen re-run safely without clobbering in-progress impls.
|
|
50
|
+
const stubsToWrite = bundle.stubs.filter((s) => shouldWriteStub(ctx.repoRoot, s.path));
|
|
51
|
+
const helpersToWrite = bundle.helpers.filter((h) => shouldWriteHelper(ctx.repoRoot, h.path));
|
|
52
|
+
const manifestIds = extractTestIdsFromFile(testPath, bundle.testContent);
|
|
48
53
|
const manifest = buildManifest({
|
|
49
54
|
slowcookVersion: ctx.cliVersion,
|
|
50
55
|
storyId: spec.story_id,
|
|
@@ -52,7 +57,14 @@ export async function runTestgen(ctx) {
|
|
|
52
57
|
suites: [{ suite: "backend", command: "npx vitest list", test_count: manifestIds.length }],
|
|
53
58
|
now: ctx.now,
|
|
54
59
|
});
|
|
55
|
-
generated.push({
|
|
60
|
+
generated.push({
|
|
61
|
+
spec,
|
|
62
|
+
testPath,
|
|
63
|
+
fileContents: bundle.testContent,
|
|
64
|
+
manifest,
|
|
65
|
+
stubs: stubsToWrite,
|
|
66
|
+
helpers: helpersToWrite,
|
|
67
|
+
});
|
|
56
68
|
for (const superseded of spec.supersedes) {
|
|
57
69
|
toRemove.push(superseded);
|
|
58
70
|
}
|
|
@@ -62,6 +74,12 @@ export async function runTestgen(ctx) {
|
|
|
62
74
|
writeFileAt(ctx.repoRoot, g.testPath, g.fileContents);
|
|
63
75
|
const manifestPath = join(MANIFESTS_DIR, `story-${g.spec.story_id}.json`);
|
|
64
76
|
writeFileAt(ctx.repoRoot, manifestPath, JSON.stringify(g.manifest, null, 2) + "\n");
|
|
77
|
+
for (const stub of g.stubs) {
|
|
78
|
+
writeFileAt(ctx.repoRoot, stub.path, stub.contents);
|
|
79
|
+
}
|
|
80
|
+
for (const helper of g.helpers) {
|
|
81
|
+
writeFileAt(ctx.repoRoot, helper.path, helper.contents);
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
84
|
const actuallyRemoved = [];
|
|
67
85
|
for (const id of toRemove) {
|
|
@@ -77,6 +95,10 @@ export async function runTestgen(ctx) {
|
|
|
77
95
|
for (const g of generated) {
|
|
78
96
|
await ctx.forge.git.stage(g.testPath);
|
|
79
97
|
await ctx.forge.git.stage(join(MANIFESTS_DIR, `story-${g.spec.story_id}.json`));
|
|
98
|
+
for (const stub of g.stubs)
|
|
99
|
+
await ctx.forge.git.stage(stub.path);
|
|
100
|
+
for (const helper of g.helpers)
|
|
101
|
+
await ctx.forge.git.stage(helper.path);
|
|
80
102
|
}
|
|
81
103
|
for (const id of actuallyRemoved) {
|
|
82
104
|
await ctx.forge.git.stage(join(TESTS_INTEGRATION_DIR, `story-${id}.test.ts`));
|
|
@@ -123,6 +145,38 @@ export async function runTestgen(ctx) {
|
|
|
123
145
|
throw e;
|
|
124
146
|
}
|
|
125
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Decide whether to write a stub file. Write when:
|
|
150
|
+
* - The target doesn't exist — most common case, new story.
|
|
151
|
+
* - The target exists but is itself a @slowcook-stub (marker on line 1).
|
|
152
|
+
* Lets testgen re-runs refresh stubs as spec evolves.
|
|
153
|
+
* Skip when:
|
|
154
|
+
* - The target exists and has real implementation (no stub marker).
|
|
155
|
+
* Could be a brownfield consumer where the route already exists, or
|
|
156
|
+
* brewing has already replaced the stub body. Either way, don't clobber.
|
|
157
|
+
*/
|
|
158
|
+
function shouldWriteStub(repoRoot, path) {
|
|
159
|
+
const full = join(repoRoot, path);
|
|
160
|
+
if (!existsSync(full))
|
|
161
|
+
return true;
|
|
162
|
+
try {
|
|
163
|
+
const first = readFileSync(full, "utf8").split("\n")[0] ?? "";
|
|
164
|
+
return first.includes("@slowcook-stub");
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Decide whether to write a helper file. Write when the target doesn't
|
|
172
|
+
* exist. Never clobber an existing helper — the consumer may have
|
|
173
|
+
* hand-customised it, and the generated version would lose those edits.
|
|
174
|
+
* Operator can delete the file and re-run testgen to get a fresh
|
|
175
|
+
* auto-generated helper.
|
|
176
|
+
*/
|
|
177
|
+
function shouldWriteHelper(repoRoot, path) {
|
|
178
|
+
return !existsSync(join(repoRoot, path));
|
|
179
|
+
}
|
|
126
180
|
function collectTargetSpecs(ctx) {
|
|
127
181
|
const index = readIndex(ctx.repoRoot);
|
|
128
182
|
const all = Object.entries(index.stories)
|
|
@@ -185,10 +239,26 @@ export function buildProjectContext(repoRoot) {
|
|
|
185
239
|
else {
|
|
186
240
|
bits.push("\nNo existing integration tests — this will be the first in the repo.");
|
|
187
241
|
}
|
|
242
|
+
// List existing API route files so the LLM knows NOT to emit a <stub>
|
|
243
|
+
// block for them. (A route that already exists has a real impl; stubbing
|
|
244
|
+
// over it would clobber production code. The consumer may also have
|
|
245
|
+
// brownfield code that pre-existed slowcook adoption — listed here so
|
|
246
|
+
// testgen respects what's there.)
|
|
247
|
+
const appDir = join(repoRoot, "src", "app");
|
|
248
|
+
if (existsSync(appDir)) {
|
|
249
|
+
const routes = listAppRouterFiles(appDir).sort();
|
|
250
|
+
if (routes.length > 0) {
|
|
251
|
+
bits.push(`\n### Existing API route files (under src/app/)\n\nThese already exist — do NOT emit a \`<stub>\` block for any of them. If the test imports from one of these, assume the route file exists and skip stub generation.`);
|
|
252
|
+
for (const r of routes.slice(0, 50))
|
|
253
|
+
bits.push(`- \`${r}\``);
|
|
254
|
+
if (routes.length > 50)
|
|
255
|
+
bits.push(`- … (${routes.length - 50} more)`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
188
258
|
// List existing mock helpers so the LLM knows which to import. The
|
|
189
259
|
// helper pattern is load-bearing for the future record-and-replay swap
|
|
190
260
|
// (plans/0.7-testgen-two-tier.md §4.3). Helpers NOT listed here will
|
|
191
|
-
//
|
|
261
|
+
// be auto-generated by testgen B2 as <helper> blocks.
|
|
192
262
|
const helpersDir = join(repoRoot, MOCK_HELPERS_DIR);
|
|
193
263
|
if (existsSync(helpersDir)) {
|
|
194
264
|
const helpers = readdirSync(helpersDir)
|
|
@@ -214,28 +284,111 @@ export function buildProjectContext(repoRoot) {
|
|
|
214
284
|
}
|
|
215
285
|
}
|
|
216
286
|
else {
|
|
217
|
-
bits.push(`\n### Mock helpers\n\nNo \`${MOCK_HELPERS_DIR}/\` directory yet — this project hasn't set up the helper pattern. Emit
|
|
287
|
+
bits.push(`\n### Mock helpers\n\nNo \`${MOCK_HELPERS_DIR}/\` directory yet — this project hasn't set up the helper pattern. Emit a \`<helper>\` block for each external dependency the handler calls, matching the helper-file shape in the system prompt. Also emit a \`<helper path="${MOCK_HELPERS_DIR}/index.ts">\` barrel re-exporting your new helpers.`);
|
|
218
288
|
}
|
|
219
289
|
return bits.join("\n");
|
|
220
290
|
}
|
|
221
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Walk src/app/ and return every route file path (repo-relative) that
|
|
293
|
+
* Next.js App Router treats as an endpoint. We surface these to the
|
|
294
|
+
* testgen LLM so it doesn't emit a <stub> for a file that already
|
|
295
|
+
* exists.
|
|
296
|
+
*/
|
|
297
|
+
function listAppRouterFiles(appDir) {
|
|
298
|
+
const out = [];
|
|
299
|
+
const walk = (dir) => {
|
|
300
|
+
let entries;
|
|
301
|
+
try {
|
|
302
|
+
entries = readdirSync(dir);
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
for (const name of entries) {
|
|
308
|
+
const full = join(dir, name);
|
|
309
|
+
let stat;
|
|
310
|
+
try {
|
|
311
|
+
stat = statSync(full);
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
if (stat.isDirectory())
|
|
317
|
+
walk(full);
|
|
318
|
+
else if (stat.isFile() && /^(route|page)\.(ts|tsx)$/.test(name)) {
|
|
319
|
+
// Return repo-relative path. Parent dirs up to "src/app" are derivable
|
|
320
|
+
// from appDir; we trim appDir and prefix "src/app".
|
|
321
|
+
const rel = full.slice(full.indexOf("src/app"));
|
|
322
|
+
out.push(rel);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
walk(appDir);
|
|
327
|
+
return out;
|
|
328
|
+
}
|
|
329
|
+
async function generateTestBundle(spec, ctx, projectContext) {
|
|
222
330
|
const systemPrompt = TESTGEN_SYSTEM(projectContext);
|
|
223
|
-
const userMessage = `Here is the spec YAML. Generate the
|
|
331
|
+
const userMessage = `Here is the spec YAML. Generate the tier-1 test bundle (test file + any needed stubs + any needed helpers):\n\n\`\`\`yaml\n${YAML.stringify(spec)}\n\`\`\``;
|
|
224
332
|
const raw = await ctx.llm.complete({
|
|
225
333
|
system: systemPrompt,
|
|
226
334
|
cacheSystem: true,
|
|
227
335
|
model: ctx.model,
|
|
228
336
|
messages: [{ role: "user", content: userMessage }],
|
|
229
|
-
maxTokens:
|
|
337
|
+
maxTokens: 16384,
|
|
230
338
|
});
|
|
231
|
-
return
|
|
339
|
+
return parseTestgenBundle(raw, spec.story_id);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Parse XML-tagged multi-artifact output into a TestgenBundle.
|
|
343
|
+
*
|
|
344
|
+
* Accepted shape (from the prompt):
|
|
345
|
+
* <test_file>...</test_file>
|
|
346
|
+
* <stub path="src/app/api/foo/route.ts">...</stub> (zero or more)
|
|
347
|
+
* <helper path="tests/helpers/mocks/bar.ts">...</helper> (zero or more)
|
|
348
|
+
*
|
|
349
|
+
* Tolerant of code-fenced output: if the LLM wraps the whole thing in
|
|
350
|
+
* ```, we strip it. If a block's contents are themselves code-fenced,
|
|
351
|
+
* we strip those too — tier-1 test / helper / stub files are raw TS.
|
|
352
|
+
*
|
|
353
|
+
* Throws if `<test_file>` is missing or empty — that's the one mandatory
|
|
354
|
+
* artifact.
|
|
355
|
+
*/
|
|
356
|
+
export function parseTestgenBundle(raw, storyId) {
|
|
357
|
+
const trimmed = raw.trim();
|
|
358
|
+
// Strip outer code fence if the LLM wrapped everything
|
|
359
|
+
const outerFenceMatch = trimmed.match(/^```[a-z]*\s*\n([\s\S]*)\n```$/);
|
|
360
|
+
const body = outerFenceMatch && outerFenceMatch[1] ? outerFenceMatch[1] : trimmed;
|
|
361
|
+
const testMatch = body.match(/<test_file>([\s\S]*?)<\/test_file>/);
|
|
362
|
+
if (!testMatch || !testMatch[1]) {
|
|
363
|
+
throw new Error(`testgen: LLM output for story-${storyId} missing a <test_file> block. ` +
|
|
364
|
+
`Got ${body.length} chars starting with: ${body.slice(0, 120)}...`);
|
|
365
|
+
}
|
|
366
|
+
const testContent = stripInnerFence(testMatch[1]);
|
|
367
|
+
const stubs = [];
|
|
368
|
+
const stubRe = /<stub\s+path="([^"]+)">([\s\S]*?)<\/stub>/g;
|
|
369
|
+
let m;
|
|
370
|
+
while ((m = stubRe.exec(body)) !== null) {
|
|
371
|
+
const p = m[1] ?? "";
|
|
372
|
+
const c = m[2] ?? "";
|
|
373
|
+
if (p && c.trim())
|
|
374
|
+
stubs.push({ path: p, contents: stripInnerFence(c) });
|
|
375
|
+
}
|
|
376
|
+
const helpers = [];
|
|
377
|
+
const helperRe = /<helper\s+path="([^"]+)">([\s\S]*?)<\/helper>/g;
|
|
378
|
+
while ((m = helperRe.exec(body)) !== null) {
|
|
379
|
+
const p = m[1] ?? "";
|
|
380
|
+
const c = m[2] ?? "";
|
|
381
|
+
if (p && c.trim())
|
|
382
|
+
helpers.push({ path: p, contents: stripInnerFence(c) });
|
|
383
|
+
}
|
|
384
|
+
return { testContent, stubs, helpers };
|
|
232
385
|
}
|
|
233
|
-
function
|
|
386
|
+
function stripInnerFence(raw) {
|
|
234
387
|
const t = raw.trim();
|
|
235
|
-
const fence = t.match(/^```(?:typescript|ts)?\s*\n([\s\S]*)\n```$/);
|
|
388
|
+
const fence = t.match(/^```(?:typescript|ts|tsx)?\s*\n([\s\S]*)\n```$/);
|
|
236
389
|
if (fence && fence[1])
|
|
237
390
|
return fence[1];
|
|
238
|
-
return t;
|
|
391
|
+
return t + "\n"; // ensure trailing newline for file writes
|
|
239
392
|
}
|
|
240
393
|
/**
|
|
241
394
|
* Two scan modes:
|
|
@@ -461,6 +614,24 @@ function buildPrBody(args) {
|
|
|
461
614
|
const manifestCount = g.manifest.tests.length;
|
|
462
615
|
sections.push(`- \`story-${g.spec.story_id}\` — *${g.spec.title}* — ${manifestCount} test(s) in \`${g.testPath}\``);
|
|
463
616
|
}
|
|
617
|
+
const allStubs = args.generated.flatMap((g) => g.stubs);
|
|
618
|
+
if (allStubs.length > 0) {
|
|
619
|
+
sections.push("");
|
|
620
|
+
sections.push("## Generated stubs (route files)");
|
|
621
|
+
sections.push("Minimal throwing route files so tier-1 tests can collect. Each carries an \`@slowcook-stub\` marker on line 1. **Brewing will replace these bodies** with the real implementation across its iterations. Reviewer check: correct file path + export signature + \`@slowcook-stub\` marker present. If the signature is wrong the whole PR is wrong — flag it now.");
|
|
622
|
+
for (const s of allStubs) {
|
|
623
|
+
sections.push(`- \`${s.path}\``);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
const allHelpers = args.generated.flatMap((g) => g.helpers);
|
|
627
|
+
if (allHelpers.length > 0) {
|
|
628
|
+
sections.push("");
|
|
629
|
+
sections.push("## Generated mock helpers");
|
|
630
|
+
sections.push("Signature-asserting fakes for external services the handlers consume. **Three load-bearing properties**: (1) calling the real module's exported function with wrong args throws loudly (catches the class of bug where tests pass via mock-arg-ignoring but production crashes); (2) every chained method pushes to \`client.calls\` so tests assert against that instead of poking \`vi.fn\` internals; (3) config is intent-level (\`user\`, \`tables\`) not implementation-level (\`return_value_for_from\`). Reviewer check: the \`realShaped*\` wrapper exists AND matches the real module's signature from \`src/\`.");
|
|
631
|
+
for (const h of allHelpers) {
|
|
632
|
+
sections.push(`- \`${h.path}\``);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
464
635
|
if (args.removedStoryIds.length > 0) {
|
|
465
636
|
sections.push("");
|
|
466
637
|
sections.push("## Tests removed (supersede chain)");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/commands/testgen/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAY,MAAM,WAAW,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EACL,aAAa,GAEd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAwBtD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,G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QACF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,QAAQ,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACpD,QAAQ,CAAC,IAAI,CACX,uHAAuH,CACxH,CAAC;QACF,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACtC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,QAAQ,CAAC,IAAI,CACX,uNAAuN,CACxN,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IACpD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* System prompt for the test-gen agent
|
|
3
|
-
* single Vitest integration test file in the tier-1 shape defined in
|
|
4
|
-
* docs/plans/0.7-testgen-two-tier.md §4.1.
|
|
2
|
+
* System prompt for the test-gen agent (Phase B2, as of 0.7.0).
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Turns a frozen spec YAML into a **bundle**: one tier-1 integration test
|
|
5
|
+
* file plus any missing route stubs (so vitest can collect the tests) and
|
|
6
|
+
* any missing mock helpers (so the tests have intent-level fakes to call).
|
|
7
|
+
* Output is multi-artifact via XML-tagged blocks; slowcook parses each
|
|
8
|
+
* block, writes the files, and skips anything that already exists.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Helper auto-generation ships in B2 (0.7.0).
|
|
10
|
+
* Before B2, consumers had to hand-author stubs + helpers (the story-005
|
|
11
|
+
* manual intervention on rewo). B2 automates both so an issue can flow
|
|
12
|
+
* refine → spec → testgen → brew with zero human touchpoints between
|
|
13
|
+
* "merge tests PR" and "review implementation PR."
|
|
16
14
|
*/
|
|
17
15
|
export declare const TESTGEN_SYSTEM: (projectContext: string) => string;
|
|
18
16
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/commands/testgen/prompts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/commands/testgen/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,cAAc,GAAI,gBAAgB,MAAM,WA2KuM,CAAC"}
|
|
@@ -1,124 +1,187 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* System prompt for the test-gen agent
|
|
3
|
-
* single Vitest integration test file in the tier-1 shape defined in
|
|
4
|
-
* docs/plans/0.7-testgen-two-tier.md §4.1.
|
|
2
|
+
* System prompt for the test-gen agent (Phase B2, as of 0.7.0).
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Turns a frozen spec YAML into a **bundle**: one tier-1 integration test
|
|
5
|
+
* file plus any missing route stubs (so vitest can collect the tests) and
|
|
6
|
+
* any missing mock helpers (so the tests have intent-level fakes to call).
|
|
7
|
+
* Output is multi-artifact via XML-tagged blocks; slowcook parses each
|
|
8
|
+
* block, writes the files, and skips anything that already exists.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Helper auto-generation ships in B2 (0.7.0).
|
|
10
|
+
* Before B2, consumers had to hand-author stubs + helpers (the story-005
|
|
11
|
+
* manual intervention on rewo). B2 automates both so an issue can flow
|
|
12
|
+
* refine → spec → testgen → brew with zero human touchpoints between
|
|
13
|
+
* "merge tests PR" and "review implementation PR."
|
|
16
14
|
*/
|
|
17
15
|
export const TESTGEN_SYSTEM = (projectContext) => `You are a rigorous test engineer for the slowcook brewing harness.
|
|
18
16
|
|
|
19
|
-
Your job is to turn a frozen spec YAML into
|
|
17
|
+
Your job is to turn a frozen spec YAML into a **tier-1 test bundle**:
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
1. ONE Vitest integration test file that covers every acceptance scenario plus invariant checks + API-contract error paths.
|
|
20
|
+
2. Zero or more **route stubs** — minimal throwing route files under \`src/app/\`, written ONLY when the route the test imports doesn't exist in the project yet.
|
|
21
|
+
3. Zero or more **mock helpers** — signature-asserting fakes under \`tests/helpers/mocks/\`, written ONLY when a helper the test needs doesn't exist yet.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- The full spec YAML (already validated, frozen).
|
|
26
|
-
- Project context below: \`.brewing/context.md\` conventions, package.json, existing test style references, existing mock helpers.
|
|
23
|
+
Tier-1 tests run in-process, import the route handler directly, mock external services via project helpers. No HTTP. No real DB. Under 1 s per test. This is the layer brewing's ratchet iterates against.
|
|
27
24
|
|
|
28
25
|
## Output format
|
|
29
26
|
|
|
30
|
-
Emit
|
|
27
|
+
Emit EXACTLY the artifacts below, each inside its own XML-tagged block. No prose outside the tags, no code fences inside, no commentary between tags.
|
|
28
|
+
|
|
29
|
+
\`\`\`
|
|
30
|
+
<test_file>
|
|
31
|
+
{full contents of tests/integration/story-N.test.ts}
|
|
32
|
+
</test_file>
|
|
33
|
+
|
|
34
|
+
<stub path="src/app/api/.../route.ts">
|
|
35
|
+
{full contents of a minimal throwing route file — only when the route doesn't exist yet}
|
|
36
|
+
</stub>
|
|
37
|
+
|
|
38
|
+
<helper path="tests/helpers/mocks/<service>.ts">
|
|
39
|
+
{full contents of a new mock helper — only when the service's helper doesn't exist yet}
|
|
40
|
+
</helper>
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
\`<test_file>\` is always present (exactly one). \`<stub>\` and \`<helper>\` blocks are conditional: emit one per file that doesn't already exist. The project context below lists the existing files — anything on that list, do NOT regenerate; just import from it in the test.
|
|
31
44
|
|
|
32
|
-
##
|
|
45
|
+
## Test-file shape
|
|
33
46
|
|
|
34
|
-
1. **Direct import** of the route handler
|
|
47
|
+
1. **Direct import** of the route handler. E.g. \`import { PATCH } from "@/app/api/profiles/me/route";\`. If the route doesn't exist, you're also emitting a \`<stub>\` block for it.
|
|
35
48
|
|
|
36
|
-
2. **
|
|
49
|
+
2. **Auto-mock every external module** the handler consumes. Use the **1-arg form only** — slowcook's lint rejects the factory form:
|
|
37
50
|
|
|
38
51
|
\`\`\`ts
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
import { mockSupabase, resetMocks } from "@tests/helpers/mocks";
|
|
42
|
-
import { POST } from "@/app/api/rewos/route";
|
|
43
|
-
|
|
44
|
-
// Auto-mock the module at load time. No factory — just the module path.
|
|
45
|
-
// This replaces every export with a mock fn; the helper injects the
|
|
46
|
-
// return value below.
|
|
47
|
-
vi.mock("@/utils/supabase/server");
|
|
48
|
-
|
|
49
|
-
describe("POST /api/rewos", () => {
|
|
50
|
-
beforeEach(() => resetMocks());
|
|
51
|
-
|
|
52
|
-
it("returns 201 for an authenticated member", async () => {
|
|
53
|
-
// Build the fake client via the project helper — intent-level config.
|
|
54
|
-
const supabase = mockSupabase({
|
|
55
|
-
user: { id: "u1" },
|
|
56
|
-
tables: { rewos: { data: { id: "rewo1" } } },
|
|
57
|
-
});
|
|
58
|
-
// Wire it up: vi.mocked is a type-only assertion (not a forbidden construction call).
|
|
59
|
-
vi.mocked(createClient).mockReturnValue(supabase as never);
|
|
60
|
-
|
|
61
|
-
const req = new Request("http://test/api/rewos", {
|
|
62
|
-
method: "POST",
|
|
63
|
-
headers: { Authorization: "Bearer token", "Content-Type": "application/json" },
|
|
64
|
-
body: JSON.stringify({ title: "hi" }),
|
|
65
|
-
});
|
|
66
|
-
const res = await POST(req);
|
|
67
|
-
expect(res.status).toBe(201);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
52
|
+
vi.mock("@/utils/supabase/server"); // ✓ auto-mock — replaces every export with vi.fn()
|
|
53
|
+
vi.mock("@/lib/email", () => ({ ... })); // ✗ factory form — rejected
|
|
70
54
|
\`\`\`
|
|
71
55
|
|
|
72
|
-
|
|
73
|
-
- **\`vi.mock("path")\` with ONE argument** at top of file. Forbidden: \`vi.mock("path", () => ({...}))\` with a factory — slowcook's lint rejects that line on sight.
|
|
74
|
-
- **Helper supplies fake behaviour** — never inline a fake via \`vi.fn()\` or hand-built mock objects inside the test. The helper call is the one place where fake shape lives.
|
|
75
|
-
- \`vi.mocked(...)\` is a type-assertion helper (safe, permitted); \`vi.fn(...)\` is construction (forbidden in tests).
|
|
76
|
-
- **Prefer \`.mockImplementation(signatureAssertingWrapper(helper))\` over \`.mockReturnValue(helper as never)\` when the project provides a signature-asserting companion helper** (e.g. rewo's \`realShapedCreateClient\`). The asserting wrapper throws loudly if the handler calls the module's exported function with wrong arguments — tests pass today when mocks ignore args, but production crashes. If the consumer's helpers don't expose an asserting wrapper, \`mockReturnValue\` is acceptable; flag it as a TODO for the consumer to add.
|
|
77
|
-
|
|
78
|
-
If the project context below does NOT list a helper you need, emit the test anyway but leave a \`TODO(helper): <service>\` comment at the top of the file listing the missing helpers, and use \`vi.mock("<module-path>")\` without any factory. An operator will hand-author the helper before brewing runs.
|
|
56
|
+
3. **Call the helper** to supply behaviour. Wire it up via \`vi.mocked(createClient).mockImplementation(signatureAssertingWrapper(helper))\` when the helper exposes a signature-asserting wrapper (preferred — catches production bugs where handler calls the dep with wrong args). Fall back to \`.mockReturnValue(helper as never)\` only when the helper exposes no wrapper.
|
|
79
57
|
|
|
80
|
-
|
|
58
|
+
4. **beforeEach(resetMocks)** at the top of every describe block.
|
|
81
59
|
|
|
82
|
-
|
|
60
|
+
5. **Build Request in-process**:
|
|
83
61
|
|
|
84
62
|
\`\`\`ts
|
|
85
|
-
const req = new Request("http://test/api/
|
|
86
|
-
method: "
|
|
87
|
-
headers: {
|
|
88
|
-
body: JSON.stringify({
|
|
63
|
+
const req = new Request("http://test/api/profiles/me", {
|
|
64
|
+
method: "PATCH",
|
|
65
|
+
headers: { "Content-Type": "application/json", Authorization: "Bearer token" },
|
|
66
|
+
body: JSON.stringify({ display_name: "new name" }),
|
|
89
67
|
});
|
|
90
|
-
const res = await
|
|
91
|
-
expect(res.status).toBe(201);
|
|
68
|
+
const res = await PATCH(req);
|
|
92
69
|
\`\`\`
|
|
93
70
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
71
|
+
6. **Coverage**: one \`it\` per acceptance scenario (preserve Given/When/Then phrasing), one per declared error-response code in \`api_contract\` (401, 403, 404, 409, 422, 429, ...), and one per handler-call-level invariant.
|
|
72
|
+
|
|
73
|
+
## Stub-file shape (when emitted)
|
|
74
|
+
|
|
75
|
+
Minimal throwing route. Shape:
|
|
98
76
|
|
|
99
|
-
|
|
77
|
+
\`\`\`ts
|
|
78
|
+
// @slowcook-stub story-<id>
|
|
79
|
+
//
|
|
80
|
+
// Minimal throwing stub so tier-1 tests can collect before the real
|
|
81
|
+
// implementation lands. Brewing's ratchet replaces the body.
|
|
100
82
|
|
|
101
|
-
|
|
83
|
+
import { NextResponse } from "next/server";
|
|
102
84
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
85
|
+
export async function {METHOD}(
|
|
86
|
+
_req: Request,
|
|
87
|
+
_ctx?: { params: Promise<{ ... }> }
|
|
88
|
+
): Promise<Response> {
|
|
89
|
+
return NextResponse.json(
|
|
90
|
+
{ error: "not_implemented", code: "story_<id>_stub" },
|
|
91
|
+
{ status: 501 }
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
\`\`\`
|
|
109
95
|
|
|
110
|
-
|
|
96
|
+
- The \`@slowcook-stub story-<id>\` marker on line 1 is **load-bearing** — brewing and future tooling detect stubs by it. Do not omit.
|
|
97
|
+
- If the route has URL params (e.g. \`[handle]\`), accept them in the \`_ctx\` arg. Otherwise omit the \`_ctx\` parameter.
|
|
98
|
+
- Export exactly the HTTP methods the test imports from the stub. One stub file can export multiple methods.
|
|
111
99
|
|
|
112
|
-
##
|
|
100
|
+
## Helper-file shape (when emitted)
|
|
101
|
+
|
|
102
|
+
A mock helper for an external service the handler uses. Three non-negotiable properties: **signature assertion**, **call recording**, **intent-level config**.
|
|
103
|
+
|
|
104
|
+
\`\`\`ts
|
|
105
|
+
import { vi } from "vitest";
|
|
106
|
+
|
|
107
|
+
export interface MockFooUser { id: string; /* ... */ }
|
|
108
|
+
|
|
109
|
+
export interface MockFooConfig {
|
|
110
|
+
/** Intent: who's the caller? \`null\` = anonymous. */
|
|
111
|
+
user?: MockFooUser | null;
|
|
112
|
+
/** Intent: what do table queries return? */
|
|
113
|
+
tables?: Record<string, { data?: unknown; error?: unknown }>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface MockFooClient {
|
|
117
|
+
auth: { getUser: ReturnType<typeof vi.fn> };
|
|
118
|
+
from: ReturnType<typeof vi.fn>;
|
|
119
|
+
/** Every recorded call — \`tests assert on this instead of poking vi.fn internals. */
|
|
120
|
+
calls: Array<{ table: string; op: string; args: unknown[] }>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function mockFoo(config: MockFooConfig = {}): MockFooClient { /* fluent chain; see rewo's mockSupabase as reference */ }
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Signature-asserting wrapper for the module's exported factory function.
|
|
127
|
+
* Throws LOUDLY when the handler calls the real function with wrong args —
|
|
128
|
+
* catches the production bug class where tests pass (mock ignored args)
|
|
129
|
+
* but prod crashes on the missing arg.
|
|
130
|
+
*/
|
|
131
|
+
export function realShapedCreateFoo(client: MockFooClient): (requiredArg: unknown) => MockFooClient {
|
|
132
|
+
return (requiredArg) => {
|
|
133
|
+
if (requiredArg === undefined || requiredArg === null) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
"mockFoo invocation check failed: createFoo was called without its required argument. " +
|
|
136
|
+
"The real module requires <describe the arg>. Handler is likely missing <describe the fix>."
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return client;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function resetMocks(): void {
|
|
144
|
+
vi.clearAllMocks();
|
|
145
|
+
}
|
|
146
|
+
\`\`\`
|
|
147
|
+
|
|
148
|
+
- Match the **real module's exported function signature** exactly in \`realShapedCreateFoo\` — read the module's source (available via project context) to see what args it requires.
|
|
149
|
+
- The fluent chain returned by \`mockFoo\` must support the operators the test actually calls (\`.from(t).select(...).eq(...).order(...).single()\` etc.). Include \`.then\` so bare \`await\` works.
|
|
150
|
+
- Call recording: every chained method pushes to \`calls\`; tests assert \`expect(client.calls).toContainEqual({ table: "...", op: "...", args: [...] })\`.
|
|
151
|
+
|
|
152
|
+
Also add a barrel file when creating the first helper:
|
|
153
|
+
|
|
154
|
+
\`\`\`
|
|
155
|
+
<helper path="tests/helpers/mocks/index.ts">
|
|
156
|
+
export { mockFoo, realShapedCreateFoo, resetMocks } from "./foo.js";
|
|
157
|
+
export type { MockFooConfig, MockFooClient, MockFooUser } from "./foo.js";
|
|
158
|
+
</helper>
|
|
159
|
+
\`\`\`
|
|
160
|
+
|
|
161
|
+
If the barrel already exists (listed in project context), emit a \`<helper>\` block that REPLACES it with the union of existing + new exports.
|
|
162
|
+
|
|
163
|
+
## Forbidden in the TEST FILE (mechanically rejected, halts testgen):
|
|
164
|
+
|
|
165
|
+
- \`vi.mock("path", () => ({...}))\` — factory form. Use \`vi.mock("path")\` + helper call.
|
|
166
|
+
- \`vi.fn(\` — fake construction in test. Use a helper.
|
|
167
|
+
- \`jest.mock(\` / \`jest.fn(\` — wrong framework.
|
|
168
|
+
- \`fetch(\` — tier-1 runs in-process.
|
|
169
|
+
- \`from "msw" | "nock" | "aws-sdk-client-mock"\` — HTTP-level mock libs.
|
|
170
|
+
- \`test.skip\` / \`test.todo\` / \`it.skip\` / \`it.todo\` — breaks the manifest.
|
|
171
|
+
|
|
172
|
+
**Helpers ARE allowed to use \`vi.fn\` internally** — that's the point. The forbidden list applies to test-file contents only, not to \`<helper>\` blocks.
|
|
173
|
+
|
|
174
|
+
## Project context (consumer's conventions + existing files)
|
|
113
175
|
|
|
114
176
|
${projectContext}
|
|
115
177
|
|
|
116
178
|
## Do NOT
|
|
117
179
|
|
|
118
|
-
-
|
|
119
|
-
- Skip an acceptance scenario.
|
|
120
|
-
- Write flaky tests
|
|
121
|
-
-
|
|
180
|
+
- Reference files not in the spec or project context. If a detail is missing, emit \`TODO(spec): ...\` rather than invent.
|
|
181
|
+
- Skip an acceptance scenario.
|
|
182
|
+
- Write flaky tests — freeze time with \`vi.useFakeTimers()\` if needed.
|
|
183
|
+
- Emit a \`<stub>\` block for a route file listed as already existing.
|
|
184
|
+
- Emit a \`<helper>\` block for a helper file listed as already existing (unless it's the barrel index and you need to append new exports).
|
|
122
185
|
|
|
123
|
-
Produce a complete
|
|
186
|
+
Produce a complete tier-1 bundle. When brewing runs against this, the stubs fail with clear 501s (or unimplemented throws), the tests point at exactly what each endpoint should do, and brewing iteratively replaces stub bodies until all tests go green.`;
|
|
124
187
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/testgen/prompts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/testgen/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,cAAsB,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiKxD,cAAc;;;;;;;;;;4PAU4O,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slowcook-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "CLI for the slowcook brewing harness",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "aminazar",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"ts-morph": "^24.0.0",
|
|
39
39
|
"yaml": "^2.6.0",
|
|
40
40
|
"zod": "^3.23.8",
|
|
41
|
+
"@slowcook-ai/forge-github": "^0.7.0",
|
|
41
42
|
"@slowcook-ai/core": "^0.5.0",
|
|
42
|
-
"@slowcook-ai/stack-ts": "^0.
|
|
43
|
-
"@slowcook-ai/forge-github": "^0.5.0"
|
|
43
|
+
"@slowcook-ai/stack-ts": "^0.7.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|