opencode-swarm 7.145.0 → 7.145.2

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/.opencode/skills/phase-wrap/SKILL.md +3 -2
  2. package/README.md +5 -1
  3. package/dist/background/workspace-snapshot.d.ts +29 -0
  4. package/dist/cli/{config-doctor-dzsv3pqy.js → config-doctor-j1r33f4q.js} +3 -3
  5. package/dist/cli/{core-qkh9me8x.js → core-c2zrd384.js} +4 -4
  6. package/dist/cli/{curation-policy-5x6346tf.js → curation-policy-xv0j8zyt.js} +6 -6
  7. package/dist/cli/{curator-zssndq5x.js → curator-gk2kmrk1.js} +31 -31
  8. package/dist/cli/{curator-llm-factory-q5p4578g.js → curator-llm-factory-sat3mn5n.js} +31 -31
  9. package/dist/cli/{evidence-summary-service-dqcpapj8.js → evidence-summary-service-0mhx0t0v.js} +14 -14
  10. package/dist/cli/{gate-evidence-bkdqryqg.js → gate-evidence-a5adh55x.js} +9 -9
  11. package/dist/cli/{guardrail-explain-kspf83x5.js → guardrail-explain-r50fery8.js} +32 -32
  12. package/dist/cli/{guardrail-log-qg4sq6gr.js → guardrail-log-p69eys6d.js} +4 -4
  13. package/dist/cli/{hive-promoter-3h7dhnek.js → hive-promoter-ay8a7sct.js} +31 -31
  14. package/dist/cli/{index-wk54ey3h.js → index-0a0asz2s.js} +1 -1
  15. package/dist/cli/{index-2dnqazyr.js → index-1g87esfp.js} +2 -2
  16. package/dist/cli/{index-0pcq32y2.js → index-2vefr1f8.js} +1 -1
  17. package/dist/cli/{index-fp464as8.js → index-4p3qfb05.js} +1 -1
  18. package/dist/cli/{index-77ef8gye.js → index-5e5a1y2r.js} +1 -1
  19. package/dist/cli/{index-0jr9zn34.js → index-612rr70a.js} +2 -2
  20. package/dist/cli/{index-apjdytwx.js → index-673axbjx.js} +3 -3
  21. package/dist/cli/{index-qfawexc8.js → index-6wf75rcm.js} +6 -6
  22. package/dist/cli/{index-k6pdsct6.js → index-7y5akvc9.js} +1 -1
  23. package/dist/cli/{index-hfzcztv6.js → index-9080b3de.js} +34 -34
  24. package/dist/cli/{index-v64kjqvg.js → index-917z76qr.js} +25 -18
  25. package/dist/cli/{index-ffdwj1an.js → index-97psh79d.js} +1 -1
  26. package/dist/cli/{index-kp87kr1a.js → index-9gt8g2qj.js} +4 -4
  27. package/dist/cli/{index-4e5a28h7.js → index-b9kxxd6k.js} +2 -2
  28. package/dist/cli/{index-pa86tpgt.js → index-bghwrr59.js} +1 -1
  29. package/dist/cli/{index-6ezbzd5e.js → index-cb2qtetk.js} +682 -181
  30. package/dist/cli/{index-v3y3qg48.js → index-cpg98bh1.js} +17 -1
  31. package/dist/cli/{index-c13ttmak.js → index-cxn95n7q.js} +180 -32
  32. package/dist/cli/{index-7g276m9m.js → index-czde45km.js} +3 -3
  33. package/dist/cli/{index-zfhe7vbb.js → index-gpnv14kq.js} +2 -2
  34. package/dist/cli/{index-6q3agdmr.js → index-j20fzn0w.js} +2 -2
  35. package/dist/cli/{index-mkks7jwg.js → index-jgb7mq2y.js} +4 -4
  36. package/dist/cli/{index-h4hasck4.js → index-jpppcckq.js} +4 -4
  37. package/dist/cli/{index-4evasm2b.js → index-kggqpefz.js} +5 -5
  38. package/dist/cli/{index-s6cwsnrw.js → index-n55a28zr.js} +254 -36
  39. package/dist/cli/{index-b3xret0a.js → index-ncfjxz9n.js} +5 -5
  40. package/dist/cli/{index-e00wbqw5.js → index-np4ytvvv.js} +2 -2
  41. package/dist/cli/{index-jy9bwa9k.js → index-nsr5b69r.js} +2 -2
  42. package/dist/cli/{index-zz5qsjd1.js → index-qyvjp0bq.js} +66 -38
  43. package/dist/cli/{index-6hqhyb0f.js → index-rk80jhef.js} +19 -5
  44. package/dist/cli/{index-4zwjc9sb.js → index-vav705md.js} +101 -4
  45. package/dist/cli/{index-s72naw1j.js → index-x8pm918t.js} +1 -1
  46. package/dist/cli/{index-b30x236n.js → index-z9yhhk6q.js} +96 -8
  47. package/dist/cli/index.js +32 -32
  48. package/dist/cli/{knowledge-escalator-w1mbaktt.js → knowledge-escalator-22apj3dj.js} +14 -14
  49. package/dist/cli/{knowledge-events-a0dj6gy6.js → knowledge-events-bx8xba9z.js} +12 -12
  50. package/dist/cli/{knowledge-link-mzdjvjsd.js → knowledge-link-82ew2yc4.js} +5 -5
  51. package/dist/cli/{knowledge-store-8kk3rghx.js → knowledge-store-nc71kfsg.js} +6 -6
  52. package/dist/cli/{knowledge-validator-91ym56e0.js → knowledge-validator-g8ne80v6.js} +8 -8
  53. package/dist/cli/model-preflight-7ea00h34.js +170 -0
  54. package/dist/cli/{pending-delegations-6vsrmw5w.js → pending-delegations-kkrczqv7.js} +3 -3
  55. package/dist/cli/{pr-subscriptions-zc3skxde.js → pr-subscriptions-2xn238xt.js} +3 -3
  56. package/dist/cli/{runner-jj32v8bk.js → runner-pqsf809k.js} +6 -6
  57. package/dist/cli/{scan-cursor-12jxwd14.js → scan-cursor-6ksgv514.js} +7 -7
  58. package/dist/cli/{schema-nq9tcz87.js → schema-mpcm7nje.js} +2 -2
  59. package/dist/cli/{scope-persistence-dv6z7n08.js → scope-persistence-mj1w3hqw.js} +11 -8
  60. package/dist/cli/{skill-generator-drscnzq9.js → skill-generator-gsa6qwwt.js} +16 -16
  61. package/dist/cli/{telemetry-z54dgdrh.js → telemetry-t109dhv7.js} +1 -1
  62. package/dist/cli/{workspace-snapshot-q21mgbsh.js → workspace-snapshot-kznz5e13.js} +4 -2
  63. package/dist/cli/{worktree-collision-ownership-rfyyjjct.js → worktree-collision-ownership-2jtg2my1.js} +8 -8
  64. package/dist/cli/{worktree-isolation-4tehtym5.js → worktree-isolation-ajzyp2gm.js} +33 -31
  65. package/dist/config/schema.d.ts +2 -2
  66. package/dist/evidence/task-gate-repair.d.ts +26 -0
  67. package/dist/evidence/task-gate-requirements.d.ts +20 -0
  68. package/dist/gate-evidence.d.ts +7 -0
  69. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +4 -0
  70. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +2 -0
  71. package/dist/hooks/knowledge-receipt-ledger.d.ts +72 -3
  72. package/dist/hooks/knowledge-receipt-observability.d.ts +1 -1
  73. package/dist/hooks/phase-complete-directive-gate.d.ts +9 -0
  74. package/dist/index.js +566 -546
  75. package/dist/observability/catalog.d.ts +2 -2
  76. package/dist/plan/manager.d.ts +8 -0
  77. package/dist/review/diff-source.d.ts +30 -0
  78. package/dist/review/engine.d.ts +1 -0
  79. package/dist/review/evidence.d.ts +16 -2
  80. package/dist/review/phase-runner.d.ts +1 -0
  81. package/dist/scope/scope-binding.d.ts +16 -0
  82. package/dist/services/model-preflight.d.ts +151 -0
  83. package/dist/services/session-reflection.d.ts +24 -0
  84. package/dist/telemetry.d.ts +12 -1
  85. package/dist/tools/completion-verify.d.ts +2 -0
  86. package/dist/tools/convene-council.d.ts +1 -1
  87. package/dist/tools/index.d.ts +4 -0
  88. package/dist/tools/manifest.d.ts +4 -0
  89. package/dist/tools/phase-complete/gates/final-review-gate.d.ts +3 -3
  90. package/dist/tools/phase-complete/gates/types.d.ts +2 -2
  91. package/dist/tools/phase-complete/preflight-report.d.ts +66 -0
  92. package/dist/tools/phase-complete/snapshot-identity.d.ts +1 -0
  93. package/dist/tools/phase-complete.d.ts +66 -3
  94. package/dist/tools/placeholder-scan.d.ts +64 -0
  95. package/dist/tools/record-directive-override.d.ts +14 -0
  96. package/dist/tools/repair-gate-evidence.d.ts +6 -0
  97. package/dist/tools/repair-knowledge-receipt-ledger.d.ts +27 -0
  98. package/dist/tools/run-phase-review.d.ts +37 -0
  99. package/dist/tools/sast-scan.d.ts +6 -0
  100. package/dist/tools/submit-phase-council-verdicts.d.ts +1 -1
  101. package/dist/tools/tool-metadata.d.ts +32 -16
  102. package/dist/tools/write-final-council-evidence.d.ts +1 -1
  103. package/dist/tools/write-retro.d.ts +2 -0
  104. package/package.json +1 -1
  105. package/dist/cli/{curator-drift-yn5d0mvq.js → curator-drift-r50x1rac.js} +1 -1
