opencode-swarm 7.133.0 → 7.134.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 (77) hide show
  1. package/dist/background/completion-observer.d.ts +17 -7
  2. package/dist/background/pending-delegations.d.ts +305 -30
  3. package/dist/cli/{config-doctor-8nbdwnn6.js → config-doctor-t5r92674.js} +3 -3
  4. package/dist/cli/{core-egwpry19.js → core-d6yd2jzv.js} +3 -3
  5. package/dist/cli/{curation-policy-gae3xm5d.js → curation-policy-3smfn2a3.js} +7 -7
  6. package/dist/cli/{curator-drift-ea0p8nh1.js → curator-drift-tsyyf4b4.js} +6 -6
  7. package/dist/cli/{curator-e88bm4mg.js → curator-hva8f3nf.js} +31 -28
  8. package/dist/cli/{curator-llm-factory-1a7esr69.js → curator-llm-factory-p3aqev12.js} +31 -28
  9. package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
  10. package/dist/cli/{evidence-summary-service-nhsmsap8.js → evidence-summary-service-mrzsjpg4.js} +13 -12
  11. package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
  12. package/dist/cli/guardrail-explain-k8mcvk61.js +57 -0
  13. package/dist/cli/{guardrail-log-fjgyx76r.js → guardrail-log-absma1rv.js} +5 -5
  14. package/dist/cli/{hive-promoter-2b04e0wh.js → hive-promoter-jwd51gzk.js} +31 -28
  15. package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
  16. package/dist/cli/{index-7ftthvqt.js → index-2njes601.js} +8 -8
  17. package/dist/cli/{index-17zjp67y.js → index-2t1n9k7b.js} +4 -4
  18. package/dist/cli/{index-mwqfyjja.js → index-3dtjhr26.js} +48538 -48840
  19. package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
  20. package/dist/cli/index-b4z7s917.js +80 -0
  21. package/dist/cli/{index-wzb4dv5s.js → index-b5ek2cge.js} +4 -4
  22. package/dist/cli/index-b8zgtz81.js +123 -0
  23. package/dist/cli/{index-j5pnah1w.js → index-baawkm48.js} +12 -12
  24. package/dist/cli/{index-sp7tm8t7.js → index-c3e0ymrg.js} +1 -1
  25. package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
  26. package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
  27. package/dist/cli/{index-bz08438z.js → index-dgxgvzab.js} +7 -7
  28. package/dist/cli/{index-mhcge2ry.js → index-eedq2y40.js} +33 -30
  29. package/dist/cli/{index-tj2mkfb3.js → index-g87ty4wp.js} +1 -1
  30. package/dist/cli/{index-mmvaf4t6.js → index-hgh01f6h.js} +25 -3
  31. package/dist/cli/{index-0vd91yb8.js → index-j6ywarjp.js} +3 -3
  32. package/dist/cli/{index-cpest8sa.js → index-jpkxjmfw.js} +5 -5
  33. package/dist/cli/{index-r260ybay.js → index-k742ecbm.js} +178 -222
  34. package/dist/cli/{index-hfpw5m0e.js → index-kapharv7.js} +3 -3
  35. package/dist/cli/{index-66zght9d.js → index-m2s0gbzt.js} +2 -2
  36. package/dist/cli/{index-74tptrss.js → index-p8hezdtz.js} +1 -1
  37. package/dist/cli/{index-sw82jvf2.js → index-rkyhv4p5.js} +2 -2
  38. package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
  39. package/dist/cli/{index-kc1m6vpr.js → index-xfejq1p9.js} +2 -2
  40. package/dist/cli/{index-wz36r0fk.js → index-y0kk3rtv.js} +2 -2
  41. package/dist/cli/index-y3v1404y.js +1625 -0
  42. package/dist/cli/index.js +31 -28
  43. package/dist/cli/{knowledge-escalator-hzkw1ban.js → knowledge-escalator-mkdac2m7.js} +8 -8
  44. package/dist/cli/{knowledge-events-pbycdhqd.js → knowledge-events-jjc9qbe0.js} +6 -6
  45. package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
  46. package/dist/cli/{knowledge-store-45jawb2p.js → knowledge-store-9e0w1kxm.js} +6 -6
  47. package/dist/cli/{knowledge-validator-ge576f8n.js → knowledge-validator-h1nrn2pk.js} +9 -9
  48. package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
  49. package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
  50. package/dist/cli/{scan-cursor-kvw872be.js → scan-cursor-mk3tq3sf.js} +7 -7
  51. package/dist/cli/{schema-a2zm2m3r.js → schema-bjb0yzsq.js} +2 -2
  52. package/dist/cli/{scope-persistence-5qypzxxm.js → scope-persistence-hz3zmmsv.js} +5 -5
  53. package/dist/cli/{skill-generator-ch79hvxh.js → skill-generator-p1de0wkr.js} +10 -10
  54. package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
  55. package/dist/evaluation/contracts.d.ts +1 -1
  56. package/dist/evaluation/public-api.d.ts +1 -1
  57. package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
  58. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
  59. package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
  60. package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
  61. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
  62. package/dist/hooks/delegation-gate.d.ts +14 -5
  63. package/dist/hooks/index.d.ts +1 -1
  64. package/dist/hooks/init-orphan-recovery.d.ts +17 -0
  65. package/dist/index.js +476 -470
  66. package/dist/memory/schema.d.ts +4 -4
  67. package/dist/session/snapshot-writer.d.ts +2 -0
  68. package/dist/state.d.ts +43 -1
  69. package/dist/tools/dispatch-lanes.d.ts +1 -1
  70. package/dist/tools/epic-record-divergence.d.ts +5 -5
  71. package/dist/worktree/merge.d.ts +47 -1
  72. package/package.json +1 -1
  73. package/dist/cli/guardrail-explain-zgja2b9m.js +0 -54
  74. package/dist/cli/pending-delegations-kxy8mdqg.js +0 -75
  75. package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
  76. package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
  77. package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
