opencode-swarm 7.153.0 → 7.153.1

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 (84) hide show
  1. package/dist/background/pending-delegations.d.ts +7 -0
  2. package/dist/cli/{config-doctor-7s7xga6f.js → config-doctor-ze21qs6b.js} +2 -2
  3. package/dist/cli/{core-vkpy14vv.js → core-qdmhh1kx.js} +1 -1
  4. package/dist/cli/{curation-policy-xy7tm4ad.js → curation-policy-twa6agf8.js} +7 -7
  5. package/dist/cli/{curator-6freqnhf.js → curator-hxb3wsxr.js} +30 -30
  6. package/dist/cli/{curator-llm-factory-q5cjk7mt.js → curator-llm-factory-s8atmc2n.js} +30 -30
  7. package/dist/cli/{evidence-summary-service-engtgjww.js → evidence-summary-service-wzzym9r7.js} +13 -13
  8. package/dist/cli/{gate-evidence-6bzzz8kq.js → gate-evidence-f71dn9vv.js} +7 -7
  9. package/dist/cli/{guardrail-explain-vsck39dh.js → guardrail-explain-5kzeem4m.js} +31 -31
  10. package/dist/cli/{guardrail-log-0dn8m3k6.js → guardrail-log-38jnajpa.js} +5 -5
  11. package/dist/cli/{guardrail-reset-6e2vyfn9.js → guardrail-reset-wzvtmpn2.js} +30 -30
  12. package/dist/cli/{hive-promoter-021abs6z.js → hive-promoter-55qcqgfx.js} +30 -30
  13. package/dist/cli/{index-hw49515c.js → index-0tyc8kdg.js} +1 -1
  14. package/dist/cli/{index-9vdh4kdx.js → index-0tzv5zg2.js} +2 -2
  15. package/dist/cli/{index-e2hs0bh7.js → index-1akn19mp.js} +1 -1
  16. package/dist/cli/{index-5x67858f.js → index-1dtshrzg.js} +5 -5
  17. package/dist/cli/{index-9gjbe4e4.js → index-1gzdnjg9.js} +2 -2
  18. package/dist/cli/{index-dh1gk5c5.js → index-23rneydq.js} +32 -32
  19. package/dist/cli/{index-z4bg1hv8.js → index-2mqmvxac.js} +9 -2
  20. package/dist/cli/index-3cegckkq.js +239 -0
  21. package/dist/cli/{index-1yfpw7w0.js → index-3ttktt56.js} +1 -1
  22. package/dist/cli/{index-eajfs7v4.js → index-4g0g3dqz.js} +1 -1
  23. package/dist/cli/{index-x6zy6veh.js → index-4pjkdcgc.js} +1 -1
  24. package/dist/cli/{index-g0m6kypc.js → index-6vgb5fyb.js} +1 -1
  25. package/dist/cli/{index-95qra69h.js → index-6ybjrqf7.js} +4397 -2470
  26. package/dist/cli/{index-txbd25bc.js → index-891g7hbf.js} +1 -1
  27. package/dist/cli/{index-7q56f3se.js → index-8v9sj4aq.js} +2 -2
  28. package/dist/cli/{index-babtfqa0.js → index-9v8d3c0k.js} +450 -48
  29. package/dist/cli/{index-eqh3t8eh.js → index-af0cqe6n.js} +14 -14
  30. package/dist/cli/{index-hkmgzesw.js → index-ajkxx2k6.js} +2 -2
  31. package/dist/cli/{index-6v77adf7.js → index-gn26q90p.js} +2 -2
  32. package/dist/cli/{index-77xy577c.js → index-k10qtq71.js} +9 -9
  33. package/dist/cli/{index-80ekaf5b.js → index-mb7b1gye.js} +3 -3
  34. package/dist/cli/{index-0q2mjxp2.js → index-meg33yyv.js} +1 -1
  35. package/dist/cli/{index-3z2f1cy8.js → index-n5pxkera.js} +4 -4
  36. package/dist/cli/{index-3z5jtyan.js → index-n823qsae.js} +3 -2
  37. package/dist/cli/{index-6zkm4p7p.js → index-pk1gbqmq.js} +1 -1
  38. package/dist/cli/{index-4gn111h3.js → index-smqsp8hs.js} +5 -5
  39. package/dist/cli/{index-k2ydsqs7.js → index-td0jz8xe.js} +4 -4
  40. package/dist/cli/{index-xv881ahz.js → index-tdzbm974.js} +7 -7
  41. package/dist/cli/{index-5w915x8b.js → index-v689bmr2.js} +4 -4
  42. package/dist/cli/{index-qgfnd206.js → index-x3y6zhgj.js} +1 -1
  43. package/dist/cli/{index-aw492hpn.js → index-x8vw6ap1.js} +58 -41
  44. package/dist/cli/{index-hexhzq5j.js → index-xkjrg9k4.js} +3 -3
  45. package/dist/cli/{index-0n7nm9e8.js → index-zppxpc3y.js} +2 -2
  46. package/dist/cli/index.js +30 -30
  47. package/dist/cli/{knowledge-escalator-79zbhpz5.js → knowledge-escalator-w05ztgvk.js} +12 -12
  48. package/dist/cli/{knowledge-events-79cak7eb.js → knowledge-events-pwm9jc0m.js} +10 -10
  49. package/dist/cli/{knowledge-link-40zsr5ja.js → knowledge-link-ge0rddxw.js} +6 -6
  50. package/dist/cli/{knowledge-store-w29aw5w0.js → knowledge-store-4xv65tj2.js} +7 -7
  51. package/dist/cli/{knowledge-validator-qsecnt2d.js → knowledge-validator-0ttfsca7.js} +9 -9
  52. package/dist/cli/{pending-delegations-a2nmssr1.js → pending-delegations-nk78wx7h.js} +4 -4
  53. package/dist/cli/{pr-subscriptions-7879nq5k.js → pr-subscriptions-dq1f61ye.js} +4 -4
  54. package/dist/cli/{runner-fbgsxs74.js → runner-n50w1y4w.js} +7 -7
  55. package/dist/cli/{scan-cursor-1r3pcdqp.js → scan-cursor-b6n15w8d.js} +8 -8
  56. package/dist/cli/{schema-19qsv6fw.js → schema-jkbfwqr2.js} +1 -1
  57. package/dist/cli/{scope-persistence-ypcrvqtt.js → scope-persistence-5xt2m5ep.js} +9 -9
  58. package/dist/cli/{skill-generator-wpp9kpa0.js → skill-generator-3keadpf7.js} +14 -14
  59. package/dist/cli/{telemetry-52pw5xac.js → telemetry-hh1j99za.js} +1 -1
  60. package/dist/cli/{worktree-collision-ownership-p31zm5k0.js → worktree-collision-ownership-4drcjymy.js} +15 -10
  61. package/dist/cli/{worktree-isolation-wcry8qnn.js → worktree-isolation-1ymaxn4h.js} +30 -30
  62. package/dist/commands/lanes.d.ts +25 -0
  63. package/dist/consensus/corpus.d.ts +16 -0
  64. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +50 -3
  65. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +40 -2
  66. package/dist/hooks/delegation-gate/worktree-recovery-authority.d.ts +201 -0
  67. package/dist/hooks/init-orphan-recovery.d.ts +5 -1
  68. package/dist/hooks/trajectory-logger.d.ts +22 -6
  69. package/dist/hooks/trajectory-step-state.d.ts +43 -2
  70. package/dist/index.js +556 -551
  71. package/dist/observability/catalog.d.ts +6 -4
  72. package/dist/prm/index.d.ts +3 -3
  73. package/dist/prm/replay.d.ts +29 -2
  74. package/dist/prm/trajectory-store.d.ts +210 -20
  75. package/dist/telemetry.d.ts +21 -1
  76. package/dist/utils/atomic-write.d.ts +2 -0
  77. package/dist/utils/canonical-root.d.ts +31 -0
  78. package/dist/workflow/coder-settlement.d.ts +2 -0
  79. package/dist/worktree/index.d.ts +2 -2
  80. package/dist/worktree/merge.d.ts +47 -0
  81. package/package.json +2 -1
  82. package/dist/cli/index-fxvgaeq4.js +0 -125
  83. package/dist/cli/worktree-provisioning-owner-cve95q4f.js +0 -22
  84. package/dist/cli/{curator-drift-2h1d2fnq.js → curator-drift-h57z6tm3.js} +1 -1
