opencode-swarm 7.199.6 → 7.200.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 (105) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/cli/attest-task-8ekwny8v.js +2209 -0
  4. package/dist/cli/{auto-checkpoint-gv21fb1h.js → auto-checkpoint-dqjk82s7.js} +9 -9
  5. package/dist/cli/{checkpoint-rd1bt793.js → checkpoint-2ahps2sp.js} +17 -17
  6. package/dist/cli/{coder-settlement-21zd1g3a.js → coder-settlement-1dk37pa9.js} +12 -12
  7. package/dist/cli/{config-doctor-mxe9nr78.js → config-doctor-73rctg85.js} +16 -16
  8. package/dist/cli/{core-7bd1sd36.js → core-y5mfws8v.js} +3 -3
  9. package/dist/cli/{curation-policy-w9y0db1n.js → curation-policy-43gq6t0y.js} +6 -6
  10. package/dist/cli/{curator-drift-21y19fnz.js → curator-drift-k7j9rcgp.js} +8 -8
  11. package/dist/cli/curator-llm-factory-rke0964p.js +82 -0
  12. package/dist/cli/{curator-7rf98h3k.js → curator-m278hyrq.js} +43 -43
  13. package/dist/cli/{doctor-knowledge-receipt-phase-id-6pdjxgfa.js → doctor-knowledge-receipt-phase-id-1m7pkzvt.js} +9 -9
  14. package/dist/cli/{evidence-summary-service-vdcx7fqd.js → evidence-summary-service-19k8x1g9.js} +20 -20
  15. package/dist/cli/{gate-evidence-ernx9gck.js → gate-evidence-hche0hf8.js} +15 -7
  16. package/dist/cli/guardrail-explain-jg5png4a.js +83 -0
  17. package/dist/cli/{guardrail-log-jr6b9rt3.js → guardrail-log-tvbgnxns.js} +7 -7
  18. package/dist/cli/{guardrail-reset-0qyt8vpd.js → guardrail-reset-v8kvh9cn.js} +43 -43
  19. package/dist/cli/{hive-promoter-2qwxrrsc.js → hive-promoter-bqfa763z.js} +43 -43
  20. package/dist/cli/{index-hx2f3j9w.js → index-0wg5q595.js} +2 -2
  21. package/dist/cli/{index-s4wbe96z.js → index-1rfgzsaw.js} +4 -4
  22. package/dist/cli/{index-zbygz217.js → index-1tpz99db.js} +2 -2
  23. package/dist/cli/{index-2cb644vj.js → index-22atsy06.js} +6 -6
  24. package/dist/cli/{index-x6rv0e00.js → index-35tf03js.js} +21 -14
  25. package/dist/cli/{index-gx2vp8gx.js → index-3t46mez1.js} +27 -1
  26. package/dist/cli/{index-syaa76vg.js → index-511hw14d.js} +47 -45
  27. package/dist/cli/{index-dqkr60bw.js → index-58cr1xg0.js} +172 -14
  28. package/dist/cli/{index-s9hekeej.js → index-71bqn1nn.js} +7 -7
  29. package/dist/cli/{index-zzpy5cx3.js → index-7v74n9a1.js} +12 -8
  30. package/dist/cli/{index-4cyc18bc.js → index-8a3aasag.js} +7 -7
  31. package/dist/cli/{index-jhjmf5sn.js → index-8rrs1nc0.js} +3 -3
  32. package/dist/cli/{index-j3rfbs45.js → index-99zt998b.js} +2 -2
  33. package/dist/cli/{index-qbhjey8k.js → index-9nmrw7ek.js} +3 -3
  34. package/dist/cli/{index-jmhn6ab5.js → index-ac8vdmgv.js} +2 -2
  35. package/dist/cli/{index-eyq1q1xn.js → index-bp476gwc.js} +2 -2
  36. package/dist/cli/{index-dtwj4hsk.js → index-c2k7q723.js} +2 -2
  37. package/dist/cli/{index-snx2vb1x.js → index-d083d1q7.js} +1 -1
  38. package/dist/cli/{index-n1ddn12j.js → index-dng8z8me.js} +1 -1
  39. package/dist/cli/{index-gdyqdhz1.js → index-e8m8bb1r.js} +4 -4
  40. package/dist/cli/{index-88d5kpjj.js → index-gwc7jahh.js} +1 -1
  41. package/dist/cli/{index-exj9yb0x.js → index-hg4qa0aq.js} +2704 -2208
  42. package/dist/cli/{index-f02p4yn4.js → index-hxp5jgd8.js} +2 -2
  43. package/dist/cli/{index-txh6dtnj.js → index-jbm301bq.js} +43 -43
  44. package/dist/cli/{index-0veqvgny.js → index-jy0mgzjq.js} +1 -1
  45. package/dist/cli/{index-eqw5vq9r.js → index-kwfhr3mz.js} +1 -1
  46. package/dist/cli/{index-vgb679vr.js → index-m9j9varx.js} +3 -3
  47. package/dist/cli/{index-tqtfjzb0.js → index-md2180vx.js} +3 -3
  48. package/dist/cli/{index-cwg99gea.js → index-n5k81wym.js} +7 -7
  49. package/dist/cli/{index-0je0mees.js → index-nq3zcrhm.js} +1 -1
  50. package/dist/cli/{index-3ct8kgfj.js → index-p5m71yph.js} +4 -4
  51. package/dist/cli/{index-7m2gcmm7.js → index-pyv8vzkx.js} +6 -6
  52. package/dist/cli/{index-270zfq1f.js → index-q1x73nnd.js} +6 -6
  53. package/dist/cli/{index-dz15f98h.js → index-q8vfw61p.js} +1 -1
  54. package/dist/cli/{index-r227g76y.js → index-qnabg1wp.js} +6 -6
  55. package/dist/cli/{index-b9f2j9bx.js → index-qnst0jwc.js} +3 -3
  56. package/dist/cli/{index-tsg61z0r.js → index-r02aqt0a.js} +2 -2
  57. package/dist/cli/{index-cyp3r8ar.js → index-rfvnq6wd.js} +10 -10
  58. package/dist/cli/{index-38fgg593.js → index-sk1rva12.js} +2 -2
  59. package/dist/cli/{index-bef4nhtj.js → index-tv9c3b3q.js} +4 -4
  60. package/dist/cli/{index-9y6yk1n0.js → index-vmevv6my.js} +1 -1
  61. package/dist/cli/{index-t67n8jhb.js → index-vqtca3xv.js} +2 -2
  62. package/dist/cli/{index-cs1d9e03.js → index-wfb6vrc2.js} +2 -2
  63. package/dist/cli/{index-3mzc5rqc.js → index-wr0n2w3z.js} +3 -3
  64. package/dist/cli/{index-b3ws03kp.js → index-x1z5d5kj.js} +1 -1
  65. package/dist/cli/{index-s5tgnsmh.js → index-x25rhkmk.js} +6 -6
  66. package/dist/cli/{index-exr153j1.js → index-yss701b3.js} +5 -5
  67. package/dist/cli/{index-0bw1jyen.js → index-yvv0my1a.js} +1 -1
  68. package/dist/cli/index.js +44 -44
  69. package/dist/cli/{knowledge-escalator-rsj9nqqt.js → knowledge-escalator-qcra58bx.js} +15 -15
  70. package/dist/cli/{knowledge-events-appww5kb.js → knowledge-events-9mnx1a3f.js} +13 -13
  71. package/dist/cli/{knowledge-link-t0ce3mw7.js → knowledge-link-2jsn9f6a.js} +5 -5
  72. package/dist/cli/{knowledge-store-n76rzv27.js → knowledge-store-fdneqf7z.js} +6 -6
  73. package/dist/cli/{knowledge-validator-ycxvjasa.js → knowledge-validator-7nj987ga.js} +8 -8
  74. package/dist/cli/{mcp-jy0gk3c8.js → mcp-0g34wmz4.js} +1 -1
  75. package/dist/cli/{model-preflight-rg0mppzf.js → model-preflight-g11ykgc0.js} +43 -43
  76. package/dist/cli/{pending-delegations-e6brjxp2.js → pending-delegations-5vme18wx.js} +13 -13
  77. package/dist/cli/{pr-subscriptions-vjsb5ydq.js → pr-subscriptions-cbx5p838.js} +12 -12
  78. package/dist/cli/{pr-workflow-gate-bj66aa9k.js → pr-workflow-gate-376gw6yj.js} +43 -43
  79. package/dist/cli/{runner-wq954cda.js → runner-vvd26z2z.js} +6 -6
  80. package/dist/cli/{scan-cursor-kkg94g0t.js → scan-cursor-x3j5wvfm.js} +7 -7
  81. package/dist/cli/{schema-d1exxwv8.js → schema-d98zzrpn.js} +1 -1
  82. package/dist/cli/{scope-persistence-3v9hce7b.js → scope-persistence-vkb8z4hc.js} +16 -16
  83. package/dist/cli/{server-jkcwkh8t.js → server-25svy6cb.js} +45 -45
  84. package/dist/cli/{skill-generator-wg8qfdm8.js → skill-generator-ktz33dt6.js} +17 -17
  85. package/dist/cli/{snapshot-coordination-init-xyffgya9.js → snapshot-coordination-init-74x3psxc.js} +43 -43
  86. package/dist/cli/{speckit-checkoff-61xn2c2v.js → speckit-checkoff-9t6cdn4a.js} +4 -4
  87. package/dist/cli/{telemetry-gena5typ.js → telemetry-cr8q16wk.js} +1 -1
  88. package/dist/cli/{workspace-snapshot-hzhz0rxw.js → workspace-snapshot-afqvh9bq.js} +3 -3
  89. package/dist/cli/{worktree-collision-ownership-gsv009xc.js → worktree-collision-ownership-7a1n1f9j.js} +14 -14
  90. package/dist/cli/{worktree-isolation-3sdvs69a.js → worktree-isolation-8snw7w34.js} +43 -43
  91. package/dist/commands/attest.d.ts +10 -0
  92. package/dist/commands/index.d.ts +1 -0
  93. package/dist/commands/registry.d.ts +8 -0
  94. package/dist/config/plan-schema.d.ts +44 -0
  95. package/dist/gate-evidence.d.ts +138 -1
  96. package/dist/index.js +561 -557
  97. package/dist/tools/attest-task.d.ts +67 -0
  98. package/dist/tools/phase-complete.d.ts +12 -0
  99. package/dist/tools/save-plan.d.ts +16 -0
  100. package/dist/tools/update-task-status.d.ts +1 -1
  101. package/dist/workflow/task-terminal.d.ts +1 -0
  102. package/dist/workflow/workflow-wal-schema.d.ts +2 -0
  103. package/package.json +1 -1
  104. package/dist/cli/curator-llm-factory-ab821je6.js +0 -82
  105. package/dist/cli/guardrail-explain-7jef0dhs.js +0 -83