package/dist/cli/index.js CHANGED
@@ -6,29 +6,30 @@ import {
6
6
  getPluginConfigDir,
7
7
  getPluginLockFilePaths,
8
8
  resolveCommand
9
- } from "./index-mwqfyjja.js";
10
- import"./index-mmvaf4t6.js";
11
- import"./index-tj2mkfb3.js";
12
- import"./index-r260ybay.js";
9
+ } from "./index-3dtjhr26.js";
10
+ import"./index-13xxjfhn.js";
11
+ import"./index-hgh01f6h.js";
12
+ import"./index-g87ty4wp.js";
13
+ import"./index-k742ecbm.js";
13
14
  import"./index-4905hd2m.js";
14
15
  import"./index-134d35c1.js";
15
- import"./index-9f71ye47.js";
16
- import"./index-0vd91yb8.js";
17
- import"./index-cpest8sa.js";
18
- import"./index-66zght9d.js";
16
+ import"./index-j6ywarjp.js";
17
+ import"./index-jpkxjmfw.js";
18
+ import"./index-m2s0gbzt.js";
19
19
  import"./index-vxv732ex.js";
20
20
  import"./index-c8s9a3zh.js";
21
21
  import"./index-9ss2m4rs.js";
22
- import"./index-g4mnf3p5.js";
23
- import"./index-s80bsjkj.js";
24
- import"./index-7ftthvqt.js";
25
- import"./index-wz36r0fk.js";
22
+ import"./index-wk1h5ec2.js";
23
+ import"./index-1j3682j8.js";
24
+ import"./index-2njes601.js";
25
+ import"./index-y0kk3rtv.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-j5pnah1w.js";
28
- import"./index-bz08438z.js";
27
+ import"./index-baawkm48.js";
28
+ import"./index-dgxgvzab.js";
29
29
  import"./index-ae75rja9.js";
30
- import"./index-q27bajqb.js";
31
- import"./index-kc1m6vpr.js";
30
+ import"./index-cfkvc5q9.js";
31
+ import"./index-dd7ttx8x.js";
32
+ import"./index-xfejq1p9.js";
32
33
  import"./index-k5jrywpr.js";
33
34
  import"./index-n832052r.js";
34
35
  import {
@@ -36,27 +37,29 @@ import {
36
37
  init_constants,
37
38
  init_package,
38
39
  package_default
39
- } from "./index-wzb4dv5s.js";
40
+ } from "./index-b5ek2cge.js";
40
41
  import"./index-bk5tah7q.js";
41
42
  import"./index-8fwhhayc.js";
42
43
  import"./index-q1exe2b3.js";
43
- import"./index-74tptrss.js";
44
- import"./index-2tn5h2zp.js";
44
+ import"./index-p8hezdtz.js";
45
+ import"./index-4p02dp92.js";
45
46
  import"./index-1kz6da87.js";
46
- import"./index-17zjp67y.js";
47
- import"./index-z6xqpmqg.js";
47
+ import"./index-b4z7s917.js";
48
+ import"./index-b8zgtz81.js";
49
+ import"./index-2t1n9k7b.js";
48
50
  import"./index-4rhhvd1a.js";
