@slowcook-ai/cli 0.18.0-alpha.6 → 0.19.0-alpha.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.
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `slowcook chef-drift` — α.9 L1 drift-fixer (cli α.9).
3
+ *
4
+ * Sibling to the existing `slowcook chef --pr <n>` (PR-CI-failure
5
+ * handler). This module is the SURGICAL EDITOR variant: triggered by
6
+ * mock-isolation / recon / brew halt / navigator halt-class. Reads the
7
+ * failure + history-index + PR state, calls the chef LLM to get a
8
+ * ChefVerdict, applies edits surgically, validates, commits, posts an
9
+ * audit comment.
10
+ *
11
+ * Frozen surface (HARD): never edits tests/, vitest.config.*,
12
+ * .brewing/{auto-gen}/. If a fix requires test edits → escalates to PM
13
+ * via a two-option pm_comment (option B = `testgen --regenerate`).
14
+ *
15
+ * Ledger at .brewing/chef/<story-id>.json tracks moves + cost. Cycle
16
+ * detection + budget cap enforce convergence.
17
+ *
18
+ * Run from consumer repo root:
19
+ * ANTHROPIC_API_KEY=... slowcook chef-drift \
20
+ * --story 018 \
21
+ * --trigger mock_isolation_check_failed \
22
+ * --trigger-detail "Relative import resolves to a non-existent file..."
23
+ */
24
+ /**
25
+ * Parse a vitest-style test runner output to extract the failing test
26
+ * files. Brew agent halts include the runner's stdout/stderr; chef
27
+ * needs to know exactly which test files are red so it can grep their
28
+ * imports + propose surgical edits to the source files under test.
29
+ *
30
+ * Recognises:
31
+ * - `FAIL src/foo/bar.test.ts > description > it works`
32
+ * - `× src/foo/bar.test.ts > description > it works`
33
+ * - ` ❯ src/foo/bar.test.ts (...)` with a 'Tests fail' summary nearby
34
+ * - `Test Files X failed | Y passed` summary lines (signal only)
35
+ *
36
+ * Returns { failingFiles: string[]; failingTestNames: string[] }.
37
+ * Pure — does no IO. Exported for unit tests.
38
+ */
39
+ export declare function parseBrewHaltOutput(text: string): {
40
+ failingFiles: string[];
41
+ failingTestNames: string[];
42
+ };
43
+ /**
44
+ * Extract the set of source files (non-test) imported by each failing
45
+ * test file. Pure: takes a {testFile → contents} map and returns a
46
+ * {testFile → importedSourceFiles[]} map.
47
+ *
48
+ * Resolves only relative imports (./ or ../); skips package imports
49
+ * (those don't live in the consumer repo).
50
+ */
51
+ export declare function collectImportedSourceFiles(testContents: Record<string, string>): Record<string, string[]>;
52
+ export declare function chefDrift(argv: string[], _cliVersion: string): Promise<void>;
53
+ //# sourceMappingURL=drift-fix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift-fix.d.ts","sourceRoot":"","sources":["../../../src/commands/chef/drift-fix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAiEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG;IACjD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CA0BA;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAczG;AA0YD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8WlF"}