issue-flow 0.18.0 → 0.19.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 (233) hide show
  1. package/README.md +34 -100
  2. package/dist/agent-EWKA7357.js +32 -0
  3. package/dist/{analyze-Q4ONIWRZ.js → analyze-Z7ODC27F.js} +42 -41
  4. package/dist/analyze-Z7ODC27F.js.map +1 -0
  5. package/dist/{apply-EEFPY2W4.js → apply-VNSWQS6O.js} +22 -24
  6. package/dist/apply-VNSWQS6O.js.map +1 -0
  7. package/dist/artifacts-AMJQJFFV.js +82 -0
  8. package/dist/artifacts-AMJQJFFV.js.map +1 -0
  9. package/dist/{bench-WWWXLTFH.js → bench-ZJEIACUK.js} +42 -42
  10. package/dist/{chunk-RYOUZ6EK.js → chunk-23VHVVKW.js} +3 -3
  11. package/dist/chunk-2EYLOS5I.js +99 -0
  12. package/dist/chunk-2EYLOS5I.js.map +1 -0
  13. package/dist/{chunk-XUEMATVY.js → chunk-2EZW4X57.js} +28 -25
  14. package/dist/chunk-2EZW4X57.js.map +1 -0
  15. package/dist/{chunk-LGHND47K.js → chunk-2Q6PG3MT.js} +15 -15
  16. package/dist/chunk-2Q6PG3MT.js.map +1 -0
  17. package/dist/{chunk-C5TL7T4V.js → chunk-2YM2VH6R.js} +2 -2
  18. package/dist/{chunk-OODXFCQV.js → chunk-2YYP7AE6.js} +14 -16
  19. package/dist/{chunk-OODXFCQV.js.map → chunk-2YYP7AE6.js.map} +1 -1
  20. package/dist/chunk-3JD25HHJ.js +278 -0
  21. package/dist/chunk-3JD25HHJ.js.map +1 -0
  22. package/dist/{chunk-PMLE7KAQ.js → chunk-46S7APLQ.js} +30 -14
  23. package/dist/chunk-46S7APLQ.js.map +1 -0
  24. package/dist/chunk-6AOZCWN2.js +21 -0
  25. package/dist/chunk-6AOZCWN2.js.map +1 -0
  26. package/dist/{chunk-QPGEFLMY.js → chunk-7CMVL4X6.js} +7 -7
  27. package/dist/chunk-7MJGYPHF.js +1571 -0
  28. package/dist/chunk-7MJGYPHF.js.map +1 -0
  29. package/dist/chunk-7ZZUSMBJ.js +35 -0
  30. package/dist/chunk-7ZZUSMBJ.js.map +1 -0
  31. package/dist/{chunk-DUS5ZNKL.js → chunk-DIMDAYZS.js} +7 -6
  32. package/dist/{chunk-DGRTJD5R.js → chunk-DXH4TQRB.js} +7 -7
  33. package/dist/{chunk-CRGIQFUQ.js → chunk-E2H3JV2E.js} +3 -1
  34. package/dist/chunk-E2H3JV2E.js.map +1 -0
  35. package/dist/{chunk-YUNBOUQH.js → chunk-ERAG5IQB.js} +8 -8
  36. package/dist/{chunk-ZVZMWNCG.js → chunk-F2NFJ27Z.js} +2 -2
  37. package/dist/{chunk-SOM4QA6C.js → chunk-GD7JZMSJ.js} +93 -18
  38. package/dist/chunk-GD7JZMSJ.js.map +1 -0
  39. package/dist/{chunk-6K2LCFG6.js → chunk-HEHHQU4G.js} +70 -81
  40. package/dist/chunk-HEHHQU4G.js.map +1 -0
  41. package/dist/{chunk-34OCSKOB.js → chunk-HHXWAWU6.js} +159 -114
  42. package/dist/chunk-HHXWAWU6.js.map +1 -0
  43. package/dist/{chunk-E4I6MMHD.js → chunk-HWWB22HC.js} +152 -100
  44. package/dist/chunk-HWWB22HC.js.map +1 -0
  45. package/dist/chunk-IMB6FA2F.js +673 -0
  46. package/dist/chunk-IMB6FA2F.js.map +1 -0
  47. package/dist/{chunk-ECU7YO7S.js → chunk-IQYXXFRC.js} +22 -6
  48. package/dist/chunk-IQYXXFRC.js.map +1 -0
  49. package/dist/chunk-J6VJ5M2U.js +1201 -0
  50. package/dist/chunk-J6VJ5M2U.js.map +1 -0
  51. package/dist/{chunk-QJ44VG5G.js → chunk-KDQRNVBZ.js} +3 -3
  52. package/dist/{chunk-7UMMFOL2.js → chunk-LRWIP7QS.js} +39 -24
  53. package/dist/chunk-LRWIP7QS.js.map +1 -0
  54. package/dist/{chunk-LI35PIIS.js → chunk-LYC57OXF.js} +20 -117
  55. package/dist/chunk-LYC57OXF.js.map +1 -0
  56. package/dist/{chunk-HAKDLR6N.js → chunk-MAJ6QDRL.js} +65 -78
  57. package/dist/chunk-MAJ6QDRL.js.map +1 -0
  58. package/dist/{chunk-CWSQVHVV.js → chunk-MHA7Q3KU.js} +248 -102
  59. package/dist/chunk-MHA7Q3KU.js.map +1 -0
  60. package/dist/{chunk-TZYINKCC.js → chunk-MQTVMB7W.js} +33 -28
  61. package/dist/chunk-MQTVMB7W.js.map +1 -0
  62. package/dist/chunk-NP47HRX2.js +136 -0
  63. package/dist/chunk-NP47HRX2.js.map +1 -0
  64. package/dist/{chunk-EG2MGDP5.js → chunk-NYDAHE3Y.js} +52 -46
  65. package/dist/chunk-NYDAHE3Y.js.map +1 -0
  66. package/dist/{chunk-45WZ6GMI.js → chunk-P7ZYOC23.js} +16 -16
  67. package/dist/{chunk-3R27MJ5R.js → chunk-PFWHHYEO.js} +3 -3
  68. package/dist/{chunk-NEWNXZ65.js → chunk-PHPAK2L6.js} +28 -26
  69. package/dist/{chunk-NEWNXZ65.js.map → chunk-PHPAK2L6.js.map} +1 -1
  70. package/dist/{chunk-PPZ3K4YM.js → chunk-PRGPSNGA.js} +2 -2
  71. package/dist/{chunk-V7QOIQYC.js → chunk-RGFMQFX7.js} +9 -23
  72. package/dist/{chunk-V7QOIQYC.js.map → chunk-RGFMQFX7.js.map} +1 -1
  73. package/dist/{chunk-YVPZUN6X.js → chunk-TJVX42KY.js} +335 -38
  74. package/dist/chunk-TJVX42KY.js.map +1 -0
  75. package/dist/{chunk-HOAHMERN.js → chunk-UDRAD7MF.js} +21 -21
  76. package/dist/{chunk-QF7VEL3M.js → chunk-UHDXXLYH.js} +39 -127
  77. package/dist/chunk-UHDXXLYH.js.map +1 -0
  78. package/dist/{chunk-RNFUVKC3.js → chunk-UPAAZU4W.js} +30 -13
  79. package/dist/chunk-UPAAZU4W.js.map +1 -0
  80. package/dist/{chunk-L6HSKTQE.js → chunk-W7LZLJAF.js} +4 -4
  81. package/dist/{chunk-KMCS76ZW.js → chunk-WB2FVIUS.js} +44 -12
  82. package/dist/chunk-WB2FVIUS.js.map +1 -0
  83. package/dist/{chunk-SA6HXL4Y.js → chunk-WPHC6JBR.js} +9 -9
  84. package/dist/chunk-WPHC6JBR.js.map +1 -0
  85. package/dist/{chunk-KRAGAUKD.js → chunk-XHCP6ZNO.js} +201 -64
  86. package/dist/chunk-XHCP6ZNO.js.map +1 -0
  87. package/dist/{chunk-7F7LGMVO.js → chunk-XKR3VD2Z.js} +12 -12
  88. package/dist/{chunk-7F7LGMVO.js.map → chunk-XKR3VD2Z.js.map} +1 -1
  89. package/dist/{chunk-ICM463EO.js → chunk-XNK5UN2D.js} +5 -649
  90. package/dist/chunk-XNK5UN2D.js.map +1 -0
  91. package/dist/{chunk-LTH6XYZ3.js → chunk-XQLNZW7I.js} +40 -30
  92. package/dist/chunk-XQLNZW7I.js.map +1 -0
  93. package/dist/{chunk-62GVVZQO.js → chunk-ZAYATXJD.js} +32 -316
  94. package/dist/chunk-ZAYATXJD.js.map +1 -0
  95. package/dist/cli.js +127 -59
  96. package/dist/cli.js.map +1 -1
  97. package/dist/compat-YPDZB34U.js +24 -0
  98. package/dist/{config-LEBZZCJP.js → config-56B4OHZE.js} +20 -17
  99. package/dist/{contract-JH2WBIO6.js → contract-HWLFFL3F.js} +2 -2
  100. package/dist/{conventions-XOT6YW5L.js → conventions-DW2CM5I3.js} +20 -16
  101. package/dist/{conventions-XOT6YW5L.js.map → conventions-DW2CM5I3.js.map} +1 -1
  102. package/dist/db-5NU77PJA.js +264 -0
  103. package/dist/db-5NU77PJA.js.map +1 -0
  104. package/dist/diagnostics-UCTS2VUF.js +25 -0
  105. package/dist/execute-R7AVOLNG.js +38 -0
  106. package/dist/{generate-JGW5JSKB.js → generate-O7GUXLN4.js} +46 -43
  107. package/dist/generate-O7GUXLN4.js.map +1 -0
  108. package/dist/{git-A2IP32PQ.js → git-LCG45YXD.js} +2 -3
  109. package/dist/history-6GSURU3H.js +101 -0
  110. package/dist/history-6GSURU3H.js.map +1 -0
  111. package/dist/init-DD6DBRC5.js +28 -0
  112. package/dist/{operations-O4FORFIH.js → operations-HU5ZFEBA.js} +78 -52
  113. package/dist/operations-HU5ZFEBA.js.map +1 -0
  114. package/dist/{permissions-G4XCAESF.js → permissions-NNNSRC4P.js} +5 -6
  115. package/dist/plan-XR6B7EM3.js +38 -0
  116. package/dist/{policy-U5NBFAO5.js → policy-RFJOJQL6.js} +17 -15
  117. package/dist/{policy-U5NBFAO5.js.map → policy-RFJOJQL6.js.map} +1 -1
  118. package/dist/pr-OSCNJCOO.js +42 -0
  119. package/dist/pr-review-IKIYHFBO.js +33 -0
  120. package/dist/prd-HFDZJJQR.js +37 -0
  121. package/dist/{ps-76L6ZAZL.js → ps-AKRHGPSR.js} +26 -15
  122. package/dist/ps-AKRHGPSR.js.map +1 -0
  123. package/dist/{recorder-2BAKPBRA.js → recorder-T7426CKV.js} +11 -7
  124. package/dist/registry-DWRKD65A.js +17 -0
  125. package/dist/repository-TABBRW2C.js +80 -0
  126. package/dist/resume-GDXKK5XP.js +278 -0
  127. package/dist/resume-GDXKK5XP.js.map +1 -0
  128. package/dist/review-JJHMQA2O.js +38 -0
  129. package/dist/routing-FPNUVE7T.js +35 -0
  130. package/dist/run-RLCURLLL.js +61 -0
  131. package/dist/{session-publisher-KAJQRHNZ.js → session-publisher-Q5TNEZPX.js} +3 -3
  132. package/dist/session-publisher-Q5TNEZPX.js.map +1 -0
  133. package/dist/{state-manager-UPHO2EA2.js → state-manager-IGNTD4AB.js} +9 -4
  134. package/dist/state-manager-IGNTD4AB.js.map +1 -0
  135. package/dist/{usage-KTMYXAPF.js → usage-XW27AL5K.js} +69 -63
  136. package/dist/usage-XW27AL5K.js.map +1 -0
  137. package/dist/web-NCDBVZ5Y.js +205 -0
  138. package/dist/web-NCDBVZ5Y.js.map +1 -0
  139. package/package.json +20 -7
  140. package/prompts/analyze.md +16 -19
  141. package/prompts/execute.md +73 -144
  142. package/prompts/generate.md +23 -10
  143. package/prompts/plan.md +32 -60
  144. package/prompts/pr-review.md +58 -40
  145. package/prompts/pr.md +50 -16
  146. package/prompts/prd.md +26 -19
  147. package/prompts/review.md +41 -18
  148. package/web/public/app.js +109 -110
  149. package/dist/agent-HMZTXCRT.js +0 -30
  150. package/dist/analyze-Q4ONIWRZ.js.map +0 -1
  151. package/dist/apply-EEFPY2W4.js.map +0 -1
  152. package/dist/chunk-34OCSKOB.js.map +0 -1
  153. package/dist/chunk-62GVVZQO.js.map +0 -1
  154. package/dist/chunk-6K2LCFG6.js.map +0 -1
  155. package/dist/chunk-7UMMFOL2.js.map +0 -1
  156. package/dist/chunk-CRGIQFUQ.js.map +0 -1
  157. package/dist/chunk-CWSQVHVV.js.map +0 -1
  158. package/dist/chunk-E4I6MMHD.js.map +0 -1
  159. package/dist/chunk-ECU7YO7S.js.map +0 -1
  160. package/dist/chunk-EG2MGDP5.js.map +0 -1
  161. package/dist/chunk-HAKDLR6N.js.map +0 -1
  162. package/dist/chunk-ICM463EO.js.map +0 -1
  163. package/dist/chunk-KMCS76ZW.js.map +0 -1
  164. package/dist/chunk-KRAGAUKD.js.map +0 -1
  165. package/dist/chunk-LGHND47K.js.map +0 -1
  166. package/dist/chunk-LI35PIIS.js.map +0 -1
  167. package/dist/chunk-LTH6XYZ3.js.map +0 -1
  168. package/dist/chunk-PMLE7KAQ.js.map +0 -1
  169. package/dist/chunk-QF7VEL3M.js.map +0 -1
  170. package/dist/chunk-RNFUVKC3.js.map +0 -1
  171. package/dist/chunk-SA6HXL4Y.js.map +0 -1
  172. package/dist/chunk-SOM4QA6C.js.map +0 -1
  173. package/dist/chunk-TZYINKCC.js.map +0 -1
  174. package/dist/chunk-WCCZJL7W.js +0 -141
  175. package/dist/chunk-WCCZJL7W.js.map +0 -1
  176. package/dist/chunk-XEYH6ZZI.js +0 -289
  177. package/dist/chunk-XEYH6ZZI.js.map +0 -1
  178. package/dist/chunk-XUEMATVY.js.map +0 -1
  179. package/dist/chunk-XZUEFTUP.js +0 -243
  180. package/dist/chunk-XZUEFTUP.js.map +0 -1
  181. package/dist/chunk-YVPZUN6X.js.map +0 -1
  182. package/dist/diagnostics-HTCWF7F4.js +0 -23
  183. package/dist/execute-LELOSR5T.js +0 -37
  184. package/dist/generate-JGW5JSKB.js.map +0 -1
  185. package/dist/init-TO6MUXO4.js +0 -26
  186. package/dist/operations-O4FORFIH.js.map +0 -1
  187. package/dist/plan-OXAT344Q.js +0 -34
  188. package/dist/pr-UZHNKKZC.js +0 -39
  189. package/dist/pr-review-Q4ACAWDM.js +0 -32
  190. package/dist/prd-6CYEMLDY.js +0 -33
  191. package/dist/ps-76L6ZAZL.js.map +0 -1
  192. package/dist/registry-XLHHYLTR.js +0 -15
  193. package/dist/resume-URCU6CIJ.js +0 -244
  194. package/dist/resume-URCU6CIJ.js.map +0 -1
  195. package/dist/review-LVZT2TMW.js +0 -35
  196. package/dist/routing-EK6RBZM4.js +0 -33
  197. package/dist/run-2RXJCJKT.js +0 -56
  198. package/dist/usage-KTMYXAPF.js.map +0 -1
  199. package/dist/web-B5UPHHR5.js +0 -172
  200. package/dist/web-B5UPHHR5.js.map +0 -1
  201. /package/dist/{agent-HMZTXCRT.js.map → agent-EWKA7357.js.map} +0 -0
  202. /package/dist/{bench-WWWXLTFH.js.map → bench-ZJEIACUK.js.map} +0 -0
  203. /package/dist/{chunk-RYOUZ6EK.js.map → chunk-23VHVVKW.js.map} +0 -0
  204. /package/dist/{chunk-C5TL7T4V.js.map → chunk-2YM2VH6R.js.map} +0 -0
  205. /package/dist/{chunk-QPGEFLMY.js.map → chunk-7CMVL4X6.js.map} +0 -0
  206. /package/dist/{chunk-DUS5ZNKL.js.map → chunk-DIMDAYZS.js.map} +0 -0
  207. /package/dist/{chunk-DGRTJD5R.js.map → chunk-DXH4TQRB.js.map} +0 -0
  208. /package/dist/{chunk-YUNBOUQH.js.map → chunk-ERAG5IQB.js.map} +0 -0
  209. /package/dist/{chunk-ZVZMWNCG.js.map → chunk-F2NFJ27Z.js.map} +0 -0
  210. /package/dist/{chunk-QJ44VG5G.js.map → chunk-KDQRNVBZ.js.map} +0 -0
  211. /package/dist/{chunk-45WZ6GMI.js.map → chunk-P7ZYOC23.js.map} +0 -0
  212. /package/dist/{chunk-3R27MJ5R.js.map → chunk-PFWHHYEO.js.map} +0 -0
  213. /package/dist/{chunk-PPZ3K4YM.js.map → chunk-PRGPSNGA.js.map} +0 -0
  214. /package/dist/{chunk-HOAHMERN.js.map → chunk-UDRAD7MF.js.map} +0 -0
  215. /package/dist/{chunk-L6HSKTQE.js.map → chunk-W7LZLJAF.js.map} +0 -0
  216. /package/dist/{config-LEBZZCJP.js.map → compat-YPDZB34U.js.map} +0 -0
  217. /package/dist/{contract-JH2WBIO6.js.map → config-56B4OHZE.js.map} +0 -0
  218. /package/dist/{diagnostics-HTCWF7F4.js.map → contract-HWLFFL3F.js.map} +0 -0
  219. /package/dist/{execute-LELOSR5T.js.map → diagnostics-UCTS2VUF.js.map} +0 -0
  220. /package/dist/{git-A2IP32PQ.js.map → execute-R7AVOLNG.js.map} +0 -0
  221. /package/dist/{init-TO6MUXO4.js.map → git-LCG45YXD.js.map} +0 -0
  222. /package/dist/{permissions-G4XCAESF.js.map → init-DD6DBRC5.js.map} +0 -0
  223. /package/dist/{plan-OXAT344Q.js.map → permissions-NNNSRC4P.js.map} +0 -0
  224. /package/dist/{pr-UZHNKKZC.js.map → plan-XR6B7EM3.js.map} +0 -0
  225. /package/dist/{pr-review-Q4ACAWDM.js.map → pr-OSCNJCOO.js.map} +0 -0
  226. /package/dist/{prd-6CYEMLDY.js.map → pr-review-IKIYHFBO.js.map} +0 -0
  227. /package/dist/{recorder-2BAKPBRA.js.map → prd-HFDZJJQR.js.map} +0 -0
  228. /package/dist/{registry-XLHHYLTR.js.map → recorder-T7426CKV.js.map} +0 -0
  229. /package/dist/{review-LVZT2TMW.js.map → registry-DWRKD65A.js.map} +0 -0
  230. /package/dist/{routing-EK6RBZM4.js.map → repository-TABBRW2C.js.map} +0 -0
  231. /package/dist/{run-2RXJCJKT.js.map → review-JJHMQA2O.js.map} +0 -0
  232. /package/dist/{session-publisher-KAJQRHNZ.js.map → routing-FPNUVE7T.js.map} +0 -0
  233. /package/dist/{state-manager-UPHO2EA2.js.map → run-RLCURLLL.js.map} +0 -0
