@wildorder/nightshift 0.13.0 → 0.15.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 (73) hide show
  1. package/README.md +64 -26
  2. package/dist/agent-probe.d.ts +21 -2
  3. package/dist/agent-probe.d.ts.map +1 -1
  4. package/dist/agent-probe.js +76 -22
  5. package/dist/agent-probe.js.map +1 -1
  6. package/dist/agent-runner.d.ts +90 -2
  7. package/dist/agent-runner.d.ts.map +1 -1
  8. package/dist/agent-runner.js +382 -24
  9. package/dist/agent-runner.js.map +1 -1
  10. package/dist/agent-summary.d.ts +15 -0
  11. package/dist/agent-summary.d.ts.map +1 -1
  12. package/dist/agent-summary.js +32 -2
  13. package/dist/agent-summary.js.map +1 -1
  14. package/dist/as-built.d.ts +6 -0
  15. package/dist/as-built.d.ts.map +1 -1
  16. package/dist/as-built.js +7 -0
  17. package/dist/as-built.js.map +1 -1
  18. package/dist/author.d.ts +13 -3
  19. package/dist/author.d.ts.map +1 -1
  20. package/dist/author.js +267 -30
  21. package/dist/author.js.map +1 -1
  22. package/dist/ci-init.d.ts.map +1 -1
  23. package/dist/ci-init.js +17 -12
  24. package/dist/ci-init.js.map +1 -1
  25. package/dist/cli.js +74 -15
  26. package/dist/cli.js.map +1 -1
  27. package/dist/config.d.ts +11 -0
  28. package/dist/config.d.ts.map +1 -1
  29. package/dist/config.js +13 -0
  30. package/dist/config.js.map +1 -1
  31. package/dist/crash-report.d.ts +58 -0
  32. package/dist/crash-report.d.ts.map +1 -0
  33. package/dist/crash-report.js +115 -0
  34. package/dist/crash-report.js.map +1 -0
  35. package/dist/decide.js +1 -1
  36. package/dist/decide.js.map +1 -1
  37. package/dist/decider-review.d.ts +33 -5
  38. package/dist/decider-review.d.ts.map +1 -1
  39. package/dist/decider-review.js +55 -9
  40. package/dist/decider-review.js.map +1 -1
  41. package/dist/decision-ledger.d.ts +44 -1
  42. package/dist/decision-ledger.d.ts.map +1 -1
  43. package/dist/decision-ledger.js +46 -1
  44. package/dist/decision-ledger.js.map +1 -1
  45. package/dist/decision-view.d.ts +10 -1
  46. package/dist/decision-view.d.ts.map +1 -1
  47. package/dist/decision-view.js +41 -0
  48. package/dist/decision-view.js.map +1 -1
  49. package/dist/manifest.d.ts +29 -1
  50. package/dist/manifest.d.ts.map +1 -1
  51. package/dist/manifest.js +236 -11
  52. package/dist/manifest.js.map +1 -1
  53. package/dist/permits.d.ts +135 -0
  54. package/dist/permits.d.ts.map +1 -0
  55. package/dist/permits.js +397 -0
  56. package/dist/permits.js.map +1 -0
  57. package/dist/publish.d.ts +35 -0
  58. package/dist/publish.d.ts.map +1 -1
  59. package/dist/publish.js +149 -16
  60. package/dist/publish.js.map +1 -1
  61. package/dist/run-program.d.ts +53 -2
  62. package/dist/run-program.d.ts.map +1 -1
  63. package/dist/run-program.js +539 -56
  64. package/dist/run-program.js.map +1 -1
  65. package/dist/whole-program-review.d.ts +4 -0
  66. package/dist/whole-program-review.d.ts.map +1 -1
  67. package/dist/whole-program-review.js +9 -1
  68. package/dist/whole-program-review.js.map +1 -1
  69. package/package.json +2 -2
  70. package/dist/verify-allowlist.d.ts +0 -23
  71. package/dist/verify-allowlist.d.ts.map +0 -1
  72. package/dist/verify-allowlist.js +0 -46
  73. package/dist/verify-allowlist.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"as-built.js","sourceRoot":"","sources":["../src/as-built.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAwB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,O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+DAA+D;YAC7D,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrC,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvC,KAAK,CAAC,IAAI,CACR,wEAAwE,CACzE,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAChF,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/author.d.ts CHANGED
@@ -1,16 +1,22 @@
1
1
  import { type AgentRunner } from "./agent-runner.js";
2
2
  import type { NightshiftConfig } from "./config.js";
3
+ import { type PermitsContext } from "./permits.js";
3
4
  import { type ReviewPassOutcome } from "./review-pass.js";
4
5
  import { type GitOps } from "./run-program.js";
5
6
  export interface AuthorOptions {
6
7
  cwd: string;
7
8
  programId: string;
8
9
  config: NightshiftConfig;
9
- /** Workstream ids eligible for `force` re-authoring. */
10
- only?: string[];
11
- /** Re-author ids named in `only`, even though their spec already exists. */
10
+ /** Workstream id to begin authoring from, in stable authoring order.
11
+ * Undefined selects the whole roster. Validated before any agent spawns. */
12
+ from?: string;
13
+ /** Re-author every selected workstream, even ones already complete or legacy. */
12
14
  force?: boolean;
13
15
  agentRunner?: AgentRunner;
16
+ /** Defaults to a no-op context; the owner (`runProgram`, or the `author`
17
+ * CLI command) builds and passes the run's real `PermitsContext` — this
18
+ * stage never builds its own. */
19
+ permits?: PermitsContext;
14
20
  git?: GitOps;
15
21
  log?: (line: string) => void;
16
22
  now?: () => Date;
@@ -58,6 +64,10 @@ export interface AuthorResult {
58
64
  reauthored: boolean;
59
65
  /** The spec-critique pass for this workstream; absent when no authoring ran. */
60
66
  specCritique?: ReviewPassOutcome;
67
+ /** Agent stages (decision review, finding triage) that could not be
68
+ * spawned; surfaced here, never fatal — mirrors run-program.ts's
69
+ * WorkstreamResult.stageErrors (WS-04 SC-12). */
70
+ stageErrors?: string[];
61
71
  }
62
72
  export interface AuthorStageResult {
63
73
  programId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"author.d.ts","sourceRoot":"","sources":["../src/author.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAe,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAkBjE,OAAO,EASL,KAAK,iBAAiB,EAEvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAiC,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAe9E,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,QAAQ,CA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vE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,8FAA8F;IAC9F,UAAU,EAAE,OAAO,CAAC;IACpB,gFAAgF;IAChF,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;sDAEkD;IAClD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,8EAA8E;IAC9E,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAooBD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAqjB5B"}
package/dist/author.js CHANGED
@@ -2,10 +2,11 @@ import { readFile, writeFile } from "node:fs/promises";
2
2
  import { join, resolve } from "node:path";
3
3
  import { defaultAgentRunner, describeAgent, invokeAgent, resolveAuthorAgent, resolveDeciderAgent, resolveReviewerAgent, } from "./agent-runner.js";
4
4
  import { resolveSummary, summaryContract } from "./agent-summary.js";
5
+ import { NOOP_PERMITS_CONTEXT } from "./permits.js";
5
6
  import { decisionContract, decisionFingerprint, extractDecisions, } from "./decision.js";
6
7
  import { appendLedgerEvents } from "./decision-ledger.js";
7
8
  import { reviewDecisions, triageFindings } from "./decider-review.js";
8
- import { findCycles, topologicalLevels } from "./graph.js";
9
+ import { findCycles, stableTopologicalOrder, topologicalLevels } from "./graph.js";
9
10
  import { loadManifest, saveManifest, specInputsHash, } from "./manifest.js";
10
11
  import { extractFindings, findingsContract, findingsToLedgerEvents, hasRoutableEvidence, locateInRepo, reviewerAbsentOutcome, runReviewPass, verifyEvidence, } from "./review-pass.js";
11
12
  import { defaultGitOps, downstreamCone } from "./run-program.js";
@@ -30,6 +31,42 @@ async function readFinishedSpec(root, workstream) {
30
31
  return undefined;
31
32
  }
32
33
  }
34
+ /**
35
+ * Classifies a workstream's spec by runner-owned lifecycle state, not by
36
+ * file existence alone: a non-empty `taskFile` proves only that writing
37
+ * started, never that authoring finished (WS-01 SC-01/SC-02/SC-03).
38
+ * Precedence: `missing` first regardless of the marker (a deleted taskFile is
39
+ * always re-authored), then `interrupted` (a prior attempt did not finish,
40
+ * even though it left a non-empty partial file), then the two kept classes.
41
+ */
42
+ function classifySpec(existing, workstream) {
43
+ if (existing === undefined)
44
+ return "missing";
45
+ if (workstream.specStatus === "in_progress")
46
+ return "interrupted";
47
+ if (workstream.specStatus === "complete")
48
+ return "complete";
49
+ return "legacy";
50
+ }
51
+ /**
52
+ * True when a *returned* (not thrown) author invocation reported failure —
53
+ * a nonzero exit code, an undelivered prompt, or an absent required summary
54
+ * block. Each means the process either reported failure or never produced
55
+ * the reply contract, so any spec it may have written cannot be trusted as
56
+ * complete (WS-01 SC-07): the safe direction is to re-author, not to
57
+ * silently substitute raw output and proceed toward completion.
58
+ */
59
+ function isAuthorProtocolFailure(invocation, summary) {
60
+ return invocation.exitCode !== 0 || invocation.inputError !== undefined || !summary.available;
61
+ }
62
+ function describeProtocolFailure(invocation, summary) {
63
+ const parts = [`exit code ${invocation.exitCode}`];
64
+ if (invocation.inputError !== undefined)
65
+ parts.push(`input error: ${invocation.inputError}`);
66
+ if (!summary.available)
67
+ parts.push("no summary block in the reply");
68
+ return parts.join(", ");
69
+ }
33
70
  async function programDocumentSection(root, manifest) {
34
71
  const relPath = join("docs", "programs", `${manifest.program.id}-program.md`);
35
72
  let content;
@@ -372,7 +409,25 @@ async function runSpecCritique(options) {
372
409
  const review = async (_round, priorOpen) => {
373
410
  const currentSpec = (await readFinishedSpec(options.root, options.workstream)) ?? options.spec;
374
411
  const brief = await specCritiqueReviewerBrief(options.root, options.manifest, options.workstream, options.rosterById, currentSpec, priorOpen);
375
- const invocation = await invokeAgent(options.agentRunner, reviewer, brief, options.root);
412
+ let invocation;
413
+ try {
414
+ invocation = await invokeAgent(options.agentRunner, reviewer, brief, options.root, options.permits, "reviewerAgent", {
415
+ root: options.root,
416
+ programId: options.programId,
417
+ label: `${options.workstream.id}-spec-critique-reviewer`,
418
+ log: options.log,
419
+ });
420
+ }
421
+ catch (error) {
422
+ // Fail open, matching the equivalent build-side guard in
423
+ // runTestCritique: no findings this round, the outcome is unaffected,
424
+ // and the reason is recorded durably rather than only logged or —
425
+ // absent this guard — left to reject through authorProgram into a
426
+ // process crash (SC-12).
427
+ options.pushStageError(`the reviewer could not be spawned during spec critique for ` +
428
+ `${options.workstream.id}: ${error.message}`);
429
+ return { findings: [], errors: [], ran: false };
430
+ }
376
431
  const parsed = extractFindings(invocation.output);
377
432
  const findings = verifyEvidence(parsed.findings, locate);
378
433
  const ran = invocation.exitCode === 0 && hasFindingsBlock(invocation.output);
@@ -381,7 +436,23 @@ async function runSpecCritique(options) {
381
436
  const respond = async (_round, findings) => {
382
437
  const currentSpec = (await readFinishedSpec(options.root, options.workstream)) ?? options.spec;
383
438
  const brief = specCritiqueWriterBrief(options.workstream, currentSpec, findings);
384
- const invocation = await invokeAgent(options.agentRunner, options.author, brief, options.root);
439
+ let invocation;
440
+ try {
441
+ invocation = await invokeAgent(options.agentRunner, options.author, brief, options.root, options.permits, "authorAgent", {
442
+ root: options.root,
443
+ programId: options.programId,
444
+ label: `${options.workstream.id}-spec-critique-writer`,
445
+ log: options.log,
446
+ });
447
+ }
448
+ catch (error) {
449
+ // Fail open: the spec is left as the reviewer last saw it and the
450
+ // reason is recorded durably; the next review round (if any) simply
451
+ // re-reads the same findings rather than the process crashing.
452
+ options.pushStageError(`the author agent could not be spawned to respond to spec critique ` +
453
+ `findings for ${options.workstream.id}: ${error.message}`);
454
+ return { note: "(spec critique response not attempted — the author agent could not be spawned)" };
455
+ }
385
456
  return { note: resolveSummary(invocation.output).text };
386
457
  };
387
458
  return runReviewPass({ review, respond });
@@ -438,10 +509,10 @@ export async function authorProgram(options) {
438
509
  const root = resolve(options.cwd);
439
510
  const config = options.config;
440
511
  const agentRunner = options.agentRunner ?? defaultAgentRunner;
512
+ const permits = options.permits ?? NOOP_PERMITS_CONTEXT;
441
513
  const git = options.git ?? defaultGitOps;
442
514
  const log = options.log ?? ((line) => console.log(line));
443
515
  const now = options.now ?? (() => new Date());
444
- const only = options.only;
445
516
  const force = options.force === true;
446
517
  const reviewed = options.reviewed ?? new Set();
447
518
  const triaged = options.triaged ?? new Set();
@@ -468,6 +539,25 @@ export async function authorProgram(options) {
468
539
  .map((cycle) => cycle.join(" -> "))
469
540
  .join("; ")}. Re-plan with /plan-program.`);
470
541
  }
542
+ // The selected range (SC-05): computed once, up front, from the manifest
543
+ // as loaded — before any agent spawns — so `--from` validation and the
544
+ // selected set are deterministic, independent of dependency edges an
545
+ // author might discover mid-run. The same stable order the authoring loop
546
+ // below walks level-by-level, so selection and execution agree by
547
+ // construction.
548
+ const stableOrder = stableTopologicalOrder(manifest.workstreams);
549
+ let selectedIds;
550
+ if (options.from === undefined) {
551
+ selectedIds = new Set(stableOrder.map((workstream) => workstream.id));
552
+ }
553
+ else {
554
+ const fromIndex = stableOrder.findIndex((workstream) => workstream.id === options.from);
555
+ if (fromIndex === -1) {
556
+ throw new Error(`Unknown workstream id "${options.from}" for --from. Valid ids: ` +
557
+ `${stableOrder.map((workstream) => workstream.id).join(", ")}.`);
558
+ }
559
+ selectedIds = new Set(stableOrder.slice(fromIndex).map((workstream) => workstream.id));
560
+ }
471
561
  const isRepository = await git.isRepository(root);
472
562
  if (!isRepository) {
473
563
  log("warning: not a git repository — commits and decision anchors are unavailable");
@@ -505,16 +595,38 @@ export async function authorProgram(options) {
505
595
  };
506
596
  if (blockedCone.has(workstream.id)) {
507
597
  workstream.status = "parked";
508
- await saveManifest(root, options.programId, manifest);
598
+ await saveManifest(root, options.programId, manifest, { log });
509
599
  base.outcome = {
510
600
  status: "parked",
511
601
  reason: "an upstream dependency's authoring failed; parked, not attempted",
512
602
  };
513
603
  return base;
514
604
  }
605
+ // Out-of-range keep (SC-05): a workstream before `--from` is kept and
606
+ // never drift-checked — the operator explicitly asked to start
607
+ // elsewhere, so this is neither authored nor parked. Decided ahead of
608
+ // both classification and the drift check.
609
+ if (!selectedIds.has(workstream.id)) {
610
+ return base;
611
+ }
515
612
  const existing = await readFinishedSpec(root, workstream);
516
- const shouldAuthor = existing === undefined || (force && only !== undefined && only.includes(workstream.id));
613
+ const classification = classifySpec(existing, workstream);
614
+ const shouldAuthor = force || classification === "missing" || classification === "interrupted";
517
615
  if (!shouldAuthor) {
616
+ // Legacy specHash migration (SC-03): a legacy spec (no specStatus
617
+ // marker) whose specHash matches the manifest's current inputs is
618
+ // recognized as completed legacy Nightshift authoring and normalized
619
+ // — persisted immediately, since a kept-only invocation otherwise
620
+ // never saves.
621
+ if (classification === "legacy" &&
622
+ workstream.specHash !== undefined &&
623
+ specInputsHash(manifest, workstream) === workstream.specHash) {
624
+ workstream.specStatus = "complete";
625
+ await saveManifest(root, options.programId, manifest, { log });
626
+ log(`${workstream.id}: recognized as completed legacy authoring — ` +
627
+ 'normalized to specStatus "complete"');
628
+ return base;
629
+ }
518
630
  // Drift check: the spec exists and is about to be graded against, but
519
631
  // if the manifest entry changed since it was authored, the spec text
520
632
  // may promise something the manifest no longer does. The manifest is
@@ -527,7 +639,7 @@ export async function authorProgram(options) {
527
639
  const current = specInputsHash(manifest, workstream);
528
640
  if (current !== workstream.specHash) {
529
641
  workstream.status = "parked";
530
- await saveManifest(root, options.programId, manifest);
642
+ await saveManifest(root, options.programId, manifest, { log });
531
643
  for (const id of downstreamCone(manifest.workstreams, [workstream.id])) {
532
644
  blockedCone.add(id);
533
645
  }
@@ -538,7 +650,7 @@ export async function authorProgram(options) {
538
650
  reason: `the manifest entry (name, scope, dependencies, or the program's ` +
539
651
  `success criteria) changed after ${workstream.taskFile} was ` +
540
652
  `authored, so the spec may be stale. Re-author it with ` +
541
- `\`nightshift author ${options.programId} --only ${workstream.id} --force\``,
653
+ `\`nightshift author ${options.programId} --from ${workstream.id} --force\``,
542
654
  };
543
655
  return base;
544
656
  }
@@ -557,8 +669,63 @@ export async function authorProgram(options) {
557
669
  const allDecisionsById = new Map();
558
670
  const first = await authorBrief(root, manifest, workstream, rosterById);
559
671
  base.demotedDependencies = first.demoted;
560
- let invocation = await invokeAgent(agentRunner, author, first.brief, root);
561
- base.summary = resolveSummary(invocation.output).text;
672
+ // Stamped before the agent can write anything (SC-01): the agent has
673
+ // whole-file write access, so a crash at any point after this line
674
+ // leaves a durable `in_progress` marker the next attempt classifies as
675
+ // interrupted, regardless of whether a partial file exists.
676
+ workstream.specStatus = "in_progress";
677
+ await saveManifest(root, options.programId, manifest, { log });
678
+ let invocation;
679
+ try {
680
+ invocation = await invokeAgent(agentRunner, author, first.brief, root, permits, "authorAgent", {
681
+ root,
682
+ programId: options.programId,
683
+ label: `${workstream.id}-author`,
684
+ log,
685
+ });
686
+ }
687
+ catch (error) {
688
+ // A spawn error here means the author agent never started — the same
689
+ // silent-exit shape SC-12 exists to prevent, just on the authoring
690
+ // path rather than the build one. Nothing was written, so this parks
691
+ // the workstream exactly like the "no spec was written" branch below,
692
+ // instead of letting the rejection travel through authorProgram (which
693
+ // runProgram awaits unguarded) into a process crash. `specStatus`
694
+ // stays `in_progress` — never cleared on a failure path — so a later
695
+ // retry resumes without needing --force (SC-07).
696
+ workstream.status = "parked";
697
+ await saveManifest(root, options.programId, manifest, { log });
698
+ for (const id of downstreamCone(manifest.workstreams, [workstream.id])) {
699
+ blockedCone.add(id);
700
+ }
701
+ base.outcome = {
702
+ status: "failed",
703
+ reason: `the author agent could not be spawned: ${error.message}. ` +
704
+ `Nothing was written to ${workstream.taskFile}.`,
705
+ };
706
+ return base;
707
+ }
708
+ const firstSummary = resolveSummary(invocation.output);
709
+ if (isAuthorProtocolFailure(invocation, firstSummary)) {
710
+ // The process reported failure, its prompt was not fully delivered, or
711
+ // it never produced the required summary contract — any spec it may
712
+ // have written cannot be trusted as complete (SC-07). Park exactly
713
+ // like a spawn failure and leave `specStatus` at `in_progress` so a
714
+ // force-free retry re-authors.
715
+ workstream.status = "parked";
716
+ await saveManifest(root, options.programId, manifest, { log });
717
+ for (const id of downstreamCone(manifest.workstreams, [workstream.id])) {
718
+ blockedCone.add(id);
719
+ }
720
+ base.summary = firstSummary.text;
721
+ base.outcome = {
722
+ status: "failed",
723
+ reason: `the author agent reported a protocol failure (${describeProtocolFailure(invocation, firstSummary)}); ` +
724
+ `not trusted as a finished spec.`,
725
+ };
726
+ return base;
727
+ }
728
+ base.summary = firstSummary.text;
562
729
  let parsed = extractDecisions(invocation.output);
563
730
  base.decisionErrors.push(...parsed.errors);
564
731
  for (const decision of parsed.decisions) {
@@ -577,12 +744,12 @@ export async function authorProgram(options) {
577
744
  if (merge.merged.length > 0) {
578
745
  const originalDependencies = workstream.dependencies.filter((id) => !merge.merged.includes(id));
579
746
  base.mergedDependencies = merge.merged;
580
- await saveManifest(root, options.programId, manifest);
747
+ await saveManifest(root, options.programId, manifest, { log });
581
748
  log(`${workstream.id}: merged new dependency edge(s): ${merge.merged.join(", ")}`);
582
749
  const cyclesNow = findCycles(manifest.workstreams);
583
750
  if (cyclesNow.length > 0) {
584
751
  workstream.dependencies = originalDependencies;
585
- await saveManifest(root, options.programId, manifest);
752
+ await saveManifest(root, options.programId, manifest, { log });
586
753
  throw new Error(`Dependency cycle(s) created by a discovered edge from ${workstream.id}: ` +
587
754
  `${cyclesNow.map((cycle) => cycle.join(" -> ")).join("; ")}. Re-plan with /plan-program.`);
588
755
  }
@@ -610,26 +777,67 @@ export async function authorProgram(options) {
610
777
  ].join("\n");
611
778
  const second = await authorBrief(root, manifest, workstream, rosterById, note);
612
779
  base.demotedDependencies = second.demoted;
613
- invocation = await invokeAgent(agentRunner, author, second.brief, root);
614
- base.summary = resolveSummary(invocation.output).text;
615
- parsed = extractDecisions(invocation.output);
616
- base.decisionErrors.push(...parsed.errors);
617
- for (const decision of parsed.decisions) {
618
- allDecisionsById.set(decisionFingerprint(workstream.id, decision), decision);
780
+ let reauthorInvocation;
781
+ try {
782
+ reauthorInvocation = await invokeAgent(agentRunner, author, second.brief, root, permits, "authorAgent", { root, programId: options.programId, label: `${workstream.id}-author-reauthor`, log });
783
+ }
784
+ catch (error) {
785
+ // Fail open: the first pass already wrote a spec and journaled
786
+ // decisions, so a spawn error on the optional re-author refresh
787
+ // must not undo that or crash the run — it keeps the
788
+ // pre-discovery spec and records the reason durably instead.
789
+ (base.stageErrors ??= []).push(`the author agent could not be spawned for ${workstream.id}'s re-author ` +
790
+ `pass: ${error.message}. The pre-discovery spec was kept.`);
619
791
  }
620
- await journalDecisions(workstream, parsed.decisions, baseCommit);
621
- base.decisionIds.push(...parsed.decisions.map((decision) => decisionFingerprint(workstream.id, decision)));
622
- const secondDeclaration = extractDependenciesDeclaration(invocation.output);
623
- if (secondDeclaration.ids.length > 0) {
624
- log(`${workstream.id}: additional dependency declaration after the ` +
625
- `re-author pass was not honored: ${secondDeclaration.ids.join(", ")}`);
792
+ if (reauthorInvocation !== undefined) {
793
+ const reauthorSummary = resolveSummary(reauthorInvocation.output);
794
+ if (isAuthorProtocolFailure(reauthorInvocation, reauthorSummary)) {
795
+ // A *returned* protocol failure on the re-author pass is treated
796
+ // exactly like one on the first invocation (SC-07): the process
797
+ // reported failure, its prompt was not fully delivered, or it
798
+ // never produced the summary contract, so nothing this pass
799
+ // produced can be trusted — park, isolate the downstream cone,
800
+ // and leave specStatus at in_progress for a force-free retry.
801
+ // This differs from a *thrown* spawn error above, which fails
802
+ // open because the first pass's spec is otherwise untouched; a
803
+ // returned failure carries no such guarantee.
804
+ workstream.status = "parked";
805
+ await saveManifest(root, options.programId, manifest, { log });
806
+ for (const id of downstreamCone(manifest.workstreams, [workstream.id])) {
807
+ blockedCone.add(id);
808
+ }
809
+ base.summary = reauthorSummary.text;
810
+ base.outcome = {
811
+ status: "failed",
812
+ reason: `the author agent reported a protocol failure during ${workstream.id}'s ` +
813
+ `re-author pass (${describeProtocolFailure(reauthorInvocation, reauthorSummary)}); ` +
814
+ `not trusted as a finished spec.`,
815
+ };
816
+ return base;
817
+ }
818
+ else {
819
+ invocation = reauthorInvocation;
820
+ base.summary = reauthorSummary.text;
821
+ parsed = extractDecisions(invocation.output);
822
+ base.decisionErrors.push(...parsed.errors);
823
+ for (const decision of parsed.decisions) {
824
+ allDecisionsById.set(decisionFingerprint(workstream.id, decision), decision);
825
+ }
826
+ await journalDecisions(workstream, parsed.decisions, baseCommit);
827
+ base.decisionIds.push(...parsed.decisions.map((decision) => decisionFingerprint(workstream.id, decision)));
828
+ const secondDeclaration = extractDependenciesDeclaration(invocation.output);
829
+ if (secondDeclaration.ids.length > 0) {
830
+ log(`${workstream.id}: additional dependency declaration after the ` +
831
+ `re-author pass was not honored: ${secondDeclaration.ids.join(", ")}`);
832
+ }
833
+ }
626
834
  }
627
835
  }
628
836
  }
629
837
  const final = await readFinishedSpec(root, workstream);
630
838
  if (final === undefined) {
631
839
  workstream.status = "parked";
632
- await saveManifest(root, options.programId, manifest);
840
+ await saveManifest(root, options.programId, manifest, { log });
633
841
  for (const id of downstreamCone(manifest.workstreams, [workstream.id])) {
634
842
  blockedCone.add(id);
635
843
  }
@@ -637,19 +845,24 @@ export async function authorProgram(options) {
637
845
  status: "failed",
638
846
  reason: `no spec was written to ${workstream.taskFile} (or it was left empty)`,
639
847
  };
640
- await reviewWorkstreamDecisions(workstream.id, [...allDecisionsById.values()], baseCommit);
848
+ const spawnErrors = await reviewWorkstreamDecisions(workstream.id, [...allDecisionsById.values()], baseCommit);
849
+ if (spawnErrors.length > 0)
850
+ (base.stageErrors ??= []).push(...spawnErrors);
641
851
  return base;
642
852
  }
643
853
  const critique = await runSpecCritique({
644
854
  root,
855
+ programId: options.programId,
645
856
  manifest,
646
857
  workstream,
647
858
  rosterById,
648
859
  spec: final,
649
860
  config,
650
861
  agentRunner,
862
+ permits,
651
863
  author,
652
864
  log,
865
+ pushStageError: (message) => (base.stageErrors ??= []).push(message),
653
866
  });
654
867
  base.specCritique = critique;
655
868
  const postCritique = await readFinishedSpec(root, workstream);
@@ -667,18 +880,38 @@ export async function authorProgram(options) {
667
880
  await appendLedgerEvents(root, options.programId, critiqueEvents);
668
881
  // Stamped after every dependency merge above, so the hash records the
669
882
  // manifest exactly as this spec's author last saw it — a later manifest
670
- // edit is drift; authoring's own merges are not.
883
+ // edit is drift; authoring's own merges are not. `specStatus` is
884
+ // deliberately NOT stamped `complete` in this same save (SC-01, SC-02):
885
+ // inside a repository, the durable signal is the git commit below, and a
886
+ // crash or throw from `commitPaths` between this save and the commit
887
+ // must still classify as interrupted on retry, not falsely complete with
888
+ // an unmade commit.
671
889
  workstream.specHash = specInputsHash(manifest, workstream);
672
- await saveManifest(root, options.programId, manifest);
890
+ await saveManifest(root, options.programId, manifest, { log });
673
891
  let commit;
674
892
  if (isRepository) {
675
893
  commit = await git.commitPaths(root, `nightshift(${options.programId}): author ${workstream.id} ${workstream.name}`, [workstream.taskFile, "docs/programs"]);
676
894
  }
677
- await reviewWorkstreamDecisions(workstream.id, [...allDecisionsById.values()], baseCommit);
895
+ // Outside a git repository there is no commit to wait for — the finished
896
+ // spec, its specHash, and this manifest save are already the durable
897
+ // state, so `complete` is stamped right here. Inside one, this still
898
+ // only runs after `commitPaths` above resolves, so the transition is
899
+ // recoverable on both sides of the commit (SC-01, SC-02).
900
+ workstream.specStatus = "complete";
901
+ await saveManifest(root, options.programId, manifest, { log });
902
+ {
903
+ const spawnErrors = await reviewWorkstreamDecisions(workstream.id, [...allDecisionsById.values()], baseCommit);
904
+ if (spawnErrors.length > 0)
905
+ (base.stageErrors ??= []).push(...spawnErrors);
906
+ }
678
907
  // Findings triage against the same pre-workstream diff base the decision
679
908
  // review used above — a spec-critique finding has no separate green
680
909
  // anchor the way a test-critique fix does.
681
- await reviewWorkstreamFindings(workstream.id, critiqueEvents, baseCommit);
910
+ {
911
+ const spawnErrors = await reviewWorkstreamFindings(workstream.id, critiqueEvents, baseCommit);
912
+ if (spawnErrors.length > 0)
913
+ (base.stageErrors ??= []).push(...spawnErrors);
914
+ }
682
915
  base.outcome = { status: "authored", ...(commit === undefined ? {} : { commit }) };
683
916
  return base;
684
917
  }
@@ -707,12 +940,14 @@ export async function authorProgram(options) {
707
940
  baseCommit,
708
941
  decider,
709
942
  agentRunner,
943
+ permits,
710
944
  git,
711
945
  isRepository,
712
946
  reviewed,
713
947
  triaged,
714
948
  now,
715
949
  log,
950
+ observe: { root, programId: options.programId, label: `${workstreamId}-decider-decision`, log },
716
951
  });
717
952
  }
718
953
  function reviewWorkstreamFindings(workstreamId, findings, baseCommit) {
@@ -725,12 +960,14 @@ export async function authorProgram(options) {
725
960
  baseCommit,
726
961
  decider,
727
962
  agentRunner,
963
+ permits,
728
964
  git,
729
965
  isRepository,
730
966
  reviewed,
731
967
  triaged,
732
968
  now,
733
969
  log,
970
+ observe: { root, programId: options.programId, label: `${workstreamId}-decider-finding`, log },
734
971
  });
735
972
  }
736
973
  }