@@ -6,37 +6,37 @@ import {
6
6
  WORKTREE_PROVISIONING_OWNER_LEASE_MS,
7
7
  removeWorktreeProvisioningOwner,
8
8
  scanWorktreeProvisioningOwnersForRecovery
9
- } from "./index-tsg61z0r.js";
9
+ } from "./index-r02aqt0a.js";
10
10
  import {
11
11
  scanDelegationFallbacksForRecovery,
12
12
  scanDelegationsForRecovery
13
- } from "./index-cyp3r8ar.js";
13
+ } from "./index-rfvnq6wd.js";
14
14
  import {
15
15
  scanWorktreeMergeFailuresForRecovery
16
16
  } from "./index-v3bmwmqw.js";
17
- import"./index-b3ws03kp.js";
18
- import"./index-j3rfbs45.js";
19
- import"./index-9y6yk1n0.js";
20
- import"./index-snx2vb1x.js";
17
+ import"./index-x1z5d5kj.js";
18
+ import"./index-99zt998b.js";
19
+ import"./index-vmevv6my.js";
20
+ import"./index-d083d1q7.js";
21
21
  import"./index-ry16d01s.js";
22
22
  import"./index-rdm3px0g.js";
23
- import"./index-3mzc5rqc.js";
23
+ import"./index-wr0n2w3z.js";
24
24
  import"./index-7pmbnjvj.js";