@@ -3,26 +3,7 @@ import {
3
3
  formatPhaseLine,
4
4
  loadPhaseTiming,
5
5
  snapshotTimingFields
6
- } from "./chunk-QJ44VG5G.js";
7
- import {
8
- runPr
9
- } from "./chunk-OODXFCQV.js";
10
- import {
11
- mostRecent,
12
- prReviewDir,
13
- readPrReviewIndex,
14
- runPrReview
15
- } from "./chunk-LTH6XYZ3.js";
16
- import {
17
- listPullRequests,
18
- publishGitState
19
- } from "./chunk-YUNBOUQH.js";
20
- import {
21
- runPrd
22
- } from "./chunk-XUEMATVY.js";
23
- import {
24
- runReview
25
- } from "./chunk-EG2MGDP5.js";
6
+ } from "./chunk-KDQRNVBZ.js";
26
7
  import {
27
8
  PIPELINE_PHASES,
28
9
  PIPELINE_PHASES_NO_BRANCH,
@@ -41,51 +22,71 @@ import {
41
22
  markQueueIssueInProgress,
42
23
  markQueueIssueSkipped,
43
24
  nextQueueIssue,
25
+ queueNeedsFinalization,
44
26
  saveExecutionPlan,
45
27
  setQueueBranch,
46
28
  setQueuePullRequest
47
- } from "./chunk-7UMMFOL2.js";
29
+ } from "./chunk-LRWIP7QS.js";
48
30
  import {
49
- runInit
50
- } from "./chunk-PMLE7KAQ.js";
31
+ listStoredIssueEvents
32
+ } from "./chunk-2EYLOS5I.js";
51
33
  import {
34
+ SqliteSessionPublisher,
52
35
  printQueueSummary,
53
36
  printRunSummary,
54
37
  runExecute,
55
38
  stripMarkdown
56
- } from "./chunk-KRAGAUKD.js";
39
+ } from "./chunk-XHCP6ZNO.js";
57
40
  import {
58
41
  ensureWebMonitor
59
- } from "./chunk-NEWNXZ65.js";
42
+ } from "./chunk-PHPAK2L6.js";
60
43
  import {
61
44
  runPlan
62
- } from "./chunk-34OCSKOB.js";
45
+ } from "./chunk-HHXWAWU6.js";
46
+ import {
47
+ runPr
48
+ } from "./chunk-2YYP7AE6.js";
49
+ import {
50
+ mostRecent,
51
+ prReviewDir,
52
+ readPrReviewIndex,
53
+ runPrReview
54
+ } from "./chunk-XQLNZW7I.js";
55
+ import {
56
+ listPullRequests,
57
+ publishGitState
58
+ } from "./chunk-ERAG5IQB.js";
59
+ import {
60
+ runPrd
61
+ } from "./chunk-2EZW4X57.js";
62
+ import {
63
+ runReview
64
+ } from "./chunk-NYDAHE3Y.js";
63
65
  import {
64
66
  resolveCommandIssue
65
- } from "./chunk-SA6HXL4Y.js";
67
+ } from "./chunk-WPHC6JBR.js";
68
+ import {
69
+ runInit
70
+ } from "./chunk-46S7APLQ.js";
66
71
  import {
67
72
  getProvider
68
- } from "./chunk-62GVVZQO.js";
73
+ } from "./chunk-ZAYATXJD.js";
69
74
  import {
70
75
  beginUsageScope,
71
76
  getRunUsageTotals
72
- } from "./chunk-KMCS76ZW.js";
77
+ } from "./chunk-WB2FVIUS.js";
73
78
  import {
74
79
  assessDecomposition,
75
80
  buildDecompositionReport,
76
81
  proposeSubIssues,
77
82
  resetAgentInvocationState
78
- } from "./chunk-TZYINKCC.js";
79
- import {
80
- JournalPublisher,
81
- MultiPublisher
82
- } from "./chunk-WCCZJL7W.js";
83
+ } from "./chunk-MQTVMB7W.js";
83
84
  import {
84
85
  recommendedTarget
85
- } from "./chunk-ZVZMWNCG.js";
86
+ } from "./chunk-F2NFJ27Z.js";
86
87
  import {
87
88
  getPackageVersion
88
- } from "./chunk-C5TL7T4V.js";
89
+ } from "./chunk-2YM2VH6R.js";
89
90
  import {
90
91
  describeRunAgents,
91
92
  getActiveResilienceConfig,
@@ -97,13 +98,10 @@ import {
97
98
  loadRoutingConfig,
98
99
  loadWebConfig,
99
100
  onShutdown
100
- } from "./chunk-QF7VEL3M.js";
101
- import {
102
- resolveIssuePaths,
103
- resolveProjectPaths,
104
- resolveQueuePaths
105
- } from "./chunk-LI35PIIS.js";
101
+ } from "./chunk-UHDXXLYH.js";
106
102
  import {
103
+ JournalPublisher,
104
+ MultiPublisher,
107
105
  formatDuration,
108
106
  getIcons,
109
107
  getInactivityTimeout,
@@ -112,51 +110,60 @@ import {
112
110
  printInfo,
113
111
  printSuccess,
114
112
  printWarning,
113
+ resolveIssuePaths,
114
+ resolveProjectPaths,
115
+ resolveQueuePaths,
115
116
  setActivityCallback,
116
117
  setInactivityTimeout,
117
118
  setOutputCallback,
118
119
  setStoryStageCallback,
119
120
  setStoryUpdateCallback
120
- } from "./chunk-XZUEFTUP.js";
121
+ } from "./chunk-J6VJ5M2U.js";
121
122
  import {
122
123
  bindDiagnosticContext,
123
124
  flushDiagnostics,
124
125
  writeDiagnostic
125
- } from "./chunk-QPGEFLMY.js";
126
- import {
127
- committedStoryIds,
128
- describePreflight,
129
- getBaseBranch,
130
- getCurrentBranch,
131
- getHeadCommit,
132
- getProjectRoot,
133
- localBranchExists,
134
- preflightRepository,
135
- run
136
- } from "./chunk-YVPZUN6X.js";
126
+ } from "./chunk-7CMVL4X6.js";
137
127
  import {
138
128
  FilePublisher,
139
129
  MemoryPublisher,
140
130
  getSessionPublisher,
141
131
  setSessionPublisher
142
- } from "./chunk-DUS5ZNKL.js";
132
+ } from "./chunk-DIMDAYZS.js";
143
133
  import {
134
+ DEFAULT_MAX_CORRECTION_CYCLES,
135
+ allStoriesPass,
144
136
  isoNow,
145
137
  loadTaskPlan,
146
138
  saveTaskPlan
147
- } from "./chunk-SOM4QA6C.js";
139
+ } from "./chunk-GD7JZMSJ.js";
148
140
  import {
149
141
  acquireRunLock,
150
142
  describeRunLockOwner
151
- } from "./chunk-ICM463EO.js";
143
+ } from "./chunk-IMB6FA2F.js";
144
+ import {
145
+ getPlanRepository,
146
+ ingestGeneratedPlan
147
+ } from "./chunk-7MJGYPHF.js";
148
+ import {
149
+ committedStoryIds,
150
+ describePreflight,
151
+ getBaseBranch,
152
+ getCurrentBranch,
153
+ getHeadCommit,
154
+ getProjectRoot,
155
+ localBranchExists,
156
+ preflightRepository,
157
+ run
158
+ } from "./chunk-TJVX42KY.js";
152
159
 