49
- import"./index-zjygnfay.js";
50
- import"./index-zgwm4ryv.js";
51
- import"./index-h3k62043.js";
52
- import"./index-3x761jqv.js";
53
- import"./index-7mkpsw6g.js";
51
+ import"./index-y3v1404y.js";
52
+ import"./index-2ghkk9ve.js";
54
53
  import"./index-fsrp8wp3.js";
55
- import"./index-76kvm9z5.js";
54
+ import"./index-5nybajn9.js";
55
+ import"./index-7g4c7s5r.js";
56
56
  import"./index-q2rrv0cy.js";
57
57
  import"./index-bpmtbmy9.js";
58
- import"./index-7g4c7s5r.js";
58
+ import"./index-z6xqpmqg.js";
59
+ import"./index-zjygnfay.js";
59
60
  import"./index-qe3v54nb.js";
61
+ import"./index-zgwm4ryv.js";
62
+ import"./index-h3k62043.js";
60
63
  import"./index-a76rekgs.js";
61
64
 
62
65
  // src/cli/index.ts
@@ -8,19 +8,19 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-cpest8sa.js";
12
- import"./index-j5pnah1w.js";
13
- import"./index-bz08438z.js";
11
+ } from "./index-jpkxjmfw.js";
12
+ import"./index-baawkm48.js";
13
+ import"./index-dgxgvzab.js";
14
14
  import"./index-ae75rja9.js";
15
- import"./index-q27bajqb.js";
15
+ import"./index-cfkvc5q9.js";
16
+ import"./index-dd7ttx8x.js";
16
17
  import"./index-bk5tah7q.js";
17
- import"./index-zgwm4ryv.js";
18
- import"./index-7mkpsw6g.js";
19
18
  import"./index-fsrp8wp3.js";
20
- import"./index-76kvm9z5.js";
21
- import"./index-q2rrv0cy.js";
19
+ import"./index-5nybajn9.js";
22
20
  import"./index-7g4c7s5r.js";
21
+ import"./index-q2rrv0cy.js";
23
22
  import"./index-qe3v54nb.js";
23
+ import"./index-zgwm4ryv.js";
24
24
  import"./index-a76rekgs.js";
25
25
  export {
26
26
  readRecentEscalations,
@@ -26,16 +26,16 @@ import {
26
26
  resolveKnowledgeCounterBaselinePath,
27
27
  resolveKnowledgeEventsPath,
28
28
  resolveLegacyApplicationLogPath
29
- } from "./index-bz08438z.js";
29
+ } from "./index-dgxgvzab.js";
30
30
  import"./index-ae75rja9.js";
31
- import"./index-q27bajqb.js";
32
- import"./index-zgwm4ryv.js";
33
- import"./index-7mkpsw6g.js";
31
+ import"./index-cfkvc5q9.js";
32
+ import"./index-dd7ttx8x.js";
34
33
  import"./index-fsrp8wp3.js";
35
- import"./index-76kvm9z5.js";
36
- import"./index-q2rrv0cy.js";
34
+ import"./index-5nybajn9.js";
37
35
  import"./index-7g4c7s5r.js";
36
+ import"./index-q2rrv0cy.js";
38
37
  import"./index-qe3v54nb.js";
38
+ import"./index-zgwm4ryv.js";
39
39
  import"./index-a76rekgs.js";
40
40
  export {
41
41
  resolveLegacyApplicationLogPath,
@@ -12,14 +12,14 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-q27bajqb.js";
16
- import"./index-zgwm4ryv.js";
17
- import"./index-7mkpsw6g.js";
15
+ } from "./index-cfkvc5q9.js";
16
+ import"./index-dd7ttx8x.js";
18
17
  import"./index-fsrp8wp3.js";
19
- import"./index-76kvm9z5.js";
20
- import"./index-q2rrv0cy.js";
18
+ import"./index-5nybajn9.js";
21
19
  import"./index-7g4c7s5r.js";
20
+ import"./index-q2rrv0cy.js";
22
21
  import"./index-qe3v54nb.js";
22
+ import"./index-zgwm4ryv.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
25
25
  writeLinkPointer,
@@ -41,19 +41,19 @@ import {
41
41
  transactKnowledge,
42
42
  transactKnowledgeWithCas,
43
43
  wordBigrams
44
- } from "./index-j5pnah1w.js";
44
+ } from "./index-baawkm48.js";
45
45
  import {
46
46
  resolveHiveDataDir
47
47
  } from "./index-ae75rja9.js";
