opencode-swarm 7.142.0 → 7.143.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 (75) hide show
  1. package/.opencode/skills/execute/SKILL.md +1 -1
  2. package/.opencode/skills/phase-wrap/SKILL.md +2 -2
  3. package/dist/cli/{config-doctor-7xqerhnw.js → config-doctor-t1r5qwxk.js} +2 -2
  4. package/dist/cli/{core-nwmpg9t8.js → core-e30p4vz9.js} +1 -1
  5. package/dist/cli/{curation-policy-bzk13bj2.js → curation-policy-pkb2eeb1.js} +6 -6
  6. package/dist/cli/{curator-3wsaz7ay.js → curator-ctasdmmq.js} +29 -29
  7. package/dist/cli/curator-drift-49p3jnte.js +1 -1
  8. package/dist/cli/{curator-llm-factory-kbkddqk2.js → curator-llm-factory-y9xg7k6k.js} +29 -29
  9. package/dist/cli/{evidence-summary-service-wwfvpvxq.js → evidence-summary-service-7bmg5r8y.js} +13 -11
  10. package/dist/cli/{gate-evidence-3mazsjrq.js → gate-evidence-1v0cj4c6.js} +9 -5
  11. package/dist/cli/{guardrail-explain-rmz1yjzw.js → guardrail-explain-6x9psbwz.js} +30 -30
  12. package/dist/cli/{guardrail-log-8m4dnkgd.js → guardrail-log-pma4m8vr.js} +4 -4
  13. package/dist/cli/{hive-promoter-ss8dm52r.js → hive-promoter-g16grej1.js} +29 -29
  14. package/dist/cli/{index-kkxt9g8d.js → index-15h4dpsn.js} +3 -3
  15. package/dist/cli/{index-ae0j9qpc.js → index-1g473508.js} +31 -31
  16. package/dist/cli/{index-67vxmh1v.js → index-28jr28fg.js} +9 -9
  17. package/dist/cli/{index-vwyamc2d.js → index-2n8y67b4.js} +2 -2
  18. package/dist/cli/{index-ad93kz8m.js → index-336ra397.js} +1 -1
  19. package/dist/cli/{index-8g5aa1s7.js → index-6texwk9p.js} +2 -2
  20. package/dist/cli/{index-520ev2d7.js → index-7c4bxgdh.js} +1 -1
  21. package/dist/cli/{index-99eftm6b.js → index-82m5kwtd.js} +1 -1
  22. package/dist/cli/{index-mbeqw4cb.js → index-96h1v2jw.js} +1 -1
  23. package/dist/cli/{index-eytxcbm8.js → index-9v53ez3a.js} +6 -6
  24. package/dist/cli/{index-em1kfnss.js → index-erfnw81g.js} +3 -3
  25. package/dist/cli/index-fhxh447f.js +1372 -0
  26. package/dist/cli/{index-z7eeq0tt.js → index-fprxtq3q.js} +137 -36
  27. package/dist/cli/{index-e4y7mfp0.js → index-g0pbvfhw.js} +1 -1
  28. package/dist/cli/{index-hncahn40.js → index-htmsm37t.js} +5 -5
  29. package/dist/cli/{index-bd2h7r2w.js → index-k31en0ja.js} +3 -3
  30. package/dist/cli/{index-0dvx8f03.js → index-k92cagmt.js} +2 -2
  31. package/dist/cli/{index-26ynh10w.js → index-keskta0w.js} +9 -9
  32. package/dist/cli/{index-tzbd5050.js → index-kxpz3ncd.js} +4 -4
  33. package/dist/cli/{index-56knmbwf.js → index-m4v9kab1.js} +2615 -2048
  34. package/dist/cli/{index-2p3h7det.js → index-n96ay8w4.js} +1 -1
  35. package/dist/cli/{index-v8f3wa0e.js → index-q8st0mtw.js} +1 -1
  36. package/dist/cli/{index-sh3r66tt.js → index-r0tn9kpa.js} +1 -1
  37. package/dist/cli/{index-338zfvff.js → index-s2rcz51a.js} +1 -1
  38. package/dist/cli/{index-hgydkvty.js → index-s89y08tk.js} +2 -2
  39. package/dist/cli/{index-amepv9dh.js → index-sb16w4wj.js} +212 -10
  40. package/dist/cli/{index-ycd63sz3.js → index-tq5s07ta.js} +1 -1
  41. package/dist/cli/{index-gcn7tsr3.js → index-w7x7qxz2.js} +1 -1
  42. package/dist/cli/{index-7c5xtcfm.js → index-x6qq39e9.js} +3 -3
  43. package/dist/cli/{index-78p6nvcv.js → index-y9h2vqf6.js} +1 -1
  44. package/dist/cli/index.js +29 -29
  45. package/dist/cli/{knowledge-escalator-w235g6ce.js → knowledge-escalator-1b2hmcgn.js} +12 -12
  46. package/dist/cli/{knowledge-events-amn94djz.js → knowledge-events-vx4fqjzb.js} +10 -10
  47. package/dist/cli/{knowledge-link-xned4jbm.js → knowledge-link-fn5j3r4q.js} +5 -5
  48. package/dist/cli/{knowledge-store-3vb855ta.js → knowledge-store-t2qyr4yr.js} +6 -6
  49. package/dist/cli/{knowledge-validator-a8c185hw.js → knowledge-validator-c7871bjc.js} +8 -8
  50. package/dist/cli/{pending-delegations-8ccjby4b.js → pending-delegations-0hb97ps1.js} +4 -4
  51. package/dist/cli/{pr-subscriptions-gn7r3bg7.js → pr-subscriptions-b63t252j.js} +4 -4
  52. package/dist/cli/{runner-rhgkhy5e.js → runner-hrg7h2h4.js} +6 -6
  53. package/dist/cli/{scan-cursor-vjbjm140.js → scan-cursor-pnbpfjjc.js} +7 -7
  54. package/dist/cli/{schema-dd8mzm6k.js → schema-47xpcghn.js} +1 -1
  55. package/dist/cli/{scope-persistence-8j8d4874.js → scope-persistence-wxx1jpfw.js} +6 -6
  56. package/dist/cli/{skill-generator-a4apb7c2.js → skill-generator-s456hfta.js} +14 -14
  57. package/dist/cli/{telemetry-k9nxy24s.js → telemetry-xyfb5vm8.js} +1 -1
  58. package/dist/cli/{worktree-collision-ownership-183jk2dv.js → worktree-collision-ownership-ymdxetnn.js} +4 -4
  59. package/dist/cli/{worktree-isolation-j71zz7g9.js → worktree-isolation-d0xgp705.js} +29 -29
  60. package/dist/commands/close.d.ts +20 -2
  61. package/dist/gate-evidence.d.ts +24 -1
  62. package/dist/hooks/delegation-gate.d.ts +65 -0
  63. package/dist/index.js +462 -458
  64. package/dist/plan/ledger.d.ts +31 -1
  65. package/dist/plan/manager.d.ts +1 -0
  66. package/dist/state.d.ts +1 -1
  67. package/dist/workflow/close-terminal.d.ts +22 -0
  68. package/dist/workflow/coder-settlement.d.ts +0 -23
  69. package/dist/workflow/task-repair.d.ts +1 -0
  70. package/dist/workflow/task-terminal.d.ts +18 -23
  71. package/dist/workflow/workflow-wal-file.d.ts +20 -0
  72. package/dist/workflow/workflow-wal-schema.d.ts +67 -0
  73. package/dist/worktree/merge.d.ts +17 -0
  74. package/package.json +1 -1
  75. package/dist/cli/index-h2vpk15y.js +0 -623