@@ -23,19 +23,22 @@ import {
23
23
  tombstoneScopeBinding,
24
24
  writeScopeBindingToDisk,
25
25
  writeScopeToDisk
26
- } from "./index-4zwjc9sb.js";
27
- import"./index-apjdytwx.js";
26
+ } from "./index-vav705md.js";
27
+ import"./index-673axbjx.js";
28
28
  import"./index-556ja8an.js";
29
- import"./index-0pcq32y2.js";
30
- import"./index-zfhe7vbb.js";
31
- import"./index-v3y3qg48.js";
29
+ import"./index-2vefr1f8.js";
30
+ import"./index-gpnv14kq.js";
31
+ import"./index-cpg98bh1.js";
32
32
  import"./index-9e6fdz2h.js";
33
33
  import"./index-4rhhvd1a.js";
34
+ import"./index-w8pgjr75.js";
35
+ import"./index-z6xqpmqg.js";
36
+ import"./index-zj6t9zgx.js";
34
37
  import"./index-zjygnfay.js";
35
38
  import"./index-bk5tah7q.js";
36
- import"./index-4evasm2b.js";
37
- import"./index-pa86tpgt.js";
38
- import"./index-zz5qsjd1.js";
39
+ import"./index-kggqpefz.js";
40
+ import"./index-bghwrr59.js";
41
+ import"./index-qyvjp0bq.js";
39
42
  import"./index-7g4c7s5r.js";
