opencode-swarm 7.140.3 → 7.140.5

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 (148) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -1
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +11 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +6 -4
  4. package/.opencode/skills/discover/SKILL.md +1 -1
  5. package/.opencode/skills/durable-session-state/SKILL.md +82 -0
  6. package/.opencode/skills/engineering-conventions/SKILL.md +1 -1
  7. package/.opencode/skills/issue-ingest/SKILL.md +13 -7
  8. package/.opencode/skills/issue-tracer/SKILL.md +1 -1
  9. package/.opencode/skills/orchestrating-subagents/SKILL.md +113 -0
  10. package/.opencode/skills/parallel-work-check/SKILL.md +1 -1
  11. package/.opencode/skills/plan/SKILL.md +40 -12
  12. package/.opencode/skills/swarm-ci-monitor/SKILL.md +5 -3
  13. package/.opencode/skills/swarm-pr-feedback/SKILL.md +30 -4
  14. package/.opencode/skills/writing-tests/SKILL.md +1 -1
  15. package/dist/agents/architect.d.ts +2 -1
  16. package/dist/agents/reviewer-directive-compliance.d.ts +19 -5
  17. package/dist/background/pending-delegations.d.ts +5 -0
  18. package/dist/cli/{config-doctor-fnmfd35x.js → config-doctor-5vzpq4qa.js} +3 -3
  19. package/dist/cli/{core-p5cyej3r.js → core-xjzdc56e.js} +2 -2
  20. package/dist/cli/{curation-policy-d52h4g8t.js → curation-policy-avvb56x2.js} +6 -8
  21. package/dist/cli/{curator-3zpdqt9r.js → curator-5nytvg7p.js} +38 -38
  22. package/dist/cli/curator-llm-factory-rds75zhj.js +61 -0
  23. package/dist/cli/{evidence-summary-service-nfdc1ht9.js → evidence-summary-service-zq4gyx6g.js} +15 -12
  24. package/dist/cli/gate-evidence-smn2wqft.js +51 -0
  25. package/dist/cli/guardrail-explain-an7jvam1.js +62 -0
  26. package/dist/cli/{guardrail-log-82da8y5a.js → guardrail-log-0hnd2k9v.js} +4 -4
  27. package/dist/cli/{hive-promoter-af5yaxvt.js → hive-promoter-qe8pqg79.js} +38 -38
  28. package/dist/cli/{index-qksjaxpd.js → index-01ggt2mj.js} +49 -18
  29. package/dist/cli/{index-j1xmren9.js → index-0r2m0vbq.js} +12 -10
  30. package/dist/cli/{index-pg7n141e.js → index-0rx9t9w8.js} +1 -1
  31. package/dist/cli/{index-brh827g0.js → index-2bg901qt.js} +73 -32
  32. package/dist/cli/{index-8n4c3vec.js → index-386ts4tm.js} +4 -4
  33. package/dist/cli/{index-898f16j9.js → index-8rp1y4ab.js} +2 -2
  34. package/dist/cli/{index-hfvxhk4z.js → index-912qz4y0.js} +88 -88
  35. package/dist/cli/index-affh1gtg.js +2554 -0
  36. package/dist/cli/{index-1m1ksyqt.js → index-c432knmy.js} +1 -1
  37. package/dist/cli/{index-jvk119ck.js → index-e0mpz2j3.js} +54 -19
  38. package/dist/cli/{index-ry0hgg3m.js → index-epvhf50h.js} +37 -3
  39. package/dist/cli/{index-95bj4kaw.js → index-ex7r16gc.js} +2 -2
  40. package/dist/cli/{index-7d5jseea.js → index-jm4cpp4n.js} +5 -2
  41. package/dist/cli/{index-n408rw7n.js → index-jqsfsqbx.js} +27 -2
  42. package/dist/cli/{index-7kdd75se.js → index-kb5q9v34.js} +11 -9
  43. package/dist/cli/{index-jfjnn408.js → index-m9xrdjn0.js} +1 -1
  44. package/dist/cli/{index-pj9h75cc.js → index-mm2egvdt.js} +40 -40
  45. package/dist/cli/{index-8bnzzv3b.js → index-nwrwy8eb.js} +70 -34
  46. package/dist/cli/index-nyjtzmsj.js +43 -0
  47. package/dist/cli/{index-h2waehqq.js → index-p8kk34am.js} +3 -3
  48. package/dist/cli/{index-wf35ka4z.js → index-ptn13xjn.js} +3 -3
  49. package/dist/cli/{index-1kyex7z2.js → index-qwm6vdyv.js} +32 -1
  50. package/dist/cli/{index-p9dsb0tw.js → index-qy1nq52t.js} +2 -19
  51. package/dist/cli/{index-b9rd29ge.js → index-s1v0wza5.js} +6 -2
  52. package/dist/cli/{index-yyyk63kk.js → index-t5pytnca.js} +2 -2
  53. package/dist/cli/index-tjqzr3jc.js +623 -0
  54. package/dist/cli/{index-rs1f1bh0.js → index-vh05t3w5.js} +1 -1
  55. package/dist/cli/{index-adyxbmt5.js → index-wkt9fj06.js} +4 -4
  56. package/dist/cli/{index-kbfsp07d.js → index-wrb0gykj.js} +217 -15
  57. package/dist/cli/{index-xz8f1n1a.js → index-z7h37d63.js} +2 -2
  58. package/dist/cli/{index-q1q8b85k.js → index-z90nvqj3.js} +49315 -47331
  59. package/dist/cli/{index-b8zgtz81.js → index-zsrtt42s.js} +34 -1
  60. package/dist/cli/{index-gtbmabws.js → index-ztgn70jz.js} +2 -2
  61. package/dist/cli/index.js +37 -37
  62. package/dist/cli/{knowledge-escalator-7q59skqg.js → knowledge-escalator-4pfrc902.js} +20 -8
  63. package/dist/cli/{knowledge-events-3nwfdpq7.js → knowledge-events-3zkfnksk.js} +19 -6
  64. package/dist/cli/{knowledge-link-q46k9adx.js → knowledge-link-m9p80f4r.js} +5 -5
  65. package/dist/cli/{knowledge-store-0d83rhh3.js → knowledge-store-dpqgvvjt.js} +6 -6
  66. package/dist/cli/{knowledge-validator-6mfx91a2.js → knowledge-validator-2c7w87dk.js} +8 -9
  67. package/dist/cli/{pending-delegations-qzrx38y9.js → pending-delegations-cxx9tezp.js} +4 -4
  68. package/dist/cli/{pr-subscriptions-5s59h4dd.js → pr-subscriptions-2sfnb599.js} +4 -4
  69. package/dist/cli/{runner-y78d7ryb.js → runner-mky3vvht.js} +6 -6
  70. package/dist/cli/{scan-cursor-rc8q12ss.js → scan-cursor-1z60gwrw.js} +7 -7
  71. package/dist/cli/{schema-n9eaxp3a.js → schema-vpnkwvez.js} +2 -2
  72. package/dist/cli/{scope-persistence-dr1msqxw.js → scope-persistence-p9dmprry.js} +10 -5
  73. package/dist/cli/{skill-generator-q7c6vadg.js → skill-generator-yx7ka1cj.js} +19 -10
  74. package/dist/cli/{telemetry-sc57xtb0.js → telemetry-0x6kszvk.js} +1 -1
  75. package/dist/cli/{worktree-collision-ownership-7a8e6gr9.js → worktree-collision-ownership-wm5pse49.js} +8 -8
  76. package/dist/cli/worktree-isolation-bwc6ra8e.js +102 -0
  77. package/dist/cli/worktree-provisioning-owner-sjh7te1h.js +22 -0
  78. package/dist/commands/acknowledge-spec-drift.d.ts +4 -5
  79. package/dist/commands/ci-simulate.d.ts +7 -3
  80. package/dist/commands/close.d.ts +8 -0
  81. package/dist/commands/registry.d.ts +2 -2
  82. package/dist/commands/sdd.d.ts +15 -0
  83. package/dist/config/bundled-skills.d.ts +1 -1
  84. package/dist/config/evidence-schema.d.ts +3 -3
  85. package/dist/config/index.d.ts +2 -2
  86. package/dist/config/plan-schema.d.ts +8 -0
  87. package/dist/config/schema.d.ts +4 -2
  88. package/dist/council/council-evidence-writer.d.ts +1 -1
  89. package/dist/gate-evidence.d.ts +117 -4
  90. package/dist/git/branch.d.ts +1 -1
  91. package/dist/hooks/delegate-ack-collector.d.ts +5 -0
  92. package/dist/hooks/delegation-gate.d.ts +21 -0
  93. package/dist/hooks/hive-promoter.d.ts +4 -4
  94. package/dist/hooks/issue-trace-reducer.d.ts +7 -1
  95. package/dist/hooks/issue-trace-state.d.ts +18 -0
  96. package/dist/hooks/issue-trace.d.ts +3 -1
  97. package/dist/hooks/knowledge-application-gate.d.ts +8 -3
  98. package/dist/hooks/knowledge-application.d.ts +8 -5
  99. package/dist/hooks/knowledge-escalator.d.ts +9 -5
  100. package/dist/hooks/knowledge-events.d.ts +21 -8
  101. package/dist/hooks/knowledge-injector.d.ts +9 -0
  102. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +49 -0
  103. package/dist/hooks/knowledge-receipt-ledger.d.ts +305 -0
  104. package/dist/hooks/knowledge-receipt-observability.d.ts +28 -0
  105. package/dist/hooks/knowledge-receipt-validator.d.ts +13 -50
  106. package/dist/hooks/knowledge-store.d.ts +6 -1
  107. package/dist/hooks/knowledge-types.d.ts +12 -0
  108. package/dist/hooks/phase-complete-directive-gate.d.ts +3 -1
  109. package/dist/hooks/phase-directives.d.ts +4 -4
  110. package/dist/hooks/pr-workflow-gate.d.ts +34 -1
  111. package/dist/hooks/promotion-evidence-store.d.ts +14 -8
  112. package/dist/hooks/reviewer-verdict-parser.d.ts +34 -10
  113. package/dist/index.js +823 -779
  114. package/dist/knowledge/curation-policy.d.ts +0 -2
  115. package/dist/observability/catalog.d.ts +5 -3
  116. package/dist/observability/legacy.d.ts +4 -3
  117. package/dist/plan/ledger.d.ts +55 -0
  118. package/dist/plan/manager.d.ts +9 -0
  119. package/dist/plan/planning-profile.d.ts +27 -0
  120. package/dist/services/spec-drift-recovery.d.ts +84 -0
  121. package/dist/session/snapshot-writer.d.ts +3 -1
  122. package/dist/state.d.ts +19 -17
  123. package/dist/summaries/schema.d.ts +2 -2
  124. package/dist/telemetry.d.ts +1 -1
  125. package/dist/tools/convene-council.d.ts +6 -6
  126. package/dist/tools/index.d.ts +3 -0
  127. package/dist/tools/manifest.d.ts +3 -0
  128. package/dist/tools/phase-complete.d.ts +9 -0
  129. package/dist/tools/rebind-pr-feedback-head.d.ts +17 -0
  130. package/dist/tools/record-implementation-review.d.ts +19 -0
  131. package/dist/tools/record-recurrence-sweep.d.ts +17 -0
  132. package/dist/tools/run-pr-feedback-stage-a.d.ts +8 -0
  133. package/dist/tools/save-plan.d.ts +8 -0
  134. package/dist/tools/submit-phase-council-verdicts.d.ts +6 -6
  135. package/dist/tools/tool-metadata.d.ts +40 -28
  136. package/dist/tools/update-task-status.d.ts +13 -0
  137. package/dist/tools/write-final-council-evidence.d.ts +6 -6
  138. package/dist/types/events.d.ts +29 -1
  139. package/dist/workflow/coder-settlement.d.ts +62 -0
  140. package/dist/workflow/task-repair.d.ts +30 -0
  141. package/dist/workflow/task-terminal.d.ts +52 -0
  142. package/package.json +3 -1
  143. package/dist/cli/curator-llm-factory-2h0xb62t.js +0 -61
  144. package/dist/cli/gate-evidence-46qeyfc1.js +0 -32
  145. package/dist/cli/guardrail-explain-yktan15c.js +0 -62
  146. package/dist/cli/index-d181x9zr.js +0 -71
  147. package/dist/cli/index-n0pja0qs.js +0 -239
  148. package/dist/cli/index-n8jncheh.js +0 -666