@@ -9,16 +9,16 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-99eftm6b.js";
12
+ } from "./index-82m5kwtd.js";
13
13
  import"./index-k46me75h.js";
14
14
  import"./index-ee3x66a5.js";
15
- import"./index-bd2h7r2w.js";
16
- import"./index-7g4c7s5r.js";
17
15
  import"./index-ed5ykebp.js";
16
+ import"./index-k31en0ja.js";
17
+ import"./index-7g4c7s5r.js";
18
+ import"./index-s2rcz51a.js";
18
19
  import"./index-4nt52yr9.js";
19
20
  import"./index-zgwm4ryv.js";
20
21
  import"./index-zjygnfay.js";
21
- import"./index-338zfvff.js";
22
22
  import"./index-bpmtbmy9.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
@@ -3,16 +3,16 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-78p6nvcv.js";
7
- import"./index-0dvx8f03.js";
6
+ } from "./index-y9h2vqf6.js";
7
+ import"./index-k92cagmt.js";
8
8
  import"./index-y8552snf.js";
9
- import"./index-em1kfnss.js";
10
- import"./index-bd2h7r2w.js";
11
- import"./index-7g4c7s5r.js";
9
+ import"./index-erfnw81g.js";
12
10
  import"./index-ed5ykebp.js";
11
+ import"./index-k31en0ja.js";
12
+ import"./index-7g4c7s5r.js";
13
+ import"./index-s2rcz51a.js";
13
14
  import"./index-4nt52yr9.js";