@@ -23,20 +23,20 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-5w915x8b.js";
27
- import"./index-1yfpw7w0.js";
26
+ } from "./index-v689bmr2.js";
27
+ import"./index-3ttktt56.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-77xy577c.js";
29
+ import"./index-k10qtq71.js";
30
30
  import"./index-ae75rja9.js";
31
- import"./index-qgfnd206.js";
32
- import"./index-0n7nm9e8.js";
31
+ import"./index-x3y6zhgj.js";
32
+ import"./index-zppxpc3y.js";
33
33
  import"./index-bk5tah7q.js";
34
- import"./index-k2ydsqs7.js";
35
- import"./index-txbd25bc.js";
36
- import"./index-aw492hpn.js";
34
+ import"./index-td0jz8xe.js";
35
+ import"./index-891g7hbf.js";
36
+ import"./index-ed5ykebp.js";
37
+ import"./index-x8vw6ap1.js";
37
38
  import"./index-7g4c7s5r.js";
38
39
  import"./index-bpmtbmy9.js";
39
- import"./index-ed5ykebp.js";
40
40
  import"./index-zgwm4ryv.js";
41
41
  import"./index-a76rekgs.js";
42
42
  export {
@@ -58,16 +58,16 @@ import {
58
58
  sweepStaleDelegations,
59
59
  updateCoderSettlement,
60
60
  writeDelegationFallback
61
- } from "./index-z4bg1hv8.js";
61
+ } from "./index-2mqmvxac.js";
62
62
  import"./index-4cgee5vh.js";
63
63
  import"./index-z6xqpmqg.js";
64
64
  import"./index-r3mvsbtq.js";
65
65
  import"./index-zjygnfay.js";
66
- import"./index-txbd25bc.js";
67
- import"./index-aw492hpn.js";
66
+ import"./index-891g7hbf.js";
67
+ import"./index-ed5ykebp.js";
68
+ import"./index-x8vw6ap1.js";
68
69
  import"./index-7g4c7s5r.js";
69
70
  import"./index-bpmtbmy9.js";
70
- import"./index-ed5ykebp.js";
71
71
  import"./index-zgwm4ryv.js";
72
72
  import"./index-a76rekgs.js";