48
- import"./index-q27bajqb.js";
48
+ import"./index-cfkvc5q9.js";
49
+ import"./index-dd7ttx8x.js";
49
50
  import"./index-bk5tah7q.js";
50
- import"./index-zgwm4ryv.js";
51
- import"./index-7mkpsw6g.js";
52
51
  import"./index-fsrp8wp3.js";
53
- import"./index-76kvm9z5.js";
54
- import"./index-q2rrv0cy.js";
52
+ import"./index-5nybajn9.js";
55
53
  import"./index-7g4c7s5r.js";
54
+ import"./index-q2rrv0cy.js";
56
55
  import"./index-qe3v54nb.js";
56
+ import"./index-zgwm4ryv.js";
57
57
  import"./index-a76rekgs.js";
58
58
  export {
59
59
  wordBigrams,
@@ -23,21 +23,21 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-7ftthvqt.js";
27
- import"./index-wz36r0fk.js";
26
+ } from "./index-2njes601.js";
27
+ import"./index-y0kk3rtv.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-j5pnah1w.js";
30
- import"./index-bz08438z.js";
29
+ import"./index-baawkm48.js";
30
+ import"./index-dgxgvzab.js";
31
31
  import"./index-ae75rja9.js";
32
- import"./index-q27bajqb.js";
32
+ import"./index-cfkvc5q9.js";
33
+ import"./index-dd7ttx8x.js";
33
34
  import"./index-bk5tah7q.js";
34
- import"./index-zgwm4ryv.js";
35
- import"./index-7mkpsw6g.js";
36
35
  import"./index-fsrp8wp3.js";
37
- import"./index-76kvm9z5.js";
38
- import"./index-q2rrv0cy.js";
36
+ import"./index-5nybajn9.js";
39
37
  import"./index-7g4c7s5r.js";
38
+ import"./index-q2rrv0cy.js";
40
39
  import"./index-qe3v54nb.js";
40
+ import"./index-zgwm4ryv.js";
41
41
  import"./index-a76rekgs.js";