14
15
  import"./index-zgwm4ryv.js";
15
- import"./index-338zfvff.js";
16
16
  import"./index-bpmtbmy9.js";
17
17
  import"./index-a76rekgs.js";
18
18
  export {
@@ -4,18 +4,18 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-8g5aa1s7.js";
8
- import"./index-26ynh10w.js";
7
+ } from "./index-6texwk9p.js";
8
+ import"./index-keskta0w.js";
9
9
  import"./index-ae75rja9.js";
10
- import"./index-gcn7tsr3.js";
11
- import"./index-em1kfnss.js";
12
- import"./index-bd2h7r2w.js";
13
- import"./index-7g4c7s5r.js";
10
+ import"./index-w7x7qxz2.js";
11
+ import"./index-erfnw81g.js";
14
12
  import"./index-ed5ykebp.js";
13
+ import"./index-k31en0ja.js";
14
+ import"./index-7g4c7s5r.js";
15
+ import"./index-s2rcz51a.js";
15
16
  import"./index-4nt52yr9.js";
16
17
  import"./index-zgwm4ryv.js";
17
18
  import"./index-bk5tah7q.js";
18
- import"./index-338zfvff.js";
19
19
  import"./index-bpmtbmy9.js";
20
20
  import"./index-a76rekgs.js";
21
21
  export {
@@ -96,7 +96,7 @@ import {
96
96
  resolveGeneratedAgentRole,
97
97
  resolveGuardrailsConfig,
98
98
  stripKnownSwarmPrefix
99
- } from "./index-v8f3wa0e.js";
99
+ } from "./index-q8st0mtw.js";
100
100
  import"./index-jqsfsqbx.js";
101
101
  import"./index-zjygnfay.js";
102
102
  import"./index-bk5tah7q.js";
@@ -23,20 +23,20 @@ import {
23
23
  tombstoneScopeBinding,
24
24
  writeScopeBindingToDisk,
25
25
  writeScopeToDisk
26
- } from "./index-eytxcbm8.js";
26
+ } from "./index-9v53ez3a.js";
27
+ import"./index-sb16w4wj.js";
27
28
  import"./index-556ja8an.js";
28
- import"./index-amepv9dh.js";
29
- import"./index-bd2h7r2w.js";
29
+ import"./index-k31en0ja.js";
30
30
  import"./index-7g4c7s5r.js";
31
+ import"./index-s2rcz51a.js";
31
32
  import"./index-4nt52yr9.js";
32
- import"./index-ad93kz8m.js";
33
+ import"./index-336ra397.js";
33
34
  import"./index-4rhhvd1a.js";