25
- import"./index-zbygz217.js";
26
- import"./index-cwg99gea.js";
25
+ import"./index-1tpz99db.js";
26
+ import"./index-n5k81wym.js";
27
27
  import"./index-vzm6zre7.js";
28
28
  import"./index-ae75rja9.js";
29
- import"./index-n1ddn12j.js";
30
- import"./index-jmhn6ab5.js";
31
- import"./index-dz15f98h.js";
29
+ import"./index-dng8z8me.js";
30
+ import"./index-ac8vdmgv.js";
31
+ import"./index-q8vfw61p.js";
32
32
  import"./index-t7hmqgjy.js";
33
- import"./index-dtwj4hsk.js";
33
+ import"./index-c2k7q723.js";
34
34
  import {
35
35
  canonicalRootKeyFresh
36
36
  } from "./index-te9hq2f4.js";
37
37
  import"./index-ejhxgyvm.js";
38
38
  import"./index-7g4c7s5r.js";
39
- import"./index-270zfq1f.js";
39
+ import"./index-q1x73nnd.js";
40
40
  import"./index-sp2cxpaq.js";
41
41
  import"./index-qbxk2rn6.js";
42
42
  import"./index-zgwm4ryv.js";
@@ -25,79 +25,79 @@ import {
25
25
  sanitizeWorktreeTaskId,
26
26
  standardWorktreeByCallID,
27
27
  standardWorktreeSerializationSessions
28
- } from "./index-exj9yb0x.js";
29
- import"./index-jhjmf5sn.js";
30
- import"./index-tqtfjzb0.js";
31
- import"./index-exr153j1.js";
28
+ } from "./index-hg4qa0aq.js";
29
+ import"./index-nq3zcrhm.js";
30
+ import"./index-8rrs1nc0.js";
31
+ import"./index-md2180vx.js";
32
+ import"./index-yss701b3.js";
33
+ import"./index-0wg5q595.js";
32
34
  import"./index-axqyjreb.js";