40
43
  import"./index-bpmtbmy9.js";
41
44
  import"./index-ed5ykebp.js";
@@ -33,31 +33,31 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-mkks7jwg.js";
37
- import"./index-h4hasck4.js";
38
- import"./index-fp464as8.js";
36
+ } from "./index-jgb7mq2y.js";
37
+ import"./index-jpppcckq.js";
38
+ import"./index-4p3qfb05.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-qfawexc8.js";
41
- import"./index-c13ttmak.js";
42
- import"./index-7g276m9m.js";
40
+ import"./index-6wf75rcm.js";
41
+ import"./index-cxn95n7q.js";
42
+ import"./index-czde45km.js";
43
43
  import"./index-gprxjmm7.js";
44
44
  import"./index-n832052r.js";
45
+ import"./index-2vefr1f8.js";
46
+ import"./index-gpnv14kq.js";
47
+ import"./index-cpg98bh1.js";
48
+ import"./index-9e6fdz2h.js";
49
+ import"./index-4rhhvd1a.js";
45
50
  import"./index-w8pgjr75.js";
46
51
  import"./index-z6xqpmqg.js";
47
52
  import"./index-zj6t9zgx.js";
48
- import"./index-0pcq32y2.js";
49
- import"./index-zfhe7vbb.js";
50
- import"./index-v3y3qg48.js";
51
- import"./index-9e6fdz2h.js";
52
- import"./index-4rhhvd1a.js";
53
53
  import"./index-zjygnfay.js";
54
54
  import"./index-ae75rja9.js";
55
- import"./index-s72naw1j.js";
56
- import"./index-6q3agdmr.js";
55
+ import"./index-x8pm918t.js";
56
+ import"./index-j20fzn0w.js";
57
57
  import"./index-bk5tah7q.js";
58
- import"./index-4evasm2b.js";
59
- import"./index-pa86tpgt.js";
60
- import"./index-zz5qsjd1.js";
58
+ import"./index-kggqpefz.js";
59
+ import"./index-bghwrr59.js";
60
+ import"./index-qyvjp0bq.js";
61
61
  import"./index-7g4c7s5r.js";
62
62
  import"./index-bpmtbmy9.js";
63
63
  import"./index-ed5ykebp.js";
@@ -13,7 +13,7 @@ import {
13
13
  startHeartbeatTracking,
14
14
  stopHeartbeatTracking,
15
15
  telemetry
16
- } from "./index-zz5qsjd1.js";
16
+ } from "./index-qyvjp0bq.js";
17
17
  import"./index-bpmtbmy9.js";
18
18
  import"./index-a76rekgs.js";
