copperhead 0.6.0 → 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.
Files changed (58) hide show
  1. package/dist/agent/loop.js +118 -16
  2. package/dist/agent/loop.js.map +1 -1
  3. package/dist/agent/prompts.js +2 -1
  4. package/dist/agent/prompts.js.map +1 -1
  5. package/dist/agent/providers/claude-code.js +207 -27
  6. package/dist/agent/providers/claude-code.js.map +1 -1
  7. package/dist/agent/recovery.js +148 -0
  8. package/dist/agent/recovery.js.map +1 -0
  9. package/dist/agent/render.js +17 -2
  10. package/dist/agent/render.js.map +1 -1
  11. package/dist/agent/response-cache.js +81 -0
  12. package/dist/agent/response-cache.js.map +1 -0
  13. package/dist/agent/tools.js +61 -4
  14. package/dist/agent/tools.js.map +1 -1
  15. package/dist/agent/transcript.js.map +1 -1
  16. package/dist/commands/create.js +470 -35
  17. package/dist/commands/create.js.map +1 -1
  18. package/dist/config.js +19 -0
  19. package/dist/config.js.map +1 -1
  20. package/dist/kicad/bootstrap.js +166 -0
  21. package/dist/kicad/bootstrap.js.map +1 -0
  22. package/dist/kicad/spice.js +306 -0
  23. package/dist/kicad/spice.js.map +1 -0
  24. package/dist/kicad/symlib.js +228 -0
  25. package/dist/kicad/symlib.js.map +1 -0
  26. package/dist/memory/bom-table.js +193 -22
  27. package/dist/memory/bom-table.js.map +1 -1
  28. package/dist/memory/drift.js +33 -11
  29. package/dist/memory/drift.js.map +1 -1
  30. package/dist/util/git.js +37 -1
  31. package/dist/util/git.js.map +1 -1
  32. package/dist/util/preflight.js +37 -0
  33. package/dist/util/preflight.js.map +1 -1
  34. package/dist/util/retry.js +23 -0
  35. package/dist/util/retry.js.map +1 -1
  36. package/dist/util/tmp.js +119 -0
  37. package/dist/util/tmp.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/agent/loop.ts +136 -16
  40. package/src/agent/prompts.ts +2 -1
  41. package/src/agent/providers/claude-code.ts +207 -24
  42. package/src/agent/recovery.ts +162 -0
  43. package/src/agent/render.ts +28 -1
  44. package/src/agent/response-cache.ts +80 -0
  45. package/src/agent/tools.ts +62 -4
  46. package/src/agent/transcript.ts +1 -0
  47. package/src/agent/types.ts +17 -0
  48. package/src/commands/create.ts +528 -38
  49. package/src/config.ts +34 -0
  50. package/src/kicad/bootstrap.ts +181 -0
  51. package/src/kicad/spice.ts +399 -0
  52. package/src/kicad/symlib.ts +248 -0
  53. package/src/memory/bom-table.ts +191 -20
  54. package/src/memory/drift.ts +42 -11
  55. package/src/util/git.ts +37 -1
  56. package/src/util/preflight.ts +44 -0
  57. package/src/util/retry.ts +29 -0
  58. package/src/util/tmp.ts +113 -0
@@ -1,12 +1,19 @@
1
1
  import path from 'node:path';
2
2
  import { existsSync } from 'node:fs';
3
- import { readFile } from 'node:fs/promises';
3
+ import { readFile, mkdir, writeFile } from 'node:fs/promises';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { loadConfig } from '../config.js';
6
+ import { bootstrapKicadProject } from '../kicad/bootstrap.js';
7
+ import { exportSvg, runErc } from '../kicad/cli.js';
6
8
  import { listSymbols } from '../kicad/sexp.js';
9
+ import { isDirty, commitAll, changedFiles } from '../util/git.js';
7
10
  import { checkDrift } from '../memory/drift.js';
8
- import { runAgentLoop } from '../agent/loop.js';
11
+ import { runAgentLoop, makeProvider } from '../agent/loop.js';
12
+ import { diagnoseStageFailure, transcriptExcerpt, withTimeout } from '../agent/recovery.js';
13
+ import { fmtDuration, fmtTokens } from '../agent/render.js';
9
14
  import { openspecInit } from '../openspec/cli.js';
15
+ import { sweepStaleTempDirs, pruneHistoryDir } from '../util/tmp.js';
16
+ import { assertDiskSpace, DEFAULT_MIN_FREE_BYTES } from '../util/preflight.js';
10
17
  import { runCheck } from './check.js';
11
18
  import { emitCreateJlcpcbBom } from './export.js';
12
19
  const docExists = (repoRoot, rel) => existsSync(path.join(repoRoot, rel));
@@ -16,10 +23,22 @@ async function docHasContent(repoRoot, rel, marker) {
16
23
  return false;
17
24
  return (await readFile(p, 'utf8')).includes(marker);
18
25
  }