42
42
  export {
43
43
  validateSkillPath,
@@ -0,0 +1,96 @@
1
+ // @bun
2
+ import {
3
+ BACKGROUND_CODER_RESERVATIONS_FILE,
4
+ BACKGROUND_DELEGATIONS_FILE,
5
+ BACKGROUND_DELEGATION_FALLBACK_DIR,
6
+ BACKGROUND_INGESTION_LEASE_MS,
7
+ MAX_BACKGROUND_ADVISORY_CHARS,
8
+ MAX_BACKGROUND_OBSERVED_FILES,
9
+ MAX_LIVE_BACKGROUND_CODER_RESERVATIONS,
10
+ MAX_LIVE_BACKGROUND_FALLBACKS,
11
+ acknowledgeObservedBackgroundAdvisories,
12
+ appendDelegationTransition,
13
+ bindBackgroundCoderReservation,
14
+ buildBackgroundCoderReservationId,
15
+ buildBackgroundCompletionEventId,
16
+ buildPromptSnapshot,
17
+ claimCoderSettlement,
18
+ claimDelegationIngestion,
19
+ claimTerminalResult,
20
+ findByBatchId,
21
+ findByCorrelationId,
22
+ findDelegationForCompletion,
23
+ findOpenAsyncLaneBatches,
24
+ listDelegationFallbacks,
25
+ normalizeBackgroundObservedFiles,
26
+ preparePendingBackgroundAdvisories,
27
+ promoteDelegationFallback,
28
+ putPendingBackgroundAdvisory,
29
+ readDelegationFallback,
30
+ readDelegations,
31
+ recordDelegationIngestionResult,
32
+ recordPendingDelegation,
33
+ releaseBackgroundCoderReservation,
34
+ releasePreparedBackgroundAdvisories,
35
+ removeDelegationFallback,
36
+ reserveBackgroundCoderSlot,
37
+ scanBackgroundCoderReservationsForAdmission,
38
+ scanDelegationFallbacksForRecovery,
39
+ scanDelegationsForRecovery,
40
+ sweepStaleDelegations,
41
+ updateCoderSettlement,
42
+ writeDelegationFallback
43
+ } from "./index-y3v1404y.js";
44
+ import"./index-2ghkk9ve.js";
45
+ import"./index-fsrp8wp3.js";
46
+ import"./index-5nybajn9.js";
47
+ import"./index-7g4c7s5r.js";
48
+ import"./index-q2rrv0cy.js";
49
+ import"./index-bpmtbmy9.js";
50
+ import"./index-z6xqpmqg.js";
51
+ import"./index-zjygnfay.js";
52
+ import"./index-qe3v54nb.js";
53
+ import"./index-zgwm4ryv.js";
54
+ import"./index-a76rekgs.js";
55
+ export {
56
+ writeDelegationFallback,
57
+ updateCoderSettlement,
58
+ sweepStaleDelegations,
59
+ scanDelegationsForRecovery,
60
+ scanDelegationFallbacksForRecovery,
61
+ scanBackgroundCoderReservationsForAdmission,
62
+ reserveBackgroundCoderSlot,
63
+ removeDelegationFallback,
64
+ releasePreparedBackgroundAdvisories,
65
+ releaseBackgroundCoderReservation,
66
+ recordPendingDelegation,
67
+ recordDelegationIngestionResult,
68
+ readDelegations,
69
+ readDelegationFallback,
70
+ putPendingBackgroundAdvisory,
71
+ promoteDelegationFallback,
72
+ preparePendingBackgroundAdvisories,
73
+ normalizeBackgroundObservedFiles,
74
+ listDelegationFallbacks,
75
+ findOpenAsyncLaneBatches,
76
+ findDelegationForCompletion,
77
+ findByCorrelationId,
78
+ findByBatchId,
79
+ claimTerminalResult,
80
+ claimDelegationIngestion,
81
+ claimCoderSettlement,
82
+ buildPromptSnapshot,
83
+ buildBackgroundCompletionEventId,
84
+ buildBackgroundCoderReservationId,
85
+ bindBackgroundCoderReservation,
86
+ appendDelegationTransition,
87
+ acknowledgeObservedBackgroundAdvisories,
88
+ MAX_LIVE_BACKGROUND_FALLBACKS,
89
+ MAX_LIVE_BACKGROUND_CODER_RESERVATIONS,
90
+ MAX_BACKGROUND_OBSERVED_FILES,
91
+ MAX_BACKGROUND_ADVISORY_CHARS,
92
+ BACKGROUND_INGESTION_LEASE_MS,
93
+ BACKGROUND_DELEGATION_FALLBACK_DIR,
94
+ BACKGROUND_DELEGATIONS_FILE,
95
+ BACKGROUND_CODER_RESERVATIONS_FILE
96
+ };
@@ -9,17 +9,17 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-g4mnf3p5.js";
13
- import"./index-s80bsjkj.js";
14
- import"./index-z6xqpmqg.js";
15
- import"./index-zjygnfay.js";
16
- import"./index-zgwm4ryv.js";
12
+ } from "./index-1j3682j8.js";
13
+ import"./index-2ghkk9ve.js";
17
14
  import"./index-fsrp8wp3.js";
18
- import"./index-76kvm9z5.js";
15
+ import"./index-5nybajn9.js";
16
+ import"./index-7g4c7s5r.js";
19
17
  import"./index-q2rrv0cy.js";
20
18
  import"./index-bpmtbmy9.js";
21
- import"./index-7g4c7s5r.js";
19
+ import"./index-z6xqpmqg.js";
20
+ import"./index-zjygnfay.js";
22
21
  import"./index-qe3v54nb.js";
22
+ import"./index-zgwm4ryv.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
25
25
  updateSnapshot,
@@ -4,18 +4,18 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-66zght9d.js";
8
- import"./index-j5pnah1w.js";
7
+ } from "./index-m2s0gbzt.js";
8
+ import"./index-baawkm48.js";
9
9
  import"./index-ae75rja9.js";
10
- import"./index-q27bajqb.js";
10
+ import"./index-cfkvc5q9.js";
11
+ import"./index-dd7ttx8x.js";
11
12
  import"./index-bk5tah7q.js";
12
- import"./index-zgwm4ryv.js";
13
- import"./index-7mkpsw6g.js";
14
13
  import"./index-fsrp8wp3.js";
15
- import"./index-76kvm9z5.js";
16
- import"./index-q2rrv0cy.js";
14
+ import"./index-5nybajn9.js";
17
15
  import"./index-7g4c7s5r.js";
16
+ import"./index-q2rrv0cy.js";
18
17
  import"./index-qe3v54nb.js";
18
+ import"./index-zgwm4ryv.js";
19
19
  import"./index-a76rekgs.js";
20
20
  export {
21
21
  getScanStatus,
@@ -93,10 +93,10 @@ import {
93
93
  resolveGeneratedAgentRole,
94
94
  resolveGuardrailsConfig,
95
95
  stripKnownSwarmPrefix
96
- } from "./index-wzb4dv5s.js";
96
+ } from "./index-b5ek2cge.js";
97
97
  import"./index-bk5tah7q.js";