@@ -0,0 +1,102 @@
1
+ // @bun
2
+ import {
3
+ MAX_TRACKED_STANDARD_WORKTREE_CALLS,
4
+ _internals,
5
+ abortStandardWorktreeDispatch,
6
+ awaitingMergeByCallID,
7
+ checkStandardWorktreeSerializationRelease,
8
+ cleanupStandardWorktreeForCallId,
9
+ computeLaneRuntimeProfile,
10
+ finishStandardWorktreeDispatch,
11
+ isLaneOwnedByCurrentSession,
12
+ parseLeanLaneIndex,
13
+ preProvisionCollisionCheck,
14
+ precreateStandardWorktreeSession,
15
+ preserveBackgroundWorktreeOwnershipForCallId,
16
+ preserveDirtyWorktreeAtPath,
17
+ preserveDirtyWorktreeForCallId,
18
+ readLaneEnvFileFromDisk,
19
+ resetStandardWorktreeIsolationState,
20
+ sanitizeWorktreeTaskId,
21
+ standardWorktreeByCallID,
22
+ standardWorktreeSerializationSessions
23
+ } from "./index-z90nvqj3.js";
24
+ import"./index-4905hd2m.js";
25
+ import"./index-41hkt36g.js";
26
+ import"./index-c432knmy.js";
27
+ import"./index-ptn13xjn.js";
28
+ import"./index-c8s9a3zh.js";
29
+ import"./index-z7h37d63.js";
30
+ import"./index-2bg901qt.js";
31
+ import"./index-134d35c1.js";
32
+ import"./index-t5pytnca.js";
33
+ import"./index-y8552snf.js";
34
+ import"./index-9ss2m4rs.js";
35
+ import"./index-74hpm6sh.js";
36
+ import"./index-kb5q9v34.js";
37
+ import"./index-e0mpz2j3.js";
38
+ import"./index-ztgn70jz.js";
39
+ import"./index-v2xrer41.js";
40
+ import"./index-m9xrdjn0.js";
41
+ import"./index-wkt9fj06.js";
42
+ import"./index-556ja8an.js";
43
+ import"./index-wrb0gykj.js";
44
+ import"./index-zsrtt42s.js";
45
+ import"./index-8rp1y4ab.js";
46
+ import"./index-qwm6vdyv.js";
47
+ import"./index-tjqzr3jc.js";
48
+ import"./index-s1v0wza5.js";
49
+ import"./index-8fwhhayc.js";
50
+ import"./index-q1exe2b3.js";
51
+ import"./index-affh1gtg.js";
52
+ import"./index-k46me75h.js";
53
+ import"./index-ee3x66a5.js";
54
+ import"./index-386ts4tm.js";
55
+ import"./index-qy1nq52t.js";
56
+ import"./index-rtry5xyf.js";
57
+ import"./index-01ggt2mj.js";
58
+ import"./index-ae75rja9.js";
59
+ import"./index-vh05t3w5.js";
60
+ import"./index-p8kk34am.js";
61
+ import"./index-912qz4y0.js";
62
+ import"./index-7g4c7s5r.js";
63
+ import"./index-ed5ykebp.js";
64
+ import"./index-4nt52yr9.js";
65
+ import {
66
+ resolveWorktreeIsolationConfig
67
+ } from "./index-nyjtzmsj.js";
68
+ import"./index-gprxjmm7.js";
69
+ import"./index-n832052r.js";
70
+ import"./index-nwrwy8eb.js";
71
+ import"./index-4rhhvd1a.js";
72
+ import"./index-zgwm4ryv.js";
73
+ import"./index-jm4cpp4n.js";
74
+ import"./index-jqsfsqbx.js";
75
+ import"./index-zjygnfay.js";
76
+ import"./index-bk5tah7q.js";
77
+ import"./index-epvhf50h.js";
78
+ import"./index-bpmtbmy9.js";
79
+ import"./index-a76rekgs.js";
80
+ export {
81
+ standardWorktreeSerializationSessions,
82
+ standardWorktreeByCallID,
83
+ sanitizeWorktreeTaskId,
84
+ resolveWorktreeIsolationConfig,
85
+ resetStandardWorktreeIsolationState,
86
+ readLaneEnvFileFromDisk,
87
+ preserveDirtyWorktreeForCallId,
88
+ preserveDirtyWorktreeAtPath,
89
+ preserveBackgroundWorktreeOwnershipForCallId,
90
+ precreateStandardWorktreeSession,
91
+ preProvisionCollisionCheck,
92
+ parseLeanLaneIndex,
93
+ isLaneOwnedByCurrentSession,
94
+ finishStandardWorktreeDispatch,
95
+ computeLaneRuntimeProfile,
96
+ cleanupStandardWorktreeForCallId,
97
+ checkStandardWorktreeSerializationRelease,
98
+ awaitingMergeByCallID,
99
+ abortStandardWorktreeDispatch,
100
+ _internals,
101
+ MAX_TRACKED_STANDARD_WORKTREE_CALLS
102
+ };
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import {
3
+ WORKTREE_LIFECYCLE_LOCK_FILE,
4
+ WORKTREE_PROVISIONING_OWNER_LEASE_MS,
5
+ recordWorktreeProvisioningOwner,
6
+ removeWorktreeProvisioningOwner,
7
+ scanWorktreeProvisioningOwnersForRecovery
8
+ } from "./index-qwm6vdyv.js";
9
+ import"./index-k46me75h.js";
10
+ import"./index-ee3x66a5.js";
11
+ import"./index-ed5ykebp.js";
12
+ import"./index-4nt52yr9.js";
13
+ import"./index-zgwm4ryv.js";
14
+ import"./index-zjygnfay.js";
15
+ import"./index-a76rekgs.js";
16
+ export {
17
+ scanWorktreeProvisioningOwnersForRecovery,
18
+ removeWorktreeProvisioningOwner,
19
+ recordWorktreeProvisioningOwner,
20
+ WORKTREE_PROVISIONING_OWNER_LEASE_MS,
21
+ WORKTREE_LIFECYCLE_LOCK_FILE
22
+ };
@@ -5,13 +5,12 @@
5
5
  * the resulting event mis-attributed the action. Callers now pass an