73
73
  export {
@@ -9,16 +9,16 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-0q2mjxp2.js";
12
+ } from "./index-meg33yyv.js";
13
13
  import"./index-4cgee5vh.js";
14
14
  import"./index-z6xqpmqg.js";
15
15
  import"./index-r3mvsbtq.js";
16
16
  import"./index-zjygnfay.js";
17
- import"./index-txbd25bc.js";
18
- import"./index-aw492hpn.js";
17
+ import"./index-891g7hbf.js";
18
+ import"./index-ed5ykebp.js";
19
+ import"./index-x8vw6ap1.js";
19
20
  import"./index-7g4c7s5r.js";
20
21
  import"./index-bpmtbmy9.js";
21
- import"./index-ed5ykebp.js";
22
22
  import"./index-zgwm4ryv.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
@@ -3,17 +3,17 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-x6zy6veh.js";
7
- import"./index-9gjbe4e4.js";
6
+ } from "./index-4pjkdcgc.js";
7
+ import"./index-1gzdnjg9.js";
8
8
  import"./index-y8552snf.js";
9
9
  import"./index-r3mvsbtq.js";
10
- import"./index-0n7nm9e8.js";
11
- import"./index-k2ydsqs7.js";
12
- import"./index-txbd25bc.js";
13
- import"./index-aw492hpn.js";
10
+ import"./index-zppxpc3y.js";
11
+ import"./index-td0jz8xe.js";
12
+ import"./index-891g7hbf.js";
13
+ import"./index-ed5ykebp.js";
14
+ import"./index-x8vw6ap1.js";
14
15
  import"./index-7g4c7s5r.js";
15
16
  import"./index-bpmtbmy9.js";
16
- import"./index-ed5ykebp.js";
17
17
  import"./index-zgwm4ryv.js";
18
18
  import"./index-a76rekgs.js";
19
19
  export {
@@ -4,20 +4,20 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-7q56f3se.js";
8
- import"./index-77xy577c.js";
7
+ } from "./index-8v9sj4aq.js";
8
+ import"./index-k10qtq71.js";
9
9
  import"./index-9e6fdz2h.js";
10
10
  import"./index-4rhhvd1a.js";
11
11
  import"./index-ae75rja9.js";
12
- import"./index-qgfnd206.js";
13
- import"./index-0n7nm9e8.js";
12
+ import"./index-x3y6zhgj.js";
13
+ import"./index-zppxpc3y.js";
14
14
  import"./index-bk5tah7q.js";
15
- import"./index-k2ydsqs7.js";
16
- import"./index-txbd25bc.js";
17
- import"./index-aw492hpn.js";
15
+ import"./index-td0jz8xe.js";
16
+ import"./index-891g7hbf.js";
17
+ import"./index-ed5ykebp.js";
18
+ import"./index-x8vw6ap1.js";
18
19
  import"./index-7g4c7s5r.js";
19
20
  import"./index-bpmtbmy9.js";
20
- import"./index-ed5ykebp.js";
21
21
  import"./index-zgwm4ryv.js";
22
22
  import"./index-a76rekgs.js";
23
23
  export {
@@ -99,7 +99,7 @@ import {
99
99
  resolveGeneratedAgentRole,
100
100
  resolveGuardrailsConfig,
101
101
  stripKnownSwarmPrefix
102
- } from "./index-3z5jtyan.js";
102
+ } from "./index-n823qsae.js";
103
103
  import"./index-myt57pht.js";
104
104
  import"./index-zjygnfay.js";
105
105
  import"./index-bk5tah7q.js";
@@ -23,23 +23,23 @@ import {
23
23
  tombstoneScopeBinding,
24
24
  writeScopeBindingToDisk,
25
25
  writeScopeToDisk
26
- } from "./index-5x67858f.js";
27
- import"./index-80ekaf5b.js";
28
- import"./index-6zkm4p7p.js";
26
+ } from "./index-1dtshrzg.js";
27
+ import"./index-mb7b1gye.js";
28
+ import"./index-pk1gbqmq.js";
29
29
  import"./index-556ja8an.js";
30
- import"./index-e2hs0bh7.js";
31
- import"./index-3z5jtyan.js";
30
+ import"./index-1akn19mp.js";
31
+ import"./index-n823qsae.js";
32
32
  import"./index-myt57pht.js";
33
33
  import"./index-9e6fdz2h.js";
34
34
  import"./index-4rhhvd1a.js";
35
35
  import"./index-zjygnfay.js";
36
36
  import"./index-bk5tah7q.js";
37
- import"./index-k2ydsqs7.js";
38
- import"./index-txbd25bc.js";
39
- import"./index-aw492hpn.js";
37
+ import"./index-td0jz8xe.js";
38
+ import"./index-891g7hbf.js";
39
+ import"./index-ed5ykebp.js";
40
+ import"./index-x8vw6ap1.js";
40
41
  import"./index-7g4c7s5r.js";
41
42
  import"./index-bpmtbmy9.js";
42
- import"./index-ed5ykebp.js";
43
43
  import"./index-zgwm4ryv.js";
44
44
  import"./index-a76rekgs.js";
45
45
  export {
@@ -33,35 +33,35 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-3z2f1cy8.js";
37
- import"./index-5w915x8b.js";
38
- import"./index-1yfpw7w0.js";
36
+ } from "./index-n5pxkera.js";
37
+ import"./index-v689bmr2.js";
38
+ import"./index-3ttktt56.js";
39
39
  import"./index-rtry5xyf.js";