98
- import"./index-zjygnfay.js";
99
98
  import"./index-bpmtbmy9.js";
99
+ import"./index-zjygnfay.js";
100
100
  import"./index-a76rekgs.js";
101
101
  init_schema();
102
102
 
@@ -12,15 +12,15 @@ import {
12
12
  resolveScopeWithFallbacks,
13
13
  writeScopeBindingToDisk,
14
14
  writeScopeToDisk
15
- } from "./index-74tptrss.js";
16
- import"./index-2tn5h2zp.js";
15
+ } from "./index-p8hezdtz.js";
16
+ import"./index-4p02dp92.js";
17
17
  import"./index-1kz6da87.js";
18
- import"./index-zgwm4ryv.js";
19
- import"./index-76kvm9z5.js";
18
+ import"./index-5nybajn9.js";
19
+ import"./index-7g4c7s5r.js";
20
20
  import"./index-q2rrv0cy.js";
21
21
  import"./index-bpmtbmy9.js";
22
- import"./index-7g4c7s5r.js";
23
22
  import"./index-qe3v54nb.js";
23
+ import"./index-zgwm4ryv.js";
24
24
  import"./index-a76rekgs.js";
25
25
  export {
26
26
  writeScopeToDisk,
@@ -33,23 +33,23 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-0vd91yb8.js";
37
- import"./index-7ftthvqt.js";
38
- import"./index-wz36r0fk.js";
36
+ } from "./index-j6ywarjp.js";
37
+ import"./index-2njes601.js";
38
+ import"./index-y0kk3rtv.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-j5pnah1w.js";
41
- import"./index-bz08438z.js";
40
+ import"./index-baawkm48.js";
41
+ import"./index-dgxgvzab.js";
42
42
  import"./index-ae75rja9.js";
43
- import"./index-q27bajqb.js";
43
+ import"./index-cfkvc5q9.js";
44
+ import"./index-dd7ttx8x.js";
44
45
  import"./index-bk5tah7q.js";
45
46
  import"./index-4rhhvd1a.js";
46
- import"./index-zgwm4ryv.js";
47
- import"./index-7mkpsw6g.js";
48
47
  import"./index-fsrp8wp3.js";
49
- import"./index-76kvm9z5.js";
50
- import"./index-q2rrv0cy.js";
48
+ import"./index-5nybajn9.js";
51
49
  import"./index-7g4c7s5r.js";
50
+ import"./index-q2rrv0cy.js";
52
51
  import"./index-qe3v54nb.js";
52
+ import"./index-zgwm4ryv.js";
53
53
  import"./index-a76rekgs.js";