34
35
  import"./index-zgwm4ryv.js";
35
- import"./index-v8f3wa0e.js";
36
+ import"./index-q8st0mtw.js";
36
37
  import"./index-jqsfsqbx.js";
37
38
  import"./index-zjygnfay.js";
38
39
  import"./index-bk5tah7q.js";
39
- import"./index-338zfvff.js";
40
40
  import"./index-bpmtbmy9.js";
41
41
  import"./index-a76rekgs.js";
42
42
  export {
@@ -33,32 +33,32 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-7c5xtcfm.js";
37
- import"./index-67vxmh1v.js";
36
+ } from "./index-x6qq39e9.js";
37
+ import"./index-28jr28fg.js";
38
38
  import"./index-k46me75h.js";
39
39
  import"./index-ee3x66a5.js";
40
- import"./index-tzbd5050.js";
41
- import"./index-ycd63sz3.js";
40
+ import"./index-kxpz3ncd.js";
41
+ import"./index-tq5s07ta.js";
42
42
  import"./index-rtry5xyf.js";
43
- import"./index-26ynh10w.js";
43
+ import"./index-keskta0w.js";
44
44
  import"./index-ae75rja9.js";
45
- import"./index-gcn7tsr3.js";
46
- import"./index-em1kfnss.js";
47
- import"./index-bd2h7r2w.js";
48
- import"./index-7g4c7s5r.js";
45
+ import"./index-w7x7qxz2.js";
46
+ import"./index-erfnw81g.js";
49
47
  import"./index-ed5ykebp.js";
50
- import"./index-4nt52yr9.js";
51
- import"./index-vwyamc2d.js";
48
+ import"./index-2n8y67b4.js";
52
49
  import"./index-gprxjmm7.js";
53
50
  import"./index-n832052r.js";
54
- import"./index-ad93kz8m.js";
51
+ import"./index-k31en0ja.js";
52
+ import"./index-7g4c7s5r.js";
53
+ import"./index-s2rcz51a.js";
54
+ import"./index-4nt52yr9.js";
55
+ import"./index-336ra397.js";
55
56
  import"./index-4rhhvd1a.js";
56
57
  import"./index-zgwm4ryv.js";
57
- import"./index-v8f3wa0e.js";
58
+ import"./index-q8st0mtw.js";
58
59
  import"./index-jqsfsqbx.js";
59
60
  import"./index-zjygnfay.js";
60
61
  import"./index-bk5tah7q.js";
61
- import"./index-338zfvff.js";
62
62
  import"./index-bpmtbmy9.js";
63
63
  import"./index-a76rekgs.js";
64
64
  export {
@@ -13,7 +13,7 @@ import {
13
13
  startHeartbeatTracking,
14
14
  stopHeartbeatTracking,
15
15
  telemetry
16
- } from "./index-338zfvff.js";
16
+ } from "./index-s2rcz51a.js";
17
17
  import"./index-bpmtbmy9.js";
18
18
  import"./index-a76rekgs.js";
19
19
  export {
@@ -10,18 +10,18 @@ import {
10
10
  import {
11
11
  scanDelegationFallbacksForRecovery,
12
12
  scanDelegationsForRecovery
13
- } from "./index-520ev2d7.js";
13
+ } from "./index-7c4bxgdh.js";
14
14
  import"./index-k46me75h.js";
15
15
  import"./index-ee3x66a5.js";
16
- import"./index-bd2h7r2w.js";
17
- import"./index-7g4c7s5r.js";
18
16
  import"./index-ed5ykebp.js";
17
+ import"./index-k31en0ja.js";
18
+ import"./index-7g4c7s5r.js";
19
+ import"./index-s2rcz51a.js";
19
20
  import {
20
21
  bunSpawn
21
22
  } from "./index-4nt52yr9.js";
22
23
  import"./index-zgwm4ryv.js";
23
24
  import"./index-zjygnfay.js";
24
- import"./index-338zfvff.js";
25
25
  import"./index-bpmtbmy9.js";
26
26
  import"./index-a76rekgs.js";
27
27
 
@@ -20,61 +20,61 @@ import {
20
20
  sanitizeWorktreeTaskId,
21
21
  standardWorktreeByCallID,
22
22
  standardWorktreeSerializationSessions
23
- } from "./index-56knmbwf.js";
23
+ } from "./index-m4v9kab1.js";
24
24
  import"./index-4905hd2m.js";