33
- import"./index-0je0mees.js";
34
- import"./index-hx2f3j9w.js";
35
35
  import"./index-txdagbh7.js";
36
- import"./index-t67n8jhb.js";
36
+ import"./index-qnabg1wp.js";
37
+ import"./index-vqtca3xv.js";
37
38
  import"./index-rdec0y3z.js";
38
- import"./index-b9f2j9bx.js";
39
- import"./index-s9hekeej.js";
40
- import"./index-gdyqdhz1.js";
41
- import"./index-r227g76y.js";
42
- import"./index-eyq1q1xn.js";
43
- import"./index-4cyc18bc.js";
39
+ import"./index-qnst0jwc.js";
40
+ import"./index-71bqn1nn.js";
41
+ import"./index-e8m8bb1r.js";
42
+ import"./index-bp476gwc.js";
43
+ import"./index-8a3aasag.js";
44
44
  import"./index-x5jwegqw.js";
45
- import"./index-tsg61z0r.js";
46
- import"./index-cyp3r8ar.js";
45
+ import"./index-r02aqt0a.js";
46
+ import"./index-rfvnq6wd.js";
47
47
  import"./index-8mrentmw.js";
48
48
  import"./index-pt7h91zc.js";
49
49
  import"./index-q7sjgr1y.js";
50
- import"./index-2cb644vj.js";
51
- import"./index-x6rv0e00.js";
50
+ import"./index-22atsy06.js";
51
+ import"./index-35tf03js.js";
52
52
  import"./index-6b295cas.js";
53
53
  import"./index-9nyqt3kb.js";
54
- import"./index-qbhjey8k.js";
54
+ import"./index-9nmrw7ek.js";
55
55
  import"./index-v3bmwmqw.js";
56
- import"./index-38fgg593.js";
57
- import"./index-dqkr60bw.js";
58
- import"./index-vgb679vr.js";
56
+ import"./index-sk1rva12.js";
57
+ import"./index-58cr1xg0.js";
58
+ import"./index-m9j9varx.js";
59
59
  import"./index-spggmr30.js";
60
- import"./index-s4wbe96z.js";
61
- import"./index-s5tgnsmh.js";
60
+ import"./index-1rfgzsaw.js";
61
+ import"./index-x25rhkmk.js";
62
62
  import"./index-m9zzj4ee.js";
63
- import"./index-b3ws03kp.js";
64
- import"./index-3ct8kgfj.js";
65
- import"./index-0veqvgny.js";
63
+ import"./index-x1z5d5kj.js";
64
+ import"./index-p5m71yph.js";
65
+ import"./index-jy0mgzjq.js";
66
66
  import"./index-rtry5xyf.js";
67
67
  import {
68
68
  resolveWorktreeIsolationConfig
69
- } from "./index-f02p4yn4.js";
69
+ } from "./index-hxp5jgd8.js";
70
70
  import"./index-g22dps7x.js";
71
71
  import"./index-0725jpp7.js";
72
- import"./index-7m2gcmm7.js";
73
- import"./index-j3rfbs45.js";
74
- import"./index-zzpy5cx3.js";
75
- import"./index-9y6yk1n0.js";
76
- import"./index-snx2vb1x.js";
72
+ import"./index-pyv8vzkx.js";
73
+ import"./index-99zt998b.js";
74
+ import"./index-7v74n9a1.js";
75
+ import"./index-vmevv6my.js";
76
+ import"./index-d083d1q7.js";
77
77
  import"./index-ry16d01s.js";
78
78
  import"./index-rdm3px0g.js";
79
- import"./index-3mzc5rqc.js";
79
+ import"./index-wr0n2w3z.js";
80
80
  import"./index-7pmbnjvj.js";
81
81
  import"./index-9rwhas09.js";
82
- import"./index-zbygz217.js";
83
- import"./index-cwg99gea.js";
82
+ import"./index-1tpz99db.js";
83
+ import"./index-n5k81wym.js";
84
84
  import"./index-vzm6zre7.js";