54
54
  export {
55
55
  writeEvalStub,
@@ -0,0 +1,221 @@
1
+ // @bun
2
+ import {
3
+ scanWorktreeProvisioningOwnersForRecovery
4
+ } from "./index-b4z7s917.js";
5
+ import {
6
+ scanWorktreeMergeFailuresForRecovery
7
+ } from "./index-b8zgtz81.js";
8
+ import {
9
+ scanDelegationFallbacksForRecovery,
10
+ scanDelegationsForRecovery
11
+ } from "./index-y3v1404y.js";
12
+ import"./index-2ghkk9ve.js";
13
+ import"./index-fsrp8wp3.js";
14
+ import"./index-5nybajn9.js";
15
+ import"./index-7g4c7s5r.js";
16
+ import"./index-q2rrv0cy.js";
17
+ import"./index-bpmtbmy9.js";
18
+ import"./index-z6xqpmqg.js";
19
+ import"./index-zjygnfay.js";
20
+ import {
21
+ bunSpawn
22
+ } from "./index-qe3v54nb.js";
23
+ import"./index-zgwm4ryv.js";
24
+ import"./index-a76rekgs.js";
25
+
26
+ // src/hooks/delegation-gate/worktree-collision-ownership.ts
27
+ import * as path2 from "path";
28
+
29
+ // src/hooks/delegation-gate/worktree-ownership-tag.ts
30
+ import * as fs from "fs";
31
+ import * as path from "path";
32
+ var OWNERSHIP_TAG_SCAN_TIMEOUT_MS = 2000;
33
+ var MAX_OWNERSHIP_TAGS = 512;
34
+ function decodeTagPart(value) {
35
+ if (!value || !/^[A-Za-z0-9_-]+$/.test(value))
36
+ return null;
37
+ const decoded = Buffer.from(value, "base64url").toString("utf8");
38
+ return decoded && Buffer.from(decoded, "utf8").toString("base64url") === value ? decoded : null;
39
+ }
40
+ async function scanBackgroundWorktreeOwnershipTagsForRecovery(directory) {
41
+ try {
42
+ fs.statSync(path.join(directory, ".git"));
43
+ } catch (error) {
44
+ if (error.code === "ENOENT") {
45
+ return { status: "ok", owners: [] };
46
+ }
47
+ return {
48
+ status: "uncertain",
49
+ reason: `Git metadata could not be inspected: ${error instanceof Error ? error.message : String(error)}`
50
+ };
51
+ }
52
+ const proc = bunSpawn([
53
+ "git",
54
+ "-C",
55
+ directory,
56
+ "for-each-ref",
57
+ `--count=${MAX_OWNERSHIP_TAGS + 1}`,
58
+ "--format=%(refname:strip=2)%00%(objectname)",
59
+ "refs/tags/swarm-preserved-owner/"
60
+ ], {
61
+ stdin: "ignore",
62
+ stdout: "pipe",
63
+ stderr: "ignore",
64
+ timeout: OWNERSHIP_TAG_SCAN_TIMEOUT_MS
65
+ });
66
+ try {
67
+ const exitCode = await proc.exited;
68
+ if (exitCode !== 0) {
69
+ return {
70
+ status: "uncertain",
71
+ reason: `ownership tag scan exited ${exitCode}`
72
+ };
73
+ }
74
+ const lines = (await proc.stdout.text()).split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
75
+ if (lines.length > MAX_OWNERSHIP_TAGS) {
76
+ return {
77
+ status: "uncertain",
78
+ reason: `ownership tag scan exceeded the ${MAX_OWNERSHIP_TAGS}-tag safety bound`
79
+ };
80
+ }
81
+ const owners = [];
82
+ for (const line of lines) {
83
+ const [tag, ref, ...extra] = line.split("\x00");
84
+ const segments = tag?.split("/") ?? [];
85
+ const sessionId = decodeTagPart(segments[1] ?? "");
86
+ const laneId = decodeTagPart(segments[2] ?? "");
87
+ const callDigest = segments[3];
88
+ if (extra.length > 0 || segments.length !== 4 || segments[0] !== "swarm-preserved-owner" || !sessionId || !laneId || !callDigest || !/^[0-9a-f]{12}$/.test(callDigest) || !ref || !/^[0-9a-f]{40,64}$/i.test(ref)) {
89
+ return {
90
+ status: "uncertain",
91
+ reason: `malformed background ownership tag entry "${tag ?? ""}"`
92
+ };
93
+ }
94
+ owners.push({ sessionId, laneId, callDigest, ref });
95
+ }
96
+ return { status: "ok", owners };
97
+ } catch (error) {
98
+ return {
99
+ status: "uncertain",
100
+ reason: `ownership tag scan failed: ${error instanceof Error ? error.message : String(error)}`
101
+ };
102
+ } finally {
103
+ try {
104
+ proc.kill();
105
+ } catch {}
106
+ }
107
+ }
108
+
109
+ // src/hooks/delegation-gate/worktree-collision-ownership.ts
110
+ function normalizedPath(value) {
111
+ const resolved = path2.normalize(path2.resolve(value));
112
+ return process.platform === "win32" ? resolved.toLowerCase() : resolved;
113
+ }
114
+ function descriptorCoordinateMatch(descriptor, identity) {
115
+ const branchMatches = descriptor.branchName === identity.branchName;
116
+ const pathMatches = normalizedPath(descriptor.worktreePath) === normalizedPath(identity.worktreePath);
117
+ if (!branchMatches && !pathMatches)
118
+ return "none";
119
+ if (!branchMatches || !pathMatches || descriptor.parentSessionId !== identity.parentSessionId || descriptor.taskId !== identity.taskId) {
120
+ return "uncertain";
121
+ }
122
+ return "exact";
123
+ }
124
+ function isProvenSettled(record) {
125
+ const settlement = record.coderSettlement;
126
+ return settlement?.state === "settled" && settlement.outcome?.kind === "standard-worktree" && (settlement.outcome.result === "merged" || settlement.outcome.result === "unchanged");
127
+ }
128
+ function classifyRecord(record, identity, ownerKind) {
129
+ if (!record.worktree)
130
+ return null;
131
+ const coordinates = descriptorCoordinateMatch(record.worktree, identity);
132
+ if (coordinates === "none")
133
+ return null;
134
+ if (coordinates === "uncertain") {
135
+ return {
136
+ status: "uncertain",
137
+ reason: `${ownerKind} background owner has conflicting identity for branch "${identity.branchName}"`
138
+ };
139
+ }
140
+ if (isProvenSettled(record))
141
+ return null;
142
+ const lifecycle = record.coderSettlement?.state === "preserved" ? "preserved" : "active";
143
+ return {
144
+ status: "protected",
145
+ ownerKind,
146
+ lifecycle,
147
+ reason: `${ownerKind} background owner ${record.correlationId} is ${record.status}` + (record.coderSettlement ? ` with coder settlement ${record.coderSettlement.state}` : " without a settled workspace outcome")
148
+ };
149
+ }
150
+ async function inspectStandardWorktreeCollisionOwnership(identity) {
151
+ const provisioning = scanWorktreeProvisioningOwnersForRecovery(identity.directory);
152
+ if (provisioning.status === "uncertain")
153
+ return provisioning;
154
+ for (const owner of provisioning.owners) {
155
+ const sameSession = owner.parentSessionId === identity.parentSessionId || owner.worktreeSessionId === identity.parentSessionId;
156
+ if (!sameSession)
157
+ continue;
158
+ if (owner.schemaVersion === 1 || owner.taskId === identity.taskId) {
159
+ return {
160
+ status: "protected",
161
+ ownerKind: "provisioning",
162
+ lifecycle: "active",
163
+ reason: owner.schemaVersion === 1 ? `legacy provisioning owner ${owner.callID} cannot disprove ownership of this same-session lane` : `provisioning owner ${owner.callID} is active for task ${identity.taskId}`
164
+ };
165
+ }
166
+ }
167
+ const fallback = await scanDelegationFallbacksForRecovery(identity.directory);
168
+ if (fallback.status === "uncertain")
169
+ return fallback;
170
+ for (const artifact of fallback.owners) {
171
+ const classified = classifyRecord(artifact.record, identity, "fallback");
172
+ if (classified)
173
+ return classified;
174
+ }
175
+ const primary = scanDelegationsForRecovery(identity.directory);
176
+ if (primary.status === "uncertain")
177
+ return primary;
178
+ for (const record of primary.owners) {
179
+ const classified = classifyRecord(record, identity, "primary");
180
+ if (classified)
181
+ return classified;
182
+ }
183
+ const tags = await scanBackgroundWorktreeOwnershipTagsForRecovery(identity.directory);
184
+ if (tags.status === "uncertain")
185
+ return tags;
186
+ for (const owner of tags.owners) {
187
+ if (owner.sessionId === identity.parentSessionId && owner.laneId === identity.taskId) {
188
+ return {
189
+ status: "protected",
190
+ ownerKind: "ownership-tag",
191
+ lifecycle: "preserved",
192
+ reason: `durable ownership tag ${owner.callDigest} preserves this same-session lane`
193
+ };
194
+ }
195
+ }
196
+ const mergeStatus = scanWorktreeMergeFailuresForRecovery(identity.directory);
197
+ if (mergeStatus.status === "uncertain")
198
+ return mergeStatus;
199
+ for (const [, failure] of mergeStatus.failures) {
200
+ const branchMatches = failure.branch === identity.branchName;
201
+ const pathMatches = typeof failure.worktreePath === "string" && normalizedPath(failure.worktreePath) === normalizedPath(identity.worktreePath);
202
+ if (!branchMatches && !pathMatches)
203
+ continue;
204
+ if (!branchMatches || !pathMatches) {
205
+ return {
206
+ status: "uncertain",
207
+ reason: `merge-status owner has conflicting identity for branch "${identity.branchName}"`
208
+ };
209
+ }
210
+ return {
211
+ status: "protected",
212
+ ownerKind: "merge-status",
213
+ lifecycle: "preserved",
214
+ reason: `merge-status records ${failure.outcome} at stage ${failure.stage}`
215
+ };
216
+ }
217
+ return { status: "unowned" };
218
+ }
219
+ export {
220
+ inspectStandardWorktreeCollisionOwnership
221
+ };
@@ -278,9 +278,9 @@ export declare const PromotionDecisionV1Schema: z.ZodObject<{
278
278
  runId: z.ZodString;
279
279
  decidedAt: z.ZodISODateTime;
280
280
  status: z.ZodEnum<{
281
- reject: "reject";
282
281
  inconclusive: "inconclusive";
283
282
  accept: "accept";
283
+ reject: "reject";
284
284
  }>;
285
285
  reasons: z.ZodArray<z.ZodString>;
286
286
  baseline: z.ZodObject<{