25
25
  import"./index-ebwznsfy.js";
26
- import"./index-78p6nvcv.js";
27
- import"./index-2p3h7det.js";
26
+ import"./index-y9h2vqf6.js";
27
+ import"./index-n96ay8w4.js";
28
28
  import"./index-c8s9a3zh.js";
29
- import"./index-sh3r66tt.js";
30
- import"./index-z7eeq0tt.js";
29
+ import"./index-r0tn9kpa.js";
30
+ import"./index-fprxtq3q.js";
31
31
  import"./index-134d35c1.js";
32
- import"./index-0dvx8f03.js";
32
+ import"./index-k92cagmt.js";
33
33
  import"./index-y8552snf.js";
34
34
  import"./index-9ss2m4rs.js";
35
35
  import"./index-74hpm6sh.js";
36
- import"./index-7c5xtcfm.js";
37
- import"./index-hncahn40.js";
38
- import"./index-8g5aa1s7.js";
36
+ import"./index-x6qq39e9.js";
37
+ import"./index-htmsm37t.js";
38
+ import"./index-6texwk9p.js";
39
39
  import"./index-xmzmeknp.js";
40
- import"./index-99eftm6b.js";
41
- import"./index-eytxcbm8.js";
42
- import"./index-556ja8an.js";
43
- import"./index-amepv9dh.js";
40
+ import"./index-82m5kwtd.js";
44
41
  import"./index-zsrtt42s.js";
45
- import"./index-e4y7mfp0.js";
46
42
  import"./index-qwm6vdyv.js";
47
- import"./index-h2vpk15y.js";
48
- import"./index-520ev2d7.js";
43
+ import"./index-fhxh447f.js";
44
+ import"./index-g0pbvfhw.js";
45
+ import"./index-7c4bxgdh.js";
49
46
  import"./index-8fwhhayc.js";
50
47
  import"./index-q1exe2b3.js";
51
- import"./index-67vxmh1v.js";
48
+ import"./index-28jr28fg.js";
52
49
  import"./index-k46me75h.js";
53
50
  import"./index-ee3x66a5.js";
54
- import"./index-tzbd5050.js";
55
- import"./index-ycd63sz3.js";
51
+ import"./index-kxpz3ncd.js";
52
+ import"./index-tq5s07ta.js";
56
53
  import"./index-rtry5xyf.js";
57
- import"./index-26ynh10w.js";
54
+ import"./index-keskta0w.js";
58
55
  import"./index-ae75rja9.js";
59
- import"./index-gcn7tsr3.js";
60
- import"./index-em1kfnss.js";
61
- import"./index-bd2h7r2w.js";
62
- import"./index-7g4c7s5r.js";
56
+ import"./index-w7x7qxz2.js";
57
+ import"./index-erfnw81g.js";
63
58
  import"./index-ed5ykebp.js";
64
- import"./index-4nt52yr9.js";
65
59
  import {
66
60
  resolveWorktreeIsolationConfig
67
- } from "./index-vwyamc2d.js";
61
+ } from "./index-2n8y67b4.js";
68
62
  import"./index-gprxjmm7.js";
69
63
  import"./index-n832052r.js";
70
- import"./index-ad93kz8m.js";
64
+ import"./index-9v53ez3a.js";
65
+ import"./index-sb16w4wj.js";
66
+ import"./index-556ja8an.js";
67
+ import"./index-k31en0ja.js";
68
+ import"./index-7g4c7s5r.js";
69
+ import"./index-s2rcz51a.js";
70
+ import"./index-4nt52yr9.js";
71
+ import"./index-336ra397.js";
71
72
  import"./index-4rhhvd1a.js";