40
40
  import"./index-q7sjgr1y.js";
41
- import"./index-77xy577c.js";
42
- import"./index-xv881ahz.js";
43
- import"./index-hkmgzesw.js";
41
+ import"./index-k10qtq71.js";
42
+ import"./index-tdzbm974.js";
43
+ import"./index-ajkxx2k6.js";
44
44
  import"./index-gprxjmm7.js";
45
45
  import"./index-n832052r.js";
46
46
  import"./index-4cgee5vh.js";
47
47
  import"./index-z6xqpmqg.js";
48
48
  import"./index-r3mvsbtq.js";
49
- import"./index-e2hs0bh7.js";
50
- import"./index-3z5jtyan.js";
49
+ import"./index-1akn19mp.js";
50
+ import"./index-n823qsae.js";
51
51
  import"./index-myt57pht.js";
52
52
  import"./index-9e6fdz2h.js";
53
53
  import"./index-4rhhvd1a.js";
54
54
  import"./index-zjygnfay.js";
55
55
  import"./index-ae75rja9.js";
56
- import"./index-qgfnd206.js";
57
- import"./index-0n7nm9e8.js";
56
+ import"./index-x3y6zhgj.js";
57
+ import"./index-zppxpc3y.js";
58
58
  import"./index-bk5tah7q.js";
59
- import"./index-k2ydsqs7.js";
60
- import"./index-txbd25bc.js";
61
- import"./index-aw492hpn.js";
59
+ import"./index-td0jz8xe.js";
60
+ import"./index-891g7hbf.js";
61
+ import"./index-ed5ykebp.js";
62
+ import"./index-x8vw6ap1.js";
62
63
  import"./index-7g4c7s5r.js";
63
64
  import"./index-bpmtbmy9.js";
64
- import"./index-ed5ykebp.js";
65
65
  import"./index-zgwm4ryv.js";
66
66
  import"./index-a76rekgs.js";
67
67
  export {
@@ -13,7 +13,7 @@ import {
13
13
  startHeartbeatTracking,
14
14
  stopHeartbeatTracking,
15
15
  telemetry
16
- } from "./index-aw492hpn.js";
16
+ } from "./index-x8vw6ap1.js";
17
17
  import"./index-bpmtbmy9.js";
18
18
  import"./index-a76rekgs.js";
19
19
  export {
@@ -1,16 +1,16 @@
1
1
  // @bun
2
+ import {
3
+ WORKTREE_PROVISIONING_OWNER_LEASE_MS,
4
+ removeWorktreeProvisioningOwner,
5
+ scanWorktreeProvisioningOwnersForRecovery
6
+ } from "./index-3cegckkq.js";
2
7
  import {
3
8
  scanWorktreeMergeFailuresForRecovery
4
9
  } from "./index-zsrtt42s.js";
5
10
  import {
6
11
  scanDelegationFallbacksForRecovery,
7
12
  scanDelegationsForRecovery
8
- } from "./index-z4bg1hv8.js";
9
- import {
10
- WORKTREE_PROVISIONING_OWNER_LEASE_MS,
11
- removeWorktreeProvisioningOwner,
12
- scanWorktreeProvisioningOwnersForRecovery
13
- } from "./index-fxvgaeq4.js";
13
+ } from "./index-2mqmvxac.js";
14
14
  import"./index-4cgee5vh.js";
15
15
  import"./index-z6xqpmqg.js";
16
16
  import {
@@ -22,11 +22,12 @@ import {
22
22
  } from "./index-9e6fdz2h.js";
23
23
  import"./index-4rhhvd1a.js";
24
24
  import"./index-zjygnfay.js";
25
- import"./index-txbd25bc.js";
26
- import"./index-aw492hpn.js";
25
+ import"./index-td0jz8xe.js";
26
+ import"./index-891g7hbf.js";
27
+ import"./index-ed5ykebp.js";
28
+ import"./index-x8vw6ap1.js";
27
29
  import"./index-7g4c7s5r.js";
28
30
  import"./index-bpmtbmy9.js";
29
- import"./index-ed5ykebp.js";
30
31
  import"./index-zgwm4ryv.js";
31
32
  import"./index-a76rekgs.js";
32
33
 
@@ -183,7 +184,11 @@ async function inspectStandardWorktreeCollisionOwnership(identity) {
183
184
  reason: `expired provisioning owner ${owner.callID} lane liveness is unreadable: ${error instanceof Error ? error.message : String(error)}`
184
185
  };
185
186
  }