6
6
  * explicit actor so events.jsonl can distinguish the legitimate paths
7
7
  * ('user' from chat slash command, 'cli' from a real terminal) from any
8
- * unidentified caller ('unknown'). The Bash guardrail
9
- * (`src/hooks/guardrails.ts` section 23) blocks the agent-shell bypass at
10
- * the runtime layer; this parameter exists for forensic clarity.
8
+ * unidentified caller ('unknown').
11
9
  */
12
10
  export type SpecDriftAcknowledgedBy = 'user' | 'cli' | 'unknown';
13
11
  /**
14
- * Handle /swarm acknowledge-spec-drift command
15
- * Acknowledges and clears a previously detected spec drift staleness warning
12
+ * Handle /swarm acknowledge-spec-drift command.
13
+ * Acknowledges a previously detected spec-drift marker after reconciling
14
+ * plan hash, snapshot, and audit state in a retry-safe order.
16
15
  */
17
16
  export declare function handleAcknowledgeSpecDriftCommand(directory: string, _args: string[], acknowledgedBy?: SpecDriftAcknowledgedBy): Promise<string>;
@@ -14,20 +14,24 @@
14
14
  * merge-queue kick-outs.
15
15
  *
16
16
  * Input contract:
17
- * /swarm ci-simulate → uses current HEAD branch
18
- * /swarm ci-simulate <pr-ref> → uses the specified branch/ref
17
+ * /swarm ci-simulate → uses current HEAD branch
18
+ * /swarm ci-simulate <pr-ref> → uses the specified branch/ref
19
+ * /swarm ci-simulate <pr-ref> --base <ref> → validated explicit base for
20
+ * stacked/release-branch PRs
19
21
  */