85
85
  import"./index-ae75rja9.js";
86
- import"./index-n1ddn12j.js";
87
- import"./index-jmhn6ab5.js";
88
- import"./index-dz15f98h.js";
86
+ import"./index-dng8z8me.js";
87
+ import"./index-ac8vdmgv.js";
88
+ import"./index-q8vfw61p.js";
89
89
  import"./index-t7hmqgjy.js";
90
- import"./index-dtwj4hsk.js";
90
+ import"./index-c2k7q723.js";
91
91
  import"./index-te9hq2f4.js";
92
92
  import"./index-ejhxgyvm.js";
93
93
  import"./index-7g4c7s5r.js";
94
- import"./index-270zfq1f.js";
95
- import"./index-gx2vp8gx.js";
96
- import"./index-88d5kpjj.js";
94
+ import"./index-q1x73nnd.js";
95
+ import"./index-3t46mez1.js";
96
+ import"./index-gwc7jahh.js";
97
97
  import"./index-sp2cxpaq.js";
98
98
  import"./index-qbxk2rn6.js";
99
99
  import"./index-zgwm4ryv.js";
100
- import"./index-0bw1jyen.js";
100
+ import"./index-yvv0my1a.js";
101
101
  import"./index-xfzkq1k4.js";
102
102
  import"./index-bk5tah7q.js";
103
103
  import"./index-gknz3bv1.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `/swarm attest <task_id>` (issue #3422): verify a git-external deliverable
3
+ * with the task's pinned read-only git anchors and record the durable
4
+ * external-evidence bundle that admits completion — the in-machine exit for
5
+ * tasks whose deliverable (commit/push, gh ops) can never produce a coder
6
+ * settlement. Human- or agent-invoked; everything fails closed exactly as
7
+ * the underlying executor does (undeclared tasks, non-read-only commands,
8
+ * mismatched anchors, oversized output all refuse).
9
+ */
10
+ export declare function handleAttestCommand(directory: string, args: string[], sessionID?: string): Promise<string>;
@@ -8,6 +8,7 @@ export { handleAgentsCommand } from './agents';
8
8
  export { handleAnalyzeCommand } from './analyze';
9
9
  export { handleApproveWriteCommand } from './approve-write';
10
10
  export { handleArchiveCommand } from './archive';
11
+ export { handleAttestCommand } from './attest';
11
12
  export { handleAutoProceedCommand } from './auto-proceed';
12
13
  export { handleBenchmarkCommand } from './benchmark';
13
14
  export { handleBrainstormCommand } from './brainstorm';
@@ -1082,6 +1082,14 @@ export declare const COMMAND_REGISTRY: {
1082
1082
  readonly category: "utility";
1083
1083
  readonly toolPolicy: "restricted";
1084
1084
  };
