@samahlstrom/forge-cli 0.1.7 → 0.1.9
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/run.d.ts +9 -0
- package/dist/commands/run.js +601 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/seed.d.ts +5 -0
- package/dist/commands/seed.js +57 -0
- package/dist/commands/seed.js.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/bd.d.ts +37 -0
- package/dist/utils/bd.js +81 -0
- package/dist/utils/bd.js.map +1 -0
- package/dist/utils/seed-beads.d.ts +8 -0
- package/dist/utils/seed-beads.js +93 -0
- package/dist/utils/seed-beads.js.map +1 -0
- package/package.json +1 -1
- package/templates/core/skill-ingest.md.hbs +25 -16
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
import * as p from '@clack/prompts';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { exists, writeText, ensureDir } from '../utils/fs.js';
|
|
5
|
+
import { bdReady, bdClose, bdUpdate, bdList } from '../utils/bd.js';
|
|
6
|
+
import { execaCommand } from 'execa';
|
|
7
|
+
import { writeFile, unlink, readFile } from 'node:fs/promises';
|
|
8
|
+
export async function run(specId, options) {
|
|
9
|
+
const cwd = process.cwd();
|
|
10
|
+
const concurrency = parseInt(options.concurrency ?? '1', 10);
|
|
11
|
+
const budget = options.budget ? parseFloat(options.budget) : undefined;
|
|
12
|
+
const reviewEnabled = options.review !== false;
|
|
13
|
+
p.intro(chalk.bold('forge run') + chalk.dim(` — ${specId}`));
|
|
14
|
+
// Verify spec exists
|
|
15
|
+
const specDir = join(cwd, '.forge', 'specs', specId);
|
|
16
|
+
if (!(await exists(join(specDir, 'spec.yaml')))) {
|
|
17
|
+
p.cancel(`No spec.yaml found. Run /ingest ${specId} first.`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
// Verify beads exist
|
|
21
|
+
let allTasks;
|
|
22
|
+
try {
|
|
23
|
+
allTasks = await bdList({ labels: [`spec:${specId}`], type: 'task' }, cwd);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
p.cancel('Could not query beads. Is bd initialized? Run: forge seed ' + specId);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
if (allTasks.length === 0) {
|
|
30
|
+
p.cancel(`No task beads found for ${specId}. Run: forge seed ${specId}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const openTasks = allTasks.filter(t => t.status === 'open' || t.status === 'in_progress');
|
|
34
|
+
p.log.info(`${chalk.cyan(String(openTasks.length))} tasks remaining out of ${allTasks.length} total`);
|
|
35
|
+
if (options.dryRun) {
|
|
36
|
+
await showDryRun(specId, cwd);
|
|
37
|
+
p.outro(chalk.dim('Dry run complete — no tasks executed.'));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Warn about permissions
|
|
41
|
+
p.log.warn(chalk.yellow('Auto-pilot uses --dangerously-skip-permissions and git worktrees for isolation.'));
|
|
42
|
+
if (concurrency > 1) {
|
|
43
|
+
p.log.info(`Concurrency: ${chalk.cyan(String(concurrency))} parallel worktrees`);
|
|
44
|
+
}
|
|
45
|
+
const confirm = await p.confirm({
|
|
46
|
+
message: 'Continue?',
|
|
47
|
+
initialValue: true,
|
|
48
|
+
});
|
|
49
|
+
if (p.isCancel(confirm) || !confirm) {
|
|
50
|
+
p.cancel('Run cancelled.');
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
53
|
+
// Set up reports directory
|
|
54
|
+
const reportsDir = join(cwd, '.forge', 'specs', specId, 'reports');
|
|
55
|
+
await ensureDir(reportsDir);
|
|
56
|
+
// Main orchestration loop
|
|
57
|
+
let completed = 0;
|
|
58
|
+
let failed = 0;
|
|
59
|
+
let currentPhase = '';
|
|
60
|
+
const startTime = Date.now();
|
|
61
|
+
const allReports = [];
|
|
62
|
+
const phaseReports = [];
|
|
63
|
+
let currentPhaseReport = null;
|
|
64
|
+
while (true) {
|
|
65
|
+
// Get ready tasks
|
|
66
|
+
const labelFilters = [`spec:${specId}`];
|
|
67
|
+
if (options.phase)
|
|
68
|
+
labelFilters.push(`phase:${options.phase}`);
|
|
69
|
+
let readyTasks;
|
|
70
|
+
try {
|
|
71
|
+
readyTasks = await bdReady(labelFilters, cwd);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
readyTasks = [];
|
|
75
|
+
}
|
|
76
|
+
if (readyTasks.length === 0) {
|
|
77
|
+
// Check if there are still open tasks (blocked)
|
|
78
|
+
const remaining = await bdList({ labels: [`spec:${specId}`], type: 'task', status: 'open' }, cwd);
|
|
79
|
+
if (remaining.length === 0)
|
|
80
|
+
break; // All done
|
|
81
|
+
// Try closing eligible epics to unblock next phase
|
|
82
|
+
try {
|
|
83
|
+
await execaCommand('bd epic close-eligible', { shell: true, cwd, timeout: 10000 });
|
|
84
|
+
}
|
|
85
|
+
catch { /* ignore */ }
|
|
86
|
+
// Re-check ready tasks
|
|
87
|
+
try {
|
|
88
|
+
readyTasks = await bdReady(labelFilters, cwd);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
readyTasks = [];
|
|
92
|
+
}
|
|
93
|
+
if (readyTasks.length === 0) {
|
|
94
|
+
// Finalize current phase report
|
|
95
|
+
if (currentPhaseReport) {
|
|
96
|
+
currentPhaseReport.finished_at = new Date().toISOString();
|
|
97
|
+
phaseReports.push(currentPhaseReport);
|
|
98
|
+
await writePhaseReport(reportsDir, currentPhaseReport);
|
|
99
|
+
}
|
|
100
|
+
if (reviewEnabled) {
|
|
101
|
+
const elapsed = formatElapsed(Date.now() - startTime);
|
|
102
|
+
p.log.info(`\n${chalk.bold('Phase checkpoint')} — ${completed} completed, ${failed} failed, ${remaining.length} remaining (${elapsed})`);
|
|
103
|
+
// Show phase retrospective if we have reports
|
|
104
|
+
if (currentPhaseReport && currentPhaseReport.tasks.length > 0) {
|
|
105
|
+
showPhaseRetro(currentPhaseReport);
|
|
106
|
+
}
|
|
107
|
+
const cont = await p.confirm({
|
|
108
|
+
message: `${remaining.length} tasks blocked. Continue to next phase?`,
|
|
109
|
+
initialValue: true,
|
|
110
|
+
});
|
|
111
|
+
if (p.isCancel(cont) || !cont)
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
currentPhaseReport = null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (readyTasks.length === 0)
|
|
121
|
+
continue;
|
|
122
|
+
// Detect phase transition
|
|
123
|
+
const taskPhase = readyTasks[0].labels?.find(l => l.startsWith('phase:')) ?? '';
|
|
124
|
+
if (taskPhase !== currentPhase) {
|
|
125
|
+
if (currentPhase && currentPhaseReport) {
|
|
126
|
+
currentPhaseReport.finished_at = new Date().toISOString();
|
|
127
|
+
phaseReports.push(currentPhaseReport);
|
|
128
|
+
await writePhaseReport(reportsDir, currentPhaseReport);
|
|
129
|
+
if (reviewEnabled) {
|
|
130
|
+
p.log.success(`\n${chalk.bold('Phase complete:')} ${currentPhase}`);
|
|
131
|
+
showPhaseRetro(currentPhaseReport);
|
|
132
|
+
const cont = await p.confirm({
|
|
133
|
+
message: `Start ${taskPhase}?`,
|
|
134
|
+
initialValue: true,
|
|
135
|
+
});
|
|
136
|
+
if (p.isCancel(cont) || !cont)
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
currentPhase = taskPhase;
|
|
141
|
+
currentPhaseReport = {
|
|
142
|
+
phase: currentPhase,
|
|
143
|
+
tasks: [],
|
|
144
|
+
started_at: new Date().toISOString(),
|
|
145
|
+
finished_at: '',
|
|
146
|
+
success_count: 0,
|
|
147
|
+
failure_count: 0,
|
|
148
|
+
};
|
|
149
|
+
p.log.step(chalk.bold(`\nStarting ${currentPhase}`));
|
|
150
|
+
}
|
|
151
|
+
// Pick tasks up to concurrency limit
|
|
152
|
+
const batch = readyTasks.slice(0, concurrency);
|
|
153
|
+
// Execute batch in parallel worktrees
|
|
154
|
+
const results = await Promise.allSettled(batch.map(task => executeTaskInWorktree(task, specId, cwd, budget)));
|
|
155
|
+
for (let i = 0; i < results.length; i++) {
|
|
156
|
+
const result = results[i];
|
|
157
|
+
const task = batch[i];
|
|
158
|
+
if (result.status === 'fulfilled') {
|
|
159
|
+
const report = result.value;
|
|
160
|
+
allReports.push(report);
|
|
161
|
+
currentPhaseReport?.tasks.push(report);
|
|
162
|
+
if (report.status === 'success') {
|
|
163
|
+
completed++;
|
|
164
|
+
currentPhaseReport && currentPhaseReport.success_count++;
|
|
165
|
+
p.log.success(`${chalk.green('✓')} ${task.title} ${chalk.dim(`(${formatElapsed(report.elapsed_ms)})`)}`);
|
|
166
|
+
try {
|
|
167
|
+
await bdClose(task.id, cwd);
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
p.log.warn(`Failed to close ${task.id}: ${err}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else if (report.status === 'merge_conflict') {
|
|
174
|
+
failed++;
|
|
175
|
+
currentPhaseReport && currentPhaseReport.failure_count++;
|
|
176
|
+
p.log.warn(`${chalk.yellow('⚠')} ${task.title}: merge conflict — branch ${chalk.cyan(report.worktree_branch)} preserved`);
|
|
177
|
+
try {
|
|
178
|
+
await bdUpdate(task.id, { status: 'open' }, cwd);
|
|
179
|
+
}
|
|
180
|
+
catch { /* ignore */ }
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
failed++;
|
|
184
|
+
currentPhaseReport && currentPhaseReport.failure_count++;
|
|
185
|
+
p.log.error(`${chalk.red('✗')} ${task.title}: ${report.errors.join('; ')}`);
|
|
186
|
+
try {
|
|
187
|
+
await bdUpdate(task.id, { status: 'open' }, cwd);
|
|
188
|
+
}
|
|
189
|
+
catch { /* ignore */ }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
failed++;
|
|
194
|
+
currentPhaseReport && currentPhaseReport.failure_count++;
|
|
195
|
+
const report = {
|
|
196
|
+
task_id: task.metadata?.spec_task_id ?? task.id,
|
|
197
|
+
bead_id: task.id,
|
|
198
|
+
title: task.title,
|
|
199
|
+
phase: currentPhase,
|
|
200
|
+
agent: task.labels?.find(l => l.startsWith('agent:'))?.replace('agent:', '') ?? '',
|
|
201
|
+
tier: task.labels?.find(l => l.startsWith('tier:'))?.replace('tier:', '') ?? '',
|
|
202
|
+
status: 'failure',
|
|
203
|
+
started_at: new Date().toISOString(),
|
|
204
|
+
finished_at: new Date().toISOString(),
|
|
205
|
+
elapsed_ms: 0,
|
|
206
|
+
worktree_branch: '',
|
|
207
|
+
files_changed: [],
|
|
208
|
+
blockers: [`Unhandled error: ${result.reason}`],
|
|
209
|
+
errors: [String(result.reason)],
|
|
210
|
+
summary: `Task failed with unhandled error: ${result.reason}`,
|
|
211
|
+
};
|
|
212
|
+
allReports.push(report);
|
|
213
|
+
currentPhaseReport?.tasks.push(report);
|
|
214
|
+
p.log.error(`${chalk.red('✗')} ${task.title}: ${result.reason}`);
|
|
215
|
+
try {
|
|
216
|
+
await bdUpdate(task.id, { status: 'open' }, cwd);
|
|
217
|
+
}
|
|
218
|
+
catch { /* ignore */ }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// Write incremental reports
|
|
222
|
+
await writeText(join(reportsDir, 'all-tasks.json'), JSON.stringify(allReports, null, 2));
|
|
223
|
+
}
|
|
224
|
+
// Finalize last phase
|
|
225
|
+
if (currentPhaseReport && !currentPhaseReport.finished_at) {
|
|
226
|
+
currentPhaseReport.finished_at = new Date().toISOString();
|
|
227
|
+
phaseReports.push(currentPhaseReport);
|
|
228
|
+
await writePhaseReport(reportsDir, currentPhaseReport);
|
|
229
|
+
}
|
|
230
|
+
// Generate final Muda analysis
|
|
231
|
+
const elapsed = formatElapsed(Date.now() - startTime);
|
|
232
|
+
await generateMudaAnalysis(reportsDir, allReports, phaseReports, elapsed);
|
|
233
|
+
const summaryLines = [
|
|
234
|
+
`Completed: ${chalk.green(String(completed))}`,
|
|
235
|
+
`Failed: ${failed > 0 ? chalk.red(String(failed)) : chalk.dim('0')}`,
|
|
236
|
+
`Elapsed: ${chalk.cyan(elapsed)}`,
|
|
237
|
+
`Reports: ${chalk.dim(`.forge/specs/${specId}/reports/`)}`,
|
|
238
|
+
];
|
|
239
|
+
p.note(summaryLines.join('\n'), 'Run complete');
|
|
240
|
+
if (failed > 0) {
|
|
241
|
+
p.log.info(`Review blockers: ${chalk.cyan(`.forge/specs/${specId}/reports/muda-analysis.md`)}`);
|
|
242
|
+
}
|
|
243
|
+
p.outro(chalk.green('Done.'));
|
|
244
|
+
}
|
|
245
|
+
// ─── Worktree Execution ───────────────────────────────────────────
|
|
246
|
+
async function executeTaskInWorktree(task, specId, cwd, budget) {
|
|
247
|
+
const startedAt = new Date();
|
|
248
|
+
const tier = task.labels?.find(l => l.startsWith('tier:'))?.replace('tier:', '') ?? 'T2';
|
|
249
|
+
const agent = task.labels?.find(l => l.startsWith('agent:'))?.replace('agent:', '') ?? '';
|
|
250
|
+
const phase = task.labels?.find(l => l.startsWith('phase:'))?.replace('phase:', '') ?? '';
|
|
251
|
+
const filesLikely = task.metadata?.files_likely;
|
|
252
|
+
const specTaskId = task.metadata?.spec_task_id;
|
|
253
|
+
// Create a unique branch for this task
|
|
254
|
+
const branchName = `forge/${specId}/${task.id}`;
|
|
255
|
+
const worktreePath = join(cwd, '.forge', 'worktrees', task.id);
|
|
256
|
+
const report = {
|
|
257
|
+
task_id: specTaskId ?? task.id,
|
|
258
|
+
bead_id: task.id,
|
|
259
|
+
title: task.title,
|
|
260
|
+
phase: `phase:${phase}`,
|
|
261
|
+
agent,
|
|
262
|
+
tier,
|
|
263
|
+
status: 'failure',
|
|
264
|
+
started_at: startedAt.toISOString(),
|
|
265
|
+
finished_at: '',
|
|
266
|
+
elapsed_ms: 0,
|
|
267
|
+
worktree_branch: branchName,
|
|
268
|
+
files_changed: [],
|
|
269
|
+
blockers: [],
|
|
270
|
+
errors: [],
|
|
271
|
+
summary: '',
|
|
272
|
+
};
|
|
273
|
+
try {
|
|
274
|
+
// Create worktree
|
|
275
|
+
await execaCommand(`git worktree add -b "${branchName}" "${worktreePath}" HEAD`, {
|
|
276
|
+
shell: true, cwd, timeout: 30000,
|
|
277
|
+
});
|
|
278
|
+
// Build the deliver prompt with retrospective instruction
|
|
279
|
+
const filesStr = filesLikely?.length ? ` Target files: ${filesLikely.join(', ')}.` : '';
|
|
280
|
+
const reportPath = join(worktreePath, '.forge', 'task-report.json');
|
|
281
|
+
const prompt = buildTaskPrompt(task, specId, filesStr, tier, agent, specTaskId, reportPath);
|
|
282
|
+
// Write prompt to temp file
|
|
283
|
+
const tmpFile = join('/tmp', `forge-run-${task.id}-${Date.now()}.txt`);
|
|
284
|
+
await writeFile(tmpFile, prompt);
|
|
285
|
+
try {
|
|
286
|
+
const args = ['claude', '-p', '--dangerously-skip-permissions', '--output-format', 'json'];
|
|
287
|
+
if (budget)
|
|
288
|
+
args.push('--max-budget-usd', String(budget));
|
|
289
|
+
await execaCommand(`cat "${tmpFile}" | ${args.join(' ')}`, { shell: true, cwd: worktreePath, timeout: 600000 });
|
|
290
|
+
// Read the agent's self-report if it wrote one
|
|
291
|
+
try {
|
|
292
|
+
const agentReport = JSON.parse(await readFile(reportPath, 'utf-8'));
|
|
293
|
+
report.blockers = agentReport.blockers ?? [];
|
|
294
|
+
report.errors = agentReport.errors ?? [];
|
|
295
|
+
report.summary = agentReport.summary ?? '';
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
report.summary = 'Task completed (no agent report generated)';
|
|
299
|
+
}
|
|
300
|
+
// Get list of files changed
|
|
301
|
+
try {
|
|
302
|
+
const diffResult = await execaCommand('git diff --name-only HEAD', {
|
|
303
|
+
shell: true, cwd: worktreePath, timeout: 10000,
|
|
304
|
+
});
|
|
305
|
+
report.files_changed = diffResult.stdout.trim().split('\n').filter(Boolean);
|
|
306
|
+
}
|
|
307
|
+
catch { /* ignore */ }
|
|
308
|
+
// Commit changes in worktree
|
|
309
|
+
try {
|
|
310
|
+
await execaCommand('git add -A', { shell: true, cwd: worktreePath, timeout: 10000 });
|
|
311
|
+
const commitMsg = `forge: ${task.title} [${specTaskId ?? task.id}]`;
|
|
312
|
+
await execaCommand(`git commit -m "${commitMsg}" --allow-empty`, {
|
|
313
|
+
shell: true, cwd: worktreePath, timeout: 15000,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
// Nothing to commit
|
|
318
|
+
}
|
|
319
|
+
// Merge worktree branch back to main
|
|
320
|
+
try {
|
|
321
|
+
const mainBranch = await getMainBranch(cwd);
|
|
322
|
+
await execaCommand(`git checkout ${mainBranch}`, { shell: true, cwd, timeout: 10000 });
|
|
323
|
+
await execaCommand(`git merge "${branchName}" --no-edit`, { shell: true, cwd, timeout: 30000 });
|
|
324
|
+
report.status = 'success';
|
|
325
|
+
}
|
|
326
|
+
catch (mergeErr) {
|
|
327
|
+
// Merge conflict — abort and preserve branch for manual resolution
|
|
328
|
+
try {
|
|
329
|
+
await execaCommand('git merge --abort', { shell: true, cwd, timeout: 10000 });
|
|
330
|
+
}
|
|
331
|
+
catch { /* ignore */ }
|
|
332
|
+
report.status = 'merge_conflict';
|
|
333
|
+
report.blockers.push(`Merge conflict on branch ${branchName}`);
|
|
334
|
+
report.errors.push(String(mergeErr));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
try {
|
|
339
|
+
await unlink(tmpFile);
|
|
340
|
+
}
|
|
341
|
+
catch { /* ignore */ }
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
catch (err) {
|
|
345
|
+
report.errors.push(String(err));
|
|
346
|
+
report.summary = `Worktree setup or execution failed: ${err}`;
|
|
347
|
+
}
|
|
348
|
+
finally {
|
|
349
|
+
// Clean up worktree (but keep the branch if merge failed)
|
|
350
|
+
try {
|
|
351
|
+
await execaCommand(`git worktree remove "${worktreePath}" --force`, {
|
|
352
|
+
shell: true, cwd, timeout: 15000,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
catch { /* ignore */ }
|
|
356
|
+
// Delete branch only on success
|
|
357
|
+
if (report.status === 'success') {
|
|
358
|
+
try {
|
|
359
|
+
await execaCommand(`git branch -D "${branchName}"`, {
|
|
360
|
+
shell: true, cwd, timeout: 10000,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
catch { /* ignore */ }
|
|
364
|
+
}
|
|
365
|
+
const finishedAt = new Date();
|
|
366
|
+
report.finished_at = finishedAt.toISOString();
|
|
367
|
+
report.elapsed_ms = finishedAt.getTime() - startedAt.getTime();
|
|
368
|
+
}
|
|
369
|
+
return report;
|
|
370
|
+
}
|
|
371
|
+
function buildTaskPrompt(task, specId, filesStr, tier, agent, specTaskId, reportPath) {
|
|
372
|
+
return `/deliver "${task.title} — ${task.description ?? ''}.${filesStr} Risk: ${tier}. Agent: ${agent}. Spec ref: ${specTaskId ?? task.id}"
|
|
373
|
+
|
|
374
|
+
IMPORTANT: Before you finish, write a JSON report to "${reportPath}" with this structure:
|
|
375
|
+
{
|
|
376
|
+
"summary": "1-2 sentence summary of what you accomplished",
|
|
377
|
+
"blockers": ["list of things that blocked progress or required workarounds"],
|
|
378
|
+
"errors": ["list of errors encountered during execution"],
|
|
379
|
+
"decisions": ["key decisions you made and why"],
|
|
380
|
+
"suggestions": ["improvements for future similar tasks"]
|
|
381
|
+
}
|
|
382
|
+
If everything went smoothly, blockers and errors should be empty arrays. Always write this file before finishing.`;
|
|
383
|
+
}
|
|
384
|
+
// ─── Reporting ────────────────────────────────────────────────────
|
|
385
|
+
function showPhaseRetro(phaseReport) {
|
|
386
|
+
const failedTasks = phaseReport.tasks.filter(t => t.status !== 'success');
|
|
387
|
+
const blockers = phaseReport.tasks.flatMap(t => t.blockers).filter(Boolean);
|
|
388
|
+
if (failedTasks.length === 0 && blockers.length === 0) {
|
|
389
|
+
p.log.info(chalk.dim(' No issues in this phase.'));
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (failedTasks.length > 0) {
|
|
393
|
+
p.log.warn(` ${chalk.yellow(`${failedTasks.length} failed tasks:`)}`);
|
|
394
|
+
for (const t of failedTasks) {
|
|
395
|
+
p.log.message(` ${chalk.red('✗')} ${t.title}: ${t.errors[0] ?? t.status}`);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (blockers.length > 0) {
|
|
399
|
+
const unique = [...new Set(blockers)];
|
|
400
|
+
p.log.warn(` ${chalk.yellow(`${unique.length} blockers identified:`)}`);
|
|
401
|
+
for (const b of unique) {
|
|
402
|
+
p.log.message(` ${chalk.dim('•')} ${b}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
async function writePhaseReport(reportsDir, phaseReport) {
|
|
407
|
+
const filename = `${phaseReport.phase.replace(':', '-')}.json`;
|
|
408
|
+
await writeText(join(reportsDir, filename), JSON.stringify(phaseReport, null, 2));
|
|
409
|
+
}
|
|
410
|
+
async function generateMudaAnalysis(reportsDir, allReports, phaseReports, totalElapsed) {
|
|
411
|
+
const totalTasks = allReports.length;
|
|
412
|
+
const successCount = allReports.filter(r => r.status === 'success').length;
|
|
413
|
+
const failCount = allReports.filter(r => r.status === 'failure').length;
|
|
414
|
+
const conflictCount = allReports.filter(r => r.status === 'merge_conflict').length;
|
|
415
|
+
// Collect all blockers and errors
|
|
416
|
+
const allBlockers = allReports.flatMap(r => r.blockers).filter(Boolean);
|
|
417
|
+
const allErrors = allReports.flatMap(r => r.errors).filter(Boolean);
|
|
418
|
+
const allSuggestions = allReports.flatMap(r => {
|
|
419
|
+
const meta = r;
|
|
420
|
+
return meta.suggestions ?? [];
|
|
421
|
+
}).filter(Boolean);
|
|
422
|
+
// Categorize waste
|
|
423
|
+
const blockerFreq = {};
|
|
424
|
+
for (const b of allBlockers) {
|
|
425
|
+
const normalized = b.slice(0, 80);
|
|
426
|
+
blockerFreq[normalized] = (blockerFreq[normalized] ?? 0) + 1;
|
|
427
|
+
}
|
|
428
|
+
const errorFreq = {};
|
|
429
|
+
for (const e of allErrors) {
|
|
430
|
+
const normalized = e.slice(0, 80);
|
|
431
|
+
errorFreq[normalized] = (errorFreq[normalized] ?? 0) + 1;
|
|
432
|
+
}
|
|
433
|
+
// Find slowest tasks
|
|
434
|
+
const sorted = [...allReports].sort((a, b) => b.elapsed_ms - a.elapsed_ms);
|
|
435
|
+
const slowest = sorted.slice(0, 5);
|
|
436
|
+
// Agent performance
|
|
437
|
+
const agentStats = {};
|
|
438
|
+
for (const r of allReports) {
|
|
439
|
+
if (!agentStats[r.agent])
|
|
440
|
+
agentStats[r.agent] = { success: 0, fail: 0, totalMs: 0 };
|
|
441
|
+
agentStats[r.agent].totalMs += r.elapsed_ms;
|
|
442
|
+
if (r.status === 'success')
|
|
443
|
+
agentStats[r.agent].success++;
|
|
444
|
+
else
|
|
445
|
+
agentStats[r.agent].fail++;
|
|
446
|
+
}
|
|
447
|
+
// Build markdown report
|
|
448
|
+
const lines = [
|
|
449
|
+
'# Muda Analysis — Waste & Blocker Report',
|
|
450
|
+
'',
|
|
451
|
+
`Generated: ${new Date().toISOString()}`,
|
|
452
|
+
`Total elapsed: ${totalElapsed}`,
|
|
453
|
+
'',
|
|
454
|
+
'## Summary',
|
|
455
|
+
'',
|
|
456
|
+
`| Metric | Count |`,
|
|
457
|
+
`|--------|-------|`,
|
|
458
|
+
`| Total tasks | ${totalTasks} |`,
|
|
459
|
+
`| Succeeded | ${successCount} |`,
|
|
460
|
+
`| Failed | ${failCount} |`,
|
|
461
|
+
`| Merge conflicts | ${conflictCount} |`,
|
|
462
|
+
`| Success rate | ${totalTasks > 0 ? Math.round((successCount / totalTasks) * 100) : 0}% |`,
|
|
463
|
+
'',
|
|
464
|
+
];
|
|
465
|
+
// Blockers section
|
|
466
|
+
if (Object.keys(blockerFreq).length > 0) {
|
|
467
|
+
lines.push('## Blockers (Muda — Waiting Waste)');
|
|
468
|
+
lines.push('');
|
|
469
|
+
lines.push('Recurring blockers indicate systemic issues that slow the pipeline.');
|
|
470
|
+
lines.push('');
|
|
471
|
+
const sortedBlockers = Object.entries(blockerFreq).sort((a, b) => b[1] - a[1]);
|
|
472
|
+
for (const [blocker, count] of sortedBlockers) {
|
|
473
|
+
lines.push(`- **${count}x** ${blocker}`);
|
|
474
|
+
}
|
|
475
|
+
lines.push('');
|
|
476
|
+
}
|
|
477
|
+
// Errors section
|
|
478
|
+
if (Object.keys(errorFreq).length > 0) {
|
|
479
|
+
lines.push('## Errors (Muda — Defect Waste)');
|
|
480
|
+
lines.push('');
|
|
481
|
+
lines.push('Recurring errors suggest missing prerequisites, bad assumptions, or spec gaps.');
|
|
482
|
+
lines.push('');
|
|
483
|
+
const sortedErrors = Object.entries(errorFreq).sort((a, b) => b[1] - a[1]);
|
|
484
|
+
for (const [error, count] of sortedErrors) {
|
|
485
|
+
lines.push(`- **${count}x** ${error}`);
|
|
486
|
+
}
|
|
487
|
+
lines.push('');
|
|
488
|
+
}
|
|
489
|
+
// Slowest tasks
|
|
490
|
+
if (slowest.length > 0) {
|
|
491
|
+
lines.push('## Slowest Tasks (Muda — Processing Waste)');
|
|
492
|
+
lines.push('');
|
|
493
|
+
lines.push('Tasks taking disproportionately long may need decomposition or better context.');
|
|
494
|
+
lines.push('');
|
|
495
|
+
for (const t of slowest) {
|
|
496
|
+
lines.push(`- **${formatElapsed(t.elapsed_ms)}** ${t.title} (${t.tier}, ${t.agent})`);
|
|
497
|
+
}
|
|
498
|
+
lines.push('');
|
|
499
|
+
}
|
|
500
|
+
// Agent performance
|
|
501
|
+
if (Object.keys(agentStats).length > 0) {
|
|
502
|
+
lines.push('## Agent Performance');
|
|
503
|
+
lines.push('');
|
|
504
|
+
lines.push('| Agent | Success | Failed | Avg Time |');
|
|
505
|
+
lines.push('|-------|---------|--------|----------|');
|
|
506
|
+
for (const [agent, stats] of Object.entries(agentStats)) {
|
|
507
|
+
const total = stats.success + stats.fail;
|
|
508
|
+
const avg = total > 0 ? formatElapsed(Math.round(stats.totalMs / total)) : '-';
|
|
509
|
+
lines.push(`| ${agent} | ${stats.success} | ${stats.fail} | ${avg} |`);
|
|
510
|
+
}
|
|
511
|
+
lines.push('');
|
|
512
|
+
}
|
|
513
|
+
// Merge conflicts
|
|
514
|
+
const conflicts = allReports.filter(r => r.status === 'merge_conflict');
|
|
515
|
+
if (conflicts.length > 0) {
|
|
516
|
+
lines.push('## Merge Conflicts (Muda — Motion Waste)');
|
|
517
|
+
lines.push('');
|
|
518
|
+
lines.push('Conflicts indicate tasks touching overlapping files. Consider:');
|
|
519
|
+
lines.push('- Reducing concurrency for tightly coupled epics');
|
|
520
|
+
lines.push('- Reordering tasks to serialize shared-file work');
|
|
521
|
+
lines.push('');
|
|
522
|
+
for (const c of conflicts) {
|
|
523
|
+
lines.push(`- **${c.title}** — branch \`${c.worktree_branch}\` preserved for manual merge`);
|
|
524
|
+
}
|
|
525
|
+
lines.push('');
|
|
526
|
+
}
|
|
527
|
+
// Suggestions from agents
|
|
528
|
+
const uniqueSuggestions = [...new Set(allSuggestions)];
|
|
529
|
+
if (uniqueSuggestions.length > 0) {
|
|
530
|
+
lines.push('## Agent Suggestions (Kaizen — Continuous Improvement)');
|
|
531
|
+
lines.push('');
|
|
532
|
+
for (const s of uniqueSuggestions) {
|
|
533
|
+
lines.push(`- ${s}`);
|
|
534
|
+
}
|
|
535
|
+
lines.push('');
|
|
536
|
+
}
|
|
537
|
+
// Phase breakdown
|
|
538
|
+
if (phaseReports.length > 0) {
|
|
539
|
+
lines.push('## Phase Breakdown');
|
|
540
|
+
lines.push('');
|
|
541
|
+
for (const pr of phaseReports) {
|
|
542
|
+
const phaseElapsed = pr.finished_at && pr.started_at
|
|
543
|
+
? formatElapsed(new Date(pr.finished_at).getTime() - new Date(pr.started_at).getTime())
|
|
544
|
+
: '?';
|
|
545
|
+
lines.push(`### ${pr.phase} (${phaseElapsed})`);
|
|
546
|
+
lines.push('');
|
|
547
|
+
lines.push(`- ${pr.success_count} succeeded, ${pr.failure_count} failed`);
|
|
548
|
+
const phaseBlockers = pr.tasks.flatMap(t => t.blockers).filter(Boolean);
|
|
549
|
+
if (phaseBlockers.length > 0) {
|
|
550
|
+
lines.push(`- Blockers: ${[...new Set(phaseBlockers)].join('; ')}`);
|
|
551
|
+
}
|
|
552
|
+
lines.push('');
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
await writeText(join(reportsDir, 'muda-analysis.md'), lines.join('\n'));
|
|
556
|
+
}
|
|
557
|
+
// ─── Utilities ────────────────────────────────────────────────────
|
|
558
|
+
async function showDryRun(specId, cwd) {
|
|
559
|
+
const ready = await bdReady([`spec:${specId}`], cwd);
|
|
560
|
+
if (ready.length === 0) {
|
|
561
|
+
p.log.info('No ready tasks found.');
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
p.log.step(`${ready.length} tasks ready to execute:`);
|
|
565
|
+
for (const task of ready) {
|
|
566
|
+
const tier = task.labels?.find(l => l.startsWith('tier:'))?.replace('tier:', '') ?? '?';
|
|
567
|
+
const phase = task.labels?.find(l => l.startsWith('phase:'))?.replace('phase:', '') ?? '?';
|
|
568
|
+
p.log.message(` ${chalk.dim(`P${phase}`)} ${chalk.cyan(tier)} ${task.title}`);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
async function getMainBranch(cwd) {
|
|
572
|
+
try {
|
|
573
|
+
const result = await execaCommand('git symbolic-ref refs/remotes/origin/HEAD', {
|
|
574
|
+
shell: true, cwd, timeout: 5000,
|
|
575
|
+
});
|
|
576
|
+
return result.stdout.trim().replace('refs/remotes/origin/', '');
|
|
577
|
+
}
|
|
578
|
+
catch {
|
|
579
|
+
// Fallback: check if main or master exists
|
|
580
|
+
try {
|
|
581
|
+
await execaCommand('git rev-parse --verify main', { shell: true, cwd, timeout: 5000 });
|
|
582
|
+
return 'main';
|
|
583
|
+
}
|
|
584
|
+
catch {
|
|
585
|
+
return 'master';
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function formatElapsed(ms) {
|
|
590
|
+
const secs = Math.floor(ms / 1000);
|
|
591
|
+
if (secs < 60)
|
|
592
|
+
return `${secs}s`;
|
|
593
|
+
const mins = Math.floor(secs / 60);
|
|
594
|
+
const remSecs = secs % 60;
|
|
595
|
+
if (mins < 60)
|
|
596
|
+
return `${mins}m ${remSecs}s`;
|
|
597
|
+
const hrs = Math.floor(mins / 60);
|
|
598
|
+
const remMins = mins % 60;
|
|
599
|
+
return `${hrs}h ${remMins}m`;
|
|
600
|
+
}
|
|
601
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAY,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAgB,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAqC/D,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,MAAc,EAAE,OAAmB;IAC5D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,C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+
import { join } from 'node:path';
|
|
4
|
+
import { exists } from '../utils/fs.js';
|
|
5
|
+
import { seedBeads } from '../utils/seed-beads.js';
|
|
6
|
+
import { bdCount } from '../utils/bd.js';
|
|
7
|
+
export async function seed(specId, options) {
|
|
8
|
+
const cwd = process.cwd();
|
|
9
|
+
p.intro(chalk.bold('forge seed') + chalk.dim(` — ${specId}`));
|
|
10
|
+
const specDir = join(cwd, '.forge', 'specs', specId);
|
|
11
|
+
// Verify spec.yaml exists
|
|
12
|
+
const specYamlPath = join(specDir, 'spec.yaml');
|
|
13
|
+
if (!(await exists(specYamlPath))) {
|
|
14
|
+
p.cancel(`No spec.yaml found at ${specYamlPath}. Run /ingest ${specId} first.`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
// Check if beads already exist for this spec
|
|
18
|
+
try {
|
|
19
|
+
const existingCount = await bdCount({ labels: [`spec:${specId}`] }, cwd);
|
|
20
|
+
if (existingCount > 0 && !options.force) {
|
|
21
|
+
const overwrite = await p.confirm({
|
|
22
|
+
message: `${existingCount} beads already exist for ${specId}. Re-create?`,
|
|
23
|
+
initialValue: false,
|
|
24
|
+
});
|
|
25
|
+
if (p.isCancel(overwrite) || !overwrite) {
|
|
26
|
+
p.cancel('Seed cancelled.');
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// bd not initialized or count failed — proceed
|
|
33
|
+
}
|
|
34
|
+
const spinner = p.spinner();
|
|
35
|
+
spinner.start('Creating beads from spec.yaml...');
|
|
36
|
+
try {
|
|
37
|
+
const result = await seedBeads(specDir, specId, cwd);
|
|
38
|
+
spinner.stop('Beads created');
|
|
39
|
+
const lines = [
|
|
40
|
+
`Phases: ${chalk.cyan(String(result.phases))} epics`,
|
|
41
|
+
`Epics: ${chalk.cyan(String(result.epics))} epics`,
|
|
42
|
+
`Tasks: ${chalk.cyan(String(result.tasks))} tasks`,
|
|
43
|
+
`Deps: ${chalk.cyan(String(result.links))} blocking links`,
|
|
44
|
+
];
|
|
45
|
+
p.note(lines.join('\n'), 'Beads seeded');
|
|
46
|
+
p.log.step('Next:');
|
|
47
|
+
p.log.message(` Run ${chalk.cyan(`forge run ${specId}`)} to start auto-pilot execution`);
|
|
48
|
+
p.log.message(` Or ${chalk.cyan('bd ready')} to see what tasks are available`);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
spinner.stop('Seeding failed');
|
|
52
|
+
p.log.error(String(err));
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
p.outro(chalk.green('Ready to execute.'));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/commands/seed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAMzC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAc,EAAE,OAAoB;IAC9D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAErD,0BAA0B;IAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,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ACrD,YAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ;YACpD,YAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ;YACpD,YAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,iBAAiB;SAC7D,CAAC;QACF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;QAEzC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,aAAa,MAAM,EAAE,CAAC,gCAAgC,CAAC,CAAC;QAC1F,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IACjF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import { remove } from './commands/remove.js';
|
|
|
6
6
|
import { upgrade } from './commands/upgrade.js';
|
|
7
7
|
import { status } from './commands/status.js';
|
|
8
8
|
import { doctor } from './commands/doctor.js';
|
|
9
|
+
import { seed } from './commands/seed.js';
|
|
10
|
+
import { run } from './commands/run.js';
|
|
9
11
|
const program = new Command();
|
|
10
12
|
program
|
|
11
13
|
.name('forge')
|
|
@@ -47,5 +49,19 @@ program
|
|
|
47
49
|
.command('doctor')
|
|
48
50
|
.description('Diagnose harness health: check files, scripts, deps, and config')
|
|
49
51
|
.action(doctor);
|
|
52
|
+
program
|
|
53
|
+
.command('seed <spec-id>')
|
|
54
|
+
.description('Create beads (bd tasks) from an approved spec.yaml decomposition')
|
|
55
|
+
.option('--force', 'Re-create beads even if they already exist')
|
|
56
|
+
.action(seed);
|
|
57
|
+
program
|
|
58
|
+
.command('run <spec-id>')
|
|
59
|
+
.description('Auto-pilot: orchestrate task execution from a seeded spec')
|
|
60
|
+
.option('--dry-run', 'Show execution plan without running')
|
|
61
|
+
.option('--phase <number>', 'Only execute tasks in a specific phase')
|
|
62
|
+
.option('--concurrency <number>', 'Max parallel tasks', '1')
|
|
63
|
+
.option('--budget <usd>', 'Max USD spend per task via claude -p')
|
|
64
|
+
.option('--no-review', 'Skip review gates between phases')
|
|
65
|
+
.action(run);
|
|
50
66
|
program.parse();
|
|
51
67
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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;
|
|
4
|
+
description: string;
|
|
5
|
+
status: string;
|
|
6
|
+
labels: string[];
|
|
7
|
+
priority: number;
|
|
8
|
+
parent?: string;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface BdCreateOpts {
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
labels?: string[];
|
|
16
|
+
parent?: string;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
deps?: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare function bdCreate(opts: BdCreateOpts, cwd?: string): Promise<string>;
|
|
21
|
+
export declare function bdLink(from: string, to: string, type?: string, cwd?: string): Promise<void>;
|
|
22
|
+
export declare function bdReady(labels?: string[], cwd?: string): Promise<BdIssue[]>;
|
|
23
|
+
export declare function bdClose(id: string, cwd?: string): Promise<void>;
|
|
24
|
+
export declare function bdUpdate(id: string, opts: {
|
|
25
|
+
assignee?: string;
|
|
26
|
+
labels?: string[];
|
|
27
|
+
status?: string;
|
|
28
|
+
}, cwd?: string): Promise<void>;
|
|
29
|
+
export declare function bdList(filters: {
|
|
30
|
+
labels?: string[];
|
|
31
|
+
type?: string;
|
|
32
|
+
status?: string;
|
|
33
|
+
}, cwd?: string): Promise<BdIssue[]>;
|
|
34
|
+
export declare function bdShow(id: string, cwd?: string): Promise<BdIssue>;
|
|
35
|
+
export declare function bdCount(filters: {
|
|
36
|
+
labels?: string[];
|
|
37
|
+
}, cwd?: string): Promise<number>;
|
package/dist/utils/bd.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { execaCommand } from 'execa';
|
|
2
|
+
export async function bdCreate(opts, cwd) {
|
|
3
|
+
const args = ['bd', 'create', JSON.stringify(opts.title)];
|
|
4
|
+
if (opts.description)
|
|
5
|
+
args.push('-d', JSON.stringify(opts.description));
|
|
6
|
+
if (opts.type)
|
|
7
|
+
args.push('-t', opts.type);
|
|
8
|
+
if (opts.labels?.length)
|
|
9
|
+
args.push('-l', opts.labels.join(','));
|
|
10
|
+
if (opts.parent)
|
|
11
|
+
args.push('--parent', opts.parent);
|
|
12
|
+
if (opts.metadata)
|
|
13
|
+
args.push('--metadata', JSON.stringify(JSON.stringify(opts.metadata)));
|
|
14
|
+
if (opts.deps?.length)
|
|
15
|
+
args.push('--deps', opts.deps.join(','));
|
|
16
|
+
args.push('--json');
|
|
17
|
+
const result = await execaCommand(args.join(' '), { shell: true, cwd, timeout: 15000 });
|
|
18
|
+
const parsed = JSON.parse(result.stdout);
|
|
19
|
+
return parsed.id ?? parsed.ID ?? parsed.issue_id ?? result.stdout.trim();
|
|
20
|
+
}
|
|
21
|
+
export async function bdLink(from, to, type = 'blocks', cwd) {
|
|
22
|
+
await execaCommand(`bd link ${from} ${to} --type ${type}`, { shell: true, cwd, timeout: 10000 });
|
|
23
|
+
}
|
|
24
|
+
export async function bdReady(labels, cwd) {
|
|
25
|
+
const args = ['bd', 'ready', '--json', '-n', '100'];
|
|
26
|
+
if (labels?.length)
|
|
27
|
+
args.push('-l', labels.join(','));
|
|
28
|
+
const result = await execaCommand(args.join(' '), { shell: true, cwd, timeout: 10000 });
|
|
29
|
+
if (!result.stdout.trim())
|
|
30
|
+
return [];
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(result.stdout);
|
|
33
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export async function bdClose(id, cwd) {
|
|
40
|
+
await execaCommand(`bd close ${id}`, { shell: true, cwd, timeout: 10000 });
|
|
41
|
+
}
|
|
42
|
+
export async function bdUpdate(id, opts, cwd) {
|
|
43
|
+
const args = ['bd', 'update', id];
|
|
44
|
+
if (opts.assignee)
|
|
45
|
+
args.push('-a', opts.assignee);
|
|
46
|
+
if (opts.status)
|
|
47
|
+
args.push('-s', opts.status);
|
|
48
|
+
args.push('--json');
|
|
49
|
+
await execaCommand(args.join(' '), { shell: true, cwd, timeout: 10000 });
|
|
50
|
+
}
|
|
51
|
+
export async function bdList(filters, cwd) {
|
|
52
|
+
const args = ['bd', 'list', '--json'];
|
|
53
|
+
if (filters.labels?.length)
|
|
54
|
+
args.push('-l', filters.labels.join(','));
|
|
55
|
+
if (filters.type)
|
|
56
|
+
args.push('-t', filters.type);
|
|
57
|
+
if (filters.status)
|
|
58
|
+
args.push('-s', filters.status);
|
|
59
|
+
const result = await execaCommand(args.join(' '), { shell: true, cwd, timeout: 10000 });
|
|
60
|
+
if (!result.stdout.trim())
|
|
61
|
+
return [];
|
|
62
|
+
try {
|
|
63
|
+
const parsed = JSON.parse(result.stdout);
|
|
64
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export async function bdShow(id, cwd) {
|
|
71
|
+
const result = await execaCommand(`bd show ${id} --json`, { shell: true, cwd, timeout: 10000 });
|
|
72
|
+
return JSON.parse(result.stdout);
|
|
73
|
+
}
|
|
74
|
+
export async function bdCount(filters, cwd) {
|
|
75
|
+
const args = ['bd', 'count'];
|
|
76
|
+
if (filters.labels?.length)
|
|
77
|
+
args.push('-l', filters.labels.join(','));
|
|
78
|
+
const result = await execaCommand(args.join(' '), { shell: true, cwd, timeout: 10000 });
|
|
79
|
+
return parseInt(result.stdout.trim(), 10) || 0;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=bd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bd.js","sourceRoot":"","sources":["../../src/utils/bd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAuBrC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAkB,EAAE,GAAY;IAC9D,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,QAAQ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CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { readText } from './fs.js';
|
|
3
|
+
import { bdCreate, bdLink } from './bd.js';
|
|
4
|
+
export async function seedBeads(specDir, specId, cwd) {
|
|
5
|
+
const { parse } = await import('yaml');
|
|
6
|
+
const specContent = await readText(join(specDir, 'spec.yaml'));
|
|
7
|
+
const spec = parse(specContent);
|
|
8
|
+
const taskMap = {}; // spec task id -> bd id
|
|
9
|
+
const epicMap = {}; // spec epic id -> bd id
|
|
10
|
+
const phaseEpicIds = []; // bd ids for phase-level epics
|
|
11
|
+
let linkCount = 0;
|
|
12
|
+
const effectiveCwd = cwd ?? process.cwd();
|
|
13
|
+
// Create phase epics and their child epics + tasks
|
|
14
|
+
for (let pi = 0; pi < spec.execution_plan.phases.length; pi++) {
|
|
15
|
+
const phase = spec.execution_plan.phases[pi];
|
|
16
|
+
const phaseNum = pi + 1;
|
|
17
|
+
// Create phase-level epic
|
|
18
|
+
const phaseBeadId = await bdCreate({
|
|
19
|
+
title: `Phase ${phaseNum}: ${phase.name}`,
|
|
20
|
+
type: 'epic',
|
|
21
|
+
labels: [`spec:${specId}`, `phase:${phaseNum}`],
|
|
22
|
+
metadata: { spec_phase_id: phase.id, rationale: phase.rationale },
|
|
23
|
+
}, effectiveCwd);
|
|
24
|
+
phaseEpicIds.push(phaseBeadId);
|
|
25
|
+
// Phase ordering: phase N+1 is blocked by phase N
|
|
26
|
+
if (pi > 0) {
|
|
27
|
+
await bdLink(phaseBeadId, phaseEpicIds[pi - 1], 'blocks', effectiveCwd);
|
|
28
|
+
linkCount++;
|
|
29
|
+
}
|
|
30
|
+
// Create epics within this phase
|
|
31
|
+
for (const epicId of phase.epics) {
|
|
32
|
+
const epic = spec.epics.find(e => e.id === epicId);
|
|
33
|
+
if (!epic)
|
|
34
|
+
continue;
|
|
35
|
+
const epicBeadId = await bdCreate({
|
|
36
|
+
title: epic.title,
|
|
37
|
+
type: 'epic',
|
|
38
|
+
parent: phaseBeadId,
|
|
39
|
+
labels: [`spec:${specId}`, `phase:${phaseNum}`, `domain:${epic.domain}`],
|
|
40
|
+
}, effectiveCwd);
|
|
41
|
+
epicMap[epic.id] = epicBeadId;
|
|
42
|
+
// Create tasks for each feature in this epic
|
|
43
|
+
for (const feature of epic.features) {
|
|
44
|
+
for (const task of feature.tasks) {
|
|
45
|
+
const taskBeadId = await bdCreate({
|
|
46
|
+
title: task.title,
|
|
47
|
+
description: task.description,
|
|
48
|
+
parent: epicBeadId,
|
|
49
|
+
labels: [
|
|
50
|
+
`spec:${specId}`,
|
|
51
|
+
`phase:${phaseNum}`,
|
|
52
|
+
`tier:${task.risk_tier}`,
|
|
53
|
+
`agent:${task.agent}`,
|
|
54
|
+
`feature:${feature.id}`,
|
|
55
|
+
],
|
|
56
|
+
metadata: {
|
|
57
|
+
spec_task_id: task.id,
|
|
58
|
+
files_likely: task.files_likely,
|
|
59
|
+
},
|
|
60
|
+
}, effectiveCwd);
|
|
61
|
+
taskMap[task.id] = taskBeadId;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Wire up task-level dependencies
|
|
67
|
+
for (const epic of spec.epics) {
|
|
68
|
+
for (const feature of epic.features) {
|
|
69
|
+
for (const task of feature.tasks) {
|
|
70
|
+
if (!task.dependencies?.length)
|
|
71
|
+
continue;
|
|
72
|
+
const thisBeadId = taskMap[task.id];
|
|
73
|
+
if (!thisBeadId)
|
|
74
|
+
continue;
|
|
75
|
+
for (const depId of task.dependencies) {
|
|
76
|
+
const depBeadId = taskMap[depId];
|
|
77
|
+
if (!depBeadId)
|
|
78
|
+
continue;
|
|
79
|
+
await bdLink(thisBeadId, depBeadId, 'blocks', effectiveCwd);
|
|
80
|
+
linkCount++;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
phases: spec.execution_plan.phases.length,
|
|
87
|
+
epics: Object.keys(epicMap).length,
|
|
88
|
+
tasks: Object.keys(taskMap).length,
|
|
89
|
+
links: linkCount,
|
|
90
|
+
taskMap,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=seed-beads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-beads.js","sourceRoot":"","sources":["../../src/utils/seed-beads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAoD3C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,MAAc,EAAE,GAAY;IAC5E,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAa,KAAK,CAAC,WAAW,CAAC,CAAC;IAE1C,MAAM,OAAO,GAA2B,EAAE,CAAC,CAAE,wBAAwB;IACrE,MAAM,OAAO,GAA2B,EAAE,CAAC,CAAE,wBAAwB;IACrE,MAAM,YAAY,GAAa,EAAE,CAAC,CAAW,+BAA+B;IAC5E,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,MAAM,YAAY,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1C,mDAAmD;IACnD,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7C,M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AM,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;oBAC5D,SAAS,EAAE,CAAC;gBACb,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO;QACN,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM;QACzC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QAClC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QAClC,KAAK,EAAE,SAAS;QAChB,OAAO;KACP,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -201,36 +201,45 @@ After approval, for each skill identified in pass-4:
|
|
|
201
201
|
|
|
202
202
|
Use the `/skill-creator` skill's patterns for writing good skill files.
|
|
203
203
|
|
|
204
|
-
### Step 7:
|
|
204
|
+
### Step 7: Seed Beads
|
|
205
205
|
|
|
206
|
-
After skills are generated,
|
|
206
|
+
After skills are generated, create beads for all tasks in the plan:
|
|
207
|
+
|
|
208
|
+
1. Run: `forge seed <spec-id>`
|
|
209
|
+
2. This creates bd issues for every phase, epic, and task in spec.yaml
|
|
210
|
+
3. Dependencies are wired so `bd ready` returns only unblocked tasks
|
|
211
|
+
4. Report the counts to the user
|
|
212
|
+
|
|
213
|
+
### Step 8: Execution Handoff
|
|
214
|
+
|
|
215
|
+
After beads are seeded, present the execution plan:
|
|
207
216
|
|
|
208
217
|
```
|
|
209
218
|
Ready to execute. How would you like to proceed?
|
|
210
219
|
|
|
211
|
-
1.
|
|
212
|
-
2.
|
|
213
|
-
3. Manual — I'll run /deliver for individual tasks myself
|
|
220
|
+
1. Auto-pilot (recommended) — run `forge run <spec-id>` to execute all tasks automatically
|
|
221
|
+
2. Phase-by-phase — run `forge run <spec-id> --phase 1` one phase at a time
|
|
222
|
+
3. Manual — I'll run /deliver for individual tasks myself, using `bd ready` to pick the next one
|
|
214
223
|
```
|
|
215
224
|
|
|
216
|
-
**
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
225
|
+
**Auto-pilot mode** (recommended):
|
|
226
|
+
- User exits Claude Code and runs `forge run <spec-id>` in the terminal
|
|
227
|
+
- The orchestrator picks ready tasks via `bd ready`, invokes `claude -p` with `/deliver` for each
|
|
228
|
+
- Pauses between phases for review (use `--no-review` to skip)
|
|
229
|
+
- Each task runs in an isolated `claude -p` session to avoid context overflow
|
|
221
230
|
|
|
222
|
-
**
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
231
|
+
**Manual mode**:
|
|
232
|
+
- User runs `bd ready -l "spec:<spec-id>"` to see available tasks
|
|
233
|
+
- Picks a task and runs `/deliver` with its description
|
|
234
|
+
- Closes the bead with `bd close <id>` when done
|
|
226
235
|
|
|
227
236
|
### Resuming
|
|
228
237
|
|
|
229
238
|
If the session is interrupted, the user can run `/ingest <spec-id>` again. Check `spec.yaml` status:
|
|
230
239
|
- `pending-analysis`: start from pass 1
|
|
231
240
|
- `draft`: show the review gate
|
|
232
|
-
- `approved`: resume skill generation or execution
|
|
233
|
-
- `in-progress`:
|
|
241
|
+
- `approved`: resume skill generation, seeding, or execution
|
|
242
|
+
- `in-progress`: run `forge run <spec-id>` to resume — it picks up where it left off via `bd ready`
|
|
234
243
|
|
|
235
244
|
## Output Protocol
|
|
236
245
|
|