20
22
  import * as fs from 'node:fs';
21
- import { getDefaultBaseBranch } from '../git/branch.js';
23
+ import { detectDefaultRemoteBranch, getDefaultBaseBranch } from '../git/branch.js';
22
24
  import { runExternalTool } from '../utils/external-tool-runner.js';
23
25
  export declare const _internals: {
24
26
  runExternalTool: typeof runExternalTool;
25
27
  getDefaultBaseBranch: typeof getDefaultBaseBranch;
28
+ detectDefaultRemoteBranch: typeof detectDefaultRemoteBranch;
26
29
  platform: string;
27
30
  osTmpdir: () => string;
28
31
  fs: {
29
32
  existsSync: typeof fs.existsSync;
30
33
  rmSync: typeof fs.rmSync;
34
+ realpathSync: (p: fs.PathLike) => string;
31
35
  };
32
36
  };
33
37
  /**
@@ -6,6 +6,14 @@ import { createCuratorLLMDelegate } from '../hooks/curator-llm-factory';
6
6
  import { runCuratorPostMortem } from '../hooks/curator-postmortem';
7
7
  import { checkHivePromotions } from '../hooks/hive-promoter';
8
8
  import { curateAndStoreSwarm } from '../hooks/knowledge-curator';
9
+ import { reconcilePhaseClose } from '../hooks/knowledge-receipt-ledger.js';
10
+ /** Narrow seam for receipt/plan ordering tests. */
11
+ export declare const closeReceiptLifecycleInternals: {
12
+ recordPhaseCloseIntent: (directory: string, phase: string, sessionId?: string, taskId?: string) => Promise<import("../hooks/knowledge-receipt-ledger.js").ReceiptLedgerResult<{
13
+ event_id: string;
14
+ }>>;
15
+ reconcilePhaseClose: typeof reconcilePhaseClose;
16
+ };
9
17
  import { runFinalizeRewardSweep } from '../memory/finalize-reward-sweep';
10
18
  import { closePlanTerminalState } from '../plan/manager';
11
19
  import { type SessionReflectionResult } from '../services/session-reflection';