26
+ // Heading-aware variant of docHasContent: matches any Markdown heading whose
27
+ // text contains `word`, ignoring heading level, leading numbering ("3."), and
28
+ // trailing decoration ("Budgets and constraints (...)"). Stage prompts don't
29
+ // dictate exact heading text, so a literal `.includes('## Budgets')` produces
30
+ // false negatives against valid docs titled e.g. "## 3. Budgets and constraints".
31
+ async function docHasHeading(repoRoot, rel, word) {
32
+ const p = path.join(repoRoot, rel);
33
+ if (!existsSync(p))
34
+ return false;
35
+ const re = new RegExp(`^#{1,6}\\s.*\\b${word}\\b`, 'im');
36
+ return re.test(await readFile(p, 'utf8'));
37
+ }
19
38
  export const STAGES = [
20
39
  {
21
40
  name: 'spec-seed',
22
- isComplete: (root, docs) => docHasContent(root, path.join(docs, 'SPEC.md'), '## Budgets'),
41
+ isComplete: (root, docs) => docHasHeading(root, path.join(docs, 'SPEC.md'), 'Budgets?'),
23
42
  prompt: (brief) => `Stage 1 of the create pipeline: seed the requirements. From the product brief below, write docs/SPEC.md (what the device is, top-level constraints and budgets). Every budget you state must also be recorded with record_constraint. Anything the brief does not state: propose a sensible default and flag it ASSUMED. If an openspec/ workspace exists, also seed openspec/specs/ with per-capability requirements using Given/When/Then scenarios.\n\nBrief:\n${brief}`,
24
43
  },
25
44
  {
@@ -50,9 +69,19 @@ export const STAGES = [
50
69
  // the stage active on the next resume so partial capture continues.
51
70
  if (!(await listSymbols(p)).length)
52
71
  return false;
53
- return (await checkDrift(root, config.docs, config.schematic)).length === 0;
72
+ if ((await checkDrift(root, config.docs, config.schematic)).length !== 0)
73
+ return false;
74
+ // ERC-clean is part of "done" (F2 / verification-gated-out on the resume
75
+ // path). Symbols + drift-clean can still hold on a schematic with
76
+ // unconnected pins — e.g. a run hard-killed mid-capture after BOM/PINOUT
77
+ // went clean but before ERC passed. Without this check, resume would treat
78
+ // it as complete and commitResumedStage would commit an ERC-failing
79
+ // schematic, advancing the pipeline against unverified work. Returning
80
+ // false here keeps the stage active so it re-runs, fixes ERC, and commits
81
+ // through the normal finish gate.
82
+ return (await runErc(p)).ok;
54
83
  },
55
- prompt: () => 'Stage 4: schematic. Build the schematic sheet by sheet from BOM.md and SUBSYSTEMS.md. After each sheet, run run_erc and fix violations before moving on. Same net names and refdes everywhere. Update PINOUT.md as you assign pins; check the strapping table first.',
84
+ prompt: () => 'Stage 4: schematic. An empty KiCad project has already been scaffolded and wired into .copperhead/config.json (an empty schematic and a blank board with a default outline). Populate the existing schematic with edit_file — write_file refuses KiCad files, so add lib_symbols, symbols, and connectivity by anchored edits into the file that already exists. Work ONE part at a time, not in large blocks: add a symbol (its lib_symbols entry if new, then its placement), run run_erc, fix any violation, then move to the next part — small incremental edits keep a geometry or grid slip local instead of forcing a full-block rewrite. When you add a lib_symbols entry, use the exact canonical KiCad lib_id (e.g. Device:R, Connector:USB_C_Receptacle_USB2.0_16P) and reproduce the real part\'s pins faithfully — never invent pin numbers, names, or electrical types. Once symbols are placed, run verify_symbols and reconcile every divergence it reports (a wrong lib_id or pin set passes ERC but is still wrong); if it flags a renamed symbol, adopt the real name it suggests. Build subsystem by subsystem from BOM.md and SUBSYSTEMS.md. Same net names and refdes everywhere. Two KiCad rules the pipeline has repeatedly tripped on: (1) a net label placed on a pin only NAMES the net — it is NOT an electrical connection unless a wire actually reaches the pin; ERC will report the pin unconnected until you draw the wire. (2) Place every symbol origin and every wire endpoint on the 1.27mm (50mil) grid; an off-grid pin silently fails to connect and costs turns to diagnose. Update PINOUT.md as you assign pins; check the strapping table first.',
56
85
  },
57
86
  {
58
87
  name: 'layout-draft',
@@ -102,60 +131,466 @@ async function emitJlcpcbAfterOutputs(stageName, opts) {
102
131
  if (out)
103
132
  opts.log(`stage outputs: emitted ${out} (JLCPCB assembly BOM)`);
104
133
  }
134
+ /** Stages whose output is a KiCad file worth rendering to an image (5.4). */
135
+ const KICAD_STAGES = new Set(['schematic', 'layout-draft', 'outputs']);
136
+ /** True for a path copperhead itself manages inside the pipeline. Used to decide
137
+ * whether a resumed stage's uncommitted work is safe to auto-commit (2.4): only
138
+ * when the ENTIRE dirty set is copperhead's, never sweeping up a user's own WIP. */
139
+ function isManagedPath(f, config) {
140
+ // config.docs defaults to `docs/` (trailing slash), so normalize before
141
+ // building the prefix — otherwise the check becomes `startsWith('docs//')` and
142
+ // every doc reads as foreign, making commitResumedStage never commit its own
143
+ // work (it always bails as "non-copperhead changes").
144
+ const docsDir = config.docs.replace(/\/+$/, '');
145
+ return (f === docsDir ||
146
+ f.startsWith(`${docsDir}/`) ||
147
+ f.startsWith('.copperhead/') ||
148
+ f.startsWith('openspec/') ||
149
+ f.startsWith('outputs/') ||
150
+ f.startsWith('firmware/') ||
151
+ f === '.gitignore' ||
152
+ /\.(kicad_sch|kicad_pcb|kicad_pro|kicad_prl)$/.test(f));
153
+ }
154
+ /**
155
+ * When resuming past an already-complete stage whose artifact is present but
156
+ * UNCOMMITTED (e.g. a prior invocation stopped on a session limit mid-pipeline),
157
+ * commit it now so a later stage's failure — whose rollback is `git reset --hard`
158
+ * + `git clean -fd` — cannot wipe the completed work from the tree (2.4, I13).
159
+ * Strictly gated: only when every dirty path is copperhead-managed, so a user's
160
+ * unrelated working changes are never swept into a copperhead commit; if any
161
+ * foreign path is dirty, leave the whole thing for the human and say so.
162
+ */
163
+ async function commitResumedStage(opts, config, stageName) {
164
+ if (!(await isDirty(opts.repoRoot)))
165
+ return;
166
+ const dirty = await changedFiles(opts.repoRoot, 'HEAD');
167
+ const foreign = dirty.filter((f) => !isManagedPath(f, config));
168
+ if (foreign.length) {
169
+ opts.log(`stage ${stageName}: already-complete work is uncommitted, but the tree also has non-copperhead changes ` +
170
+ `(${foreign.slice(0, 3).join(', ')}${foreign.length > 3 ? ', …' : ''}); leaving it uncommitted so nothing of yours is swept up`);
171
+ return;
172
+ }
173
+ try {
174
+ const sha = await commitAll(opts.repoRoot, `copperhead: resume — commit completed stage ${stageName}`);
175
+ opts.log(`stage ${stageName}: committed already-complete work ${sha.slice(0, 10)} so a later rollback cannot wipe it (2.4)`);
176
+ }
177
+ catch (err) {
178
+ opts.log(`stage ${stageName}: could not commit resumed work (${err.message})`);
179
+ }
180
+ }
181
+ /**
182
+ * After a KiCad-touching stage completes, render the current schematic and board
183
+ * to SVG in that stage's run dir (`.copperhead/runs/<id>/artifacts/`) (5.4).
184
+ * Every text/ERC/drift gate can be satisfied by a design that is visibly wrong or
185
+ * even empty, and nothing else in the run ever *looks* at the board; a per-stage
186
+ * render closes that gap cheaply and deterministically, with no extra tokens. It
187
+ * is the natural input for an optional later vision acceptance pass. Best-effort:
188
+ * a render failure is logged, never fatal — the design is already committed.
189
+ */
190
+ async function renderStageArtifacts(opts, stageName, transcriptDir) {
191
+ if (!KICAD_STAGES.has(stageName) || !transcriptDir)
192
+ return;
193
+ const config = await loadConfig(opts.repoRoot);
194
+ const targets = [];
195
+ if (config.schematic && existsSync(path.join(opts.repoRoot, config.schematic))) {
196
+ targets.push({ kind: 'sch', file: config.schematic });
197
+ }
198
+ if (config.board && existsSync(path.join(opts.repoRoot, config.board))) {
199
+ targets.push({ kind: 'pcb', file: config.board });
200
+ }
201
+ if (!targets.length)
202
+ return;
203
+ const artifactsDir = path.join(transcriptDir, 'artifacts');
204
+ await mkdir(artifactsDir, { recursive: true });
205
+ let rendered = 0;
206
+ for (const { kind, file } of targets) {
207
+ try {
208
+ await exportSvg(kind, path.join(opts.repoRoot, file), artifactsDir);
209
+ rendered++;
210
+ }
211
+ catch (err) {
212
+ opts.log(`stage ${stageName}: could not render ${kind} SVG (${err.message})`);
213
+ }
214
+ }
215
+ if (rendered) {
216
+ opts.log(`stage ${stageName}: rendered ${rendered} SVG artifact(s) into ${path.relative(opts.repoRoot, artifactsDir)}/`);
217
+ }
218
+ }
219
+ /**
220
+ * Ask the model, on a fresh tool-less turn, whether a failed stage should be
221
+ * retried and how. Wrapped in the watchdog timeout and hardened to fail safe:
222
+ * any error or hang resolves to "abort" so recovery never itself becomes the
223
+ * thing that hangs the pipeline.
224
+ */
225
+ async function diagnose(input) {
226
+ let provider;
227
+ try {
228
+ provider = await makeProvider(input.model);
229
+ const p = provider;
230
+ const excerpt = await transcriptExcerpt(input.transcriptDir);
231
+ return await withTimeout(() => diagnoseStageFailure(p, {
232
+ stageName: input.stageName,
233
+ stageGoal: input.stageGoal,
234
+ failure: input.failure,
235
+ excerpt,
236
+ attempt: input.attempt,
237
+ maxAttempts: input.maxAttempts,
238
+ }), input.timeoutMs, () => p.close?.());
239
+ }
240
+ catch (e) {
241
+ return { verdict: 'abort', reason: `diagnosis unavailable: ${e.message}` };
242
+ }
243
+ finally {
244
+ await provider?.close?.();
245
+ }
246
+ }
247
+ /** Quote a path/value for a copy-pasteable resume command (5.3). */
248
+ function shellQuote(s) {
249
+ return /^[A-Za-z0-9_@%+=:,./-]+$/.test(s) ? s : `'${s.replace(/'/g, `'\\''`)}'`;
250
+ }
251
+ /** The single command that resumes this pipeline, reconstructed from the run's
252
+ * own options so the operator never has to remember the flags (5.3). */
253
+ function resumeCommand(opts) {
254
+ const parts = ['copperhead'];
255
+ const repo = path.resolve(opts.repoRoot);
256
+ if (repo !== process.cwd())
257
+ parts.push('--repo', shellQuote(repo));
258
+ // Absolute --brief so the command resolves the same from any cwd; a relative
259
+ // path would break when resumed from a different directory (F6).
260
+ parts.push('create', '--brief', shellQuote(path.resolve(opts.briefPath)), '--model', shellQuote(opts.model));
261
+ if (opts.interactive)
262
+ parts.push('--interactive');
263
+ return parts.join(' ');
264
+ }
265
+ /**
266
+ * On any pipeline stop, print the exact command to resume and which stage it
267
+ * will resume at, so the operator never has to reconstruct it (5.3). Stage
268
+ * completion is inferred from repo state, so resuming is just re-running the
269
+ * same command — the earlier completed stages are skipped automatically.
270
+ */
271
+ function logResumePoint(opts, stage, index) {
272
+ opts.log('');
273
+ opts.log(`⏸ stopped at stage ${index + 1}/${STAGES.length} (${stage.name}). To resume from here, run:`);
274
+ opts.log(` ${resumeCommand(opts)}`);
275
+ opts.log(` (${index} stage(s) already complete are detected from repo state and skipped; it resumes at ${stage.name}.)`);
276
+ }
277
+ /**
278
+ * Print the final per-stage cost table (5.2): stage → wall, turns, out-tokens,
279
+ * cache-hit%. Makes the expensive stages obvious at a glance and lets the effect
280
+ * of tuning be tracked across runs. Right-aligned numeric columns; resumed
281
+ * stages show "—" (they cost nothing this run).
282
+ */
283
+ function printCostTable(opts, costs) {
284
+ if (!costs.length)
285
+ return;
286
+ const pct = (hits, turns) => (turns ? `${Math.round((hits / turns) * 100)}%` : '—');
287
+ const header = { stage: 'Stage', wall: 'Wall', turns: 'Turns', out: 'Out tok', cache: 'Cache' };
288
+ const rows = costs.map((c) => ({
289
+ stage: c.name,
290
+ wall: c.resumed ? '—' : fmtDuration(c.wallMs),
291
+ turns: c.resumed ? '—' : String(c.turns),
292
+ out: c.resumed ? '—' : fmtTokens(c.tokensOut),
293
+ cache: c.resumed ? '—' : pct(c.cacheHits, c.turns),
294
+ }));
295
+ const ran = costs.filter((c) => !c.resumed);
296
+ const total = ran.length &&
297
+ {
298
+ stage: 'TOTAL',
299
+ wall: fmtDuration(ran.reduce((a, c) => a + c.wallMs, 0)),
300
+ turns: String(ran.reduce((a, c) => a + c.turns, 0)),
301
+ out: fmtTokens(ran.reduce((a, c) => a + c.tokensOut, 0)),
302
+ cache: pct(ran.reduce((a, c) => a + c.cacheHits, 0), ran.reduce((a, c) => a + c.turns, 0)),
303
+ };
304
+ const all = [header, ...rows, ...(total ? [total] : [])];
305
+ const w = {
306
+ stage: Math.max(...all.map((r) => r.stage.length)),
307
+ wall: Math.max(...all.map((r) => r.wall.length)),
308
+ turns: Math.max(...all.map((r) => r.turns.length)),
309
+ out: Math.max(...all.map((r) => r.out.length)),
310
+ cache: Math.max(...all.map((r) => r.cache.length)),
311
+ };
312
+ const line = (r) => ` ${r.stage.padEnd(w.stage)} ${r.wall.padStart(w.wall)} ${r.turns.padStart(w.turns)} ${r.out.padStart(w.out)} ${r.cache.padStart(w.cache)}`;
313
+ const rule = ` ${'-'.repeat(w.stage)} ${'-'.repeat(w.wall)} ${'-'.repeat(w.turns)} ${'-'.repeat(w.out)} ${'-'.repeat(w.cache)}`;
314
+ opts.log('');
315
+ opts.log('Per-stage cost summary (5.2):');
316
+ opts.log(line(header));
317
+ opts.log(rule);
318
+ for (const r of rows)
319
+ opts.log(line(r));
320
+ if (total) {
321
+ opts.log(rule);
322
+ opts.log(line(total));
323
+ }
324
+ }
325
+ /** Sum the cost of the stages that actually ran this invocation (resumed stages
326
+ * cost nothing). Shared by the cumulative line and the end-of-run report (5.6). */
327
+ function ranTotals(stageCosts) {
328
+ const ran = stageCosts.filter((c) => !c.resumed);
329
+ return {
330
+ wallMs: ran.reduce((a, c) => a + c.wallMs, 0),
331
+ turns: ran.reduce((a, c) => a + c.turns, 0),
332
+ tokensIn: ran.reduce((a, c) => a + c.tokensIn, 0),
333
+ tokensOut: ran.reduce((a, c) => a + c.tokensOut, 0),
334
+ cacheHits: ran.reduce((a, c) => a + c.cacheHits, 0),
335
+ };
336
+ }
337
+ const cachePct = (hits, turns) => (turns ? Math.round((hits / turns) * 100) : 0);
338
+ /**
339
+ * The running whole-run total, printed at each stage's end (5.6). A create board
340
+ * is built over many invocations and each stage's `summary.md` covers only that
341
+ * stage; this line accrues the pipeline total so the operator sees the true cost
342
+ * grow instead of adding up per-stage numbers by hand. On the last stage it is
343
+ * the grand total.
344
+ */
345
+ function logCumulative(opts, stageCosts) {
346
+ const t = ranTotals(stageCosts);
347
+ if (!t.turns && !t.wallMs)
348
+ return; // nothing has actually run yet (all resumed)
349
+ opts.log(`pipeline so far: ${stageCosts.length}/${STAGES.length} stages · ${fmtDuration(t.wallMs)} · ` +
350
+ `${fmtTokens(t.tokensOut)} out tokens · ${cachePct(t.cacheHits, t.turns)}% cache hits`);
351
+ }
352
+ /**
353
+ * Aggregate the per-stage costs into a durable end-of-run report (5.6):
354
+ * `.copperhead/runs/REPORT.md` (human) and `report.json` (machine, stable schema
355
+ * for diffing successive boards). One row per stage — wall, turns, in/out tokens,
356
+ * cache-hit%, status — plus a total row and a slowest / most-expensive callout so
357
+ * the bottleneck is obvious. This is the only artifact that makes the big token
358
+ * levers measurable *across* runs; without it, tuning is anecdote. Best-effort:
359
+ * a write failure is logged, never fatal.
360
+ */
361
+ async function writeRunReport(opts, stageCosts) {
362
+ if (!stageCosts.length)
363
+ return;
364
+ const runsDir = path.join(opts.repoRoot, '.copperhead', 'runs');
365
+ const t = ranTotals(stageCosts);
366
+ const ran = stageCosts.filter((c) => !c.resumed);
367
+ const slowest = ran.length ? ran.reduce((a, b) => (b.wallMs > a.wallMs ? b : a)) : null;
368
+ const priciest = ran.length ? ran.reduce((a, b) => (b.tokensOut > a.tokensOut ? b : a)) : null;
369
+ const report = {
370
+ generatedAtMs: Date.now(),
371
+ stageCount: STAGES.length,
372
+ ran: ran.length,
373
+ resumed: stageCosts.length - ran.length,
374
+ stages: stageCosts.map((c) => ({
375
+ name: c.name,
376
+ resumed: c.resumed,
377
+ wallMs: c.wallMs,
378
+ turns: c.turns,
379
+ tokensIn: c.tokensIn,
380
+ tokensOut: c.tokensOut,
381
+ cacheHits: c.cacheHits,
382
+ cacheHitPct: c.resumed ? null : cachePct(c.cacheHits, c.turns),
383
+ })),
384
+ total: { ...t, cacheHitPct: cachePct(t.cacheHits, t.turns) },
385
+ slowestStage: slowest ? { name: slowest.name, wallMs: slowest.wallMs } : null,
386
+ mostExpensiveStage: priciest ? { name: priciest.name, tokensOut: priciest.tokensOut } : null,
387
+ };
388
+ const row = (cells) => `| ${cells.join(' | ')} |`;
389
+ const lines = [
390
+ '# Copperhead run report',
391
+ '',
392
+ 'Per-stage cost of the create pipeline, regenerated at the end of every run.',
393
+ 'Resumed stages were already complete on entry and cost nothing this run.',
394
+ '',
395
+ row(['Stage', 'Wall', 'Turns', 'In', 'Out', 'Cache', 'Status']),
396
+ row(['---', '---:', '---:', '---:', '---:', '---:', '---']),
397
+ ...stageCosts.map((c) => c.resumed
398
+ ? row([c.name, '—', '—', '—', '—', '—', 'resumed'])
399
+ : row([
400
+ c.name,
401
+ fmtDuration(c.wallMs),
402
+ String(c.turns),
403
+ fmtTokens(c.tokensIn),
404
+ fmtTokens(c.tokensOut),
405
+ `${cachePct(c.cacheHits, c.turns)}%`,
406
+ 'ran',
407
+ ])),
408
+ row([
409
+ '**Total**',
410
+ fmtDuration(t.wallMs),
411
+ String(t.turns),
412
+ fmtTokens(t.tokensIn),
413
+ fmtTokens(t.tokensOut),
414
+ `${cachePct(t.cacheHits, t.turns)}%`,
415
+ '',
416
+ ]),
417
+ '',
418
+ ];
419
+ if (slowest && priciest) {
420
+ lines.push(`Slowest stage: **${slowest.name}** (${fmtDuration(slowest.wallMs)}). ` +
421
+ `Most expensive: **${priciest.name}** (${fmtTokens(priciest.tokensOut)} out tokens).`, '');
422
+ }
423
+ try {
424
+ await mkdir(runsDir, { recursive: true });
425
+ await writeFile(path.join(runsDir, 'report.json'), JSON.stringify(report, null, 2) + '\n', 'utf8');
426
+ await writeFile(path.join(runsDir, 'REPORT.md'), lines.join('\n'), 'utf8');
427
+ opts.log(`wrote run report: ${path.relative(opts.repoRoot, path.join(runsDir, 'REPORT.md'))} (+ report.json)`);
428
+ }
429
+ catch (err) {
430
+ opts.log(`warning: could not write run report (${err.message})`);
431
+ }
432
+ }
105
433
  export async function runCreate(opts) {
106
434
  const brief = await readFile(path.resolve(opts.briefPath), 'utf8');
107
435
  // Hashed from the content already in hand: a brief edited mid-pipeline shows
108
436
  // up as a different sha256 in the next stage's metadata (AC-8.1).
109
437
  const briefMeta = { path: opts.briefPath, sha256: createHash('sha256').update(brief).digest('hex') };
110
438
  const config = await loadConfig(opts.repoRoot);
439
+ // Fail fast on a nearly-full disk (4.1): a create run writes fab outputs and
440
+ // KiCad local history and can otherwise fill the disk mid-stage, failing with
441
+ // an opaque ENOSPC only after doing expensive work. Threshold overridable via
442
+ // COPPERHEAD_MIN_FREE_MB; an unknown reading (unsupported platform) skips it.
443
+ const minFreeMb = Number(process.env.COPPERHEAD_MIN_FREE_MB);
444
+ const minFree = Number.isFinite(minFreeMb) && minFreeMb >= 0 ? minFreeMb * 1024 * 1024 : DEFAULT_MIN_FREE_BYTES;
445
+ await assertDiskSpace(opts.repoRoot, minFree);
446
+ // Reclaim scratch dirs leaked by earlier runs whose cleanup was skipped (a
447
+ // watchdog SIGKILL or hard abort bypasses the per-call `finally`). Age-gated,
448
+ // so a concurrent run's fresh dirs are never touched; best-effort, so it never
449
+ // blocks a run (I8).
450
+ const swept = await sweepStaleTempDirs(Date.now());
451
+ if (swept.length)
452
+ opts.log(`startup: reclaimed ${swept.length} stale temp dir(s) from earlier runs`);
453
+ // Cap the gitignored .history/ so KiCad local history cannot grow unbounded
454
+ // across a long run and fill the disk (4.1, I8). Best-effort; keeps the newest.
455
+ const pruned = await pruneHistoryDir(opts.repoRoot);
456
+ if (pruned)
457
+ opts.log(`startup: pruned ${pruned} old .history/ entrie(s) to cap local-history growth`);
111
458
  await openspecInit(opts.repoRoot);
112
459
  const completed = [];
460
+ const stageCosts = [];
113
461
  for (const [i, stage] of STAGES.entries()) {
462
+ // The schematic stage is the first to touch KiCad files, but the agent
463
+ // cannot create them (write_file refuses KiCad files; edit_file needs an
464
+ // existing file). Scaffold a minimal empty project and wire config just
465
+ // before the stage runs, so there is a schematic to populate and the stage
466
+ // contract can eventually be met. No-op once a project exists.
467
+ if (stage.name === 'schematic') {
468
+ const created = await bootstrapKicadProject(opts.repoRoot, brief);
469
+ if (created)
470
+ opts.log(`stage schematic: scaffolded empty KiCad project (${created} + board + project), wired into config`);
471
+ }
114
472
  if (await stage.isComplete(opts.repoRoot, config.docs)) {
115
473
  opts.log(`stage ${stage.name}: already complete (resuming past it)`);
474
+ await commitResumedStage(opts, config, stage.name);
116
475
  completed.push(stage.name);
476
+ stageCosts.push({ name: stage.name, resumed: true, wallMs: 0, turns: 0, tokensIn: 0, tokensOut: 0, cacheHits: 0 });
117
477
  await emitJlcpcbAfterOutputs(stage.name, opts);
118
478
  continue;
119
479
  }
120
- opts.log(`stage ${stage.name}: running`);
480
+ // Auto-recovery loop: run the stage, and if it fails or ends without meeting
481
+ // its contract, ask the model to diagnose whether another attempt is likely
482
+ // to help. On "retry" the pipeline runs the stage again (with the diagnosis's
483
+ // guidance prepended); on "abort", or once the retry budget is spent, it
484
+ // stops and reports for a human — the loop keeps going by itself for the
485
+ // recoverable cases without silently spinning on the dead-end ones.
121
486
  const stageTurns = config.stageMaxTurns?.[stage.name];
122
- const res = await runAgentLoop({
123
- repoRoot: opts.repoRoot,
124
- model: opts.model,
125
- request: `create pipeline stage: ${stage.name}`,
126
- stagePrompt: stage.prompt(brief),
127
- interactive: opts.interactive ?? false,
128
- allowDirty: true, // stages build on each other's uncommitted state within the pipeline
129
- ...(stageTurns !== undefined ? { maxTurns: stageTurns } : {}),
130
- ...(opts.onBudgetExhausted ? { onBudgetExhausted: opts.onBudgetExhausted } : {}),
131
- log: opts.log,
132
- ...(opts.renderer ? { renderer: opts.renderer } : {}),
133
- meta: {
134
- ...opts.meta,
135
- command: 'create',
136
- stage: { name: stage.name, index: i + 1, total: STAGES.length },
137
- brief: briefMeta,
138
- },
139
- });
140
- if (res.outcome !== 'success') {
141
- opts.log(`stage ${stage.name} did not complete (${res.outcome}); re-run copperhead create to resume here`);
142
- return { ok: false, completed };
487
+ const basePrompt = stage.prompt(brief);
488
+ let guidance = '';
489
+ let stageDone = false;
490
+ let stageTranscriptDir = '';
491
+ // Cost accumulates across all attempts of the stage, so a stage that took a
492
+ // retry to complete shows its true total in the summary (5.2).
493
+ const stageStart = Date.now();
494
+ const cost = { name: stage.name, resumed: false, wallMs: 0, turns: 0, tokensIn: 0, tokensOut: 0, cacheHits: 0 };
495
+ for (let attempt = 1;; attempt++) {
496
+ // Re-scaffold before every attempt, not just once per stage. A previous
497
+ // attempt that failed at the commit gate rolls the tree back
498
+ // (restore(): `git reset --hard` + `git clean -fd`), which deletes the
499
+ // still-untracked scaffold (config.json + the empty KiCad files). Without
500
+ // this the retry would run against a missing schematic and cascade into a
501
+ // worse failure than the one being recovered from. Idempotent: a no-op
502
+ // whenever the project already exists.
503
+ if (stage.name === 'schematic') {
504
+ const rescaffolded = await bootstrapKicadProject(opts.repoRoot, brief);
505
+ if (rescaffolded && attempt > 1)
506
+ opts.log(`stage schematic: re-scaffolded empty KiCad project after rollback, wired into config`);
507
+ }
508
+ opts.log(`stage ${stage.name}: running${attempt > 1 ? ` (attempt ${attempt}/${config.maxStageRetries + 1})` : ''}`);
509
+ const res = await runAgentLoop({
510
+ repoRoot: opts.repoRoot,
511
+ model: opts.model,
512
+ request: `create pipeline stage: ${stage.name}`,
513
+ stagePrompt: guidance
514
+ ? `${basePrompt}\n\n## Recovery guidance (a previous attempt did not complete this stage — do this differently)\n${guidance}`
515
+ : basePrompt,
516
+ interactive: opts.interactive ?? false,
517
+ allowDirty: true, // stages build on each other's uncommitted state within the pipeline
518
+ ...(stageTurns !== undefined ? { maxTurns: stageTurns } : {}),
519
+ ...(opts.onBudgetExhausted ? { onBudgetExhausted: opts.onBudgetExhausted } : {}),
520
+ log: opts.log,
521
+ ...(opts.renderer ? { renderer: opts.renderer } : {}),
522
+ meta: {
523
+ ...opts.meta,
524
+ command: 'create',
525
+ stage: { name: stage.name, index: i + 1, total: STAGES.length },
526
+ brief: briefMeta,
527
+ },
528
+ });
529
+ // Fold this attempt's cost in. Defensive reads: a run that dies very early
530
+ // (or a scripted test double) may omit stats — never let telemetry throw.
531
+ cost.turns += res.stats?.turnsUsed ?? 0;
532
+ cost.tokensIn += res.stats?.tokensIn ?? 0;
533
+ cost.tokensOut += res.stats?.tokensOut ?? 0;
534
+ cost.cacheHits += res.cacheHits ?? 0;
535
+ stageTranscriptDir = res.transcriptDir; // last attempt's run dir (for SVG artifacts / report)
536
+ // A successful run is not the same as a completed stage: an agent can
537
+ // finish "done" with all gates green having only planned the work (seen
538
+ // with the schematic stage: one header edit, ERC "clean" on an empty
539
+ // sheet). Advancing anyway lets every later stage run against a design
540
+ // that isn't there, so the completion contract is the real gate.
541
+ const failure = res.outcome !== 'success'
542
+ ? `the run ended as "${res.outcome}" (${res.exitPath})`
543
+ : !(await stage.isComplete(opts.repoRoot, config.docs))
544
+ ? 'the run finished but the stage completion contract is not met — no usable artifact was produced'
545
+ : null;
546
+ if (!failure) {
547
+ stageDone = true;
548
+ break;
549
+ }
550
+ if (attempt > config.maxStageRetries) {
551
+ opts.log(`stage ${stage.name}: ${failure}; exhausted ${config.maxStageRetries} auto-retry(ies). Stopping for a human.`);
552
+ break;
553
+ }
554
+ opts.log(`stage ${stage.name}: ${failure}; asking the model whether to retry…`);
555
+ const diagnosis = await diagnose({
556
+ model: opts.model,
557
+ timeoutMs: config.turnTimeoutMs,
558
+ stageName: stage.name,
559
+ stageGoal: basePrompt,
560
+ failure,
561
+ transcriptDir: res.transcriptDir,
562
+ attempt,
563
+ maxAttempts: config.maxStageRetries + 1,
564
+ });
565
+ // Fold the diagnosis call's own tokens into the stage cost (F6): it is a
566
+ // real model call made on behalf of this stage, so the cost table should
567
+ // not under-report by omitting it.
568
+ cost.tokensIn += diagnosis.usage?.inputTokens ?? 0;
569
+ cost.tokensOut += diagnosis.usage?.outputTokens ?? 0;
570
+ opts.log(`stage ${stage.name}: diagnosis → ${diagnosis.verdict} — ${diagnosis.reason}`);
571
+ if (diagnosis.verdict === 'abort') {
572
+ opts.log(`stage ${stage.name}: recovery supervisor recommends stopping for a human.`);
573
+ break;
574
+ }
575
+ guidance = diagnosis.guidance ?? `The previous attempt failed: ${failure}. ${diagnosis.reason}`;
143
576
  }