72
73
  import"./index-zgwm4ryv.js";
73
- import"./index-v8f3wa0e.js";
74
+ import"./index-q8st0mtw.js";
74
75
  import"./index-jqsfsqbx.js";
75
76
  import"./index-zjygnfay.js";
76
77
  import"./index-bk5tah7q.js";
77
- import"./index-338zfvff.js";
78
78
  import"./index-bpmtbmy9.js";
79
79
  import"./index-a76rekgs.js";
80
80
  export {
@@ -1,4 +1,5 @@
1
1
  import { loadPluginConfigWithMeta } from '../config';
2
+ import type { Plan } from '../config/plan-schema';
2
3
  import { type KnowledgeConfig, type PluginConfig } from '../config/schema';
3
4
  import { archiveEvidence } from '../evidence/manager';
4
5
  import { getGitRepositoryStatus, resetToMainAfterMerge, resetToRemoteBranch } from '../git/branch';
@@ -15,9 +16,9 @@ export declare const closeReceiptLifecycleInternals: {
15
16
  reconcilePhaseClose: typeof reconcilePhaseClose;
16
17
  };
17
18
  import { runFinalizeRewardSweep } from '../memory/finalize-reward-sweep';
18
- import { closePlanTerminalState } from '../plan/manager';
19
19
  import { type SessionReflectionResult } from '../services/session-reflection';
20
20
  import { endAgentSession, resetSwarmStatePreservingSingletons } from '../state';
21
+ import { type CloseTerminalResult } from '../workflow/close-terminal.js';
21
22
  import { type SqliteRowCounts } from './archive-sqlite';
22
23
  interface PlanPhase {
23
24
  id: number;
@@ -33,6 +34,22 @@ interface PlanData {
33
34
  title: string;
34
35
  phases: PlanPhase[];
35
36
  }
37
+ /**
38
+ * Close-command wrapper around the exact-task terminal reconciliation service.
39
+ *
40
+ * Deliberately NOT named `closePlanTerminalState`: `src/plan/manager.ts` exports a
41
+ * distinct function by that name (ledger-first phase/projection persistence), which
42
+ * `reconcileCloseTerminalState` itself calls downstream. Keeping the two identifiers
43
+ * distinct avoids a same-name collision across close.ts / close-terminal.ts /
44
+ * plan/manager.ts. The `_internals` key below stays `closePlanTerminalState` so the
45
+ * existing test seam is unchanged.
46
+ */
47
+ declare function reconcileCloseTerminalStateForPlan(directory: string, targetPlan: Plan, options: {
48
+ actor: string;
49
+ requestedClosedTaskIds: string[];
50
+ closedPhaseIds: number[];
51
+ originalStatuses?: Map<string, string>;
52
+ }): Promise<CloseTerminalResult | undefined>;
36
53
  interface CloseCommandOptions {
37
54
  sessionID?: string;
38
55
  skillReviewTimeoutMs?: number;
@@ -113,6 +130,7 @@ export interface CloseStageContext {
113
130
  closedPhaseIds: number[];
114
131
  closedTaskIds: string[];
115
132
  };
133
+ terminalizationError?: string;
116
134
  archiveResult: string;
117
135
  archivedFileCount: number;
118
136
  archivedActiveStateFiles: Set<string>;
@@ -274,7 +292,7 @@ export declare const _internals: {
274
292
  runAlignStage: typeof runAlignStage;
275
293
  runFinalizeDryRun: typeof runFinalizeDryRun;
276
294
  archiveEvidence: typeof archiveEvidence;
277
- closePlanTerminalState: typeof closePlanTerminalState;
295
+ closePlanTerminalState: typeof reconcileCloseTerminalStateForPlan;
278
296
  endAgentSession: typeof endAgentSession;
279
297
  flushAndDrainTelemetry: () => Promise<void>;
280
298
  };
@@ -22,7 +22,7 @@ export interface GateEvidence {
22
22
  agent: string;
23
23
  }
24
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"];
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", "task_closed", "repair_idle"];
26
26
  export type TaskWorkflowTransitionOutcome = (typeof TASK_WORKFLOW_OUTCOMES)[number];
27
27
  export interface TaskWorkflowMetadata {
28
28
  schema: typeof TASK_WORKFLOW_SCHEMA_MARKER;
@@ -35,6 +35,18 @@ export interface TaskWorkflowMetadata {
35
35
  lastOutcome: TaskWorkflowTransitionOutcome;
36
36
  lastTransitionId: string | null;
37
37
  updatedAt: string;
38
+ /**
39
+ * True when this task reached `complete` via a QA-exempt forced completion
40
+ * (`/swarm close` reconciling a task that plan.json already marked completed but
41
+ * for which no authoritative workflow evidence existed) rather than by passing
42
+ * the normal Stage B gates.
43
+ *
44
+ * Without this the durable evidence file is byte-identical for a genuinely
45
+ * QA'd completion and a forced one, so no consumer can tell them apart. Absent
46
+ * on evidence written before this field existed, which reads as "not forced" —
47
+ * the same answer those files would have given anyway.
48
+ */
49
+ forcedCompletion?: boolean;
38
50
  }
39
51
  export interface TaskWorkflowSnapshot extends TaskWorkflowMetadata {
40
52
  authoritative: boolean;
@@ -113,6 +125,10 @@ export type TaskWorkflowTransitionEvent = {
113
125
  type: 'task_blocked';
114
126
  expectedGeneration: number;
115
127
  transitionId?: string;
128
+ } | {
129
+ type: 'task_closed';
130
+ expectedGeneration: number;
131
+ transitionId?: string;
116
132
  } | {
117
133
  type: 'repair_idle';
118
134
  expectedGeneration: number;
@@ -176,6 +192,13 @@ export declare function recordAgentDispatch(directory: string, taskId: string, a
176
192
  /**
177
193
  * Returns the TaskEvidence for a task, or null if file missing or parse error.
178
194
  * Never throws.
195
+ *
196
+ * Note this collapses "no evidence file" and "evidence file is unreadable" into the
197
+ * same `null`, which degrades two delegation-gate checks when an older build reads
198
+ * evidence carrying a `workflow.state` it does not recognise. Tracked in #2199 — do
199
+ * not "fix" this by rethrowing here: two call sites iterate every task in the plan,
200
+ * so one corrupt file would block dispatch for all of them. The fix is a separate
201
+ * discriminated reader used at the two affected sites.
179
202
  */
180
203
  export declare function readTaskEvidence(directory: string, taskId: string): Promise<TaskEvidence | null>;
181
204
  /**
@@ -221,6 +221,15 @@ export interface CoverageMissDiagnostic {
221
221
  expectedSnippet: string;
222
222
  foundSnippet: string;
223
223
  divergenceOffset: number;
224
+ /**
225
+ * Issue #2204: the longest matching prefix fell under
226
+ * `COVERAGE_DIAG_MIN_PREFIX`, so the "divergence" is coincidental
227
+ * punctuation/noise rather than a real aligned prefix — the requirement
228
+ * text is effectively absent from ACCEPTANCE. Renderers must emit the
229
+ * "requirement text completely missing" fallback instead of a
230
+ * divergence pointer.
231
+ */
232
+ completelyMissing?: boolean;
224
233
  corruptionHint?: string;
225
234
  }
226
235
  /**
@@ -237,6 +246,30 @@ export declare function describeCoverageMiss(params: {
237
246
  normalizedExpected: string;
238
247
  normalizedAcceptance: string;
239
248
  }): CoverageMissDiagnostic;
249
+ /**
250
+ * Builds the ACCEPTANCE_FIELD_COVERAGE_MISMATCH error (#1687/#1896/#2063/#2204
251
+ * contract). Exported pure so the message contract — normalized-compare note,
252
+ * divergence pointer vs #2204 completely-missing fallback, mojibake warning,
253
+ * fenced paste-ready requirement body with its cap, and the anti-spelunking
254
+ * directive — stays unit-testable even though #2205's injection makes the
255
+ * toolBefore throw structurally unreachable today (injection and the
256
+ * coverage recheck share the same field list, id-resolution, and
257
+ * normalization logic, so whatever injection covers, the recheck also
258
+ * considers covered). This stays wired as defense-in-depth against a FUTURE
259
+ * divergence — e.g. someone edits `injectSpecRequirementsIntoAcceptance`'s
260
+ * field list, unknown-id handling, or normalization without updating
261
+ * `checkAcceptanceCoversFrRefs` to match, or vice versa.
262
+ */
263
+ export declare function buildAcceptanceCoverageMismatchError(params: {
264
+ targetAgent: string;
265
+ coverageTaskId: string | null;
266
+ coverageResult: {
267
+ covered: boolean;
268
+ missingId?: string;
269
+ diagnostic?: CoverageMissDiagnostic;
270
+ expectedBody?: string;
271
+ };
272
+ }): Error;
240
273
  /**
241
274
  * FR-001/FR-002/FR-005/SC-001/SC-002/SC-006 (issue #1687): mechanical coverage
242
275
  * check that the ACCEPTANCE text CONTAINS the verbatim requirement body for each
@@ -264,6 +297,38 @@ export declare function checkAcceptanceCoversFrRefs(params: {
264
297
  diagnostic?: CoverageMissDiagnostic;
265
298
  expectedBody?: string;
266
299
  };
300
+ /** Args fields (in precedence order) that may carry the ACCEPTANCE header. */
301
+ declare const ACCEPTANCE_ARGS_FIELDS: readonly ["prompt", "description", "task", "input", "message"];
302
+ export interface AcceptanceInjectionOutcome {
303
+ /** The args field that carried the ACCEPTANCE header and was mutated. */
304
+ field: (typeof ACCEPTANCE_ARGS_FIELDS)[number];
305
+ /** Spec ids whose verbatim bodies were appended. */
306
+ injectedIds: string[];
307
+ }
308
+ /**
309
+ * Issue #2205: programmatically guarantee verbatim FR/SC fidelity in the
310
+ * ACCEPTANCE field. The architect lists the task's mapped FR-###/SC-### ids on
311
+ * the ACCEPTANCE line (or pastes bodies itself, legacy style); this helper
312
+ * appends the VERBATIM requirement body from .swarm/spec.md — prefixed with the
313
+ * id, on its own line inside the ACCEPTANCE section — for every mapped id the
314
+ * current ACCEPTANCE text does not already cover, mutating the args field in
315
+ * place so the downstream coder/reviewer receives the exact requirement text.
316
+ *
317
+ * Coverage uses the SAME normalized-substring test as
318
+ * `checkAcceptanceCoversFrRefs` (shared helpers, no drift), so:
319
+ * - an already-verbatim legacy dispatch is a no-op;
320
+ * - an id missing from spec.md is skipped (fail-open, mirrored semantics);
321
+ * - after injection, every extractable id is covered by construction.
322
+ *
323
+ * Returns null when nothing was injected (no ACCEPTANCE header in any field,
324
+ * or every mapped id already covered). Throws never — mechanical failures are
325
+ * the caller's concern (the coverage block is already fail-open).
326
+ */
327
+ export declare function injectSpecRequirementsIntoAcceptance(params: {
328
+ args: Record<string, unknown>;
329
+ frRefs: string[];
330
+ specText: string;
331
+ }): AcceptanceInjectionOutcome | null;
267
332
  interface MessageInfo {
268
333
  role: string;
269
334
  agent?: string;