1085
+ readonly attest: {
1086
+ readonly handler: (ctx: CommandContext) => Promise<string>;
1087
+ readonly description: "Verify a git-external deliverable with pinned anchors <task_id>";
1088
+ readonly details: "Runs the task's pinned read-only git evidence_anchors (issue #3422) inside the project root and records the durable external-evidence bundle that admits completion — the in-machine exit for tasks whose deliverable (commit/push, gh ops) can never produce a coder settlement. Fail-closed: the plan task must declare evidence_class external_git with 1..16 anchors (expect exact / expect_prefix non-empty), every anchor runs as a bounded no-shell argv spawn (stdin ignored, 10s per anchor, 30s total; output over the 4096-char evidence bound refuses the anchor rather than truncating it), and only positively-known read-only git subcommands/flags (rev-list, log, rev-parse, show, diff) are admitted. Undeclared tasks, mismatched anchors, and non-read-only commands refuse exactly as the completion gate does. Declaration changes revoke stale proofs (a fresh attest is then required). See docs/commands.md and docs/plan-durability.md.";
1089
+ readonly args: "<task_id>";
1090
+ readonly category: "utility";
1091
+ readonly toolPolicy: "agent";
1092
+ };
1085
1093
  readonly recover: {
1086
1094
  readonly handler: (ctx: CommandContext) => Promise<string>;
1087
1095
  readonly description: "Recover wedged coder settlements [task_id] [--force]";
@@ -53,6 +53,23 @@ export declare const MigrationStatusSchema: z.ZodEnum<{
53
53
  migration_failed: "migration_failed";
54
54
  }>;
55
55
  export type MigrationStatus = z.infer<typeof MigrationStatusSchema>;
56
+ /**
57
+ * External-evidence anchor (issue #3422): a pinned read-only git assertion a
58
+ * task declares so `/swarm attest` can verify a git-external deliverable
59
+ * (commit/push, gh ops) without a coder settlement.
60
+ *
61
+ * `expect` matches the trimmed stdout exactly; `expect_prefix` requires a
62
+ * NON-EMPTY prefix of it (an empty prefix would match everything and attest
63
+ * nothing). At least one of the two must be present per anchor; both bounds
64
+ * mirror the durable-evidence storage cap so an anchor is never accepted with
65
+ * output that cannot be persisted verbatim.
66
+ */
67
+ export declare const ExternalEvidenceAnchorSchema: z.ZodObject<{
68
+ command: z.ZodString;
69
+ expect: z.ZodOptional<z.ZodString>;
70
+ expect_prefix: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>;
72
+ export type ExternalEvidenceAnchor = z.infer<typeof ExternalEvidenceAnchorSchema>;
56
73
  export declare const TaskSchema: z.ZodObject<{
57
74
  id: z.ZodString;
58
75
  phase: z.ZodNumber;
@@ -75,6 +92,15 @@ export declare const TaskSchema: z.ZodObject<{
75
92
  evidence_path: z.ZodOptional<z.ZodString>;
76
93
  blocked_reason: z.ZodOptional<z.ZodString>;
77
94
  fr_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ evidence_class: z.ZodOptional<z.ZodEnum<{
96
+ coder_mutation: "coder_mutation";
97
+ external_git: "external_git";
98
+ }>>;
99
+ evidence_anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
+ command: z.ZodString;
101
+ expect: z.ZodOptional<z.ZodString>;
102
+ expect_prefix: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>>>;
78
104
  }, z.core.$strip>;
79
105
  export type Task = z.infer<typeof TaskSchema>;
80
106
  export declare const PhaseSchema: z.ZodObject<{
@@ -110,6 +136,15 @@ export declare const PhaseSchema: z.ZodObject<{
110
136
  evidence_path: z.ZodOptional<z.ZodString>;
111
137
  blocked_reason: z.ZodOptional<z.ZodString>;
112
138
  fr_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ evidence_class: z.ZodOptional<z.ZodEnum<{
140
+ coder_mutation: "coder_mutation";
141
+ external_git: "external_git";
142
+ }>>;
143
+ evidence_anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
+ command: z.ZodString;
145
+ expect: z.ZodOptional<z.ZodString>;
146
+ expect_prefix: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strip>>>;
113
148
  }, z.core.$strip>>>;
114
149
  type: z.ZodOptional<z.ZodEnum<{
115
150
  code: "code";
@@ -156,6 +191,15 @@ export declare const PlanSchema: z.ZodObject<{
156
191
  evidence_path: z.ZodOptional<z.ZodString>;
157
192
  blocked_reason: z.ZodOptional<z.ZodString>;
158
193
  fr_refs: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ evidence_class: z.ZodOptional<z.ZodEnum<{
195
+ coder_mutation: "coder_mutation";
196
+ external_git: "external_git";
197
+ }>>;
198
+ evidence_anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
199
+ command: z.ZodString;
200
+ expect: z.ZodOptional<z.ZodString>;
201
+ expect_prefix: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strip>>>;
159
203
  }, z.core.$strip>>>;
160
204
  type: z.ZodOptional<z.ZodEnum<{
161
205
  code: "code";
@@ -16,6 +16,7 @@
16
16
  * authorization against a process with arbitrary same-user workspace access;
17
17
  * that requires a protected trust root outside the project workspace.
18
18
  */
19
+ import { z } from 'zod';
19
20
  import { appendTaskGateRequirementsReceiptIfNeeded } from './evidence/task-gate-requirements.js';
20
21
  import type { ReviewRouteEvidence } from './review/routing-enforcement.js';
21
22
  import type { TaskWorkflowState } from './state';
@@ -28,7 +29,7 @@ export interface GateEvidence {
28
29
  agent: string;
29
30
  }
30
31
  export declare const TASK_WORKFLOW_SCHEMA_MARKER: "exact-task-v1";
31
- 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"];
32
+ 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", "external_evidence_attested", "external_evidence_revoked"];
32
33
  export type TaskWorkflowTransitionOutcome = (typeof TASK_WORKFLOW_OUTCOMES)[number];
33
34
  export interface TaskWorkflowMetadata {
34
35
  schema: typeof TASK_WORKFLOW_SCHEMA_MARKER;
@@ -95,6 +96,17 @@ export interface TaskWorkflowMetadata {
95
96
  transitionId: string;
96
97
  declaredFiles: string[];
97
98
  };
99
+ /**
100
+ * Pinned external evidence bundle (issue #3422): the read-only git proof
101
+ * for a task declared `evidence_class: 'external_git'`, attested while the
102
+ * workflow is idle and preserved through the terminal task_completed write
103
+ * so a duplicate completion can re-validate the same current proof. Cleared
104
+ * by a new coder attribution window (dispatch_attempted /
105
+ * dispatch_no_mutation / accepted_mutation), by repair_idle's fresh
106
+ * generation, and by the declaration-change revoke; terminal states are
107
+ * never revoked (06-critic-review.md R4F1).
108
+ */
109
+ externalEvidence?: ExternalEvidenceBundle;
98
110
  }
99
111
  export interface TaskWorkflowSnapshot extends TaskWorkflowMetadata {
100
112
  authoritative: boolean;
@@ -237,6 +249,13 @@ export type TaskWorkflowTransitionEvent = {
237
249
  qaExempt?: boolean;
238
250
  /** Durable, non-forced completion of a trusted empty-scope settlement. */
239
251
  readOnlyNoMutation?: boolean;
252
+ /**
253
+ * Issue #3422: the caller proved the external bundle current via
254
+ * externalProofCurrent / isExternalEvidenceInitialCompletionEligible
255
+ * before forwarding the terminal event; the reducer still requires the
256
+ * durable bundle to exist and fully match before admitting it.
257
+ */
258
+ externalEvidence?: boolean;
240
259
  expectedGeneration: number;
241
260
  transitionId?: string;
242
261
  } | {
@@ -251,6 +270,27 @@ export type TaskWorkflowTransitionEvent = {
251
270
  type: 'repair_idle';
252
271
  expectedGeneration: number;
253
272
  transitionId?: string;
273
+ } | {
274
+ /**
275
+ * Issue #3422: pin the attest producer's validated read-only git bundle
276
+ * as durable workflow metadata. State-preserving (the gate_recorded
277
+ * precedent) and admitted from idle only — an external task never
278
+ * enters the coder QA lifecycle.
279
+ */
280
+ type: 'external_evidence_attested';
281
+ bundle: ExternalEvidenceBundle;
282
+ expectedGeneration: number;
283
+ transitionId?: string;
284
+ } | {
285
+ /**
286
+ * Issue #3422: the plan declaration changed under a nonterminal task, so
287
+ * the pinned bundle no longer describes the declared work. Terminal
288
+ * states are never revoked (06-critic-review.md R4F1).
289
+ */
290
+ type: 'external_evidence_revoked';
291
+ reason: 'declaration_changed';
292
+ expectedGeneration: number;
293
+ transitionId?: string;
254
294
  };
255
295
  export interface TaskEvidenceTransaction {
256
296
  taskId: string;
@@ -277,6 +317,29 @@ export interface TaskEvidenceTransaction {
277
317
  */
278
318
  save?(nextEvidence: TaskEvidence): Promise<TaskEvidence>;
279
319
  }
320
+ /**
321
+ * Durable external-evidence bundle (issue #3422): the pinned read-only git
322
+ * proof for a task whose deliverable is verified outside the coder QA
323
+ * lifecycle. The attest producer validates the bundle (digest recompute, all
324
+ * anchors matched, bounds) before publishing it through the
325
+ * `external_evidence_attested` transition; this schema is the persistence
326
+ * boundary that refuses anything malformed after the fact.
327
+ */
328
+ export declare const ExternalEvidenceBundleSchema: z.ZodObject<{
329
+ class: z.ZodLiteral<"external_git">;
330
+ transitionId: z.ZodString;
331
+ declarationDigest: z.ZodString;
332
+ anchors: z.ZodArray<z.ZodObject<{
333
+ command: z.ZodString;
334
+ expect: z.ZodOptional<z.ZodString>;
335
+ expect_prefix: z.ZodOptional<z.ZodString>;
336
+ matched: z.ZodBoolean;
337
+ exit_code: z.ZodNumber;
338
+ stdout: z.ZodString;
339
+ }, z.core.$strip>>;
340
+ attestedAt: z.ZodString;
341
+ }, z.core.$strip>;
342
+ export type ExternalEvidenceBundle = z.infer<typeof ExternalEvidenceBundleSchema>;
280
343
  export declare function parseTaskEvidence(raw: string, expectedTaskId: string): TaskEvidence;
281
344
  export declare const DEFAULT_REQUIRED_GATES: string[];
282
345
  export interface GateDerivationContext {
@@ -308,6 +371,80 @@ export declare function deriveApplicableGateSet(evidence: TaskEvidence | null |
308
371
  export declare function isReadOnlyNoMutationEligible(evidence: TaskEvidence | null | undefined, options?: {
309
372
  currentDeclaredFiles?: readonly string[] | null;
310
373
  }): boolean;
374
+ /**
375
+ * Inputs to the external-evidence declaration digest (issue #3422,
376
+ * 05-fix-plan.md §3): the exact task declaration plus the plan identity and
377
+ * evidence generation the digest binds.
378
+ */
379
+ export interface ExternalDeclarationInput {
380
+ taskId: string;
381
+ evidence_class: 'external_git';
382
+ evidence_anchors: ReadonlyArray<{
383
+ command: string;
384
+ expect?: string;
385
+ expect_prefix?: string;
386
+ }>;
387
+ plan_title: string;
388
+ plan_swarm: string;
389
+ generation: number;
390
+ }
391
+ /**
392
+ * Compute the declaration digest bound into an external evidence bundle:
393
+ * sha256 hex over the canonical JSON of `{taskId, evidence_class,
394
+ * evidence_anchors (ordered definitions only), plan_title, plan_swarm,
395
+ * generation}`.
396
+ *
397
+ * Deliberately CURSOR-FREE (issue #3422, 05-fix-plan.md §3): the whole-plan
398
+ * structure hash includes `current_phase`, which advances during the terminal
399
+ * plan write. Binding the digest to it would self-invalidate the proof in
400
+ * the crash window after plan.json advances and before the evidence
401
+ * transaction applies. Every revalidation recomputes this digest from the
402
+ * CURRENT plan task and CURRENT generation instead — no whole-plan hash is
403
+ * ever consulted.
404
+ */
405
+ export declare function computeExternalDeclarationDigest(input: ExternalDeclarationInput): string;
406
+ /** Plan identity inputs to the external declaration digest (issue #3422). */
407
+ export interface ExternalPlanIdentity {
408
+ title: string;
409
+ swarm: string;
410
+ }
411
+ /**
412
+ * The subset of a plan task the external-evidence predicates consult: the
413
+ * declaration fields save_plan validated (issue #3422).
414
+ */
415
+ export interface ExternalPlanTaskRef {
416
+ id: string;
417
+ evidence_class?: string;
418
+ evidence_anchors?: ReadonlyArray<{
419
+ command: string;
420
+ expect?: string;
421
+ expect_prefix?: string;
422
+ }> | undefined;
423
+ }
424
+ /**
425
+ * Proof-currency predicate (issue #3422, 05-fix-plan.md §4c / R3F1): true iff
426
+ * the task declares `external_git`, a bundle exists with at least one anchor,
427
+ * every anchor matched, and the bundle's declarationDigest equals the digest
428
+ * recomputed from the CURRENT plan declaration + CURRENT generation. There is
429
+ * NO workflow-state condition — this is the "proof is current" predicate
430
+ * usable in ANY state (mirroring isNoMutationSettlementMetadata's
431
+ * idle || complete acceptance), so duplicate completion, committed-WAL
432
+ * idempotent replay, terminal recovery, and check_gate_status on a completed
433
+ * task all re-validate the same way.
434
+ */
435
+ export declare function externalProofCurrent(plan: ExternalPlanIdentity, planTask: ExternalPlanTaskRef, evidence: TaskEvidence | null | undefined): boolean;
436
+ /**
437
+ * Initial-completion eligibility (issue #3422, 05-fix-plan.md §4c / R3F1):
438
+ * `externalProofCurrent` AND the authoritative workflow state is exactly
439
+ * `idle` (blocked removed — a blocked task reopens via the audited
440
+ * blocked → in_progress plan transition first). This is the R3F1 split's
441
+ * other half: the FIRST completion requires idle, while DUPLICATE
442
+ * completions and terminal recovery use `externalProofCurrent` and accept
443
+ * `complete`. Consults the authoritative snapshot (the
444
+ * isNoMutationSettlementMetadata pattern) so non-authoritative legacy
445
+ * metadata never admits an external completion.
446
+ */
447
+ export declare function isExternalEvidenceInitialCompletionEligible(plan: ExternalPlanIdentity, planTask: ExternalPlanTaskRef, evidence: TaskEvidence | null | undefined): boolean;
311
448
  export declare function reduceTaskWorkflowSnapshot(current: TaskWorkflowSnapshot, event: TaskWorkflowTransitionEvent, context: {
312
449
  requiredGates: string[];
313
450
  gates: Record<string, GateEvidence>;