144
- // A successful run is not the same as a completed stage: an agent can
145
- // finish "done" with all gates green having only planned the work (seen
146
- // with the schematic stage: one header edit, ERC "clean" on an empty
147
- // sheet). Advancing anyway lets every later stage run against a design
148
- // that isn't there, so hold the pipeline until this stage's repo-state
149
- // contract is actually met.
150
- if (!(await stage.isComplete(opts.repoRoot, config.docs))) {
151
- opts.log(`stage ${stage.name}: run succeeded but the stage contract is not met yet (partial work committed); re-run copperhead create to continue this stage`);
577
+ cost.wallMs = Date.now() - stageStart;
578
+ stageCosts.push(cost);
579
+ if (!stageDone) {
580
+ logResumePoint(opts, stage, i);
581
+ printCostTable(opts, stageCosts);
582
+ await writeRunReport(opts, stageCosts);
152
583
  return { ok: false, completed };
153
584
  }
154
585
  completed.push(stage.name);
586
+ await renderStageArtifacts(opts, stage.name, stageTranscriptDir);
155
587
  await emitJlcpcbAfterOutputs(stage.name, opts);
588
+ logCumulative(opts, stageCosts);
156
589
  }
157
590
  const check = await runCheck(opts.repoRoot, opts.log);
158
591
  opts.log(check.ok ? 'create pipeline complete; all checks green' : 'create pipeline complete with check failures');
592
+ printCostTable(opts, stageCosts);
593
+ await writeRunReport(opts, stageCosts);
159
594
  return { ok: check.ok, completed };
160
595
  }
161
596
  //# sourceMappingURL=create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAA6B,MAAM,kBAAkB,CAAC;AAG3E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgBlD,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,G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