153
160
  // src/execution/detach.ts
154
- import { spawn } from "child_process";
155
- import { mkdir, open } from "fs/promises";
156
- import { dirname } from "path";
161
+ import { spawn } from "node:child_process";
162
+ import { mkdir, open } from "node:fs/promises";
163
+ import { dirname } from "node:path";
157
164
 
158
165
  // src/storage/run-log.ts
159
- import { rename, stat } from "fs/promises";
166
+ import { rename, stat } from "node:fs/promises";
160
167
  var DEFAULT_RUN_LOG_MAX_BYTES = 5 * 1024 * 1024;
161
168
  async function rotateRunLogIfNeeded(filePath, rotatedPath, maxBytes = DEFAULT_RUN_LOG_MAX_BYTES) {
162
169
  if (maxBytes <= 0) return;
@@ -257,7 +264,7 @@ function parseIssueArguments(values) {
257
264
  }
258
265
 
259
266
  // src/execution/confirm.ts
260
- import { createInterface } from "readline";
267
+ import { createInterface } from "node:readline";
261
268
  var MAX_PROMPT_ATTEMPTS = 3;
262
269
  var QueueConfirmationError = class extends Error {
263
270
  exitCode;
@@ -541,6 +548,10 @@ async function planQueue(input) {
541
548
  const single = input.requested.length === 1;
542
549
  let resumable = await loadResumableQueue(input.planFile, input.requested);
543
550
  if (resumable !== null) {
551
+ if (input.closeIssue !== void 0) {
552
+ resumable.closeIssue = input.closeIssue;
553
+ await saveExecutionPlan(input.planFile, resumable);
554
+ }
544
555
  const reconciled = await reconcileClosedDiscoveredIssues(resumable, warn);
545
556
  resumable = reconciled.plan;
546
557
  if (reconciled.closed.length > 0) {
@@ -550,7 +561,7 @@ async function planQueue(input) {
550
561
  );
551
562
  }
552
563
  }
553
- if (resumable !== null && isQueueComplete(resumable)) {
564
+ if (resumable !== null && isQueueComplete(resumable) && !queueNeedsFinalization(resumable)) {
554
565
  const pr = resumable.pullRequest?.url;
555
566
  info(
556
567
  `The execution queue of issue #${resumable.id} is already complete (${resumable.issues.length} issues)${pr === void 0 ? "" : ` \u2014 ${pr}`}. Nothing to run.`
@@ -672,10 +683,57 @@ async function planQueue(input) {
672
683
  })
673
684
  );
674
685
  }
686
+ if (input.closeIssue !== void 0) plan.closeIssue = input.closeIssue;
675
687
  await saveExecutionPlan(input.planFile, plan);
676
688
  return { kind: "queue", plan, resumed: false };
677
689
  }
678
690
 
691
+ // src/commands/run/closure.ts
692
+ function requestedPhasesComplete(plan) {
693
+ const phases = PIPELINE_PHASES.filter(
694
+ (phase) => !plan.noBranch || phase !== "pr"
695
+ );
696
+ if (plan.prReview?.enabled && !plan.noBranch) phases.push("pr-review");
697
+ return plan.userStories.length > 0 && new PipelineManager(plan, "", phases).getNextPhase() === null && allStoriesPass(plan) && !plan.lastReviewFindings;
698
+ }
699
+ async function closeAndConfirm(id, source) {
700
+ const provider = getProvider(source);
701
+ if ((await provider.get(id))?.state === "closed") return;
702
+ if (!provider.close) throw new Error(`Provider ${source} cannot close issues`);
703
+ await provider.close(id);
704
+ if ((await provider.get(id))?.state !== "closed")
705
+ throw new Error(`Could not confirm closure of ${id}`);
706
+ }
707
+ async function persistClosureChoice(path, choice) {
708
+ if (choice === void 0) return;
709
+ const plan = await loadTaskPlan(path);
710
+ plan.closeIssue = choice;
711
+ await saveTaskPlan(path, plan);
712
+ }
713
+ async function finishIssueClosure(path, id, source) {
714
+ const plan = await loadTaskPlan(path);
715
+ if (!requestedPhasesComplete(plan)) return 1;
716
+ if (plan.closeIssue && !plan.issueClosedAt) {
717
+ try {
718
+ await closeAndConfirm(id, source);
719
+ plan.issueClosedAt = isoNow();
720
+ } catch (error) {
721
+ const message = error instanceof Error ? error.message : String(error);
722
+ plan.lastError = { category: "issue_closure", message, at: isoNow() };
723
+ plan.issueStatus = "in_progress";
724
+ plan.completedAt = null;
725
+ await saveTaskPlan(path, plan);
726
+ printError(`Delivery complete; issue closure pending: ${message}`);
727
+ return 1;
728
+ }
729
+ }
730
+ plan.issueStatus = "completed";
731
+ plan.completedAt ??= isoNow();
732
+ if (plan.lastError?.category === "issue_closure") plan.lastError = null;
733
+ await saveTaskPlan(path, plan);
734
+ return 0;
735
+ }
736
+
679
737
  // src/commands/run/pull-request.ts
680
738
  async function primaryPrCreated(plan) {
681
739
  try {
@@ -740,17 +798,6 @@ async function propagatePullRequest(plan) {
740
798
  }
741
799
  return pullRequest;
742
800
  }
743
- async function closeIssue(issueNumber, source) {
744
- try {
745
- const provider = getProvider(source);
746
- if (provider.close !== void 0) {
747
- printInfo("Closing issue...");
748
- await provider.close(issueNumber);
749
- }
750
- } catch {
751
- printWarning("Failed to close issue automatically");
752
- }
753
- }
754
801
 
755
802
  // src/commands/run/queue-failure.ts
756
803
  async function handleQueueIssueFailure(input) {
@@ -828,6 +875,7 @@ async function decideQueue(input) {
828
875
  planFile: queuePaths.planFile,
829
876
  noBranch: input.noBranch,
830
877
  prReview: input.prReview,
878
+ closeIssue: input.runOptions.closeIssue,
831
879
  confirm: {
832
880
  yes: input.runOptions.yes,
833
881
  only: input.runOptions.only,
@@ -879,6 +927,10 @@ async function detachAfterConfirm(requested, noBranch, prReview, options) {
879
927
  }
880
928
  async function runQueue(initialPlan, options, resolvedPrimary, runIssueSession3) {
881
929
  const planFile = (await resolveQueuePaths(initialPlan.id)).planFile;
930
+ if (options.runOptions?.closeIssue !== void 0) {
931
+ initialPlan = { ...initialPlan, closeIssue: options.runOptions.closeIssue };
932
+ await saveExecutionPlan(planFile, initialPlan);
933
+ }
882
934
  const queueUsage = beginUsageScope();
883
935
  const startedAtMs = Date.now();
884
936
  const resilience = getActiveResilienceConfig();
@@ -1046,7 +1098,7 @@ async function finishQueue(plan, planFile, summaries, startedAtMs, queueUsage, o
1046
1098
  let current = plan;
1047
1099
  let review = null;
1048
1100
  const alreadyOpened = current.pullRequest !== void 0 || await primaryPrCreated(current);
1049
- if (!current.noBranch && options.noBranch !== true && !alreadyOpened) {
1101
+ if (!current.noBranch && options.noBranch !== true && (!alreadyOpened || current.prReview && !current.prReviewCompleted)) {
1050
1102
  const outcome = await runIssueSession3(current.id, options.mode, {
1051
1103
  prReview: options.prReview ?? current.prReview,
1052
1104
  queue: {
@@ -1062,17 +1114,43 @@ async function finishQueue(plan, planFile, summaries, startedAtMs, queueUsage, o
1062
1114
  await saveExecutionPlan(planFile, current);
1063
1115
  return outcome.code;
1064
1116
  }
1117
+ if (current.prReview) current.prReviewCompleted = review !== null && !review.requestedChanges;
1065
1118
  const pullRequest = await propagatePullRequest(current);
1066
1119
  if (pullRequest !== null) {
1067
1120
  current = setQueuePullRequest(current, pullRequest);
1068
1121
  }
1069
1122
  }
1070
1123
  await saveExecutionPlan(planFile, current);
1124
+ if (current.prReview && !current.prReviewCompleted && !review?.requestedChanges) {
1125
+ printError("Consolidated PR review is still pending; resume the queue.");
1126
+ return 1;
1127
+ }
1071
1128
  if (review?.requestedChanges === true) {
1072
1129
  printInfo("Issues left open until the review blockers are addressed.");
1073
- } else {
1130
+ } else if (current.closeIssue && (!current.prReview || current.prReviewCompleted)) {
1074
1131
  for (const entry of current.issues) {
1075
- await closeIssue(entry.id, entry.source);
1132
+ if (entry.status !== "completed" || (current.closedIssueIds ?? []).includes(entry.id))
1133
+ continue;
1134
+ try {
1135
+ await closeAndConfirm(entry.id, entry.source);
1136
+ current.closedIssueIds = [...current.closedIssueIds ?? [], entry.id];
1137
+ await saveExecutionPlan(planFile, current);
1138
+ } catch (error) {
1139
+ printError(`Issue #${entry.id} closure pending: ${String(error)}`);
1140
+ return 1;
1141
+ }
1142
+ }
1143
+ }
1144
+ if (!review?.requestedChanges && (!current.prReview || current.prReviewCompleted)) {
1145
+ for (const entry of current.issues.filter((entry2) => entry2.status === "completed")) {
1146
+ try {
1147
+ const paths = await resolveIssuePaths(entry.id);
1148
+ const task = await loadTaskPlan(paths.tasksFile);
1149
+ task.issueStatus = "completed";
1150
+ task.completedAt = (/* @__PURE__ */ new Date()).toISOString();
1151
+ await saveTaskPlan(paths.tasksFile, task);
1152
+ } catch {
1153
+ }
1076
1154
  }
1077
1155
  }
1078
1156
  printQueueSummary({
@@ -1376,7 +1454,7 @@ async function runPipelineWithRenderer(options) {
1376
1454
  import { execa } from "execa";
1377
1455
 
1378
1456
  // src/commands/run/publish.ts
1379
- import { join } from "path";
1457
+ import { join } from "node:path";
1380
1458
  function toIssueNumber(id) {
1381
1459
  const parsed = Number.parseInt(id, 10);
1382
1460
  return Number.isNaN(parsed) ? null : parsed;
@@ -1457,8 +1535,7 @@ async function readPrReviewOutcome(issue, tasksPath, requestedChanges) {
1457
1535
  }
1458
1536
 
1459
1537
  // src/commands/run/phase-finalize.ts
1460
- async function applyReviewOutcomeAndClose(input) {
1461
- const { issueNumber, resolvedIssue, review, inQueue } = input;
1538
+ function reportReviewOutcome(review) {
1462
1539
  if (review?.requestedChanges) {
1463
1540
  console.log("");
1464
1541
  printWarning("PR review requested changes \u2014 the Pull Request is not ready to merge.");
@@ -1468,8 +1545,6 @@ async function applyReviewOutcomeAndClose(input) {
1468
1545
  }
1469
1546
  if (review?.requestedChanges) {
1470
1547
  printInfo("Issue left open until the review blockers are addressed.");
1471
- } else if (!inQueue) {
1472
- await closeIssue(issueNumber, resolvedIssue.source);
1473
1548
  }
1474
1549
  }
1475
1550
  async function resolveSummaryPrUrl(input) {
@@ -1501,7 +1576,20 @@ async function finalizeSuccessfulIssueRun(input) {
1501
1576
  effectiveNoBranch,
1502
1577
  elapsedSeconds
1503
1578
  } = input;
1504
- await applyReviewOutcomeAndClose({ issueNumber, resolvedIssue, review, inQueue });
1579
+ reportReviewOutcome(review);
1580
+ const closurePlan = !inQueue ? await loadTaskPlan(tasksPath).catch(() => null) : null;
1581
+ if (!inQueue && !review?.requestedChanges && (closurePlan?.closeIssue || closurePlan?.lastError?.category === "issue_closure")) {
1582
+ const code = await finishIssueClosure(tasksPath, issueNumber, resolvedIssue.source);
1583
+ if (code !== 0)
1584
+ return {
1585
+ code,
1586
+ failedPhase: "close",
1587
+ branchName: producedBranch,
1588
+ storyCount: 0,
1589
+ elapsedSeconds,
1590
+ review
1591
+ };
1592
+ }
1505
1593
  let branchName = "unknown";
1506
1594
  try {
1507
1595
  const proc = await execa("git", ["branch", "--show-current"], { reject: false });
@@ -1515,7 +1603,7 @@ async function finalizeSuccessfulIssueRun(input) {
1515
1603
  storyCount = plan.userStories.length;
1516
1604
  planPrUrl = plan.pullRequest?.url ?? null;
1517
1605
  plan.lastAttemptAt = isoNow();
1518
- if (!review?.requestedChanges) {
1606
+ if (!review?.requestedChanges && !inQueue) {
1519
1607
  plan.issueStatus = "completed";
1520
1608
  plan.completedAt = isoNow();
1521
1609
  }
@@ -1564,7 +1652,7 @@ async function finalizeSuccessfulIssueRun(input) {
1564
1652
  }
1565
1653
 
1566
1654
  // src/commands/run/phase-bootstrap.ts
1567
- import { randomUUID } from "crypto";
1655
+ import { randomUUID } from "node:crypto";
1568
1656
 
1569
1657
  // src/commands/run/phase-config.ts
1570
1658
  async function buildAgentConfiguration(prReview) {
@@ -1614,8 +1702,10 @@ async function buildAgentConfiguration(prReview) {
1614
1702
  }
1615
1703
 
1616
1704
  // src/commands/run/types.ts
1617
- var RUNNABLE_PHASES = ["prd", "plan", "execute", "review", "pr"];
1618
- var RUNNABLE_PHASES_NO_BRANCH = ["prd", "plan", "execute", "review"];
1705
+ var RUNNABLE_PHASES = PIPELINE_PHASES.filter((phase) => phase !== "init");
1706
+ var RUNNABLE_PHASES_NO_BRANCH = RUNNABLE_PHASES.filter(
1707
+ (phase) => phase !== "pr"
1708
+ );
1619
1709
  var RUNNABLE_PHASES_WITH_PR_REVIEW = [...RUNNABLE_PHASES, "pr-review"];
1620
1710
  var QUEUE_PR_PHASES = ["init", "pr"];
1621
1711
  var QUEUE_PR_PHASES_WITH_REVIEW = [
@@ -2052,14 +2142,17 @@ async function preparePhaseRun(issueNumber, paths, mode, publisher, input) {
2052
2142
  };
2053
2143
  }
2054
2144
 
2145
+ // src/commands/run/phase-runners.ts
2146
+ import { existsSync } from "node:fs";
2147
+
2055
2148
  // src/commands/run/session.ts
2056
- import { mkdir as mkdir3 } from "fs/promises";
2149
+ import { mkdir as mkdir3 } from "node:fs/promises";
2057
2150
 
2058
2151
  // src/commands/run/oversized.ts
2059
- import { mkdir as mkdir2, readFile, writeFile } from "fs/promises";
2152
+ import { mkdir as mkdir2, readFile, writeFile } from "node:fs/promises";
2060
2153
  async function reportIfOversized(issueNumber, paths, result) {
2061
2154
  try {
2062
- const journal = `${await readFileIfPresent(paths.rotatedEventsFile)}${await readFileIfPresent(paths.eventsFile)}`;
2155
+ const journal = await readJournal(paths);
2063
2156
  const plan = await loadTaskPlan(paths.tasksFile).catch(() => null);
2064
2157
  const assessment = assessDecomposition({
2065
2158
  journal,
@@ -2098,6 +2191,18 @@ async function reportIfOversized(issueNumber, paths, result) {
2098
2191
  } catch {
2099
2192
  }
2100
2193
  }
2194
+ async function readJournal(paths) {
2195
+ const repository = getPlanRepository(paths.tasksFile);
2196
+ if (repository === void 0) {
2197
+ return `${await readFileIfPresent(paths.rotatedEventsFile)}${await readFileIfPresent(paths.eventsFile)}`;
2198
+ }
2199
+ const events = await listStoredIssueEvents({
2200
+ projectId: repository.projectId,
2201
+ issueId: repository.issueId,
2202
+ ...repository.databaseOptions === void 0 ? {} : { databaseOptions: repository.databaseOptions }
2203
+ });
2204
+ return events.map((entry) => JSON.stringify(entry)).join("\n");
2205
+ }
2101
2206
  async function maybeCreateSubIssues(issueNumber, plan, reportFile) {
2102
2207
  if (getActiveResilienceConfig().decompose?.auto !== true) {
2103
2208
  printInfo(`Nothing was split. Read ${reportFile} and decide.`);
@@ -2115,7 +2220,7 @@ async function maybeCreateSubIssues(issueNumber, plan, reportFile) {
2115
2220
  printInfo("Nothing left to split: no pending story.");
2116
2221
  return;
2117
2222
  }
2118
- const { runGenerate } = await import("./generate-JGW5JSKB.js");
2223
+ const { runGenerate } = await import("./generate-O7GUXLN4.js");
2119
2224
  for (const proposal of proposals) {
2120
2225
  const instruction = [
2121
2226
  `Create a sub-issue of #${issueNumber}: ${proposal.title}.`,
@@ -2201,6 +2306,15 @@ async function pauseIssue(tasksFile, issueNumber) {
2201
2306
  async function createSessionPublisher(input) {
2202
2307
  const { paths, persistSnapshot, journalEnabled, webConfig, maxFileBytes } = input;
2203
2308
  const surfaces = [];
2309
+ const repository = getPlanRepository(paths.tasksFile);
2310
+ if (repository !== void 0) {
2311
+ surfaces.push(
2312
+ new SqliteSessionPublisher(repository, {
2313
+ logLimit: webConfig.logLimit,
2314
+ includeLogs: webConfig.includeLogs
2315
+ })
2316
+ );
2317
+ }
2204
2318
  if (persistSnapshot || journalEnabled) {
2205
2319
  await mkdir3(paths.issueDir, { recursive: true });
2206
2320
  }
@@ -2375,6 +2489,11 @@ function createPlanRunner(input, makeRunner) {
2375
2489
  }),
2376
2490
  "plan"
2377
2491
  )();
2492
+ const repository = getPlanRepository(tasksPath);
2493
+ if (repository !== void 0 && existsSync(tasksPath)) {
2494
+ await ingestGeneratedPlan(repository);
2495
+ }
2496
+ await persistClosureChoice(tasksPath, input.closureChoice);
2378
2497
  try {
2379
2498
  const plan = await loadTaskPlan(tasksPath);
2380
2499
  if (!effectiveNoBranch) {
@@ -2406,14 +2525,20 @@ function createPlanRunner(input, makeRunner) {
2406
2525
  function createReviewRunner(input) {
2407
2526
  const { issueNumber, tasksPath, publisher, resolvedIssue, queueCommitScope, executeRetry } = input;
2408
2527
  return async () => {
2409
- let maxCycles = 3;
2528
+ let maxCycles = DEFAULT_MAX_CORRECTION_CYCLES;
2529
+ let cycle = 0;
2410
2530
  try {
2411
2531
  const plan = await loadTaskPlan(tasksPath);
2412
2532
  maxCycles = plan.maxCorrectionCycles;
2533
+ cycle = plan.correctionCycle;
2413
2534
  } catch {
2414
2535
  }
2415
2536
  let code = await runReview(issueNumber, resolvedIssue);
2416
- let cycle = 0;
2537
+ if (code !== 0 && (await loadTaskPlan(tasksPath)).lastError?.category === "review_protocol") {
2538
+ throw new Error(
2539
+ "Review returned an invalid result; resume review after correcting its output."
2540
+ );
2541
+ }
2417
2542
  while (code !== 0 && cycle < maxCycles) {
2418
2543
  cycle++;
2419
2544
  printWarning(`Review failed. Starting correction cycle ${cycle}/${maxCycles}...`);
@@ -2426,6 +2551,7 @@ function createReviewRunner(input) {
2426
2551
  }
2427
2552
  const execCode = await runExecute(void 0, {
2428
2553
  issue: issueNumber,
2554
+ inPipeline: true,
2429
2555
  commitScope: queueCommitScope,
2430
2556
  ...executeRetry
2431
2557
  });
@@ -2433,6 +2559,9 @@ function createReviewRunner(input) {
2433
2559
  throw new Error("Correction execution failed");
2434
2560
  }
2435
2561
  code = await runReview(issueNumber, resolvedIssue);
2562
+ if (code !== 0 && (await loadTaskPlan(tasksPath)).lastError?.category === "review_protocol") {
2563
+ throw new Error("Review returned an invalid result; no correction was scheduled.");
2564
+ }
2436
2565
  }
2437
2566
  if (code !== 0) {
2438
2567
  throw new Error(`Review failed after ${maxCycles} correction cycles`);
@@ -2493,18 +2622,25 @@ function buildInstrumentedPhaseRunners(input) {
2493
2622
  execute: makeRunner(
2494
2623
  () => runExecute(void 0, {
2495
2624
  issue: issueNumber,
2625
+ inPipeline: true,
2496
2626
  commitScope: queueCommitScope,
2497
2627
  ...executeRetry
2498
2628
  }),
2499
2629
  "execute"
2500
2630
  ),
2501
2631
  review: createReviewRunner(input),
2502
- pr: makeRunner(
2503
- // The options argument is omitted outside a queue so a standalone run
2504
- // calls `runPr` exactly as it always did.
2505
- () => finalPr === void 0 ? runPr(issueNumber, resolvedIssue) : runPr(issueNumber, resolvedIssue, { queue: finalPr }),
2506
- "pr"
2507
- )
2632
+ pr: async () => {
2633
+ await makeRunner(
2634
+ // The options argument is omitted outside a queue so a standalone run
2635
+ // calls `runPr` exactly as it always did.
2636
+ () => finalPr === void 0 ? runPr(issueNumber, resolvedIssue) : runPr(issueNumber, resolvedIssue, { queue: finalPr }),
2637
+ "pr"
2638
+ )();
2639
+ const repository = getPlanRepository(tasksPath);
2640
+ if (repository !== void 0 && existsSync(tasksPath)) {
2641
+ await ingestGeneratedPlan(repository);
2642
+ }
2643
+ }
2508
2644
  };
2509
2645
  const reviewBox = { outcome: null };
2510
2646
  if (effectivePrReview) {
@@ -2596,6 +2732,13 @@ async function runPipelinePhases(issueNumber, paths, mode, publisher, input) {
2596
2732
  queue
2597
2733
  } = prepared;
2598
2734
  let { producedBranch, plannedExecutionBranch, branchExistedBeforeExecution } = prepared;
2735
+ const closureChoice = queue ? void 0 : input.runOptions?.closeIssue;
2736
+ try {
2737
+ await persistClosureChoice(tasksPath, closureChoice);
2738
+ } catch (error) {
2739
+ if (error.code !== "ENOENT" && !String(error).includes("No SQLite task plan exists"))
2740
+ throw error;
2741
+ }
2599
2742
  const startResolved = await resolveStartPhase({
2600
2743
  from,
2601
2744
  activePhases,
@@ -2626,7 +2769,8 @@ async function runPipelinePhases(issueNumber, paths, mode, publisher, input) {
2626
2769
  effectivePrReview,
2627
2770
  initialBranch,
2628
2771
  queueCommitScope,
2629
- branchState
2772
+ branchState,
2773
+ closureChoice
2630
2774
  });
2631
2775
  const phaseSuffixes = phaseSuffixesFor(agentSummary);
2632
2776
  const result = await runPipelineWithRenderer({
@@ -2722,8 +2866,10 @@ async function runPipeline(issue, mode, from, noBranch, prReview, options = {})
2722
2866
  }
2723
2867
 
2724
2868
  export {
2869
+ persistClosureChoice,
2870
+ finishIssueClosure,
2725
2871
  publishStorySeed,
2726
2872
  publishIssueDetails,
2727
2873
  runPipeline
2728
2874
  };
2729
- //# sourceMappingURL=chunk-CWSQVHVV.js.map
2875
+ //# sourceMappingURL=chunk-MHA7Q3KU.js.map