19
19
  export {
@@ -6,6 +6,7 @@ import {
6
6
  compareWorkspaceSnapshot,
7
7
  compareWorkspaceSnapshots,
8
8
  digest,
9
+ isSwarmRuntimePath,
9
10
  parsePorcelainPaths,
10
11
  parsePorcelainV2Snapshot,
11
12
  readGitTextAtRevision,
@@ -37,10 +38,10 @@ import {
37
38
  resolveRemoteRefsContainingHeadAsync,
38
39
  switchPrFeedbackTrackingCandidateAsync,
39
40
  workspaceSnapshotMatches
40
- } from "./index-b30x236n.js";
41
- import"./index-zj6t9zgx.js";
41
+ } from "./index-z9yhhk6q.js";
42
42
  import"./index-9e6fdz2h.js";
43
43
  import"./index-4rhhvd1a.js";
44
+ import"./index-zj6t9zgx.js";
44
45
  import"./index-zgwm4ryv.js";
45
46
  import"./index-a76rekgs.js";
46
47
  export {
@@ -75,6 +76,7 @@ export {
75
76
  readGitTextAtRevision,
76
77
  parsePorcelainV2Snapshot,
77
78
  parsePorcelainPaths,
79
+ isSwarmRuntimePath,
78
80
  digest,
79
81
  compareWorkspaceSnapshots,
80
82
  compareWorkspaceSnapshot,
@@ -5,25 +5,25 @@ import {
5
5
  import {
6
6
  scanDelegationFallbacksForRecovery,
7
7
  scanDelegationsForRecovery
8
- } from "./index-ffdwj1an.js";
8
+ } from "./index-97psh79d.js";
9
9
  import {
10
10
  WORKTREE_PROVISIONING_OWNER_LEASE_MS,
11
11
  removeWorktreeProvisioningOwner,
12
12
  scanWorktreeProvisioningOwnersForRecovery
13
13
  } from "./index-e1pxav9g.js";
14
- import"./index-w8pgjr75.js";
15
- import"./index-z6xqpmqg.js";
16
- import {
17
- bunSpawn
18
- } from "./index-zj6t9zgx.js";
19
14
  import {
20
15
  init_git_executable,
21
16
  resolveGitExecutable
22
17
  } from "./index-9e6fdz2h.js";
23
18
  import"./index-4rhhvd1a.js";
19
+ import"./index-w8pgjr75.js";
20
+ import"./index-z6xqpmqg.js";
21
+ import {
22
+ bunSpawn
23
+ } from "./index-zj6t9zgx.js";
24
24
  import"./index-zjygnfay.js";
25
- import"./index-pa86tpgt.js";
26
- import"./index-zz5qsjd1.js";
25
+ import"./index-bghwrr59.js";
26
+ import"./index-qyvjp0bq.js";
27
27
  import"./index-7g4c7s5r.js";
28
28
  import"./index-bpmtbmy9.js";
29
29
  import"./index-ed5ykebp.js";
@@ -8,6 +8,7 @@ import {
8
8
  cleanupStandardWorktreeForCallId,
9
9
  computeLaneRuntimeProfile,
10
10
  finishStandardWorktreeDispatch,
11
+ getStandardWorktreeDegradationReason,
11
12
  isLaneOwnedByCurrentSession,
12
13
  parseLeanLaneIndex,
13
14
  preProvisionCollisionCheck,
@@ -20,61 +21,61 @@ import {
20
21
  sanitizeWorktreeTaskId,
21
22
  standardWorktreeByCallID,
22
23
  standardWorktreeSerializationSessions
23
- } from "./index-6ezbzd5e.js";
24
- import"./index-2dnqazyr.js";
25
- import"./index-0jr9zn34.js";
26
- import"./index-v64kjqvg.js";
24
+ } from "./index-cb2qtetk.js";
25
+ import"./index-0a0asz2s.js";
26
+ import"./index-1g87esfp.js";
27
+ import"./index-612rr70a.js";
28
+ import"./index-917z76qr.js";
29
+ import"./index-nsr5b69r.js";
27
30
  import"./index-134d35c1.js";
28
31
  import"./index-abtrcs16.js";
29
- import"./index-wk54ey3h.js";
30
- import"./index-jy9bwa9k.js";
31
32
  import"./index-y8552snf.js";
32
- import"./index-e00wbqw5.js";
33
+ import"./index-ncfjxz9n.js";
34
+ import"./index-np4ytvvv.js";
33
35
  import"./index-70ha9e09.js";
34
36
  import"./index-c8s9a3zh.js";
35
37
  import"./index-9ss2m4rs.js";
36
- import"./index-b30x236n.js";
37
- import"./index-77ef8gye.js";
38
- import"./index-mkks7jwg.js";
39
- import"./index-b3xret0a.js";
40
- import"./index-h4hasck4.js";
41
- import"./index-fp464as8.js";
38
+ import"./index-z9yhhk6q.js";
39
+ import"./index-5e5a1y2r.js";
40
+ import"./index-jgb7mq2y.js";
41
+ import"./index-jpppcckq.js";
42
+ import"./index-4p3qfb05.js";
42
43
  import"./index-rtry5xyf.js";
43
44
  import"./index-zsrtt42s.js";
44
- import"./index-ffdwj1an.js";
45
+ import"./index-97psh79d.js";
45
46
  import"./index-e1pxav9g.js";
46
- import"./index-s6cwsnrw.js";
47
- import"./index-6hqhyb0f.js";
48
- import"./index-4zwjc9sb.js";
49
- import"./index-apjdytwx.js";
47
+ import"./index-n55a28zr.js";
48
+ import"./index-rk80jhef.js";
49
+ import"./index-vav705md.js";
50
+ import"./index-673axbjx.js";
50
51
  import"./index-556ja8an.js";
51
52
  import"./index-7sy3aa9m.js";
52
53
  import"./index-wx8zdh4a.js";
53
54
  import"./index-3g0xk6tk.js";
54
55
  import"./index-85gkedsf.js";
55
- import"./index-qfawexc8.js";
56
- import"./index-c13ttmak.js";
56
+ import"./index-6wf75rcm.js";
57
+ import"./index-cxn95n7q.js";
57
58
  import {
58
59
  resolveWorktreeIsolationConfig
59
- } from "./index-7g276m9m.js";
60
+ } from "./index-czde45km.js";
60
61
  import"./index-gprxjmm7.js";
61
62
  import"./index-n832052r.js";
63
+ import"./index-2vefr1f8.js";
64
+ import"./index-gpnv14kq.js";
65
+ import"./index-cpg98bh1.js";
66
+ import"./index-9e6fdz2h.js";
67
+ import"./index-4rhhvd1a.js";
62
68
  import"./index-w8pgjr75.js";
63
69
  import"./index-z6xqpmqg.js";
64
70
  import"./index-zj6t9zgx.js";
65
- import"./index-0pcq32y2.js";
66
- import"./index-zfhe7vbb.js";
67
- import"./index-v3y3qg48.js";
68
- import"./index-9e6fdz2h.js";
69
- import"./index-4rhhvd1a.js";
70
71
  import"./index-zjygnfay.js";
71
72
  import"./index-ae75rja9.js";
72
- import"./index-s72naw1j.js";
73
- import"./index-6q3agdmr.js";
73
+ import"./index-x8pm918t.js";
74
+ import"./index-j20fzn0w.js";
74
75
  import"./index-bk5tah7q.js";
75
- import"./index-4evasm2b.js";
76
- import"./index-pa86tpgt.js";
77
- import"./index-zz5qsjd1.js";
76
+ import"./index-kggqpefz.js";
77
+ import"./index-bghwrr59.js";
78
+ import"./index-qyvjp0bq.js";
78
79
  import"./index-7g4c7s5r.js";
79
80
  import"./index-bpmtbmy9.js";
80
81
  import"./index-ed5ykebp.js";
@@ -94,6 +95,7 @@ export {
94
95
  preProvisionCollisionCheck,
95
96
  parseLeanLaneIndex,
96
97
  isLaneOwnedByCurrentSession,
98
+ getStandardWorktreeDegradationReason,
97
99
  finishStandardWorktreeDispatch,
98
100
  computeLaneRuntimeProfile,
99
101
  cleanupStandardWorktreeForCallId,
@@ -358,8 +358,8 @@ export type PipelineConfig = z.infer<typeof PipelineConfigSchema>;
358
358
  export declare const PhaseCompleteConfigSchema: z.ZodObject<{
359
359
  enabled: z.ZodDefault<z.ZodBoolean>;
360
360
  required_agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
361
- reviewer: "reviewer";
362
361
  coder: "coder";
362
+ reviewer: "reviewer";
363
363
  test_engineer: "test_engineer";
364
364
  }>>>;
365
365
  require_docs: z.ZodDefault<z.ZodBoolean>;
@@ -1778,8 +1778,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
1778
1778
  phase_complete: z.ZodOptional<z.ZodObject<{
1779
1779
  enabled: z.ZodDefault<z.ZodBoolean>;
1780
1780
  required_agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1781
- reviewer: "reviewer";
1782
1781
  coder: "coder";
1782
+ reviewer: "reviewer";
1783
1783
  test_engineer: "test_engineer";
1784
1784
  }>>>;
1785
1785
  require_docs: z.ZodDefault<z.ZodBoolean>;
@@ -0,0 +1,26 @@
1
+ export declare const TASK_GATE_REQUIREMENTS_RECONSTRUCTION_SENTINEL = "requirements_reconstruction";
2
+ export interface RepairGateEvidenceArgs {
3
+ task_id: string;
4
+ reason: string;
5
+ expected_sha256?: string;
6
+ expected_generation?: number;
7
+ }
8
+ export interface RepairGateEvidenceContext {
9
+ sessionID?: string;
10
+ messageID?: string;
11
+ }
12
+ export interface RepairGateEvidenceResult {
13
+ success: boolean;
14
+ message: string;
15
+ errors?: string[];
16
+ repaired?: boolean;
17
+ task_id?: string;
18
+ required_gates?: string[];
19
+ requirements_state?: 'known' | 'unknown';
20
+ quarantine_digest?: string;
21
+ quarantine_path?: string;
22
+ repaired_generation?: number;
23
+ next_actions?: string[];
24
+ }
25
+ export declare function taskGateEvidenceQuarantinePath(directory: string, taskId: string, digest: string): string;
26
+ export declare function repairTaskGateEvidence(args: RepairGateEvidenceArgs, directory: string, context?: RepairGateEvidenceContext): Promise<RepairGateEvidenceResult>;
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { TaskEvidence, TaskWorkflowTransitionEvent } from '../gate-evidence.js';
3
+ declare const TaskGateRequirementsReceiptSchema: z.ZodObject<{
4
+ schemaVersion: z.ZodLiteral<1>;
5
+ taskId: z.ZodString;
6
+ generation: z.ZodNumber;
7
+ normalizedRole: z.ZodString;
8
+ testEngineerExempt: z.ZodNullable<z.ZodBoolean>;
9
+ requiredGates: z.ZodArray<z.ZodString>;
10
+ sourceEvent: z.ZodString;
11
+ sourceTransitionId: z.ZodNullable<z.ZodString>;
12
+ recordedAt: z.ZodString;
13
+ previousChainHash: z.ZodNullable<z.ZodString>;
14
+ chainHash: z.ZodString;
15
+ }, z.core.$strict>;
16
+ export type TaskGateRequirementsReceipt = z.infer<typeof TaskGateRequirementsReceiptSchema>;
17
+ export declare function taskGateRequirementsReceiptPath(directory: string, taskId: string): string;
18
+ export declare function readTaskGateRequirementsReceipts(directory: string, taskId: string): Promise<TaskGateRequirementsReceipt[]>;
19
+ export declare function appendTaskGateRequirementsReceiptIfNeeded(directory: string, taskId: string, current: TaskEvidence | null, next: TaskEvidence, event: TaskWorkflowTransitionEvent): Promise<void>;
20
+ export {};
@@ -56,10 +56,17 @@ export interface TaskEvidence {
56
56
  required_gates: string[];
57
57
  gates: Record<string, GateEvidence>;
58
58
  turbo?: boolean;
59
+ requirements_state?: 'known' | 'unknown';
59
60
  /** Durable proof that the coder dispatch was classified as exact Markdown-only. */
60
61
  test_engineer_exempt?: boolean;
61
62
  /** Exact-task workflow metadata. Missing on legacy evidence written before #2098. */
62
63
  workflow?: TaskWorkflowMetadata;
64
+ /** Immutable source identity for an idempotent fail-closed evidence repair. */
65
+ repair_provenance?: {
66
+ source_sha256: string | null;
67
+ source_generation: number | null;
68
+ requirements_receipt_hash: string | null;
69
+ };
63
70
  }
64
71
  /**
65
72
  * Fence ordinary evidence writers while a terminal or repair plan/evidence
@@ -125,6 +125,10 @@ interface SessionSerializationState {
125
125
  */
126
126
  successfulDispatchesSince: number;
127
127
  }
128
+ export declare function getStandardWorktreeDegradationReason(sessionID: string): {
129
+ reason: string;
130
+ at: number;
131
+ } | undefined;
128
132
  export declare function resetStandardWorktreeIsolationState(): void;
129
133
  /**
130
134
  * FR-104 SC-111/SC-112: Check whether a serialized session has met its release conditions
@@ -31,6 +31,8 @@ declare function recoverLockIfSafe(paths: ReceiptLedgerPaths): Promise<void>;
31
31
  export declare function withReceiptLedgerLock<T>(directory: string, action: (paths: ReceiptLedgerPaths) => Promise<T>): Promise<T>;
32
32
  export declare function receiptRecordHash(value: unknown): string;
33
33
  export declare function readUtf8IfPresent(filePath: string, maxBytes?: number): Promise<string | null>;
34
+ /** Read an authoritative receipt artifact without lossy text decoding. */
35
+ export declare function readBytesIfPresent(filePath: string, maxBytes?: number): Promise<Buffer | null>;
34
36
  export declare function appendFsynced(filePath: string, line: string): Promise<void>;
35
37
  export declare function atomicWriteFsynced(targetPath: string, content: string): Promise<void>;
36
38
  export declare function fileMtimeMs(filePath: string): Promise<number | null>;
@@ -1,4 +1,4 @@
1
- import { atomicWriteFsynced, type ReceiptLedgerPaths, type ReceiptStoreErrorCode } from './knowledge-receipt-ledger-storage.js';
1
+ import { appendFsynced, atomicWriteFsynced, type ReceiptLedgerPaths, type ReceiptStoreErrorCode } from './knowledge-receipt-ledger-storage.js';
2
2
  import { type KnowledgeReceiptTransitionObservation } from './knowledge-receipt-observability.js';
3
3
  /**
4
4
  * Canonical terminal-outcome vocabulary for the authoritative receipt ledger
@@ -27,7 +27,7 @@ export declare const RECEIPT_TERMINAL_OUTCOMES: ReadonlySet<ReceiptOutcome>;
27
27
  * preserved as `'unknown'` and is never coerced to delegate, ignored, or any
28
28
  * other class. New producers must stamp one of the closed values below.
29
29
  */
30
- export type ReceiptSourceCode = 'delegate' | 'reviewer' | 'architect' | 'architect_marker' | 'test_engineer' | 'phase_override' | 'application_gate_staleness_clear' | 'application_gate_denial_limit_clear' | 'manual' | 'migration' | 'unknown';
30
+ export type ReceiptSourceCode = 'delegate' | 'reviewer' | 'architect' | 'architect_marker' | 'test_engineer' | 'phase_override' | 'application_gate_staleness_release' | 'application_gate_denial_limit_release' | 'manual' | 'migration' | 'unknown';
31
31
  /** Closed set form of {@link ReceiptSourceCode}. */
32
32
  export declare const CANONICAL_RECEIPT_SOURCES: ReadonlySet<string>;
33
33
  /**
@@ -65,6 +65,13 @@ export interface ReceiptApplicationMarker {
65
65
  event_id: string;
66
66
  committed_at: string;
67
67
  }
68
+ export interface ReceiptGateRelease {
69
+ source: string;
70
+ reason?: string;
71
+ event_id: string;
72
+ committed_at: string;
73
+ membership_event_id: string;
74
+ }
68
75
  export interface ReceiptMembership {
69
76
  trace_id: string;
70
77
  entry_id: string;
@@ -84,11 +91,24 @@ export interface ReceiptMembership {
84
91
  /** Append-only audited terminal transitions; `terminal` is the current gate state. */
85
92
  terminal_history?: ReceiptTerminal[];
86
93
  application_marker?: ReceiptApplicationMarker;
94
+ gate_release?: ReceiptGateRelease;
87
95
  cohort_id?: string;
88
96
  source_link_id?: string;
89
97
  exposure_kind: ReceiptExposureKind;
90
98
  origin: 'v2' | 'legacy';
91
99
  }
100
+ export interface ReceiptRepairUncertainty {
101
+ phase: string;
102
+ session_id: string;
103
+ task_id?: string;
104
+ reason: string;
105
+ repair_id: string;
106
+ installed_at: string;
107
+ raw_journal_sha256: string;
108
+ raw_journal_bytes: number;
109
+ salvage_through_seq: number;
110
+ salvage_through_hash: string;
111
+ }
92
112
  export type ReceiptExposureKind = 'architect_directive' | 'delegate_directive' | 'manual_recall' | 'legacy_unknown';
93
113
  interface EmptyTrace {
94
114
  trace_id: string;
@@ -122,7 +142,7 @@ interface ReceiptAuditSummary {
122
142
  entry_ids?: string[];
123
143
  reason_codes?: string[];
124
144
  }
125
- export type ReceiptTransitionKind = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
145
+ export type ReceiptTransitionKind = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'gate_release_committed' | 'phase_close_intent' | 'phase_closed' | 'repair_uncertainty_installed' | 'repair_uncertainty_cleared' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
126
146
  interface LedgerState {
127
147
  memberships: Map<string, ReceiptMembership>;
128
148
  traceIds: Set<string>;
@@ -132,6 +152,7 @@ interface LedgerState {
132
152
  legacyTraceRegistry: Set<string>;
133
153
  legacyUnverifiableTraceIds: Set<string>;
134
154
  phaseLifecycle: Map<string, PhaseLifecycle>;
155
+ repairUncertainties: Map<string, ReceiptRepairUncertainty>;
135
156
  auditTail: ReceiptAuditSummary[];
136
157
  lastSeq: number;
137
158
  lastHash: string;
@@ -149,6 +170,25 @@ export type ReceiptLedgerResult<T> = ({
149
170
  ok: true;
150
171
  } & T) | ReceiptUnavailable;
151
172
  declare function writeSnapshot(paths: ReceiptLedgerPaths, state: LedgerState): Promise<void>;
173
+ export interface RepairKnowledgeReceiptLedgerInput {
174
+ phase: string;
175
+ session_id: string;
176
+ task_id?: string;
177
+ reason: string;
178
+ grace_days?: number;
179
+ }
180
+ export interface ReceiptRepairReevaluationProof {
181
+ repair_id: string;
182
+ /** Exact producer assertion that this retrieval covered the full repaired scope. */
183
+ scope_complete: boolean;
184
+ }
185
+ export declare function repairKnowledgeReceiptLedger(directory: string, input: RepairKnowledgeReceiptLedgerInput): Promise<ReceiptLedgerResult<{
186
+ status: 'validated_projection' | 'repaired_authority' | 'pending_re_evaluation';
187
+ pending_re_evaluation: boolean;
188
+ repair_id?: string;
189
+ salvage_through_seq: number;
190
+ salvage_through_hash: string;
191
+ }>>;
152
192
  export interface CommitDisplayedMembershipInput {
153
193
  trace_id: string;
154
194
  session_id: string;
@@ -166,6 +206,8 @@ export interface CommitDisplayedMembershipInput {
166
206
  source_link_id?: string;
167
207
  /** Producer provenance used by application gates; omitted callers fail closed. */
168
208
  exposure_kind?: ReceiptExposureKind;
209
+ /** Explicit repair-bound proof; ordinary retrievals intentionally omit this. */
210
+ repair_re_evaluation?: ReceiptRepairReevaluationProof;
169
211
  }
170
212
  export declare function commitDisplayedMembership(directory: string, input: CommitDisplayedMembershipInput): Promise<ReceiptLedgerResult<{
171
213
  event_id: string;
@@ -261,6 +303,31 @@ declare function commitApplicationMarkerBatch(directory: string, input: Applicat
261
303
  reason: string;
262
304
  }>;
263
305
  }>>;
306
+ export interface GateReleaseBatchInput {
307
+ trace_id: string;
308
+ session_id: string;
309
+ grace_days?: number;
310
+ items: Array<{
311
+ entry_id: string;
312
+ source?: string;
313
+ reason?: string;
314
+ }>;
315
+ }
316
+ export declare function commitGateReleaseBatch(directory: string, input: GateReleaseBatchInput): Promise<ReceiptLedgerResult<{
317
+ committed: Array<{
318
+ entry_id: string;
319
+ event_id: string;
320
+ membership_event_id: string;
321
+ }>;
322
+ idempotent: Array<{
323
+ entry_id: string;
324
+ event_id: string;
325
+ }>;
326
+ rejected: Array<{
327
+ entry_id: string;
328
+ reason: string;
329
+ }>;
330
+ }>>;
264
331
  export interface ApplicationOutcomeBatchInput {
265
332
  trace_id: string;
266
333
  session_id: string;
@@ -334,10 +401,12 @@ export declare const _internals: {
334
401
  nowMs: () => number;
335
402
  writeSnapshot: typeof writeSnapshot;
336
403
  atomicWriteFsynced: typeof atomicWriteFsynced;
404
+ appendFsynced: typeof appendFsynced;
337
405
  /** Test-only migration fixture for pre-atomic marker-only state. */
338
406
  commitApplicationMarkerBatch: typeof commitApplicationMarkerBatch;
339
407
  maxJournalRecords: number;
340
408
  maxArchiveRecords: number;
341
409
  maxArchiveBytes: number;
410
+ maxRepairQuarantineRecords: number;
342
411
  };
343
412
  export {};
@@ -21,7 +21,7 @@ export declare const RECEIPT_SEMANTICS_VERSION = 2;
21
21
  * `no_relevant` tombstone that closes an empty retrieval (not a terminal).
22
22
  */
23
23
  export type ReceiptObservationOutcome = ReceiptOutcome | 'no_relevant';
24
- export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
24
+ export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'gate_release_committed' | 'phase_close_intent' | 'phase_closed' | 'repair_uncertainty_installed' | 'repair_uncertainty_cleared' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
25
25
  export type KnowledgeReceiptObservationReasonCode = 'committed' | 'idempotent' | 'trace_not_found' | 'id_not_in_trace' | 'wrong_session' | 'wrong_phase' | 'wrong_task' | 'duplicate_conflicting_terminal' | 'event_id_conflict' | 'invalid_outcome' | 'empty_receipt' | 'lock_timeout' | 'store_unavailable' | 'store_corrupt' | 'legacy_unverifiable' | 'unauthorized_transition';
26
26
  export interface KnowledgeReceiptTransitionObservation {
27
27
  transition: KnowledgeReceiptObservedTransition;
@@ -17,6 +17,7 @@
17
17
  * surfaces as a block, never a silent pass.
18
18
  */
19
19
  export type DirectiveBlockReason = 'no_verdict' | 'unremediated_violation';
20
+ export type DirectiveGateFailureCode = 'RECEIPT_MISSING' | 'RECEIPT_CORRUPT' | 'RECEIPT_LOCK_TIMEOUT' | 'RECEIPT_WRONG_ROOT' | 'RECEIPT_PERMISSION' | 'RECEIPT_TRANSIENT' | 'RECEIPT_STORE_UNAVAILABLE';
20
21
  export interface DirectiveGateResult {
21
22
  blocked: boolean;
22
23
  unresolved: Array<{
@@ -27,6 +28,14 @@ export interface DirectiveGateResult {
27
28
  overridden: string[];
28
29
  /** True when the gate could not read its inputs (fail-closed → blocked). */
29
30
  failedClosed: boolean;
31
+ failure?: {
32
+ code: DirectiveGateFailureCode;
33
+ action_id: 'knowledge_receipt' | 'phase_complete' | 'repair_knowledge_receipt_ledger';
34
+ };
35
+ recovery?: {
36
+ kind: 'tool' | 'retry';
37
+ action: 'knowledge_receipt' | 'phase_complete' | 'repair_knowledge_receipt_ledger';
38
+ };
30
39
  }
31
40
  /**
32
41
  * Evaluate all critical directives shown during the phase. Fail-closed.