@slowcook-ai/cli 0.19.0-alpha.1 → 0.19.0-alpha.11
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/cli.js +27 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/brew/agent.d.ts +129 -0
- package/dist/commands/brew/agent.d.ts.map +1 -1
- package/dist/commands/brew/agent.js +132 -0
- package/dist/commands/brew/agent.js.map +1 -1
- package/dist/commands/brew/index.d.ts.map +1 -1
- package/dist/commands/brew/index.js +72 -0
- package/dist/commands/brew/index.js.map +1 -1
- package/dist/commands/brew/pair-navigator.d.ts +112 -0
- package/dist/commands/brew/pair-navigator.d.ts.map +1 -0
- package/dist/commands/brew/pair-navigator.js +183 -0
- package/dist/commands/brew/pair-navigator.js.map +1 -0
- package/dist/commands/chef/orchestrate.d.ts +34 -0
- package/dist/commands/chef/orchestrate.d.ts.map +1 -0
- package/dist/commands/chef/orchestrate.js +385 -0
- package/dist/commands/chef/orchestrate.js.map +1 -0
- package/dist/commands/init/mock.d.ts +46 -0
- package/dist/commands/init/mock.d.ts.map +1 -1
- package/dist/commands/init/mock.js +142 -2
- package/dist/commands/init/mock.js.map +1 -1
- package/dist/commands/recon/index.d.ts.map +1 -1
- package/dist/commands/recon/index.js +288 -5
- package/dist/commands/recon/index.js.map +1 -1
- package/dist/commands/recon/reuse.d.ts +150 -0
- package/dist/commands/recon/reuse.d.ts.map +1 -0
- package/dist/commands/recon/reuse.js +335 -0
- package/dist/commands/recon/reuse.js.map +1 -0
- package/dist/commands/recon/shape-preserve.d.ts +46 -0
- package/dist/commands/recon/shape-preserve.d.ts.map +1 -1
- package/dist/commands/recon/shape-preserve.js +126 -0
- package/dist/commands/recon/shape-preserve.js.map +1 -1
- package/dist/commands/recon/stale-stubs.d.ts +62 -0
- package/dist/commands/recon/stale-stubs.d.ts.map +1 -0
- package/dist/commands/recon/stale-stubs.js +79 -0
- package/dist/commands/recon/stale-stubs.js.map +1 -0
- package/dist/commands/refactor/index.d.ts +15 -0
- package/dist/commands/refactor/index.d.ts.map +1 -0
- package/dist/commands/refactor/index.js +126 -0
- package/dist/commands/refactor/index.js.map +1 -0
- package/dist/commands/refactor/score.d.ts +38 -0
- package/dist/commands/refactor/score.d.ts.map +1 -0
- package/dist/commands/refactor/score.js +79 -0
- package/dist/commands/refactor/score.js.map +1 -0
- package/dist/commands/refactor/types.d.ts +64 -0
- package/dist/commands/refactor/types.d.ts.map +1 -0
- package/dist/commands/refactor/types.js +26 -0
- package/dist/commands/refactor/types.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.19.0-alpha.9 — default Anthropic-backed pair-brew NavigatorHook.
|
|
3
|
+
*
|
|
4
|
+
* α.4 wired the structural NavigatorHook slot into brew/agent.ts.
|
|
5
|
+
* α.5 added the proposedTest hard-signal field. α.9 ships the
|
|
6
|
+
* default implementation: calls Anthropic with NAVIGATOR_SYSTEM +
|
|
7
|
+
* buildNavigatorPrompt, parses the NavigatorVerdict, adapts it to
|
|
8
|
+
* NavigatorHookVerdict (the brew-loop interface).
|
|
9
|
+
*
|
|
10
|
+
* Wiring path (cli α.10 will add the --with-navigator flag):
|
|
11
|
+
* ctx.navigatorHook = createPairNavigatorHook({ anthropic, model, ... });
|
|
12
|
+
*
|
|
13
|
+
* Persistent-block escalation (#77 / α.5): when `priorBlockCount >= 2`
|
|
14
|
+
* for the same root concern, the hook MAY include a proposedTest in
|
|
15
|
+
* the verdict — written to tests/navigator/ + folded into next iter's
|
|
16
|
+
* red-set as a HARD signal. Logic is in the prompt; mechanics in
|
|
17
|
+
* brew/agent.ts.
|
|
18
|
+
*/
|
|
19
|
+
import { NAVIGATOR_SYSTEM, buildNavigatorPrompt, } from "@slowcook-ai/llm-anthropic";
|
|
20
|
+
/**
|
|
21
|
+
* Adapt NavigatorVerdict (the prompt-side shape: axes + overall +
|
|
22
|
+
* rationale) → NavigatorHookVerdict (the brew-loop shape: overall +
|
|
23
|
+
* concerns + costUsd + proposedTest).
|
|
24
|
+
*
|
|
25
|
+
* Mapping rules:
|
|
26
|
+
* - overall "approve" → "approve"
|
|
27
|
+
* - overall "warn" → "approve" (warn is informational; brew
|
|
28
|
+
* only reverts on block)
|
|
29
|
+
* - overall "block" → "block"
|
|
30
|
+
* - concerns: each blocking axis becomes one entry "<axis>: <summary>".
|
|
31
|
+
* Warn-severity axes are surfaced too (lower priority).
|
|
32
|
+
* - costUsd: passed through unchanged.
|
|
33
|
+
*
|
|
34
|
+
* Pure: no IO. Tested in isolation.
|
|
35
|
+
*/
|
|
36
|
+
export function navigatorVerdictToHookVerdict(verdict, costUsd) {
|
|
37
|
+
const overall = verdict.overall === "block" ? "block" : "approve";
|
|
38
|
+
const concerns = verdict.axes
|
|
39
|
+
// Sort blocking before warn so the most important concerns surface first.
|
|
40
|
+
.slice()
|
|
41
|
+
.sort((a, b) => {
|
|
42
|
+
if (a.severity === b.severity)
|
|
43
|
+
return 0;
|
|
44
|
+
return a.severity === "blocking" ? -1 : 1;
|
|
45
|
+
})
|
|
46
|
+
.map((a) => `${a.axis}: ${a.summary}`);
|
|
47
|
+
const result = { overall, concerns };
|
|
48
|
+
if (costUsd > 0) {
|
|
49
|
+
result.costUsd = costUsd;
|
|
50
|
+
}
|
|
51
|
+
// proposedTest is intentionally NOT extracted from NavigatorVerdict's
|
|
52
|
+
// axes — the prompt-side shape doesn't carry one today. The hook
|
|
53
|
+
// factory below allows callers to pass an `extractProposedTest`
|
|
54
|
+
// function that decides whether to attach a hard-signal test based
|
|
55
|
+
// on its own escalation policy (e.g., persistent-block detector).
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Build a NavigatorHook backed by an Anthropic LLM call. Pure
|
|
60
|
+
* factory; the returned hook is ready to inject into BrewContext.
|
|
61
|
+
*
|
|
62
|
+
* Per-call flow:
|
|
63
|
+
* 1. Caller-provided loader fills in mockFiles + codeMapDigest +
|
|
64
|
+
* storyTestIds + spec yaml + cross-story files + prior verdicts.
|
|
65
|
+
* 2. buildNavigatorPrompt produces the prompt; client.messages.create
|
|
66
|
+
* runs it with NAVIGATOR_SYSTEM.
|
|
67
|
+
* 3. Response text is parsed as NavigatorVerdict (JSON; fences
|
|
68
|
+
* tolerated).
|
|
69
|
+
* 4. navigatorVerdictToHookVerdict adapts to the brew-loop shape.
|
|
70
|
+
* 5. Cost is tallied from input/output tokens × pricing.
|
|
71
|
+
*
|
|
72
|
+
* On any failure (load error, JSON parse, API error), the hook
|
|
73
|
+
* returns null — brew treats null as "navigator abstained" + the
|
|
74
|
+
* iteration proceeds to checkpoint without navigator review.
|
|
75
|
+
*/
|
|
76
|
+
export function createPairNavigatorHook(options) {
|
|
77
|
+
const { anthropic, model, maxTokens = 1024, perIterBudgetUsd = 0.10, pricingPerMTokens, loadPromptContext, } = options;
|
|
78
|
+
return {
|
|
79
|
+
async review(input) {
|
|
80
|
+
let context;
|
|
81
|
+
try {
|
|
82
|
+
context = await loadPromptContext(input);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
if (!context)
|
|
88
|
+
return null;
|
|
89
|
+
// Build a compact diff string from filesTouched + line counts.
|
|
90
|
+
// The full git diff isn't always available at call time; this
|
|
91
|
+
// summary is enough for navigator to reason about scope without
|
|
92
|
+
// overflowing the prompt.
|
|
93
|
+
const diff = `Files touched: ${input.filesTouched.join(", ")}\nLines: +${input.linesAdded} / -${input.linesRemoved}`;
|
|
94
|
+
const promptArgs = {
|
|
95
|
+
storyId: input.storyId,
|
|
96
|
+
driverRationale: input.rationale,
|
|
97
|
+
diff,
|
|
98
|
+
mockFiles: context.mockFiles ?? [],
|
|
99
|
+
codeMapDigest: context.codeMapDigest ?? "",
|
|
100
|
+
storyTestIds: context.storyTestIds ?? [],
|
|
101
|
+
apiContract: context.apiContract,
|
|
102
|
+
crossStoryFiles: context.crossStoryFiles,
|
|
103
|
+
specYaml: context.specYaml,
|
|
104
|
+
priorVerdicts: context.priorVerdicts,
|
|
105
|
+
};
|
|
106
|
+
const prompt = buildNavigatorPrompt(promptArgs);
|
|
107
|
+
let response;
|
|
108
|
+
try {
|
|
109
|
+
response = await anthropic.messages.create({
|
|
110
|
+
model,
|
|
111
|
+
system: NAVIGATOR_SYSTEM,
|
|
112
|
+
max_tokens: maxTokens,
|
|
113
|
+
messages: [{ role: "user", content: prompt }],
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const usage = response.usage ?? { input_tokens: 0, output_tokens: 0 };
|
|
120
|
+
const costUsd = (usage.input_tokens * pricingPerMTokens.input) / 1_000_000 +
|
|
121
|
+
(usage.output_tokens * pricingPerMTokens.output) / 1_000_000;
|
|
122
|
+
if (costUsd > perIterBudgetUsd) {
|
|
123
|
+
// Over-budget — surface as abstain so brew doesn't pay the
|
|
124
|
+
// full ticket on a runaway response.
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const text = extractTextFromResponse(response);
|
|
128
|
+
if (!text)
|
|
129
|
+
return null;
|
|
130
|
+
let verdict;
|
|
131
|
+
try {
|
|
132
|
+
verdict = parseNavigatorVerdict(text);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return navigatorVerdictToHookVerdict(verdict, costUsd);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Pull the text out of an Anthropic Messages API response. Returns
|
|
143
|
+
* empty string if the response shape is unexpected (defensive).
|
|
144
|
+
* Pure: no IO.
|
|
145
|
+
*/
|
|
146
|
+
export function extractTextFromResponse(response) {
|
|
147
|
+
if (!Array.isArray(response.content))
|
|
148
|
+
return "";
|
|
149
|
+
const parts = [];
|
|
150
|
+
for (const block of response.content) {
|
|
151
|
+
if (block.type === "text" && typeof block.text === "string") {
|
|
152
|
+
parts.push(block.text);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return parts.join("\n");
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Parse a NavigatorVerdict from raw LLM text. Tolerates ```json
|
|
159
|
+
* fences + leading/trailing prose. Throws on malformed JSON or
|
|
160
|
+
* shape mismatch — caller should catch + treat as abstain.
|
|
161
|
+
*
|
|
162
|
+
* Pure: validates shape; doesn't normalize/repair.
|
|
163
|
+
*/
|
|
164
|
+
export function parseNavigatorVerdict(text) {
|
|
165
|
+
const trimmed = text.trim();
|
|
166
|
+
const fence = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
167
|
+
const raw = fence ? fence[1].trim() : trimmed;
|
|
168
|
+
const parsed = JSON.parse(raw);
|
|
169
|
+
if (!parsed || typeof parsed !== "object") {
|
|
170
|
+
throw new Error("verdict is not an object");
|
|
171
|
+
}
|
|
172
|
+
if (!Array.isArray(parsed.axes)) {
|
|
173
|
+
throw new Error("verdict.axes must be an array");
|
|
174
|
+
}
|
|
175
|
+
if (parsed.overall !== "approve" && parsed.overall !== "warn" && parsed.overall !== "block") {
|
|
176
|
+
throw new Error(`verdict.overall must be approve|warn|block (got ${parsed.overall})`);
|
|
177
|
+
}
|
|
178
|
+
if (typeof parsed.rationale !== "string") {
|
|
179
|
+
throw new Error("verdict.rationale must be a string");
|
|
180
|
+
}
|
|
181
|
+
return parsed;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=pair-navigator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pair-navigator.js","sourceRoot":"","sources":["../../../src/commands/brew/pair-navigator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAIrB,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,6BAA6B,CAC3C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C;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA8B,CAAC;IAC5D,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAC5F,MAAM,IAAI,KAAK,CAAC,mDAAmD,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;IACxF,CAAC;IACD,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,MAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook chef-orchestrate` — α.10 L3 cross-pipeline orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* Sibling to chef-drift. Where chef-drift edits source files, chef-
|
|
5
|
+
* orchestrate decides what to do with a HALTED PR: re-dispatch brew,
|
|
6
|
+
* rebase against main, escalate to PM, or close. Reads the chef-drift
|
|
7
|
+
* ledger (so it knows what's already been tried) plus PR state, spec,
|
|
8
|
+
* navigator history, open PRs.
|
|
9
|
+
*
|
|
10
|
+
* Hard execution today (cli α.10 L3 α.0):
|
|
11
|
+
* - escalate → posts comment + applies label (real)
|
|
12
|
+
* - close → posts comment + closes PR (real)
|
|
13
|
+
* - rebase → writes verdict to disk; auto-resolution lands in α.10.X
|
|
14
|
+
* - redispatch_brew → writes verdict to disk; auto-dispatch lands in α.10.X
|
|
15
|
+
*
|
|
16
|
+
* Run from consumer repo root:
|
|
17
|
+
* ANTHROPIC_API_KEY=... GITHUB_TOKEN=... slowcook chef-orchestrate \
|
|
18
|
+
* --pr 153 \
|
|
19
|
+
* --story 018
|
|
20
|
+
*/
|
|
21
|
+
import { type ChefOrchestrateVerdict } from "@slowcook-ai/llm-anthropic";
|
|
22
|
+
/**
|
|
23
|
+
* Validate a verdict's action shape against its kind. Pure: throws on
|
|
24
|
+
* mismatch so the orchestrator can early-fail before posting comments
|
|
25
|
+
* or applying labels.
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateVerdictShape(verdict: ChefOrchestrateVerdict): void;
|
|
28
|
+
/**
|
|
29
|
+
* Save verdict + dispatch-payload to disk so a follow-up workflow step
|
|
30
|
+
* can pick up redispatch / rebase decisions. Idempotent (overwrites).
|
|
31
|
+
*/
|
|
32
|
+
export declare function persistVerdict(repoRoot: string, storyId: string, prNumber: number, verdict: ChefOrchestrateVerdict): string;
|
|
33
|
+
export declare function chefOrchestrate(argv: string[], _cliVersion: string): Promise<void>;
|
|
34
|
+
//# sourceMappingURL=orchestrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrate.d.ts","sourceRoot":"","sources":["../../../src/commands/chef/orchestrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EASL,KAAK,sBAAsB,EAC5B,MAAM,4BAA4B,CAAC;AAsMpC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CA6B1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,sBAAsB,GAC9B,MAAM,CAWR;AAkED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4GxF"}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook chef-orchestrate` — α.10 L3 cross-pipeline orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* Sibling to chef-drift. Where chef-drift edits source files, chef-
|
|
5
|
+
* orchestrate decides what to do with a HALTED PR: re-dispatch brew,
|
|
6
|
+
* rebase against main, escalate to PM, or close. Reads the chef-drift
|
|
7
|
+
* ledger (so it knows what's already been tried) plus PR state, spec,
|
|
8
|
+
* navigator history, open PRs.
|
|
9
|
+
*
|
|
10
|
+
* Hard execution today (cli α.10 L3 α.0):
|
|
11
|
+
* - escalate → posts comment + applies label (real)
|
|
12
|
+
* - close → posts comment + closes PR (real)
|
|
13
|
+
* - rebase → writes verdict to disk; auto-resolution lands in α.10.X
|
|
14
|
+
* - redispatch_brew → writes verdict to disk; auto-dispatch lands in α.10.X
|
|
15
|
+
*
|
|
16
|
+
* Run from consumer repo root:
|
|
17
|
+
* ANTHROPIC_API_KEY=... GITHUB_TOKEN=... slowcook chef-orchestrate \
|
|
18
|
+
* --pr 153 \
|
|
19
|
+
* --story 018
|
|
20
|
+
*/
|
|
21
|
+
import { execSync } from "node:child_process";
|
|
22
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
23
|
+
import { dirname, join } from "node:path";
|
|
24
|
+
import { AnthropicClient, CHEF_ORCHESTRATE_SYSTEM, buildChefOrchestratePrompt, } from "@slowcook-ai/llm-anthropic";
|
|
25
|
+
function parseArgs(argv) {
|
|
26
|
+
const args = {
|
|
27
|
+
storyId: "",
|
|
28
|
+
prNumber: 0,
|
|
29
|
+
repoRoot: process.cwd(),
|
|
30
|
+
model: "claude-sonnet-4-5-20250929",
|
|
31
|
+
budgetUsd: 0.5,
|
|
32
|
+
dryRun: false,
|
|
33
|
+
recentRunnerOutputPath: null,
|
|
34
|
+
};
|
|
35
|
+
for (let i = 0; i < argv.length; i++) {
|
|
36
|
+
const a = argv[i];
|
|
37
|
+
const next = argv[i + 1];
|
|
38
|
+
if (a === "--story" && next) {
|
|
39
|
+
args.storyId = next;
|
|
40
|
+
i++;
|
|
41
|
+
}
|
|
42
|
+
else if (a === "--pr" && next) {
|
|
43
|
+
args.prNumber = parseInt(next, 10);
|
|
44
|
+
i++;
|
|
45
|
+
}
|
|
46
|
+
else if (a === "--cwd" && next) {
|
|
47
|
+
args.repoRoot = next;
|
|
48
|
+
i++;
|
|
49
|
+
}
|
|
50
|
+
else if (a === "--model" && next) {
|
|
51
|
+
args.model = next;
|
|
52
|
+
i++;
|
|
53
|
+
}
|
|
54
|
+
else if (a === "--budget-usd" && next) {
|
|
55
|
+
args.budgetUsd = parseFloat(next);
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
58
|
+
else if (a === "--dry-run") {
|
|
59
|
+
args.dryRun = true;
|
|
60
|
+
}
|
|
61
|
+
else if (a === "--runner-output" && next) {
|
|
62
|
+
args.recentRunnerOutputPath = next;
|
|
63
|
+
i++;
|
|
64
|
+
}
|
|
65
|
+
else if (a === "--help" || a === "-h") {
|
|
66
|
+
printHelp();
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!args.storyId) {
|
|
71
|
+
console.error("--story <id> is required");
|
|
72
|
+
printHelp();
|
|
73
|
+
process.exit(64);
|
|
74
|
+
}
|
|
75
|
+
if (!args.prNumber) {
|
|
76
|
+
console.error("--pr <number> is required");
|
|
77
|
+
printHelp();
|
|
78
|
+
process.exit(64);
|
|
79
|
+
}
|
|
80
|
+
return args;
|
|
81
|
+
}
|
|
82
|
+
function printHelp() {
|
|
83
|
+
console.log(`
|
|
84
|
+
slowcook chef-orchestrate — pipeline orchestrator (cli α.10 L3)
|
|
85
|
+
|
|
86
|
+
Sibling to chef-drift. Where chef-drift edits source files surgically,
|
|
87
|
+
chef-orchestrate decides what to do with a HALTED brew PR:
|
|
88
|
+
redispatch_brew | rebase | escalate | close
|
|
89
|
+
|
|
90
|
+
Usage:
|
|
91
|
+
slowcook chef-orchestrate --pr <n> --story <id> [options]
|
|
92
|
+
|
|
93
|
+
Options:
|
|
94
|
+
--pr <n> PR number (required).
|
|
95
|
+
--story <id> Story id (required, e.g. "018").
|
|
96
|
+
--cwd <path> Repo root (default: cwd).
|
|
97
|
+
--model <id> Anthropic model id.
|
|
98
|
+
--budget-usd <n> Per-decision budget cap (default: 0.50).
|
|
99
|
+
--runner-output <path> Optional path to brew runner output (re-context).
|
|
100
|
+
--dry-run Print verdict; do not act.
|
|
101
|
+
|
|
102
|
+
Environment:
|
|
103
|
+
ANTHROPIC_API_KEY (required) — for the LLM call.
|
|
104
|
+
GITHUB_TOKEN (required for escalate/close) — comment + label + close.
|
|
105
|
+
|
|
106
|
+
Reads (.brewing/chef/story-<id>.json) for chef-drift's prior moves.
|
|
107
|
+
Writes the verdict to (.brewing/chef-orchestrate/story-<id>.json) so a
|
|
108
|
+
follow-up step (or workflow) can act on redispatch/rebase decisions.
|
|
109
|
+
`);
|
|
110
|
+
}
|
|
111
|
+
function repoSlug(repoRoot) {
|
|
112
|
+
return execSync(`git -C "${repoRoot}" remote get-url origin | sed -E 's|^.*github\\.com[:/]||; s|\\.git$||'`, { encoding: "utf8" }).trim();
|
|
113
|
+
}
|
|
114
|
+
function fetchPrSnapshot(repoRoot, prNumber) {
|
|
115
|
+
const slug = repoSlug(repoRoot);
|
|
116
|
+
const json = execSync(`gh pr view ${prNumber} --repo "${slug}" --json headRefName,baseRefName,state,mergeStateStatus,title,statusCheckRollup`, { encoding: "utf8", maxBuffer: 1024 * 256 });
|
|
117
|
+
const obj = JSON.parse(json);
|
|
118
|
+
const failingChecks = (obj.statusCheckRollup ?? [])
|
|
119
|
+
.filter((c) => (c.conclusion ?? "").toLowerCase() === "failure")
|
|
120
|
+
.map((c) => c.name ?? "")
|
|
121
|
+
.filter(Boolean);
|
|
122
|
+
return {
|
|
123
|
+
headRef: obj.headRefName,
|
|
124
|
+
baseRef: obj.baseRefName,
|
|
125
|
+
state: obj.state,
|
|
126
|
+
mergeStateStatus: obj.mergeStateStatus,
|
|
127
|
+
title: obj.title,
|
|
128
|
+
failingChecks,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function loadChefDriftLedger(repoRoot, storyId) {
|
|
132
|
+
const path = join(repoRoot, `.brewing/chef/story-${storyId}.json`);
|
|
133
|
+
if (!existsSync(path)) {
|
|
134
|
+
return { story_id: storyId, moves: [], cumulative_cost_usd: 0 };
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const obj = JSON.parse(readFileSync(path, "utf8"));
|
|
138
|
+
return {
|
|
139
|
+
story_id: obj.story_id ?? storyId,
|
|
140
|
+
moves: obj.moves ?? [],
|
|
141
|
+
cumulative_cost_usd: obj.cumulative_cost_usd ?? 0,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return { story_id: storyId, moves: [], cumulative_cost_usd: 0 };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function loadOpenPrs(repoRoot, storyId) {
|
|
149
|
+
const out = [];
|
|
150
|
+
try {
|
|
151
|
+
const slug = repoSlug(repoRoot);
|
|
152
|
+
const json = execSync(`gh pr list --repo "${slug}" --search "story-${storyId}" --state all --json number,headRefName,headRefOid,title,state --limit 20`, { encoding: "utf8" });
|
|
153
|
+
const prs = JSON.parse(json);
|
|
154
|
+
for (const pr of prs) {
|
|
155
|
+
const branch = pr.headRefName;
|
|
156
|
+
let kind;
|
|
157
|
+
if (branch.includes("/spec/"))
|
|
158
|
+
kind = "spec";
|
|
159
|
+
else if (branch.includes("/mockup/"))
|
|
160
|
+
kind = "mockup";
|
|
161
|
+
else if (branch.includes("/tests/") || branch.includes("/recipe/"))
|
|
162
|
+
kind = "tests";
|
|
163
|
+
else if (branch.includes("/brew/"))
|
|
164
|
+
kind = "brew";
|
|
165
|
+
else
|
|
166
|
+
continue;
|
|
167
|
+
out.push({
|
|
168
|
+
kind,
|
|
169
|
+
number: pr.number,
|
|
170
|
+
branch,
|
|
171
|
+
state: pr.state,
|
|
172
|
+
title: pr.title,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
console.warn(` warn: could not list open PRs (${e.message.slice(0, 100)})`);
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
function loadSpec(repoRoot, storyId) {
|
|
182
|
+
const path = `specs/story-${storyId}.yaml`;
|
|
183
|
+
const abs = join(repoRoot, path);
|
|
184
|
+
if (!existsSync(abs))
|
|
185
|
+
return { path, yaml: "" };
|
|
186
|
+
return { path, yaml: readFileSync(abs, "utf8") };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Validate a verdict's action shape against its kind. Pure: throws on
|
|
190
|
+
* mismatch so the orchestrator can early-fail before posting comments
|
|
191
|
+
* or applying labels.
|
|
192
|
+
*/
|
|
193
|
+
export function validateVerdictShape(verdict) {
|
|
194
|
+
if (!verdict.kind || !verdict.rationale || !verdict.action) {
|
|
195
|
+
throw new Error("verdict missing kind / rationale / action");
|
|
196
|
+
}
|
|
197
|
+
const a = verdict.action;
|
|
198
|
+
switch (verdict.kind) {
|
|
199
|
+
case "redispatch_brew":
|
|
200
|
+
if (typeof a["brew_workflow"] !== "string" || typeof a["additional_context"] !== "string") {
|
|
201
|
+
throw new Error("redispatch_brew action must include brew_workflow + additional_context strings");
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case "rebase":
|
|
205
|
+
if (typeof a["onto"] !== "string" || !Array.isArray(a["expected_conflict_paths"])) {
|
|
206
|
+
throw new Error("rebase action must include onto:string + expected_conflict_paths:string[]");
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
case "escalate":
|
|
210
|
+
if (typeof a["issue_number"] !== "number" || typeof a["label"] !== "string" || typeof a["comment"] !== "string") {
|
|
211
|
+
throw new Error("escalate action must include issue_number:number + label:string + comment:string");
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
case "close":
|
|
215
|
+
if (typeof a["reason"] !== "string" || typeof a["comment"] !== "string") {
|
|
216
|
+
throw new Error("close action must include reason:string + comment:string");
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
default:
|
|
220
|
+
throw new Error(`unknown verdict kind: ${verdict.kind}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Save verdict + dispatch-payload to disk so a follow-up workflow step
|
|
225
|
+
* can pick up redispatch / rebase decisions. Idempotent (overwrites).
|
|
226
|
+
*/
|
|
227
|
+
export function persistVerdict(repoRoot, storyId, prNumber, verdict) {
|
|
228
|
+
const path = join(repoRoot, `.brewing/chef-orchestrate/story-${storyId}.json`);
|
|
229
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
230
|
+
const payload = {
|
|
231
|
+
story_id: storyId,
|
|
232
|
+
pr_number: prNumber,
|
|
233
|
+
verdict,
|
|
234
|
+
timestamp: new Date().toISOString(),
|
|
235
|
+
};
|
|
236
|
+
writeFileSync(path, JSON.stringify(payload, null, 2), "utf8");
|
|
237
|
+
return path;
|
|
238
|
+
}
|
|
239
|
+
function applyEscalate(repoRoot, prNumber, action) {
|
|
240
|
+
const slug = repoSlug(repoRoot);
|
|
241
|
+
let posted = false;
|
|
242
|
+
let labeled = false;
|
|
243
|
+
// Comment on the source ISSUE (escalation goes to the PM, not the bot PR).
|
|
244
|
+
const tmp = "/tmp/chef-orchestrate-escalate-comment.md";
|
|
245
|
+
writeFileSync(tmp, action.comment, "utf8");
|
|
246
|
+
try {
|
|
247
|
+
execSync(`gh issue comment ${action.issue_number} --repo "${slug}" --body-file ${tmp}`, { stdio: "inherit" });
|
|
248
|
+
posted = true;
|
|
249
|
+
}
|
|
250
|
+
catch (e) {
|
|
251
|
+
console.warn(` warn: failed to post escalation comment: ${e.message.slice(0, 200)}`);
|
|
252
|
+
}
|
|
253
|
+
// Apply label to the PR (so future filters surface escalated PRs).
|
|
254
|
+
try {
|
|
255
|
+
execSync(`gh pr edit ${prNumber} --repo "${slug}" --add-label "${action.label}"`, { stdio: "inherit" });
|
|
256
|
+
labeled = true;
|
|
257
|
+
}
|
|
258
|
+
catch (e) {
|
|
259
|
+
console.warn(` warn: failed to apply label '${action.label}' to PR #${prNumber}: ${e.message.slice(0, 200)}`);
|
|
260
|
+
}
|
|
261
|
+
return { posted, labeled };
|
|
262
|
+
}
|
|
263
|
+
function applyClose(repoRoot, prNumber, action) {
|
|
264
|
+
const slug = repoSlug(repoRoot);
|
|
265
|
+
let commented = false;
|
|
266
|
+
let closed = false;
|
|
267
|
+
const tmp = "/tmp/chef-orchestrate-close-comment.md";
|
|
268
|
+
writeFileSync(tmp, action.comment, "utf8");
|
|
269
|
+
try {
|
|
270
|
+
execSync(`gh pr comment ${prNumber} --repo "${slug}" --body-file ${tmp}`, { stdio: "inherit" });
|
|
271
|
+
commented = true;
|
|
272
|
+
}
|
|
273
|
+
catch (e) {
|
|
274
|
+
console.warn(` warn: failed to post close comment: ${e.message.slice(0, 200)}`);
|
|
275
|
+
}
|
|
276
|
+
try {
|
|
277
|
+
execSync(`gh pr close ${prNumber} --repo "${slug}"`, { stdio: "inherit" });
|
|
278
|
+
closed = true;
|
|
279
|
+
}
|
|
280
|
+
catch (e) {
|
|
281
|
+
console.warn(` warn: failed to close PR #${prNumber}: ${e.message.slice(0, 200)}`);
|
|
282
|
+
}
|
|
283
|
+
return { commented, closed };
|
|
284
|
+
}
|
|
285
|
+
export async function chefOrchestrate(argv, _cliVersion) {
|
|
286
|
+
const args = parseArgs(argv);
|
|
287
|
+
const apiKey = process.env["ANTHROPIC_API_KEY"];
|
|
288
|
+
if (!apiKey) {
|
|
289
|
+
console.error("ANTHROPIC_API_KEY env var is required.");
|
|
290
|
+
process.exit(2);
|
|
291
|
+
}
|
|
292
|
+
console.log(`slowcook chef-orchestrate · story-${args.storyId} · PR #${args.prNumber}`);
|
|
293
|
+
// Gather inputs.
|
|
294
|
+
const prState = fetchPrSnapshot(args.repoRoot, args.prNumber);
|
|
295
|
+
const ledger = loadChefDriftLedger(args.repoRoot, args.storyId);
|
|
296
|
+
const openPrs = loadOpenPrs(args.repoRoot, args.storyId);
|
|
297
|
+
const spec = loadSpec(args.repoRoot, args.storyId);
|
|
298
|
+
let runnerOutput = undefined;
|
|
299
|
+
if (args.recentRunnerOutputPath && existsSync(args.recentRunnerOutputPath)) {
|
|
300
|
+
runnerOutput = readFileSync(args.recentRunnerOutputPath, "utf8");
|
|
301
|
+
}
|
|
302
|
+
console.log(` PR state: ${prState.state} · merge=${prState.mergeStateStatus} · failing=${prState.failingChecks?.length ?? 0}`);
|
|
303
|
+
console.log(` ledger: ${ledger.moves.length} prior chef-drift move(s) · cum-cost $${ledger.cumulative_cost_usd.toFixed(4)}`);
|
|
304
|
+
console.log(` openPrs: ${openPrs.length} (spec=${openPrs.filter(p => p.kind === "spec").length}, mockup=${openPrs.filter(p => p.kind === "mockup").length}, tests=${openPrs.filter(p => p.kind === "tests").length}, brew=${openPrs.filter(p => p.kind === "brew").length})`);
|
|
305
|
+
const prompt = buildChefOrchestratePrompt({
|
|
306
|
+
storyId: args.storyId,
|
|
307
|
+
prNumber: args.prNumber,
|
|
308
|
+
prState,
|
|
309
|
+
chefDriftLedger: ledger,
|
|
310
|
+
navigatorHistory: null, // hooked up in α.10 L3 α.1
|
|
311
|
+
spec,
|
|
312
|
+
storyOpenPrs: openPrs,
|
|
313
|
+
recentRunnerOutput: runnerOutput,
|
|
314
|
+
});
|
|
315
|
+
console.log(` prompt: ${prompt.length} chars · calling chef-orchestrate LLM (${args.model})`);
|
|
316
|
+
const client = new AnthropicClient(apiKey);
|
|
317
|
+
const resp = await client.complete({
|
|
318
|
+
model: args.model,
|
|
319
|
+
system: CHEF_ORCHESTRATE_SYSTEM,
|
|
320
|
+
messages: [{ role: "user", content: prompt }],
|
|
321
|
+
maxTokens: 4096,
|
|
322
|
+
});
|
|
323
|
+
console.log(` chef-orchestrate LLM: ${resp.usage.inputTokens}→${resp.usage.outputTokens} tok · $${resp.costUsd.toFixed(4)}`);
|
|
324
|
+
if (resp.costUsd > args.budgetUsd) {
|
|
325
|
+
console.warn(` warn: cost $${resp.costUsd.toFixed(4)} exceeded budget $${args.budgetUsd}. Continuing (decision is in-hand).`);
|
|
326
|
+
}
|
|
327
|
+
let verdict;
|
|
328
|
+
try {
|
|
329
|
+
const text = resp.text.trim();
|
|
330
|
+
const fence = text.match(/```json\s*([\s\S]*?)```/);
|
|
331
|
+
verdict = JSON.parse(fence ? fence[1] : text);
|
|
332
|
+
validateVerdictShape(verdict);
|
|
333
|
+
}
|
|
334
|
+
catch (e) {
|
|
335
|
+
console.error(` ! verdict parse/shape error: ${e.message}`);
|
|
336
|
+
console.error(` raw: ${resp.text.slice(0, 600)}`);
|
|
337
|
+
process.exit(1);
|
|
338
|
+
}
|
|
339
|
+
console.log(`\n VERDICT: ${verdict.kind.toUpperCase()}`);
|
|
340
|
+
console.log(` rationale: ${verdict.rationale}`);
|
|
341
|
+
// Always persist the verdict — workflows / follow-up steps consume it.
|
|
342
|
+
if (!args.dryRun) {
|
|
343
|
+
const path = persistVerdict(args.repoRoot, args.storyId, args.prNumber, verdict);
|
|
344
|
+
console.log(` wrote: ${path.replace(args.repoRoot + "/", "")}`);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
console.log(` [dry-run] would persist verdict to .brewing/chef-orchestrate/story-${args.storyId}.json`);
|
|
348
|
+
}
|
|
349
|
+
// Execute the verdict.
|
|
350
|
+
if (args.dryRun) {
|
|
351
|
+
console.log(` [dry-run] would execute: ${verdict.kind}`);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
switch (verdict.kind) {
|
|
355
|
+
case "escalate": {
|
|
356
|
+
const action = verdict.action;
|
|
357
|
+
console.log(` → escalate: post comment on issue #${action.issue_number} + apply label '${action.label}' to PR #${args.prNumber}`);
|
|
358
|
+
const r = applyEscalate(args.repoRoot, args.prNumber, action);
|
|
359
|
+
console.log(` posted=${r.posted} labeled=${r.labeled}`);
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
case "close": {
|
|
363
|
+
const action = verdict.action;
|
|
364
|
+
console.log(` → close PR #${args.prNumber}: ${action.reason}`);
|
|
365
|
+
const r = applyClose(args.repoRoot, args.prNumber, action);
|
|
366
|
+
console.log(` commented=${r.commented} closed=${r.closed}`);
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
case "redispatch_brew": {
|
|
370
|
+
const action = verdict.action;
|
|
371
|
+
console.log(` → redispatch_brew (deferred): would dispatch ${action.brew_workflow} with additional_context (${action.additional_context.length} chars)`);
|
|
372
|
+
console.log(` verdict persisted; α.10 L3 α.0 does not auto-dispatch — workflow consumer picks up the verdict file`);
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
case "rebase": {
|
|
376
|
+
const action = verdict.action;
|
|
377
|
+
console.log(` → rebase (deferred): would rebase ${prState.headRef} onto ${action.onto}`);
|
|
378
|
+
console.log(` expected conflicts: ${action.expected_conflict_paths.join(", ") || "(none)"}`);
|
|
379
|
+
console.log(` verdict persisted; α.10 L3 α.0 does not auto-rebase — workflow consumer picks up the verdict file`);
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
console.log(`\n done · cost $${resp.costUsd.toFixed(4)}`);
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=orchestrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrate.js","sourceRoot":"","sources":["../../../src/commands/ch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