@@ -701,8 +701,8 @@ export declare const COMMAND_REGISTRY: {
701
701
  readonly 'ci-simulate': {
702
702
  readonly handler: (ctx: CommandContext) => Promise<string>;
703
703
  readonly description: "Create a temporary merge-result worktree and run CI before merge queue entry";
704
- readonly args: "[--base origin/main] [--head <ref>]";
705
- readonly details: "Creates a detached temporary worktree under .swarm/ci-simulate from the base ref, merges the current worktree HEAD (or --head ref), runs fixed local CI gates (typecheck, Biome CI, build, unit/integration/security/smoke tests, drift check), then removes the worktree and prunes metadata. Intended as a pre-queue merge_group simulation helper.";
704
+ readonly args: "[pr-ref] [--base <ref>]";
705
+ readonly details: "Creates a detached temporary worktree under the OS temp dir (swarm-ci-simulate) from the base — an explicit validated --base <ref> when given (stacked/release-branch PRs), otherwise the detected default remote branch (origin/HEAD, init.defaultBranch, origin/main, origin/master, verified to exist) — merges the given PR ref (or the current ref), runs fixed local CI gates (typecheck, lint, build, test), then removes the worktree non-force and prunes metadata. Worktree removal is fail-closed: a blocked or dirty worktree is surfaced, never force-deleted. Intended as a pre-queue merge_group simulation helper.";
706
706
  readonly category: "agent";
707
707
  readonly toolPolicy: "agent";
708
708
  };
@@ -16,6 +16,21 @@ interface ParsedSddArgs {
16
16
  feature?: string;
17
17
  error?: string;
18
18
  }
19
+ /**
20
+ * Returns true when `value` contains characters that are unsafe in a directory
21
+ * name id: path separators, traversal sequences, bracket characters, or control/bidi
22
+ * characters.
23
+ *
24
+ * Shared by both --change and --feature so the same rejection logic is reused
25
+ * (task 2.2 explicit requirement; matches the pre-task baseline).
26
+ */
27
+ /**
28
+ * Issue #2131 criterion G: the allowed-mutations policy derived from the
29
+ * effective spec's source kind. Only a native swarm spec may be created,
30
+ * refined, or archived through the swarm tooling; projected sources
31
+ * (openspec / speckit) are read-only inputs — refine them in their own tool.
32
+ */
33
+ export declare function allowedMutationsFor(source: 'swarm' | 'openspec_projection' | 'speckit_projection'): string[];
19
34
  declare function parseArgs(args: string[]): ParsedSddArgs;
20
35
  export declare function handleSddStatusCommand(directory: string, args: string[]): Promise<string>;
21
36
  export declare function handleSddValidateCommand(directory: string, args: string[]): Promise<string>;
@@ -1,4 +1,4 @@
1
- export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup", "test-file-split", "fork-pr-operations", "parallel-work-check", "ci-fix-monitor", "issue-tracer"];
1
+ export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup", "test-file-split", "fork-pr-operations", "parallel-work-check", "ci-fix-monitor", "issue-tracer", "orchestrating-subagents", "durable-session-state"];
2
2
  export type BundledProjectSkill = (typeof BUNDLED_PROJECT_SKILLS)[number];
3
3
  /**
4
4
  * Project-private runtime location for plugin-owned skills. Repository-native
@@ -228,8 +228,8 @@ export declare const RetrospectiveEvidenceSchema: z.ZodObject<{
228
228
  }>;
229
229
  scope: z.ZodEnum<{
230
230
  global: "global";
231
- session: "session";
232
231
  project: "project";
232
+ session: "session";
233
233
  }>;
234
234
  }, z.core.$strip>>>;
235
235
  approaches_tried: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -751,8 +751,8 @@ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
751
751
  }>;
752
752
  scope: z.ZodEnum<{
753
753
  global: "global";
754
- session: "session";
755
754
  project: "project";
755
+ session: "session";
756
756
  }>;
757
757
  }, z.core.$strip>>>;
758
758
  approaches_tried: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1241,8 +1241,8 @@ export declare const EvidenceBundleSchema: z.ZodObject<{
1241
1241
  }>;
1242
1242
  scope: z.ZodEnum<{
1243
1243
  global: "global";
1244
- session: "session";
1245
1244
  project: "project";
1245
+ session: "session";
1246
1246
  }>;
1247
1247
  }, z.core.$strip>>>;
1248
1248
  approaches_tried: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -17,8 +17,8 @@ import { loadPluginConfigWithMeta } from './loader';
17
17
  export declare const _internals: {
18
18
  loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
19
19
  };
20
- export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
21
- export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
20
+ export type { ExecutionProfile, MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
21
+ export { ExecutionProfileSchema, MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
22
22
  export type { AgentOverrideConfig, ApplyPatchConfig, AutomationCapabilities, AutomationConfig, AutomationMode, AutoReviewBurnInDecision, AutoReviewConfig, AutoReviewReleaseContext, LeanTurboConfig, MemoryConfig, ModelPricingConfig, PhaseCompleteConfig, PipelineConfig, PluginConfig, PricingConfig, RepoGraphConfig, SkillPropagationConfig, SwarmConfig, TurboConfig, WorktreeIsolationConfig, } from './schema';
23
23
  export { AgentOverrideConfigSchema, ApplyPatchConfigSchema, AUTO_REVIEW_V8_BURN_IN_DECISION, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, AutoReviewConfigSchema, LeanTurboConfigSchema, MemoryConfigSchema, ModelPricingConfigSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, PricingConfigSchema, RepoGraphConfigSchema, resolveAutoReviewConfig, SkillPropagationConfigSchema, SwarmConfigSchema, TurboConfigSchema, WorktreeIsolationConfigSchema, } from './schema';
24
24
  export type { DeltaSpec, Obligation, SpecDelta, SpecRequirement, SpecScenario, SpecSection, SwarmSpec, } from './spec-schema';
@@ -6,6 +6,10 @@ export declare const ExecutionProfileSchema: z.ZodObject<{
6
6
  locked: z.ZodDefault<z.ZodBoolean>;
7
7
  auto_proceed: z.ZodDefault<z.ZodBoolean>;
8
8
  commit_after_each_completed_task: z.ZodDefault<z.ZodBoolean>;
9
+ planning_profile: z.ZodOptional<z.ZodEnum<{
10
+ balanced: "balanced";
11
+ strict: "strict";
12
+ }>>;
9
13
  }, z.core.$strip>;
10
14
  export type ExecutionProfile = z.infer<typeof ExecutionProfileSchema>;
11
15
  export declare const TaskStatusSchema: z.ZodEnum<{
@@ -173,6 +177,10 @@ export declare const PlanSchema: z.ZodObject<{
173
177
  locked: z.ZodDefault<z.ZodBoolean>;
174
178
  auto_proceed: z.ZodDefault<z.ZodBoolean>;
175
179
  commit_after_each_completed_task: z.ZodDefault<z.ZodBoolean>;
180
+ planning_profile: z.ZodOptional<z.ZodEnum<{
181
+ balanced: "balanced";
182
+ strict: "strict";
183
+ }>>;
176
184
  }, z.core.$strip>>;
177
185
  }, z.core.$strip>;
178
186
  export type Plan = z.infer<typeof PlanSchema>;
@@ -359,8 +359,8 @@ export declare const PhaseCompleteConfigSchema: z.ZodObject<{
359
359
  enabled: z.ZodDefault<z.ZodBoolean>;
360
360
  required_agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
361
361
  reviewer: "reviewer";
362
- test_engineer: "test_engineer";
363
362
  coder: "coder";
363
+ test_engineer: "test_engineer";
364
364
  }>>>;
365
365
  require_docs: z.ZodDefault<z.ZodBoolean>;
366
366
  policy: z.ZodDefault<z.ZodEnum<{
@@ -676,6 +676,7 @@ export declare const KnowledgeConfigSchema: z.ZodObject<{
676
676
  evergreen_utility: z.ZodDefault<z.ZodNumber>;
677
677
  low_utility_threshold: z.ZodDefault<z.ZodNumber>;
678
678
  min_retrievals_for_utility: z.ZodDefault<z.ZodNumber>;
679
+ receipt_close_grace_days: z.ZodDefault<z.ZodNumber>;
679
680
  schema_version: z.ZodDefault<z.ZodNumber>;
680
681
  directive_min_confidence: z.ZodDefault<z.ZodNumber>;
681
682
  same_project_weight: z.ZodDefault<z.ZodNumber>;
@@ -1769,8 +1770,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
1769
1770
  enabled: z.ZodDefault<z.ZodBoolean>;
1770
1771
  required_agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1771
1772
  reviewer: "reviewer";
1772
- test_engineer: "test_engineer";
1773
1773
  coder: "coder";
1774
+ test_engineer: "test_engineer";
1774
1775
  }>>>;
1775
1776
  require_docs: z.ZodDefault<z.ZodBoolean>;
1776
1777
  policy: z.ZodDefault<z.ZodEnum<{
@@ -2121,6 +2122,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
2121
2122
  evergreen_utility: z.ZodDefault<z.ZodNumber>;
2122
2123
  low_utility_threshold: z.ZodDefault<z.ZodNumber>;
2123
2124
  min_retrievals_for_utility: z.ZodDefault<z.ZodNumber>;
2125
+ receipt_close_grace_days: z.ZodDefault<z.ZodNumber>;
2124
2126
  schema_version: z.ZodDefault<z.ZodNumber>;
2125
2127
  directive_min_confidence: z.ZodDefault<z.ZodNumber>;
2126
2128
  same_project_weight: z.ZodDefault<z.ZodNumber>;
@@ -24,5 +24,5 @@ import type { CouncilSynthesis } from './types';
24
24
  export declare const _internals: {
25
25
  withTaskEvidenceLock: typeof withTaskEvidenceLock;
26
26
  };
27
- export declare function writeCouncilEvidence(workingDir: string, synthesis: CouncilSynthesis, attemptId?: string): Promise<void>;
27
+ export declare function writeCouncilEvidence(workingDir: string, synthesis: CouncilSynthesis, attemptId?: string, expectedGeneration?: number): Promise<void>;
28
28
  export declare function hasCouncilEvidenceAttempt(workingDir: string, taskId: string, attemptId: string, roundNumber: number): boolean;
@@ -15,11 +15,30 @@
15
15
  * authorization against a process with arbitrary same-user workspace access;
16
16
  * that requires a protected trust root outside the project workspace.
17
17
  */
18
+ import type { TaskWorkflowState } from './state';
18
19
  export interface GateEvidence {
19
20
  sessionId: string;
20
21
  timestamp: string;
21
22
  agent: string;
22
23
  }
24
+ export declare const TASK_WORKFLOW_SCHEMA_MARKER: "exact-task-v1";
25
+ declare const TASK_WORKFLOW_OUTCOMES: readonly ["none", "dispatch_attempted", "dispatch_no_mutation", "accepted_mutation", "accepted_mutation_failed", "stage_a_passed", "stage_a_failed", "stage_b_completed", "stage_b_failed", "gate_recorded", "task_completed", "task_blocked", "repair_idle"];
26
+ export type TaskWorkflowTransitionOutcome = (typeof TASK_WORKFLOW_OUTCOMES)[number];
27
+ export interface TaskWorkflowMetadata {
28
+ schema: typeof TASK_WORKFLOW_SCHEMA_MARKER;
29
+ generation: number;
30
+ state: TaskWorkflowState;
31
+ retryCount: number;
32
+ retryHistory: TaskWorkflowTransitionOutcome[];
33
+ /** Stable circuit-breaker cycle across accepted repair mutations. */
34
+ retryEpoch: number;
35
+ lastOutcome: TaskWorkflowTransitionOutcome;
36
+ lastTransitionId: string | null;
37
+ updatedAt: string;
38
+ }
39
+ export interface TaskWorkflowSnapshot extends TaskWorkflowMetadata {
40
+ authoritative: boolean;
41
+ }
23
42
  export interface TaskEvidence {
24
43
  taskId: string;
25
44
  required_gates: string[];
@@ -27,11 +46,90 @@ export interface TaskEvidence {
27
46
  turbo?: boolean;
28
47
  /** Durable proof that the coder dispatch was classified as exact Markdown-only. */
29
48
  test_engineer_exempt?: boolean;
49
+ /** Exact-task workflow metadata. Missing on legacy evidence written before #2098. */
50
+ workflow?: TaskWorkflowMetadata;
51
+ }
52
+ /**
53
+ * Fence ordinary evidence writers while a terminal or repair plan/evidence
54
+ * transaction is PREPARED. Only the owning WAL transition may proceed.
55
+ */
56
+ export declare function assertTaskEvidenceWriteAllowed(directory: string, taskId: string, event?: TaskWorkflowTransitionEvent): void;
57
+ export type TaskWorkflowTransitionEvent = {
58
+ type: 'dispatch_attempted';
59
+ agentType?: string;
60
+ context?: GateDerivationContext;
61
+ turbo?: boolean;
62
+ expectedGeneration: number;
63
+ transitionId?: string;
64
+ } | {
65
+ type: 'dispatch_no_mutation';
66
+ agentType?: string;
67
+ context?: GateDerivationContext;
68
+ turbo?: boolean;
69
+ expectedGeneration: number;
70
+ transitionId?: string;
71
+ } | {
72
+ type: 'accepted_mutation';
73
+ agentType?: string;
74
+ context?: GateDerivationContext;
75
+ turbo?: boolean;
76
+ expectedGeneration: number;
77
+ transitionId?: string;
78
+ } | {
79
+ type: 'stage_a_passed';
80
+ expectedGeneration: number;
81
+ transitionId?: string;
82
+ } | {
83
+ type: 'stage_a_failed';
84
+ expectedGeneration: number;
85
+ transitionId?: string;
86
+ } | {
87
+ type: 'stage_b_completed';
88
+ gate: 'reviewer' | 'test_engineer';
89
+ sessionId: string;
90
+ turbo?: boolean;
91
+ ensureDefaultStageB?: boolean;
92
+ expectedGeneration: number;
93
+ transitionId?: string;
94
+ } | {
95
+ type: 'stage_b_failed';
96
+ gate: 'reviewer' | 'test_engineer';
97
+ expectedGeneration: number;
98
+ transitionId?: string;
99
+ } | {
100
+ type: 'gate_recorded';
101
+ gate: string;
102
+ sessionId: string;
103
+ turbo?: boolean;
104
+ expectedGeneration?: number;
105
+ transitionId?: string;
106
+ } | {
107
+ type: 'task_completed';
108
+ /** Locked plan phase explicitly declares that reviewer QA is not required. */
109
+ qaExempt?: boolean;
110
+ expectedGeneration: number;
111
+ transitionId?: string;
112
+ } | {
113
+ type: 'task_blocked';
114
+ expectedGeneration: number;
115
+ transitionId?: string;
116
+ } | {
117
+ type: 'repair_idle';
118
+ expectedGeneration: number;
119
+ transitionId?: string;
120
+ };
121
+ export interface TaskEvidenceTransaction {
122
+ taskId: string;
123
+ read(): TaskEvidence | null;
124
+ transition(event: TaskWorkflowTransitionEvent): Promise<TaskEvidence>;
30
125
  }
126
+ export declare function parseTaskEvidence(raw: string, expectedTaskId: string): TaskEvidence;
31
127
  export declare const DEFAULT_REQUIRED_GATES: string[];
32
128
  export interface GateDerivationContext {
33
129
  /** Trusted pre/post workspace classification; false/absent fails closed. */
34
130
  testEngineerExempt?: boolean;
131
+ /** The shared-root coder changed files but returned a failed/cancelled result. */
132
+ settlementFailed?: boolean;
35
133
  }
36
134
  /**
37
135
  * Canonical task-id validation helper.
@@ -39,6 +137,12 @@ export interface GateDerivationContext {
39
137
  * Re-exported for backward compatibility with existing callers.
40
138
  */
41
139
  export declare function isValidTaskId(taskId: string): boolean;
140
+ export declare function getTaskWorkflowSnapshot(evidence: TaskEvidence | null | undefined): TaskWorkflowSnapshot;
141
+ export declare function reduceTaskWorkflowSnapshot(current: TaskWorkflowSnapshot, event: TaskWorkflowTransitionEvent, context: {
142
+ requiredGates: string[];
143
+ gates: Record<string, GateEvidence>;
144
+ nowIso: string;
145
+ }): TaskWorkflowMetadata;
42
146
  /**
43
147
  * Maps the first-dispatched agent type to the initial required_gates array.
44
148
  * Unknown agent types fall back to the safe default ["reviewer", "test_engineer"].
@@ -49,17 +153,24 @@ export declare function deriveRequiredGates(agentType: string, context?: GateDer
49
153
  * Sorted, deduplicated. Gates can only grow, never shrink.
50
154
  */
51
155
  export declare function expandRequiredGates(existingGates: string[], newAgentType: string, context?: GateDerivationContext): string[];
156
+ export declare function transitionTaskWorkflowEvidence(directory: string, taskId: string, event: TaskWorkflowTransitionEvent): Promise<TaskEvidence>;
157
+ export declare function withTaskEvidenceTransaction<T>(directory: string, taskId: string, agent: string, callback: (transaction: TaskEvidenceTransaction) => Promise<T>): Promise<T>;
52
158
  /**
53
159
  * Creates or updates .swarm/evidence/{taskId}.json with a gate pass entry.
54
160
  * If file doesn't exist: creates with required_gates from deriveRequiredGates(gate).
55
161
  * If file exists: merges gate entry, expands required_gates via expandRequiredGates.
56
162
  * Atomic write: temp file + rename.
57
163
  */
58
- export declare function recordGateEvidence(directory: string, taskId: string, gate: string, sessionId: string, turbo?: boolean): Promise<void>;
164
+ export declare function recordGateEvidence(directory: string, taskId: string, gate: string, sessionId: string, turbo?: boolean, options?: {
165
+ expectedGeneration?: number;
166
+ transitionId?: string;
167
+ ensureDefaultStageB?: boolean;
168
+ }): Promise<void>;
59
169
  /**
60
- * Sets or expands required_gates WITHOUT recording a gate pass.
61
- * Used when non-gate agents are dispatched (coder, explorer, sme, etc.).
62
- * Creates evidence file if it doesn't exist yet.
170
+ * Compatibility API for a settled non-gate dispatch. Coder callers represent
171
+ * an accepted mutation and therefore rotate the workflow generation; mere
172
+ * attempts must call `transitionTaskWorkflowEvidence(dispatch_attempted)` and
173
+ * failed/no-op settlements must use `dispatch_no_mutation` instead.
63
174
  */
64
175
  export declare function recordAgentDispatch(directory: string, taskId: string, agentType: string, turbo?: boolean, context?: GateDerivationContext): Promise<void>;
65
176
  /**
@@ -78,3 +189,5 @@ export declare function readTaskEvidenceRaw(directory: string, taskId: string):
78
189
  * Returns false if no evidence file exists.
79
190
  */
80
191
  export declare function hasPassedAllGates(directory: string, taskId: string): Promise<boolean>;
192
+ export declare function compareTaskWorkflowStateRank(left: TaskWorkflowState, right: TaskWorkflowState): number;
193
+ export {};
@@ -142,7 +142,7 @@ export interface ResetToRemoteBranchResult {
142
142
  /**
143
143
  * Detect the default remote branch using multiple fallback methods
144
144
  */
145
- declare function detectDefaultRemoteBranch(cwd: string): string | null;
145
+ export declare function detectDefaultRemoteBranch(cwd: string): string | null;
146
146
  /**
147
147
  * Reset local branch to align with its remote counterpart.
148
148
  * Safely handles uncommitted changes, unpushed commits, and detached HEAD states.
@@ -53,6 +53,11 @@ export interface CollectDelegateAcksResult {
53
53
  * promotion evidence.
54
54
  */
55
55
  unacknowledgedNonCritical: string[];
56
+ /** Typed authority failure: no V2 mutation was attempted. */
57
+ unverifiable?: {
58
+ code: 'missing_session_id';
59
+ detail: string;
60
+ };
56
61
  }
57
62
  /**
58
63
  * Core reconciliation used by both the runtime hook and tests. Returns a summary
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
8
8
  import type { PluginConfig } from '../config';
9
+ import type { Plan } from '../config/plan-schema';
10
+ import { type QaGates } from '../db/qa-gate-profile.js';
9
11
  import { loadPlanJsonOnly } from '../plan/manager';
10
12
  import type { AgentSessionState } from '../state';
11
13
  import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/delegation.js';
@@ -282,6 +284,18 @@ declare function extractPlanCriticVerdict(output: unknown): 'APPROVED' | 'NEEDS_
282
284
  * approval. Does not throw — returns `false` for any failure (fail-closed).
283
285
  */
284
286
  export declare function isPlanCriticApproved(directory: string): Promise<boolean>;
287
+ /**
288
+ * Resolve the effective critic-pre-plan policy for coder execution.
289
+ *
290
+ * Missing or unreadable profiles preserve the historical default (`true`). A
291
+ * persisted `false` is honored, while session overrides can only ratchet it
292
+ * back to `true` through `getEffectiveGates`.
293
+ */
294
+ export interface PlanCriticPolicyDecision {
295
+ required: boolean;
296
+ source: 'persisted_profile' | 'session_ratchet' | 'default_missing_profile' | 'corrupt_profile_conservative';
297
+ }
298
+ export declare function resolvePlanCriticPolicyForExecution(directory: string, plan: Plan, sessionOverrides?: Partial<QaGates>): PlanCriticPolicyDecision;
285
299
  /**
286
300
  * Escape hatch for the ratchet-tighter `critic_pre_plan` gate (issue #2012).
287
301
  *
@@ -348,6 +362,13 @@ declare function describeCoderScopeFailure(args: Record<string, unknown>, planTa
348
362
  * @returns Map of taskId -> verdict string
349
363
  */
350
364
  export declare function parsePerTaskVerdicts(outputText: string): Map<string, string>;
365
+ export declare function canRunWhileTaskAwaitsCompletion(input: {
366
+ directory: string | undefined;
367
+ normalizedTool: string;
368
+ args: Record<string, unknown>;
369
+ awaitingTaskId: string;
370
+ requestedTaskId: string | null;
371
+ }): boolean;
351
372
  declare function buildParallelExecutionGuidance(directory: string | undefined, sessionID: string, session: AgentSessionState): Promise<string | null>;
352
373
  /**
353
374
  * Resolves the correct task ID for evidence recording by chaining:
@@ -81,10 +81,9 @@ export declare const _internals: {
81
81
  transactHiveStore: typeof transactHiveStore;
82
82
  validateLesson: typeof validateLesson;
83
83
  authorizeCuration: typeof authorizeCuration;
84
- /** (#1849) Loads validated terminal-application evidence per swarm entry id
85
- * from .swarm/knowledge-promotion-evidence.jsonl. Empty when no validated
86
- * receipts exist yet (conservative: no synthetic credit). */
87
- loadPromotionEvidence: (directory: string) => Promise<Record<string, PromotionEvidenceRecord[]>>;
84
+ /** Loads authoritative terminal-application evidence per swarm entry id.
85
+ * Empty on receipt-ledger uncertainty (conservative: no synthetic credit). */
86
+ loadPromotionEvidence: (directory: string, canonicalCohortId?: string) => Promise<Record<string, PromotionEvidenceRecord[]>>;
88
87
  /** Loads the default KnowledgeConfig (schema defaults) for manual promotion
89
88
  * paths when the command did not load one. */
90
89
  loadDefaultKnowledgeConfig: () => {
@@ -105,6 +104,7 @@ export declare const _internals: {
105
104
  evergreen_utility: number;
106
105
  low_utility_threshold: number;
107
106
  min_retrievals_for_utility: number;
107
+ receipt_close_grace_days: number;
108
108
  schema_version: number;
109
109
  directive_min_confidence: number;
110
110
  same_project_weight: number;
@@ -55,6 +55,10 @@ export interface WorkflowArtifacts {
55
55
  reproductionPermitted: boolean;
56
56
  /** A verifiable publication receipt has been observed (issue #2131 2.4). */
57
57
  publicationObserved: boolean;
58
+ /** A valid recurrence-sweep receipt exists (issue #2131 residual B). */
59
+ recurrenceSweepVerified: boolean;
60
+ /** Fresh reviewer + critic APPROVE verdicts recorded (issue #2131 residual B). */
61
+ implementationReviewVerified: boolean;
58
62
  }
59
63
  export interface TransitionResult {
60
64
  nextMode: string | null;
@@ -82,7 +86,9 @@ export interface ComputeNextModeParams {
82
86
  * (f-block) Spec exists, no plan, reproduction NOT permitted → no-op
83
87
  * (g) Plan exists but critic not approved → no-op
84
88
  * (h) Critic approved, phases incomplete, not yet PLAN_TO_EXECUTE → EXECUTE
85
- * (i) All phases complete, not yet EXECUTE_TO_COMMIT publication_handoff + COMMIT directive
89
+ * (i-pre1) Phases complete, impl-review receipt missing one-shot REVIEW_GATE directive
90
+ * (i-pre2) Impl-review ok, recurrence-sweep receipt missing → one-shot RECURRENCE_GATE directive
91
+ * (i) All phases complete + both gates verified, not yet EXECUTE_TO_COMMIT → publication_handoff + COMMIT directive
86
92
  *
87
93
  * Idempotency: rows (f), (h), (i) return no-op when
88
94
  * `traceState.lastTransition` already equals the target transition value.