186
- if (!_internals.removeWorktreeProvisioningOwner(identity.directory, owner.callID)) {
187
+ if (!_internals.removeWorktreeProvisioningOwner(identity.directory, owner.callID, owner.schemaVersion === 3 ? {
188
+ reservationId: owner.reservationId,
189
+ generation: owner.generation,
190
+ branchName: owner.branchName
191
+ } : undefined)) {
187
192
  return {
188
193
  status: "uncertain",
189
194
  reason: `expired provisioning owner ${owner.callID} could not be removed`
@@ -21,64 +21,64 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-95qra69h.js";
25
- import"./index-x6zy6veh.js";
26
- import"./index-6v77adf7.js";
27
- import"./index-hw49515c.js";
28
- import"./index-eqh3t8eh.js";
29
- import"./index-9gjbe4e4.js";
24
+ } from "./index-6ybjrqf7.js";
25
+ import"./index-gn26q90p.js";
26
+ import"./index-0tyc8kdg.js";
27
+ import"./index-af0cqe6n.js";
30
28
  import"./index-134d35c1.js";
31
29
  import"./index-nj6rmyeh.js";
30
+ import"./index-4pjkdcgc.js";
31
+ import"./index-1gzdnjg9.js";
32
32
  import"./index-y8552snf.js";
33
- import"./index-4gn111h3.js";
34
- import"./index-7q56f3se.js";
33
+ import"./index-8v9sj4aq.js";
35
34
  import"./index-70ha9e09.js";
36
35
  import"./index-c8s9a3zh.js";
37
36
  import"./index-9ss2m4rs.js";
38
37
  import"./index-vnn7qq8c.js";
39
- import"./index-0q2mjxp2.js";
40
- import"./index-3z2f1cy8.js";
41
- import"./index-5w915x8b.js";
42
- import"./index-1yfpw7w0.js";
38
+ import"./index-meg33yyv.js";
39
+ import"./index-n5pxkera.js";
40
+ import"./index-smqsp8hs.js";
41
+ import"./index-v689bmr2.js";
42
+ import"./index-3ttktt56.js";
43
43
  import"./index-rtry5xyf.js";
44
+ import"./index-3cegckkq.js";
44
45
  import"./index-zsrtt42s.js";
45
- import"./index-z4bg1hv8.js";
46
- import"./index-fxvgaeq4.js";
47
- import"./index-babtfqa0.js";
48
- import"./index-eajfs7v4.js";
49
- import"./index-5x67858f.js";
50
- import"./index-80ekaf5b.js";
51
- import"./index-6zkm4p7p.js";
46
+ import"./index-9v8d3c0k.js";
47
+ import"./index-4g0g3dqz.js";
48
+ import"./index-2mqmvxac.js";
49
+ import"./index-1dtshrzg.js";
50
+ import"./index-mb7b1gye.js";
51
+ import"./index-pk1gbqmq.js";
52
52
  import"./index-556ja8an.js";
53
53
  import"./index-b43rt5ph.js";
54
54
  import"./index-q7sjgr1y.js";
55
55
  import"./index-4fwbbad3.js";
56
- import"./index-77xy577c.js";
57
- import"./index-xv881ahz.js";
56
+ import"./index-k10qtq71.js";
57
+ import"./index-tdzbm974.js";
58
58
  import {
59
59
  resolveWorktreeIsolationConfig
60
- } from "./index-hkmgzesw.js";
60
+ } from "./index-ajkxx2k6.js";
61
61
  import"./index-gprxjmm7.js";
62
62
  import"./index-n832052r.js";
63
63
  import"./index-4cgee5vh.js";
64
64
  import"./index-z6xqpmqg.js";
65
65
  import"./index-r3mvsbtq.js";
66
- import"./index-e2hs0bh7.js";
67
- import"./index-3z5jtyan.js";
66
+ import"./index-1akn19mp.js";
67
+ import"./index-n823qsae.js";
68
68
  import"./index-myt57pht.js";
69
69
  import"./index-9e6fdz2h.js";
70
70
  import"./index-4rhhvd1a.js";
71
71
  import"./index-zjygnfay.js";
72
72
  import"./index-ae75rja9.js";
73
- import"./index-qgfnd206.js";
74
- import"./index-0n7nm9e8.js";
73
+ import"./index-x3y6zhgj.js";
74
+ import"./index-zppxpc3y.js";
75
75
  import"./index-bk5tah7q.js";
76
- import"./index-k2ydsqs7.js";
77
- import"./index-txbd25bc.js";
78
- import"./index-aw492hpn.js";
76
+ import"./index-td0jz8xe.js";
77
+ import"./index-891g7hbf.js";
78
+ import"./index-ed5ykebp.js";
79
+ import"./index-x8vw6ap1.js";
79
80
  import"./index-7g4c7s5r.js";
80
81
  import"./index-bpmtbmy9.js";
81
- import"./index-ed5ykebp.js";
82
82
  import"./index-zgwm4ryv.js";
83
83
  import"./index-a76rekgs.js";
84
84
  export {
@@ -4,6 +4,7 @@
4
4
  * FR-105: SC-114, SC-115, SC-116, SC-117
5
5
  */
6
6
  import { type WorktreeMergeFailure } from '../hooks/delegation-gate/worktree-merge-status';
7
+ import { type WorktreeRecoveryStatus, type WorktreeRecoveryStrategy } from '../hooks/delegation-gate/worktree-recovery-authority';
7
8
  /**
8
9
  * Lane record shape for machine-parseable output (--json).
9
10
  */
@@ -17,8 +18,32 @@ export interface LaneRecord {
17
18
  parentSessionID: string;
18
19
  mergeStrategy: 'merge' | 'rebase' | 'cherry-pick';
19
20
  mergeOutcome?: WorktreeMergeFailure;
21
+ recovery?: LaneRecoveryView;
22
+ manualRecoveryHint?: string;
20
23
  recoveryHint: string;
21
24
  }
25
+ export interface LaneRecoveryView {
26
+ authorityStatus: WorktreeRecoveryStatus | 'unsupported-legacy' | 'uncertain';
27
+ generation?: number;
28
+ originalCallID?: string;
29
+ parentSessionId?: string;
30
+ reservationId?: string;
31
+ canonicalBranch?: string;
32
+ canonicalPath?: string;
33
+ laneBranch?: string;
34
+ lanePath?: string;
35
+ strategy?: WorktreeRecoveryStrategy;
36
+ claim?: LaneRecoveryClaimView;
37
+ redispatchStatus: 'available' | 'claimed' | 'manual-only' | 'unsupported-legacy' | 'uncertain';
38
+ }
39
+ export interface LaneRecoveryClaimView {
40
+ claimantCallID: string;
41
+ claimantSessionId: string;
42
+ childSessionId: string;
43
+ claimRevision: number;
44
+ attempt: number;
45
+ leaseState: 'claimed';
46
+ }
22
47
  /**
23
48
  * Handle the `/swarm lanes` command.
24
49
  *
@@ -81,6 +81,7 @@ import { type GateAuditReadSummary } from '../evaluation/store.js';
81
81
  import { type LoadEvidenceResult } from '../evidence/manager.js';
82
82
  import type { RetrievalOutcome } from '../hooks/knowledge-types.js';
83
83
  import { readSkillUsageEntries, type readSkillUsageEntriesWithCoverage } from '../hooks/skill-usage-log.js';
84
+ import { type TrajectoryReadWithCoverage } from '../prm/trajectory-store.js';
84
85
  import type { TrajectoryEntry } from '../prm/types.js';
85
86
  import type { ConsensusCorpusHash, ConsensusSourceKind } from './contracts.js';
86
87
  /**
@@ -129,6 +130,21 @@ export interface CorpusReaders {
129
130
  readTaskTrajectory: (directory: string, taskId: string) => Promise<TrajectoryEntry[]>;
130
131
  listTrajectorySessions: (directory: string) => Promise<string[]>;
131
132
  readTrajectory: (sessionId: string, directory: string) => Promise<TrajectoryEntry[]>;
133
+ /**
134
+ * Additive coverage seam (issue #2041 Required 4), mirroring
135
+ * `readSkillUsageEntriesWithCoverage` above: optional, deliberately NOT
136
+ * part of `defaultReaders()`, and injecting it overrides BOTH the entries
137
+ * and the coverage verdict so an injected fixture stays coherent.
138
+ *
139
+ * Without it, entries keep coming from `readTrajectory` (injected fixtures
140
+ * keep working) and the default coverage verdict comes from the session's
141
+ * persisted checkpoint (`readTrajectoryCheckpoint`) — the same
142
+ * manifest-only precedent the skill-usage source uses. The default path's
143
+ * known limit mirrors that precedent too: it discloses compaction eviction
144
+ * (`droppedEntries`) but not a single read that hit the tail-window byte
145
+ * cap, which for a within-budget store is unreachable.
146
+ */
147
+ readTrajectoryWithCoverage?: (sessionId: string, directory: string) => Promise<TrajectoryReadWithCoverage>;
132
148
  readSkillUsageEntries: typeof readSkillUsageEntries;
133
149
  /**
134
150
  * Additive coverage seam (issue #2038 §7). Optional, and deliberately NOT
@@ -13,9 +13,12 @@ import { tryAcquireLock } from '../../parallel/file-locks';
13
13
  import { bunSpawn } from '../../utils/bun-compat';
14
14
  import { resolveGitExecutable } from '../../utils/git-executable.js';
15
15
  import type { WorktreeHandle } from '../../worktree';
16
- import { attemptMergeBackFromDirty, cleanupOrphanedBranches, postMergeCleanup, provisionWorktree, pruneStaleWorktreeMetadata, removeWorktree, startupOrphanRecovery } from '../../worktree';
17
- import type { DirtyMergeOptions, MergeOperationProvenance } from '../../worktree/merge';
16
+ import { attemptMergeBackFromDirty, cleanupOrphanedBranches, postMergeCleanup, provisionWorktree, pruneStaleWorktreeMetadata, recoverMergeBackFromImmutableCoordinates, removeWorktree, startupOrphanRecovery } from '../../worktree';
17
+ import type { DirtyMergeOptions, ImmutableMergeRecoveryCoordinates, MergeOperationProvenance } from '../../worktree/merge';
18
+ import type { WorktreeProvisioningOwnerRemovalIdentity } from './worktree-provisioning-owner';
18
19
  import { recordWorktreeProvisioningOwner, removeWorktreeProvisioningOwner } from './worktree-provisioning-owner';
20
+ import type { WorktreeRecoveryImmutableIdentityInput } from './worktree-recovery-authority';
21
+ import { claimWorktreeRecoveryAuthority, finalizeWorktreeRecoveryAuthority, lookupWorktreeRecoveryAuthoritiesByTask, publishWorktreeRecoveryAuthority, releaseWorktreeRecoveryClaim, renewWorktreeRecoveryClaim, replayWorktreeRecoveryClaimJournal } from './worktree-recovery-authority';
19
22
  /**
20
23
  * FR-201: Per-lane runtime profile injected into spawned child processes.
21
24
  *
@@ -59,8 +62,23 @@ export interface StandardWorktreeDispatch {
59
62
  parentSessionID: string;
60
63
  taskId: string;
61
64
  planTaskId?: string;
65
+ reservationId?: string;
66
+ generation?: number;
67
+ provisioningOwner?: WorktreeProvisioningOwnerRemovalIdentity;
68
+ canonicalBranch?: string;
69
+ canonicalPath?: string;
62
70
  handle: WorktreeHandle;
63
71
  mergeStrategy: 'merge' | 'rebase' | 'cherry-pick';
72
+ recoveryClaim?: {
73
+ authorityDigest: string;
74
+ claimRevision: number;
75
+ rawToken: string;
76
+ coordinates?: ImmutableMergeRecoveryCoordinates;
77
+ settlement?: {
78
+ sourceCommitOrder: string[];
79
+ rewrittenCommitOrder: string[];
80
+ };
81
+ };
64
82
  /** FR-201: 0-based lane index for runtime profile derivation. */
65
83
  laneIndex: number;
66
84
  /** Configured worktree-dir override, so cleanup trusts the same base. */
@@ -102,6 +120,9 @@ export interface AwaitingMergeRecord {
102
120
  parentSessionID: string;
103
121
  taskId: string;
104
122
  planTaskId?: string;
123
+ /** Exact durable launch identity threaded from the delegation gate. */
124
+ reservationId?: string;
125
+ generation?: number;
105
126
  branch: string;
106
127
  worktreePath: string;
107
128
  mergeStrategy: 'merge' | 'rebase' | 'cherry-pick';
@@ -125,6 +146,11 @@ interface SessionSerializationState {
125
146
  */
126
147
  successfulDispatchesSince: number;
127
148
  }
149
+ interface CleanupStandardWorktreeResult {
150
+ removedWorktree: boolean;
151
+ cleanedBranch: boolean;
152
+ preservedRecoveryLane: boolean;
153
+ }
128
154
  export declare function getStandardWorktreeDegradationReason(sessionID: string): {
129
155
  reason: string;
130
156
  at: number;
@@ -187,6 +213,13 @@ declare function inspectStandardWorktreeCollisionOwnership(identity: {
187
213
  branchName: string;
188
214
  worktreePath: string;
189
215
  }): Promise<import("./worktree-collision-ownership").StandardWorktreeCollisionOwnership>;
216
+ declare function buildWorktreeRecoveryPublishIdentity(input: {
217
+ directory: string;
218
+ dispatch: StandardWorktreeDispatch;
219
+ taskId: string;
220
+ provenance: MergeOperationProvenance;
221
+ conflictFiles?: string[];
222
+ }): Promise<WorktreeRecoveryImmutableIdentityInput | undefined>;
190
223
  export declare function precreateStandardWorktreeSession(args: {
191
224
  config: PluginConfig;
192
225
  directory: string;
@@ -194,6 +227,9 @@ export declare function precreateStandardWorktreeSession(args: {
194
227
  callID: string;
195
228
  taskId: string;
196
229
  planTaskId?: string;
230
+ /** Exact durable launch identity threaded from the delegation gate. */
231
+ reservationId?: string;
232
+ generation?: number;
197
233
  description?: string;
198
234
  outputArgs: Record<string, unknown>;
199
235
  /** Scope to materialize into the lane for durability across restart (FR-102). */
@@ -264,7 +300,7 @@ export declare function preserveDirtyWorktreeAtPath(worktreePath: string, branch
264
300
  * @param directory - The project root (required for git worktree/branch commands).
265
301
  * @param worktree_dir - Configured worktree-dir override.
266
302
  */
267
- export declare function cleanupStandardWorktreeForCallId(callID: string, reason: 'success' | 'denied' | 'cancelled', directory: string, worktree_dir?: string): Promise<void>;
303
+ export declare function cleanupStandardWorktreeForCallId(callID: string, reason: 'success' | 'denied' | 'cancelled', directory: string, worktree_dir?: string): Promise<CleanupStandardWorktreeResult>;
268
304
  /**
269
305
  * FR-001a: Abort an in-flight standard worktree dispatch.
270
306
  *
@@ -310,6 +346,7 @@ export declare const _internals: {
310
346
  provisionWorktree: typeof provisionWorktree;
311
347
  removeWorktree: typeof removeWorktree;
312
348
  attemptMergeBackFromDirty: typeof attemptMergeBackFromDirty;
349
+ recoverMergeBackFromImmutableCoordinates: typeof recoverMergeBackFromImmutableCoordinates;
313
350
  postMergeCleanup: typeof postMergeCleanup;
314
351
  pruneStaleWorktreeMetadata: typeof pruneStaleWorktreeMetadata;
315
352
  /** FR-201: read lane runtime profile from disk for spawn injection. */
@@ -335,8 +372,18 @@ export declare const _internals: {
335
372
  tryAcquireWorktreeLifecycleLock: typeof tryAcquireLock;
336
373
  recordWorktreeProvisioningOwner: typeof recordWorktreeProvisioningOwner;
337
374
  removeWorktreeProvisioningOwner: typeof removeWorktreeProvisioningOwner;
375
+ lookupWorktreeRecoveryAuthoritiesByTask: typeof lookupWorktreeRecoveryAuthoritiesByTask;
376
+ claimWorktreeRecoveryAuthority: typeof claimWorktreeRecoveryAuthority;
377
+ renewWorktreeRecoveryClaim: typeof renewWorktreeRecoveryClaim;
378
+ releaseWorktreeRecoveryClaim: typeof releaseWorktreeRecoveryClaim;
379
+ finalizeWorktreeRecoveryAuthority: typeof finalizeWorktreeRecoveryAuthority;
380
+ publishWorktreeRecoveryAuthority: typeof publishWorktreeRecoveryAuthority;
381
+ replayWorktreeRecoveryClaimJournal: typeof replayWorktreeRecoveryClaimJournal;
382
+ buildWorktreeRecoveryPublishIdentity: typeof buildWorktreeRecoveryPublishIdentity;
338
383
  /** FR-001b SC-004: path-based dirty worktree preservation for stale-lane fallback. */
339
384
  preserveDirtyWorktreeAtPath: typeof preserveDirtyWorktreeAtPath;
385
+ /** Bounded lane session.create timeout (tests may override). */
386
+ worktreeSessionCreateTimeoutMs: number;
340
387
  /** FR-001a: abort entry point for in-flight dispatches. */
341
388
  abortStandardWorktreeDispatch: typeof abortStandardWorktreeDispatch;
342
389
  standardWorktreeByCallID: Map<string, StandardWorktreeDispatch>;
@@ -5,15 +5,36 @@
5
5
  */
6
6
  export declare const WORKTREE_PROVISIONING_OWNER_LEASE_MS: number;
7
7
  export declare const WORKTREE_LIFECYCLE_LOCK_FILE = ".swarm/locks/init-orphan-recovery.lock";
8
+ export declare const WORKTREE_PROVISIONING_LIFECYCLE_STATES: readonly ["OWNER_PUBLISHED", "OWNER_REMOVED"];
9
+ export type WorktreeProvisioningLifecycleState = (typeof WORKTREE_PROVISIONING_LIFECYCLE_STATES)[number];
8
10
  export interface WorktreeProvisioningOwner {
9
- schemaVersion: 1 | 2;
11
+ schemaVersion: 1 | 2 | 3;
10
12
  callID: string;
11
13
  parentSessionId: string;
12
14
  worktreeSessionId: string;
13
15
  /** Added in v2 so restart collision checks can identify the exact lane. */
14
16
  taskId?: string;
17
+ /** Added in v3 so restart recovery can correlate the exact reservation. */
18
+ reservationId?: string;
19
+ /** Added in v3 so restart recovery can fence same-task retries. */
20
+ generation?: number;
21
+ /** Added in v3 so crash recovery can corroborate the exact lane ref. */
22
+ branchName?: string;
15
23
  createdAt: number;
16
24
  }
25
+ export type WorktreeProvisioningOwnerRemovalIdentity = Pick<WorktreeProvisioningOwner, 'reservationId' | 'generation' | 'branchName'>;
26
+ export interface WorktreeProvisioningLifecycleEntry {
27
+ schemaVersion: 1;
28
+ state: WorktreeProvisioningLifecycleState;
29
+ callID: string;
30
+ parentSessionId: string;
31
+ worktreeSessionId: string;
32
+ taskId?: string;
33
+ reservationId?: string;
34
+ generation?: number;
35
+ branchName?: string;
36
+ recordedAt: number;
37
+ }
17
38
  export type WorktreeProvisioningOwnerScan = {
18
39
  status: 'ok';
19
40
  owners: WorktreeProvisioningOwner[];
@@ -21,6 +42,16 @@ export type WorktreeProvisioningOwnerScan = {
21
42
  status: 'uncertain';
22
43
  reason: string;
23
44
  };
45
+ export type WorktreeProvisioningLifecycleJournalScan = {
46
+ status: 'ok';
47
+ entries: WorktreeProvisioningLifecycleEntry[];
48
+ } | {
49
+ status: 'uncertain';
50
+ reason: string;
51
+ };
52
+ declare function ownerPath(directory: string, callID: string): string;
53
+ declare function journalPath(directory: string): string;
54
+ declare function readOwner(directory: string, callID: string): WorktreeProvisioningOwner | null;
24
55
  /**
25
56
  * Publish a provisional owner before a standard worktree can be created.
26
57
  * Callers hold the shared orphan-recovery lifecycle lock during this atomic
@@ -28,9 +59,16 @@ export type WorktreeProvisioningOwnerScan = {
28
59
  */
29
60
  export declare function recordWorktreeProvisioningOwner(directory: string, input: Omit<WorktreeProvisioningOwner, 'schemaVersion' | 'createdAt'>): WorktreeProvisioningOwner;
30
61
  /** Remove a provisional owner only after durable ownership or cleanup exists. */
31
- export declare function removeWorktreeProvisioningOwner(directory: string, callID: string): boolean;
62
+ export declare function removeWorktreeProvisioningOwner(directory: string, callID: string, expected?: WorktreeProvisioningOwnerRemovalIdentity): boolean;
32
63
  /**
33
64
  * Strict recovery scan. Anything except ENOENT is uncertainty because omitting
34
65
  * one marker could allow destructive cleanup to race a live worktree.
35
66
  */
36
67
  export declare function scanWorktreeProvisioningOwnersForRecovery(directory: string): WorktreeProvisioningOwnerScan;
68
+ export declare function scanWorktreeProvisioningLifecycleJournalForRecovery(directory: string): WorktreeProvisioningLifecycleJournalScan;
69
+ export declare const _internals: {
70
+ getOwnerPath: typeof ownerPath;
71
+ getJournalPath: typeof journalPath;
72
+ readOwner: typeof readOwner;
73
+ };
74
+ export {};