@overdeck/desktop 0.45.24 → 0.46.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 (511) hide show
  1. package/drizzle/overdeck/0000_overdeck_init.sql +32 -0
  2. package/package.json +1 -1
  3. package/server/{acceptance-criteria-DDCnXF58.js → acceptance-criteria-CCwFGICj.js} +2 -2
  4. package/server/activity-logger-CMthG6Vd.js +3 -0
  5. package/server/{activity-logger-DDlOIAML.js → activity-logger-CyteR4JO.js} +24 -13
  6. package/server/{advancing-selfheal-BVwW4qRn.js → advancing-selfheal-De1L-Sb4.js} +6 -6
  7. package/server/{agent-gc-CHcnvonI.js → agent-gc-CBULruzm.js} +5 -5
  8. package/server/agent-state-VQk8fY9F.js +3 -0
  9. package/server/{agent-state-service-BsgWxZuB.js → agent-state-service-BlnSkRFA.js} +5 -5
  10. package/server/{agent-state-service-D5UGKIJL.js → agent-state-service-hZpxIw1E.js} +1 -1
  11. package/server/agents-BKKkxKgK.js +3 -0
  12. package/server/{agents-EbI0zCJl.js → agents-C5rWYhb6.js} +4 -4
  13. package/server/archive-planning-0FJ6Xd3b.js +2 -0
  14. package/server/{archive-planning-Du25Jtst.js → archive-planning-C0lAbNB_.js} +16 -24
  15. package/server/{artifact-index-jobs-CbEDfCDu.js → artifact-index-jobs-ug6ZxIP5.js} +2 -2
  16. package/server/{assemble-J2ZZ2C15.js → assemble-DnffNpOo.js} +2 -2
  17. package/server/{backlog-auto-trigger-2R2jog7n.js → backlog-auto-trigger-Dh-i9PQf.js} +3 -3
  18. package/server/{behavior-B3exJ42O.js → behavior-CfIg6pKp.js} +2 -2
  19. package/server/bridge-pool-patrol-CUFmjVDN.js +136 -0
  20. package/server/{briefing-freshness-D1wzUIWv.js → briefing-freshness-DHmCSLar.js} +2 -2
  21. package/server/{build-info-CZk_TITh.js → build-info-BP160gU7.js} +1 -1
  22. package/server/{build-info-Ie_D0_BT.js → build-info-CuFfxZxp.js} +5 -3
  23. package/server/{checkpoint-manager-BI1Wxoku.js → checkpoint-manager-DEWD82qK.js} +2 -2
  24. package/server/{checkpoint-manager-DwbQoqrC.js → checkpoint-manager-Dxh0FYsv.js} +1 -1
  25. package/server/checkpoint-worker.js +1 -1
  26. package/server/{checkpoints-CQB1h765.js → checkpoints-CZvbtLnr.js} +2 -2
  27. package/server/{checkpoints-BJIs5QIA.js → checkpoints-DMTgXuLG.js} +1 -1
  28. package/server/{claude-hooks-provision-8Ngo8TpT.js → claude-hooks-provision-CN-xo-do.js} +1 -1
  29. package/server/{claude-hooks-provision-D8GXF3_s.js → claude-hooks-provision-fvy4RD2b.js} +13 -2
  30. package/server/{claude-permissions-DNWEVV6z.js → claude-permissions-CN0cSCPp.js} +2 -2
  31. package/server/{claude-settings-overlay-CEdaqpWI.js → claude-settings-overlay-CJn35FHQ.js} +2 -2
  32. package/server/{claude-settings-overlay-DWy-Bb4Y.js → claude-settings-overlay-Dabi9slj.js} +1 -1
  33. package/server/cli-DmXETsw-.js +3 -0
  34. package/server/{cli-RoOx5DUf.js → cli-oCWYA1pE.js} +9 -9
  35. package/server/{cliproxy-C8a1vtTU.js → cliproxy-C8mB3KuB.js} +2 -2
  36. package/server/{cliproxy-fHfIeiGd.js → cliproxy-PGwTX_o8.js} +1 -1
  37. package/server/{close-issue-DoOifFIK.js → close-issue-D5MF5GqF.js} +5 -5
  38. package/server/{closed-issue-reaper-CktPXo8m.js → closed-issue-reaper-CJ24u0Zt.js} +1 -1
  39. package/server/{closed-issue-reaper-Bk3SU4RC.js → closed-issue-reaper-Cltx86x5.js} +37 -16
  40. package/server/{codex-GcHuUF-k.js → codex-BdEsUFWh.js} +1 -1
  41. package/server/{codex-BZXGhUVB.js → codex-Drlf5Xhf.js} +36 -7
  42. package/server/{codex-parser-CFZ1_1Jl.js → codex-parser-DpB89Vqa.js} +2 -2
  43. package/server/compaction-continuation-K2AxQX4H.js +200 -0
  44. package/server/{config-CKxYiCmX.js → config-B2IMcBxx.js} +4 -3
  45. package/server/{config-DzV30TOm.js → config-DV-grfQc.js} +1 -1
  46. package/server/{config-BZ0sHTju.js → config-Dr3pW6w6.js} +2 -2
  47. package/server/{config-yaml-DySPNmKN.js → config-yaml-CmOPzmBb.js} +268 -14
  48. package/server/{conflict-gate-BaCVrH-N.js → conflict-gate-B9cN3SBi.js} +4 -4
  49. package/server/{conflict-gate-BhAY7TUd.js → conflict-gate-Dh754uyA.js} +1 -1
  50. package/server/{context-layers-BrPmE__h.js → context-layers-D6LZo3l1.js} +2 -2
  51. package/server/{context-layers-igZ4FI4_.js → context-layers-dR5YxHYB.js} +3 -3
  52. package/server/{control-settings-BQp7_4uD.js → control-settings-C7DUehE1.js} +49 -19
  53. package/server/{conversation-compaction-CgrR8YYp.js → conversation-compaction-BoqdDXWF.js} +8 -8
  54. package/server/{conversation-compaction-eQB5CkOe.js → conversation-compaction-Dj4FAKoZ.js} +1 -1
  55. package/server/{conversation-service-DPJ71F33.js → conversation-service-5aCnq1zR.js} +8 -7
  56. package/server/conversation-service-BCxl4f8Z.js +3 -0
  57. package/server/{conversations-6AfUfbwc.js → conversations-BUpYsOZg.js} +4 -4
  58. package/server/{conversations-CAsJF9kh.js → conversations-C34dyIb9.js} +1 -1
  59. package/server/{cost-B2ddP6wq.js → cost-Bgcub5kW.js} +12 -2
  60. package/server/{cost-R-m6Yi-W.js → cost-CvxRrucd.js} +3 -3
  61. package/server/{cost-sync-BsN6ER0n.js → cost-sync-Dv3LUaNW.js} +3 -3
  62. package/server/{dag-B1ucnjDU.js → dag-ombYYt4s.js} +2 -2
  63. package/server/{dangerous-git-ops-BXqeWVSf.js → dangerous-git-ops-BcJPC5Rr.js} +1 -1
  64. package/server/dashboard-db-worker.js +7 -7
  65. package/server/deacon-DrXqT9LQ.js +4 -0
  66. package/server/{deacon-CU_cAYSR.js → deacon-hi9KLPLT.js} +2933 -2704
  67. package/server/{deacon-nudge-log-6wVqAaqz.js → deacon-nudge-log-BNBebzeL.js} +3 -3
  68. package/server/deacon-pending-lifecycle-Cpk0k7Hi.js +33 -0
  69. package/server/{deacon-swarm-BXZZ1Z2-.js → deacon-swarm-DBxUaO-A.js} +13 -13
  70. package/server/deacon-swarm-I2JfX5Tg.js +2 -0
  71. package/server/deacon.js +14 -19
  72. package/server/dead-end-trip-CQcP70ND.js +13 -0
  73. package/server/delivery-Da0zEMY4.js +3 -0
  74. package/server/{deploy-patrol-AiFoP8dw.js → deploy-patrol-Df-Tmaq0.js} +69 -18
  75. package/server/deploy-queue-9SrhZR63.js +3 -0
  76. package/server/deploy-queue-UjKGYsDe.js +169 -0
  77. package/server/deploy-window-jOiPRHL0.js +3 -0
  78. package/server/{deploy-window-C3F-tihF.js → deploy-window-rpqpWqHA.js} +40 -16
  79. package/server/{dev-supervisor-bcOWqdQE.js → dev-supervisor-CC46Ig8q.js} +2 -2
  80. package/server/{devcontainer-renderer-_d6XhyND.js → devcontainer-renderer-68CSCRnu.js} +3 -3
  81. package/server/{dist-Cb_0uvpS.js → dist-CJy72uEg.js} +1 -1
  82. package/server/dist-DSlxIU1H.js +3 -0
  83. package/server/{dist-src-BSoS7mkd.js → dist-src-Bik83hFi.js} +1 -1
  84. package/server/docker-BMVTSFL5.js +3 -0
  85. package/server/{docker-DcMTFTUC.js → docker-Dam7mbIB.js} +2 -2
  86. package/server/{dod-C6n9RV3G.js → dod-Dar-yheg.js} +8 -4
  87. package/server/durable-review-pipeline-CGZ5QBxh.js +17 -0
  88. package/server/durable-review-pipeline-jpgCJZFp.js +3 -0
  89. package/server/{ensure-devcontainer-DNi-ono3.js → ensure-devcontainer-B057YA81.js} +4 -4
  90. package/server/{ensure-devcontainer-BZgOhRo7.js → ensure-devcontainer-C98V8yW-.js} +1 -1
  91. package/server/{esm-shims-OSHAYaS1.js → esm-shims-Br9BPdkR.js} +1 -1
  92. package/server/{event-store-EV2cMiXj.js → event-store-ELqkVOn0.js} +1 -1
  93. package/server/{event-store-CQL6NeqB.js → event-store-zY5MJHgF.js} +23 -4
  94. package/server/{events-BTdrdEq8.js → events-D6pyqhzM.js} +1 -1
  95. package/server/{events-DTfAe4My.js → events-D9PR1IC0.js} +3 -3
  96. package/server/{factory-CFibJuaw.js → factory-CRoOpGsF.js} +5 -5
  97. package/server/{feature-registry-population-DKZFMbFt.js → feature-registry-population--YUXU999.js} +4 -4
  98. package/server/{feature-registry-storage-BdPuLcBX.js → feature-registry-storage-BORBTo0y.js} +2 -2
  99. package/server/{features-ez2271oH.js → features--nFkJY8v.js} +2 -2
  100. package/server/{feedback-target-CoFDHiM8.js → feedback-target-C0ZzyHvU.js} +1 -1
  101. package/server/{feedback-target-7mqqwrX6.js → feedback-target-Dt9BsapX.js} +8 -8
  102. package/server/{feedback-writer-CY5L1lB7.js → feedback-writer-BG0RUZiu.js} +5 -5
  103. package/server/{feedback-writer-D3a22RCd.js → feedback-writer-D1fm-5Z8.js} +1 -1
  104. package/server/{flywheel-SVF02Jpq.js → flywheel-BekukH4i.js} +1 -1
  105. package/server/{flywheel-DHrgCphM.js → flywheel-BiT3odRb.js} +23 -15
  106. package/server/{flywheel-DzGtWnJ1.js → flywheel-CLVB55Be.js} +16 -15
  107. package/server/flywheel-merge-order-BJv1DZz1.js +462 -0
  108. package/server/flywheel-merge-order-BKw9o6ku.js +2 -0
  109. package/server/forge-CZbSg6Ds.js +383 -0
  110. package/server/forge-DK3blQb_.js +3 -0
  111. package/server/{from-kNxT0bZC.js → from-D_4_dk7i.js} +1 -1
  112. package/server/{fts-db-CE46vDkZ.js → fts-db-BeOomFa-.js} +2 -2
  113. package/server/{fts-operations-CqY6zl-i.js → fts-operations-BdewJ_g9.js} +2 -2
  114. package/server/git-utils-CI6cwyyC.js +3 -0
  115. package/server/{git-utils-CRw2zLPC.js → git-utils-ameCgDdy.js} +30 -5
  116. package/server/{github-app-C3QrAUd0.js → github-app-CQ1Lo6LA.js} +3 -3
  117. package/server/{github-app-ClZ2lk8D.js → github-app-DtAsvwzK.js} +1 -1
  118. package/server/{github-client-BnIsSrEN.js → github-client-BfyDxuRN.js} +2 -2
  119. package/server/{github-client-DfQYVUaw.js → github-client-Cj0yl_07.js} +1 -1
  120. package/server/github-pr-lookup-BDq6Wznz.js +58 -0
  121. package/server/{harness-binary-DPUi-Pv8.js → harness-binary-DqkftwTb.js} +2 -2
  122. package/server/{harness-resolve-3lNZkyT4.js → harness-resolve-CqMqM1Mb.js} +4 -4
  123. package/server/{health-events-BBcTYQKU.js → health-events-CazRxJUS.js} +2 -2
  124. package/server/{health-events-BDOHby5Q.js → health-events-_xfTaOUs.js} +1 -1
  125. package/server/{hooks-CKZgXlJb.js → hooks-BO3QT1sn.js} +2 -2
  126. package/server/{hooks-DPVX1rwQ.js → hooks-BnJsxlSq.js} +1 -1
  127. package/server/{hume-Cz8igP9E.js → hume-CDYJxqx-.js} +2 -2
  128. package/server/hume-Dq--7rOQ.js +3 -0
  129. package/server/{idle-stack-reaper-CuLF0j2H.js → idle-stack-reaper-BYqERdkE.js} +1 -1
  130. package/server/{idle-stack-reaper-DDIRwxUY.js → idle-stack-reaper-CnGx_PO_.js} +99 -6
  131. package/server/in-flight-guard-Bq3epG58.js +45 -0
  132. package/server/{infra-BEqFxlJc.js → infra-BjuxvjdS.js} +70 -5
  133. package/server/{injection-CPUIqNhI.js → injection-DZxlV2al.js} +1 -1
  134. package/server/{injection-C8aiVJrF.js → injection-UCf8EsjX.js} +7 -7
  135. package/server/{inspect-agent-BLuJ1AkT.js → inspect-agent-6kylZnrm.js} +26 -25
  136. package/server/inspect-agent-BVwDrVrz.js +2 -0
  137. package/server/{internal-token-s0-oKybJ.js → internal-token-DvMTQSOS.js} +2 -2
  138. package/server/{internal-token-BrcU6qfe.js → internal-token-M9omeXM1.js} +1 -1
  139. package/server/{io-C9kF1wtJ.js → io-VHvc0Ssp.js} +43 -26
  140. package/server/{issue-closed-CDJk4pIp.js → issue-closed-B6KJkmHZ.js} +7 -7
  141. package/server/{issue-lifecycle-B8sZHVHh.js → issue-lifecycle-9gk3fnXN.js} +1 -1
  142. package/server/{issue-lifecycle-ojZAzDBP.js → issue-lifecycle-C4Zj0WmE.js} +34 -28
  143. package/server/{issue-service-singleton-Yx5DdmVJ.js → issue-service-singleton-DmCh7EHj.js} +10 -10
  144. package/server/{issue-service-singleton-BvJ09SaR.js → issue-service-singleton-PMx8F1jr.js} +1 -1
  145. package/server/{issues-BMmP_77e.js → issues-CgnQ1OGQ.js} +2 -2
  146. package/server/{jsonl-parser-BXSlHwEh.js → jsonl-parser-DJOH_O-w.js} +5 -4
  147. package/server/{label-cleanup-B0UJwnv5.js → label-cleanup-Dv7AV_R1.js} +3 -3
  148. package/server/{label-reconciler-B4iOAjlC.js → label-reconciler--F85rufp.js} +4 -4
  149. package/server/{lifecycle-yPd___5E.js → lifecycle-CTdOWYMi.js} +2 -2
  150. package/server/{lifecycle-xmBfK2GJ.js → lifecycle-DDN8ApVY.js} +6 -7
  151. package/server/{lifecycle-io-BREGpnLk.js → lifecycle-io-D-lGdzK3.js} +5 -5
  152. package/server/{lifecycle-io-DPo7x11I.js → lifecycle-io-D_zTLvP1.js} +1 -1
  153. package/server/{linear-client-BsuUvkdA.js → linear-client-BQU36QqE.js} +2 -2
  154. package/server/{linear-client-CTskEeT_.js → linear-client-CY4O_Tu3.js} +1 -1
  155. package/server/linear-mcp-auth-BnU4TYfY.js +280 -0
  156. package/server/linear-mcp-auth-NYBq_oHZ.js +2 -0
  157. package/server/memory-fts-worker.js +1 -1
  158. package/server/{merge-CefQNAnq.js → merge-Bpx4jjht.js} +13 -11
  159. package/server/{merge-agent-4WOWlSYA.js → merge-agent-DdMVSV2Y.js} +233 -83
  160. package/server/{merge-agent-CKkgIBPB.js → merge-agent-DrXa1CpW.js} +1 -1
  161. package/server/{merge-batch-ClFn2T-y.js → merge-batch-C5q1c1GX.js} +1 -1
  162. package/server/merge-completeness-BMm8tMyZ.js +277 -0
  163. package/server/merge-completeness-D0ljXbk3.js +3 -0
  164. package/server/{merge-B1DiziGU.js → merge-idOG--29.js} +1 -1
  165. package/server/merge-ops-DdpTiEMt.js +2 -0
  166. package/server/merge-rebase-DGQpYJU3.js +2 -0
  167. package/server/{merge-rebase-BfaTyXsw.js → merge-rebase-xLnMlw5h.js} +3 -3
  168. package/server/{merge-set-DJ8-UErs.js → merge-set-DH7ot3yz.js} +11 -5
  169. package/server/merge-set-DzsOTBg5.js +3 -0
  170. package/server/{merge-sync-VPV28g0g.js → merge-sync-CQ-LgZ1_.js} +406 -153
  171. package/server/merge-sync-Ca7F5JnQ.js +3 -0
  172. package/server/{merge-train-CHopycP0.js → merge-train-DTEMyIu4.js} +18 -8
  173. package/server/{merge-train-deps-D1cOZzy2.js → merge-train-deps-CNPJzepw.js} +4 -4
  174. package/server/merge-verification-x3JO8Dtz.js +220 -0
  175. package/server/merged-docker-cleanup-worker-CTpC27Bs.js +107 -0
  176. package/server/merged-docker-cleanup-worker-Cdi9apm-.js +3 -0
  177. package/server/{multipart-parser-duPAfSBw.js → multipart-parser-IMSBfePV.js} +2 -2
  178. package/server/{no-resume-mode-Nw29vaFb.js → no-resume-mode-C5ULAXwO.js} +1 -1
  179. package/server/node_modules/.package-lock.json +27 -27
  180. package/server/node_modules/@effect/platform-node/node_modules/@effect/platform-node-shared/package.json +3 -3
  181. package/server/node_modules/@google-cloud/common/package.json +2 -2
  182. package/server/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  183. package/server/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  184. package/server/node_modules/gaxios/package.json +1 -1
  185. package/server/node_modules/google-auth-library/build/src/auth/googleauth.js +24 -19
  186. package/server/node_modules/google-auth-library/package.json +1 -1
  187. package/server/node_modules/google-gax/build/protos/google/api/auth.proto +2 -1
  188. package/server/node_modules/google-gax/build/protos/google/api/backend.proto +12 -1
  189. package/server/node_modules/google-gax/build/protos/google/api/billing.proto +1 -1
  190. package/server/node_modules/google-gax/build/protos/google/api/client.proto +165 -53
  191. package/server/node_modules/google-gax/build/protos/google/api/cloudquotas/v1/resources.proto +1 -1
  192. package/server/node_modules/google-gax/build/protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto +7 -3
  193. package/server/node_modules/google-gax/build/protos/google/api/cloudquotas/v1beta/resources.proto +1 -1
  194. package/server/node_modules/google-gax/build/protos/google/api/config_change.proto +1 -1
  195. package/server/node_modules/google-gax/build/protos/google/api/context.proto +1 -1
  196. package/server/node_modules/google-gax/build/protos/google/api/control.proto +3 -3
  197. package/server/node_modules/google-gax/build/protos/google/api/distribution.proto +1 -1
  198. package/server/node_modules/google-gax/build/protos/google/api/documentation.proto +1 -1
  199. package/server/node_modules/google-gax/build/protos/google/api/endpoint.proto +1 -1
  200. package/server/node_modules/google-gax/build/protos/google/api/error_reason.proto +186 -1
  201. package/server/node_modules/google-gax/build/protos/google/api/expr/v1alpha1/checked.proto +31 -3
  202. package/server/node_modules/google-gax/build/protos/google/api/expr/v1alpha1/eval.proto +8 -9
  203. package/server/node_modules/google-gax/build/protos/google/api/expr/v1alpha1/explain.proto +1 -2
  204. package/server/node_modules/google-gax/build/protos/google/api/expr/v1alpha1/syntax.proto +20 -22
  205. package/server/node_modules/google-gax/build/protos/google/api/expr/v1alpha1/value.proto +2 -3
  206. package/server/node_modules/google-gax/build/protos/google/api/field_behavior.proto +1 -1
  207. package/server/node_modules/google-gax/build/protos/google/api/field_info.proto +1 -1
  208. package/server/node_modules/google-gax/build/protos/google/api/http.proto +1 -1
  209. package/server/node_modules/google-gax/build/protos/google/api/httpbody.proto +1 -1
  210. package/server/node_modules/google-gax/build/protos/google/api/label.proto +1 -1
  211. package/server/node_modules/google-gax/build/protos/google/api/launch_stage.proto +1 -1
  212. package/server/node_modules/google-gax/build/protos/google/api/log.proto +1 -1
  213. package/server/node_modules/google-gax/build/protos/google/api/logging.proto +1 -1
  214. package/server/node_modules/google-gax/build/protos/google/api/metric.proto +1 -1
  215. package/server/node_modules/google-gax/build/protos/google/api/monitored_resource.proto +1 -1
  216. package/server/node_modules/google-gax/build/protos/google/api/monitoring.proto +1 -1
  217. package/server/node_modules/google-gax/build/protos/google/api/policy.proto +1 -1
  218. package/server/node_modules/google-gax/build/protos/google/api/quota.proto +1 -1
  219. package/server/node_modules/google-gax/build/protos/google/api/resource.proto +1 -1
  220. package/server/node_modules/google-gax/build/protos/google/api/routing.proto +8 -4
  221. package/server/node_modules/google-gax/build/protos/google/api/service.proto +2 -3
  222. package/server/node_modules/google-gax/build/protos/google/api/source_info.proto +1 -1
  223. package/server/node_modules/google-gax/build/protos/google/api/system_parameter.proto +1 -1
  224. package/server/node_modules/google-gax/build/protos/google/api/usage.proto +7 -27
  225. package/server/node_modules/google-gax/build/protos/google/api/visibility.proto +1 -1
  226. package/server/node_modules/google-gax/build/protos/google/longrunning/operations.proto +20 -1
  227. package/server/node_modules/google-gax/build/protos/google/protobuf/any.proto +52 -108
  228. package/server/node_modules/google-gax/build/protos/google/protobuf/compiler/ruby/ruby_generated_code.proto +2 -0
  229. package/server/node_modules/google-gax/build/protos/google/protobuf/cpp_features.proto +21 -1
  230. package/server/node_modules/google-gax/build/protos/google/protobuf/cpp_file_options.proto +24 -0
  231. package/server/node_modules/google-gax/build/protos/google/protobuf/cpp_options.proto +15 -0
  232. package/server/node_modules/google-gax/build/protos/google/protobuf/descriptor.proto +118 -30
  233. package/server/node_modules/google-gax/build/protos/google/protobuf/field_mask.proto +16 -18
  234. package/server/node_modules/google-gax/build/protos/google/protobuf/internal_options.proto +8 -1
  235. package/server/node_modules/google-gax/build/protos/google/protobuf/json/json_enumval_custom_string.proto +26 -0
  236. package/server/node_modules/google-gax/build/protos/google/protobuf/json_enumvalue_options.proto +29 -0
  237. package/server/node_modules/google-gax/build/protos/google/protobuf/json_options.proto +14 -0
  238. package/server/node_modules/google-gax/build/protos/google/protobuf/struct.proto +38 -22
  239. package/server/node_modules/google-gax/build/protos/google/protobuf/test_protos/forced_micro_string.proto +3 -0
  240. package/server/node_modules/google-gax/build/protos/google/protobuf/test_protos/repeated_field_proxy_import_message.proto +14 -0
  241. package/server/node_modules/google-gax/build/protos/google/protobuf/timestamp.proto +9 -8
  242. package/server/node_modules/google-gax/build/protos/google/protobuf/util/json_format_proto3.proto +18 -0
  243. package/server/node_modules/google-gax/build/protos/google/rpc/code.proto +1 -1
  244. package/server/node_modules/google-gax/build/protos/google/rpc/context/attribute_context.proto +7 -2
  245. package/server/node_modules/google-gax/build/protos/google/rpc/context/audit_context.proto +1 -1
  246. package/server/node_modules/google-gax/build/protos/google/rpc/error_details.proto +5 -5
  247. package/server/node_modules/google-gax/build/protos/google/rpc/http.proto +1 -1
  248. package/server/node_modules/google-gax/build/protos/google/rpc/status.proto +1 -2
  249. package/server/node_modules/google-gax/build/protos/google/type/calendar_period.proto +1 -1
  250. package/server/node_modules/google-gax/build/protos/google/type/color.proto +9 -10
  251. package/server/node_modules/google-gax/build/protos/google/type/date.proto +11 -9
  252. package/server/node_modules/google-gax/build/protos/google/type/datetime.proto +17 -17
  253. package/server/node_modules/google-gax/build/protos/google/type/dayofweek.proto +1 -1
  254. package/server/node_modules/google-gax/build/protos/google/type/decimal.proto +11 -13
  255. package/server/node_modules/google-gax/build/protos/google/type/expr.proto +1 -1
  256. package/server/node_modules/google-gax/build/protos/google/type/fraction.proto +1 -1
  257. package/server/node_modules/google-gax/build/protos/google/type/interval.proto +1 -2
  258. package/server/node_modules/google-gax/build/protos/google/type/latlng.proto +4 -5
  259. package/server/node_modules/google-gax/build/protos/google/type/localized_text.proto +3 -3
  260. package/server/node_modules/google-gax/build/protos/google/type/money.proto +1 -2
  261. package/server/node_modules/google-gax/build/protos/google/type/month.proto +1 -1
  262. package/server/node_modules/google-gax/build/protos/google/type/phone_number.proto +20 -15
  263. package/server/node_modules/google-gax/build/protos/google/type/postal_address.proto +39 -39
  264. package/server/node_modules/google-gax/build/protos/google/type/quaternion.proto +4 -4
  265. package/server/node_modules/google-gax/build/protos/google/type/timeofday.proto +11 -8
  266. package/server/node_modules/google-gax/package.json +5 -5
  267. package/server/node_modules/retry-request/package.json +4 -4
  268. package/server/node_modules/teeny-request/package.json +5 -5
  269. package/server/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
  270. package/server/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
  271. package/server/node_modules/undici/lib/core/request.js +12 -1
  272. package/server/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
  273. package/server/node_modules/undici/lib/global.js +36 -16
  274. package/server/node_modules/undici/lib/handler/cache-handler.js +236 -116
  275. package/server/node_modules/undici/lib/handler/cache-revalidation-handler.js +3 -3
  276. package/server/node_modules/undici/lib/handler/retry-handler.js +24 -0
  277. package/server/node_modules/undici/lib/interceptor/cache.js +152 -62
  278. package/server/node_modules/undici/lib/interceptor/decompress.js +5 -2
  279. package/server/node_modules/undici/lib/util/cache.js +328 -66
  280. package/server/node_modules/undici/lib/util/date.js +23 -6
  281. package/server/node_modules/undici/lib/web/cookies/util.js +78 -8
  282. package/server/node_modules/undici/package.json +1 -1
  283. package/server/{orphan-proposed-reconciler-CTSGcK8p.js → orphan-proposed-reconciler-CWmOdM9-.js} +1 -1
  284. package/server/{orphan-proposed-reconciler-BvKkWMJQ.js → orphan-proposed-reconciler-Dg6U4ADZ.js} +24 -15
  285. package/server/package-lock.json +28 -28
  286. package/server/package.json +1 -1
  287. package/server/{pan-dir-B0c3w0Ya.js → pan-dir-ubraCiUg.js} +24 -10
  288. package/server/{paths-D-xWGHdh.js → paths-cXmOwSbh.js} +2 -2
  289. package/server/pending-lifecycle-claim-DEteYdS9.js +110 -0
  290. package/server/{pickup-DUCLWrJY.js → pickup-D8xtG1J2.js} +1 -1
  291. package/server/pipeline-membership-BGSvkT2M.js +3 -0
  292. package/server/pipeline-membership-CrAPLYtf.js +57 -0
  293. package/server/{pipeline-membership-mY3GprlK.js → pipeline-membership-gather-CET40frr.js} +177 -109
  294. package/server/pipeline-membership-gather-DTfcgxLl.js +3 -0
  295. package/server/{pipeline-notifier-BXkJzDC4.js → pipeline-notifier-BuQ0e4hF.js} +2 -2
  296. package/server/{pipeline-notifier-BJr8gQX6.js → pipeline-notifier-ImNXknf0.js} +1 -1
  297. package/server/post-merge-lifecycle-worker-DbO10pum.js +50 -0
  298. package/server/{project-pipelines-C0MWUeCU.js → project-pipelines-Bim6bThI.js} +2 -2
  299. package/server/{project-repos-B6GycDh9.js → project-repos-C0nuoBGv.js} +7 -3
  300. package/server/project-repos-CRE6Ykow.js +3 -0
  301. package/server/projects-B03Wr-xc.js +3 -0
  302. package/server/{prompts-DxzFXuLl.js → prompts-BEx08AIu.js} +2 -2
  303. package/server/{providers-u4Ga0jOr.js → providers-D7IluJe0.js} +1 -1
  304. package/server/{providers-qQAwGQDW.js → providers-evXhiQeg.js} +7 -7
  305. package/server/public/assets/{chunk-BO2N2NFS-BamJdinX.js → chunk-BO2N2NFS-D1s4-Sqp.js} +4 -4
  306. package/server/public/assets/{diagram-OG6HWLK6-DfOB8-w4.js → diagram-OG6HWLK6-1gdMoSF7.js} +1 -1
  307. package/server/public/assets/{dist-D7zYSEA6.js → dist-CxAOHbil.js} +1 -1
  308. package/server/public/assets/{dist-ByIuzMQW.js → dist-DqDRYW6P.js} +3 -3
  309. package/server/public/assets/{ganttDiagram-6RSMTGT7-EdmRyXL3.js → ganttDiagram-6RSMTGT7-BYex-Ec7.js} +1 -1
  310. package/server/public/assets/{highlighted-body-OFNGDK62-MerOfTX8.js → highlighted-body-OFNGDK62-DlVkiG0S.js} +1 -1
  311. package/server/public/assets/index-Cc7cnFC4.css +1 -0
  312. package/server/public/assets/index-K0hAYCgV.js +807 -0
  313. package/server/public/assets/{linear-BBbArIcK.js → linear-B4cuEFmO.js} +1 -1
  314. package/server/public/assets/mermaid-GHXKKRXX-DyDHFXHV.js +1 -0
  315. package/server/public/assets/{pieDiagram-4H26LBE5-BKIddiJN.js → pieDiagram-4H26LBE5-CBHNBIJQ.js} +1 -1
  316. package/server/public/assets/{prod-B8vYiu52.js → prod-CN2nHBvX.js} +4 -4
  317. package/server/public/assets/{quadrantDiagram-W4KKPZXB-D6RtoULk.js → quadrantDiagram-W4KKPZXB-Bom87VOQ.js} +1 -1
  318. package/server/public/assets/{sankeyDiagram-5OEKKPKP-CLrCedZX.js → sankeyDiagram-5OEKKPKP-UrBeyLxk.js} +1 -1
  319. package/server/public/assets/{xychartDiagram-2RQKCTM6-hznR8DYl.js → xychartDiagram-2RQKCTM6-DhkbrIxR.js} +1 -1
  320. package/server/public/index.html +2 -2
  321. package/server/{pull-requests-7N8WKseP.js → pull-requests-Cv7LxzUN.js} +1 -1
  322. package/server/{pull-requests-_lHueOHW.js → pull-requests-DHWiKxo7.js} +19 -10
  323. package/server/{queries-CjNIf-Ub.js → queries-DHJm7bTd.js} +631 -110
  324. package/server/{rally-CyWT_lNO.js → rally-B71M9f4o.js} +3 -3
  325. package/server/rally-YDjU513q.js +3 -0
  326. package/server/{rally-api-ClOSd-Tt.js → rally-api-D5uXN08-.js} +1 -1
  327. package/server/{rally-api-C8e_1JRi.js → rally-api-Dkqmok65.js} +2 -2
  328. package/server/{rally-client-lc-nokqr.js → rally-client-Bfqm6XI4.js} +4 -4
  329. package/server/{rally-client-sgtVqzNU.js → rally-client-CxsA6ExK.js} +1 -1
  330. package/server/{reap-terminal-sessions-7KeHv1R1.js → reap-terminal-sessions-BQ23nriz.js} +2 -2
  331. package/server/{reap-terminal-sessions-BtHPo6Xc.js → reap-terminal-sessions-CvmwaqKv.js} +2 -2
  332. package/server/{rebuild-stack-lwtsW0GO.js → rebuild-stack-0EEYReVZ.js} +16 -7
  333. package/server/{rebuild-stack-CFvcBHsS.js → rebuild-stack-qeRqHZxH.js} +2 -2
  334. package/server/{reconstruct-cache-C3Ui7ojV.js → reconstruct-cache-BbYFsqLa.js} +7 -6
  335. package/server/record-CtroO946.js +3 -0
  336. package/server/record-update-DH6dLJID.js +3 -0
  337. package/server/{record-update-dE1Aw83j.js → record-update-Z0QCxmMp.js} +124 -34
  338. package/server/{recovery-trip-BvRWfUXM.js → recovery-trip-eJe26h-f.js} +2 -2
  339. package/server/{release-engine-Cx48W7z8.js → release-engine-lPUp-MTd.js} +5 -5
  340. package/server/{release-set-CQfuN9-v.js → release-set-BwGeyZKX.js} +3 -3
  341. package/server/{remote-C_2hasl7.js → remote-BCd02Es1.js} +3 -3
  342. package/server/{remote-ChgimyYa.js → remote-CVGUhXMV.js} +3 -3
  343. package/server/{remote-agents-CA3Ihlxj.js → remote-agents-C1bssi41.js} +2 -2
  344. package/server/{remote-agents-By1ige5O.js → remote-agents-C_VxssLU.js} +300 -46
  345. package/server/{remote-completion-fVe9e_3u.js → remote-completion-DAB0P706.js} +12 -12
  346. package/server/resume-u9byntrq.js +3 -0
  347. package/server/{review-agent-DNboMyW4.js → review-agent-CD4RCI0Y.js} +1 -1
  348. package/server/{review-agent-CIGOQYBD.js → review-agent-CHhI66UP.js} +60 -47
  349. package/server/{review-artifacts-nRDPuMxd.js → review-artifacts-DSMRIfuJ.js} +7 -6
  350. package/server/{review-context-2uj-YQ8J.js → review-context-oFuBbiEE.js} +8 -8
  351. package/server/{in-flight-guard-CAAkqPLu.js → review-convoy-liveness-CpzrcJ5F.js} +3 -44
  352. package/server/review-status-BZH8h-6W.js +3 -0
  353. package/server/review-status-emit-CUExtHd5.js +50 -0
  354. package/server/{review-status-enrichment-Dci-ZwEt.js → review-status-enrichment-QV_hQkgS.js} +4 -4
  355. package/server/{review-status-source-CxuEjLGg.js → review-status-source-CpvJnvnQ.js} +24 -3
  356. package/server/review-status-source-ylw5QZUR.js +3 -0
  357. package/server/{review-status-sync-BTOpxtTC.js → review-status-sync-483sujRo.js} +2 -2
  358. package/server/{review-status-sync-DSDK3OMy.js → review-status-sync-NaWvI9Xf.js} +1 -1
  359. package/server/review-status-yljtTd-q.js +7521 -0
  360. package/server/{review-verdict-feedback-CTd4QMBu.js → review-verdict-feedback-BPDn4li_.js} +1 -1
  361. package/server/{review-verdict-feedback-CCjVA7Uk.js → review-verdict-feedback-CELeUinh.js} +48 -8
  362. package/server/{rollup-FGsKki9R.js → rollup-DTNvelz9.js} +8 -8
  363. package/server/{rollup-BKQC7jp4.js → rollup-DYZfq1c4.js} +1 -1
  364. package/server/{scanner-CnqEZeDy.js → scanner-CV35oSn4.js} +8 -7
  365. package/server/{sequence-io-D909zgeH.js → sequence-io-DF_8iuhV.js} +4 -4
  366. package/server/{sequencer-agent-CzkcK6P5.js → sequencer-agent-B2WeCtGi.js} +5 -5
  367. package/server/server.js +1952 -578
  368. package/server/{service-CLeAoU6G.js → service-Br9rpBNA.js} +81 -64
  369. package/server/{session-fork-CHI1XvL9.js → session-fork-D0LY152N.js} +2 -2
  370. package/server/{session-history-BT3IvqhC.js → session-history-BUyK29eq.js} +4 -4
  371. package/server/{settings-BTMvpNFU.js → settings-Bse1Pdcj.js} +3 -3
  372. package/server/settings-CdvIF84R.js +2 -0
  373. package/server/{settings-C0zgxOGf.js → settings-CvVGqNEs.js} +3 -2
  374. package/server/{shadow-engineering-BJfgm-hX.js → shadow-engineering-BWLa8ODz.js} +2 -2
  375. package/server/{shadow-state-7a-524T8.js → shadow-state-B4fpKxOO.js} +2 -2
  376. package/server/{shadow-state-DnDyjujH.js → shadow-state-FV6PHfEW.js} +1 -1
  377. package/server/{shadow-utils-Db3oroFG.js → shadow-utils-D7asqxOZ.js} +2 -2
  378. package/server/{ship-log-D9MlVzYU.js → ship-log-xplJ8t75.js} +1 -1
  379. package/server/{smart-compaction-CV2ukKND.js → smart-compaction-CPp2Ykf6.js} +1 -1
  380. package/server/{smart-compaction-KCYScAU1.js → smart-compaction-D3U_79f-.js} +8 -7
  381. package/server/{spawn-planning-session-qUC2VWu3.js → spawn-planning-session-1nFi3gfk.js} +1 -1
  382. package/server/{spawn-planning-session-DKpdFyOC.js → spawn-planning-session-DGfZ5B8D.js} +17 -17
  383. package/server/{specialist-completion-Ky9wCDpb.js → specialist-completion-Br48eiDP.js} +1 -1
  384. package/server/{specialist-context-Bn3dCGS2.js → specialist-context-cVbGnTa3.js} +5 -5
  385. package/server/{specialist-handoff-logger-CMEwYxa2.js → specialist-handoff-logger-DK-GTz4s.js} +2 -2
  386. package/server/{specialist-logs-C5p8G7tx.js → specialist-logs-Cl5-hqT8.js} +3 -3
  387. package/server/{specialists-CC4r-c2s.js → specialists-CNfYO3G2.js} +975 -227
  388. package/server/{specialists-jiuuyVkp.js → specialists-Cicieuzu.js} +18 -18
  389. package/server/{specialists-CShuVGWT.js → specialists-JHsdU3pA.js} +1 -1
  390. package/server/{specialists-DM6bWjsi.js → specialists-Tdezg_6N.js} +1 -1
  391. package/server/specs-Bt7WJDoC.js +3 -0
  392. package/server/src-CRmCHlma.js +11408 -0
  393. package/server/{src-CXmtj0im.js → src-Ck028hjO.js} +6 -6
  394. package/server/{src-CdmnTM2m.js → src-UWcGe0Ix.js} +3 -3
  395. package/server/{stack-health-Bn3o8FBX.js → stack-health-CJLMrLBl.js} +1 -1
  396. package/server/{stack-health-DxSdG9cW.js → stack-health-DqSqx0zv.js} +7 -5
  397. package/server/{stale-task-claims-KJKxxiiQ.js → stale-task-claims-CYFOUNlT.js} +4 -4
  398. package/server/{staleness-CT34nwr9.js → staleness-BQ-0gMYK.js} +1 -1
  399. package/server/{staleness-DPm7ClwA.js → staleness-D47CUJok.js} +1 -1
  400. package/server/{state-home-Cn_Qu8IX.js → state-home-BYV7qZTW.js} +2 -2
  401. package/server/{state-mapping-BL_-3Yt8.js → state-mapping-BVldLhBf.js} +1 -1
  402. package/server/{state-migrate-BGg2ZaOt.js → state-migrate-CvvBtS0Y.js} +4 -4
  403. package/server/{stuck-remediation-s9_2qfi6.js → stuck-remediation-Wt0UVvu1.js} +1 -1
  404. package/server/{stuck-remediation-DYuPRYYw.js → stuck-remediation-mkLC6G_t.js} +79 -22
  405. package/server/{substrate-bug-weights-service-B-FwCs5V.js → substrate-bug-weights-service-XfLAKnmK.js} +3 -3
  406. package/server/{summary-fork-DpcxN9tf.js → summary-fork-CD7GOts0.js} +2 -2
  407. package/server/{summary-fork-D1RAk9rJ.js → summary-fork-xiXBnWG9.js} +8 -8
  408. package/server/supervisor/{injection-budget-Csw5tqfJ.js → injection-budget-B5SbvDx2.js} +1 -1
  409. package/server/supervisor/{paths-DehGY2Fj.js → paths-K3noE4N_.js} +1 -1
  410. package/server/supervisor/pty-supervisor.js +49 -3
  411. package/server/supervisor/{pty-token-x-ea28Us.js → pty-token-B7lp0ElT.js} +2 -2
  412. package/server/{supervisor-wM4ooB5O.js → supervisor-DL788vos.js} +3 -3
  413. package/server/supervisor-UWiQNK-y.js +2 -0
  414. package/server/{swarm-readiness-DlP_UjHq.js → swarm-readiness-BV14DF5N.js} +3 -3
  415. package/server/{system-prerequisites-DUDj1YHf.js → system-prerequisites-pdWG6ZQs.js} +2 -2
  416. package/server/{teardown-workspace-DeTTImn-.js → teardown-workspace-l2F4_zim.js} +15 -16
  417. package/server/{test-agent-queue-MbxX5vqq.js → test-agent-queue-qakFIIGz.js} +6 -6
  418. package/server/{test-verdict-bWYBtqBg.js → test-verdict-BJYDggMm.js} +1 -1
  419. package/server/{test-verdict-gscuksPv.js → test-verdict-Gw-btEfb.js} +1 -1
  420. package/server/{tldr-daemon-BYFkts95.js → tldr-daemon-BKOYB616.js} +1 -1
  421. package/server/{tldr-daemon-C-69c3OI.js → tldr-daemon-CBaWkV9k.js} +2 -2
  422. package/server/{tmux-R7N7y-Mh.js → tmux-B1Wbxz5o.js} +3 -3
  423. package/server/{tmux-B6z7h_vZ.js → tmux-DQ6jB76i.js} +1 -1
  424. package/server/{launcher-generator-BBWG_SiS.js → tmux-dedup-DbN6MGzM.js} +428 -9
  425. package/server/{token-BK6t8BIT.js → token-Cxbk023d.js} +2 -2
  426. package/server/{token-util-DxXu-vd1.js → token-util-CLq2MmQt.js} +1 -1
  427. package/server/token-util-zlz9U0ki.js +3 -0
  428. package/server/{tracker-config-G6latr8C.js → tracker-config-DZ8Zn2nQ.js} +2 -2
  429. package/server/{tracker-utils-DHv5pSDT.js → tracker-utils-L0FKtjq2.js} +3 -3
  430. package/server/{traefik-connect-Df2uXPsQ.js → traefik-connect-bNX6jKkb.js} +1 -1
  431. package/server/{tunnel-CDVKJpRv.js → tunnel-BAm1XgjG.js} +3 -3
  432. package/server/{tunnel-DGdUkGoZ.js → tunnel-CjSnHdTc.js} +1 -1
  433. package/server/{types-5M0lupud.js → types-q67TYYg5.js} +1 -1
  434. package/server/uat-promote-verification-CKB9ZrKC.js +92 -0
  435. package/server/uat-train-Cu-4nvbf.js +2 -0
  436. package/server/uat-train-D5UjcyAa.js +0 -0
  437. package/server/{validate-IfDGkaVR.js → validate-Cxsx5Uz1.js} +8 -6
  438. package/server/{validation-CC9OPqJZ.js → validation-DEaTZafj.js} +1 -1
  439. package/server/{validation-Dw1pzDzr.js → validation-VZgJxmqc.js} +4 -4
  440. package/server/{verification-artifact-B3itKTxu.js → verification-artifact-C85cRTc_.js} +1 -1
  441. package/server/{verification-artifact-TVFSz_q1.js → verification-artifact-g3yuxQDL.js} +1 -1
  442. package/server/{verification-runner-BW4HOKAz.js → verification-runner-DlZI8yhw.js} +1 -1
  443. package/server/{verification-runner-CkgX6EtI.js → verification-runner-KDZIsBj4.js} +40 -18
  444. package/server/{vtt-parser-DYPbKcIJ.js → vtt-parser-Jr94BF3Y.js} +1 -1
  445. package/server/{work-agent-prompt-Du8Vh2aJ.js → work-agent-prompt-C-vuP3_J.js} +20 -9
  446. package/server/workflows-CHrx_hcW.js +2 -0
  447. package/server/{workflows-mbQzh6mQ.js → workflows-D0oip4eV.js} +161 -78
  448. package/server/{workspace--8tnhDI0.js → workspace-BqFg__wH.js} +1 -1
  449. package/server/{workspace-BPUws1-_.js → workspace-C0fH3aek.js} +3 -3
  450. package/server/workspace-anchor-drift-B4gMRHl4.js +3 -0
  451. package/server/workspace-anchor-drift-CZKofakh.js +224 -0
  452. package/server/{workspace-config-CIVWZOQr.js → workspace-config-B123aZl-.js} +1 -1
  453. package/server/workspace-manager-CDTKjjdU.js +3 -0
  454. package/server/{workspace-manager-CBhNdzE4.js → workspace-manager-CwO-Hek7.js} +156 -117
  455. package/server/{workspace-metadata-_WygnyoX.js → workspace-metadata-CQv00QwK.js} +2 -2
  456. package/server/{workspace-metadata-BzHnwwX4.js → workspace-metadata-D4M8BM4W.js} +1 -1
  457. package/server/{workspaces-Do_9J0LQ.js → workspaces-j1e_6aAT.js} +719 -292
  458. package/sync-sources/dev-skills/pan-dashboard-restart/SKILL.md +34 -10
  459. package/sync-sources/hooks/linear-mcp-auth-hook +97 -0
  460. package/sync-sources/rules/ask-user-question-self-contained.md +9 -0
  461. package/sync-sources/skills/pan-close/SKILL.md +5 -3
  462. package/sync-sources/skills/pan-peer-review/SKILL.md +195 -0
  463. package/sync-sources/skills/pan-reload/SKILL.md +3 -3
  464. package/sync-sources/skills/pan-restart/SKILL.md +5 -4
  465. package/sync-sources/skills/pan-review/SKILL.md +7 -1
  466. package/sync-sources/skills/pan-sync-main/SKILL.md +9 -8
  467. package/sync-sources/skills/pipeline-status/SKILL.md +10 -1
  468. package/sync-sources/skills/workspace-add-repo/SKILL.md +16 -1
  469. package/server/activity-logger-OEUBdfZ8.js +0 -3
  470. package/server/agent-state-Bc3tzUC8.js +0 -3
  471. package/server/agents-wi9NWzs2.js +0 -3
  472. package/server/archive-planning-BZDgzoEj.js +0 -3
  473. package/server/cli-B86rejVV.js +0 -3
  474. package/server/conversation-service-BLd3MYsG.js +0 -3
  475. package/server/deacon-kiQrb4ZT.js +0 -4
  476. package/server/deacon-swarm-C-GwfjJy.js +0 -2
  477. package/server/deploy-window-DkZraDyj.js +0 -3
  478. package/server/dist-Bzy0y69j.js +0 -3
  479. package/server/flywheel-merge-order-UU0tiUld.js +0 -245
  480. package/server/flywheel-merge-order-UUcsCDb6.js +0 -2
  481. package/server/forge-CNFnyqps.js +0 -270
  482. package/server/forge-DXnS_YFH.js +0 -2
  483. package/server/git-utils-D0_yhCgF.js +0 -3
  484. package/server/github-pr-lookup-D16NGsSO.js +0 -44
  485. package/server/hume-ccTf4wTX.js +0 -3
  486. package/server/inspect-agent-Brtz0URj.js +0 -2
  487. package/server/merge-ops-CR44oU9-.js +0 -2
  488. package/server/merge-set-bUqbm3yc.js +0 -3
  489. package/server/merge-sync-BJYeOODr.js +0 -3
  490. package/server/merge-verification-BkaOqPsw.js +0 -124
  491. package/server/project-repos-DXKQsc_m.js +0 -3
  492. package/server/projects-vjjcmiN8.js +0 -3
  493. package/server/public/assets/index-CWeMerGO.js +0 -804
  494. package/server/public/assets/index-CenuJ3Cw.css +0 -1
  495. package/server/public/assets/mermaid-GHXKKRXX-CpPWAFwE.js +0 -1
  496. package/server/rally-zhhtXuDP.js +0 -3
  497. package/server/record-CN0pj4_5.js +0 -3
  498. package/server/record-update-bLJxAXH4.js +0 -3
  499. package/server/resume-BFv1PGpA.js +0 -3
  500. package/server/review-status-btEYlaxA.js +0 -3
  501. package/server/review-status-kZj_KyCk.js +0 -1470
  502. package/server/settings-66A6uvIA.js +0 -2
  503. package/server/specs-C8Wsn2XO.js +0 -3
  504. package/server/src-DtcUOZCq.js +0 -4826
  505. package/server/supervisor-FTJAIsAK.js +0 -2
  506. package/server/token-util-DuPuNriz.js +0 -3
  507. package/server/tracker-utils-B4ylXZQK.js +0 -3
  508. package/server/uat-train-B05BWkp-.js +0 -2
  509. package/server/uat-train-DDSrSoV1.js +0 -2152
  510. package/server/workflows-BQu4RFQ-.js +0 -2
  511. package/server/workspace-manager-CWT55qeI.js +0 -3
@@ -1,44 +1,49 @@
1
- import { $n as resolveIssueIdSync, Br as getOverdeckHome, Jn as extractPrefixSync, Nr as encodeClaudeProjectDir, Tn as init_projects, Vr as init_paths, Xt as isStatePlaneOnlyStatus, Yn as init_issue_id, Yt as init_state_plane, Zn as parseIssueIdSync, ar as GitError, ir as FsError, kn as listProjectsSync, mn as findProjectByTeamSync, mr as init_errors, qn as extractNumberSync, t as init_config_yaml, tt as resolveModel, un as extractTeamPrefix, yn as getProjectSync, zn as resolveProjectFromIssueSync } from "./config-yaml-DySPNmKN.js";
2
- import { Q as getWorkAgentLifecycleStateSync, St as jsonResponse, bt as httpHandler, dt as rejectUnauthorizedDashboardRequest, et as spawnPanCli, gt as getHeaderFromMap, n as _serverManagedMerges, pt as rejectUnsafeDashboardMutationRequest } from "./specialists-CC4r-c2s.js";
3
- import { a as init_activity_logger, n as emitActivityEntrySync } from "./activity-logger-DDlOIAML.js";
4
- import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-BEqFxlJc.js";
5
- import { $ as init_child_env, H as sessionExists, M as listSessionNames, Q as buildChildEnvWithoutTmuxSync, i as capturePane, w as init_tmux } from "./tmux-R7N7y-Mh.js";
6
- import { a as init_event_store, n as getEventStore } from "./event-store-CQL6NeqB.js";
7
- import { _ as setAutoMerge, b as setReviewStatusSync, c as getReviewStatusSync, d as loadReviewStatuses, l as init_review_status, p as markWorkspaceStuck, v as setDeaconIgnored } from "./review-status-kZj_KyCk.js";
8
- import { _ as init_queue_position, a as EventStoreService, g as findPositionInQueueSync, h as computeQueuePositionFromStatusSync, s as init_domain_services } from "./issue-lifecycle-ojZAzDBP.js";
9
- import { o as getPricingSync, s as init_cost, t as calculateCostSync } from "./cost-B2ddP6wq.js";
10
- import { Ar as saveAgentRuntimeState, Kt as transitionIssueToInReview, Or as getAgentRuntimeStateSync, X as messageAgent, b as init_agents, i as listRunningAgents, lt as spawnAgent, qn as getAgentState } from "./queries-CjNIf-Ub.js";
11
- import { f as CostWriter, l as CostDoorLive } from "./service-CLeAoU6G.js";
12
- import { a as init_tracker_config, t as getGitHubConfig } from "./tracker-config-G6latr8C.js";
13
- import { i as resolveGitHubIssueSync, n as init_tracker_utils } from "./tracker-utils-DHv5pSDT.js";
14
- import { o as getInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-s0-oKybJ.js";
1
+ import { An as extractTeamPrefix, Er as GitError, Fr as init_errors, Gn as init_projects, Pn as findProjectByTeamSync, Tr as FsError, Yn as listProjectsSync, ar as resolveProjectFromIssueSync, br as resolveIssueIdSync, ci as init_paths, ei as encodeClaudeProjectDir, gn as isStatePlaneOnlyStatus, gr as init_issue_id, hn as init_state_plane, hr as extractPrefixSync, mr as extractNumberSync, si as getOverdeckHome, t as init_config_yaml, tt as resolveModel, vr as parseIssueIdSync, zn as getProjectSync } from "./config-yaml-CmOPzmBb.js";
2
+ import { Et as httpHandler, Ot as jsonResponse, St as getHeaderFromMap, _t as rejectUnauthorizedDashboardRequest, it as getWorkAgentLifecycleStateSync, n as _serverManagedMerges, ot as spawnPanCli, yt as rejectUnsafeDashboardMutationRequest } from "./specialists-CNfYO3G2.js";
3
+ import { o as init_activity_logger, r as emitActivityEntrySync } from "./activity-logger-CyteR4JO.js";
4
+ import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-BjuxvjdS.js";
5
+ import { H as sessionExists, M as listSessionNames, et as buildChildEnvWithoutTmuxSync, i as capturePane, tt as init_child_env, w as init_tmux } from "./tmux-B1Wbxz5o.js";
6
+ import { a as init_event_store, n as getEventStore } from "./event-store-zY5MJHgF.js";
7
+ import { S as setReviewStatusSync, b as setDeaconIgnored, f as init_review_status, g as markWorkspaceStuck, m as loadReviewStatuses, r as clearFeedbackDeliveryStuck, u as getReviewStatusSync, y as setAutoMerge } from "./review-status-yljtTd-q.js";
8
+ import { _ as findPositionInQueueSync, a as EventStoreService, g as computeQueuePositionFromStatusSync, s as init_domain_services, v as init_queue_position } from "./issue-lifecycle-C4Zj0WmE.js";
9
+ import { o as getPricingSync, s as init_cost, t as calculateCostSync } from "./cost-Bgcub5kW.js";
10
+ import { Ir as getAgentRuntimeStateSync, Qn as decideResumeGate, Rr as saveAgentRuntimeState, X as messageAgent, Zn as clearYieldForResumeSync, Zt as transitionIssueToInReview, _r as saveAgentStateSync, b as init_agents, er as getAgentResumeGateBlockReason, i as listRunningAgents, ir as init_agent_state, rr as getAgentStateSync, tr as getAgentState, ut as spawnAgent } from "./queries-DHJm7bTd.js";
11
+ import { f as CostWriter, l as CostDoorLive } from "./service-Br9rpBNA.js";
12
+ import { a as init_tracker_config, t as getGitHubConfig } from "./tracker-config-DZ8Zn2nQ.js";
13
+ import { n as resolveGitHubIssueSync, t as init_tracker_utils } from "./tracker-utils-L0FKtjq2.js";
14
+ import { o as getInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-DvMTQSOS.js";
15
+ import { r as notifyPipelineSync, t as init_pipeline_notifier } from "./pipeline-notifier-BuQ0e4hF.js";
15
16
  import { a as PAN_DIRNAME, i as PAN_CONTINUE_FILENAME, p as init_types } from "./types-hraoaQIp.js";
16
- import { o as init_merge_sync, r as getAllActiveQueues } from "./merge-sync-VPV28g0g.js";
17
- import { A as init_xbrief_index, M as readXBriefDocument, _ as XBRIEF_INSPECTION_POLICIES, c as mergeRecordStatusOverrides, g as serializeXBriefDocument, k as findXBriefByIssue, o as init_io, r as findPlan, s as isPlanningComplete, u as readPlan, v as init_types$1 } from "./io-C9kF1wtJ.js";
18
- import { it as findConversationForCostSessionSync, k as init_conversations } from "./conversations-6AfUfbwc.js";
19
- import { a as normalizeModelOverrideSync, i as init_model_validation } from "./launcher-generator-BBWG_SiS.js";
20
- import { f as init_config, m as loadConfigSync$1 } from "./config-BZ0sHTju.js";
21
- import { a as getWorkspaceStackHealth, n as collectDockerContainerLifecycleSnapshot, r as composeProjectNameForWorkspace, s as init_stack_health } from "./stack-health-DxSdG9cW.js";
22
- import { a as criticalPath, l as init_dag, t as actionableDoc } from "./dag-B1ucnjDU.js";
23
- import { E as verifyAppCanMerge, M as withConcurrencyLimit, f as init_github_app, j as init_concurrency, m as isIntegrationPermissionError } from "./github-app-C3QrAUd0.js";
24
- import { a as readEventsFromLineSync, i as init_events, l as init_wal, o as readEventsSync, r as getLastEventMetadataSync, t as appendCostEventSync } from "./events-DTfAe4My.js";
25
- import { n as getContainersReferencingWorkspacePath, r as init_workspace_manager } from "./workspace-manager-CBhNdzE4.js";
26
- import { r as init_devcontainer_renderer, t as DEVCONTAINER_DIRNAME } from "./devcontainer-renderer-_d6XhyND.js";
27
- import { a as init_jsonl_parser, t as getActiveSessionModelSync } from "./jsonl-parser-BXSlHwEh.js";
28
- import { r as init_in_flight_guard, t as createInFlightGuard } from "./in-flight-guard-CAAkqPLu.js";
29
- import { i as findWorkspacePath, o as init_archive_planning } from "./archive-planning-Du25Jtst.js";
30
- import { a as loadWorkspaceMetadataSync, i as listWorkspaceMetadataSync } from "./workspace-metadata-_WygnyoX.js";
31
- import { n as enrichReviewStatusFromSessions } from "./review-status-enrichment-Dci-ZwEt.js";
32
- import { n as generateDailySummary, r as init_cli } from "./cli-RoOx5DUf.js";
33
- import { a as getDiffStat, i as getDiffBase, o as init_review_context, r as getChangedFiles } from "./review-context-2uj-YQ8J.js";
34
- import { n as getTldrDaemonServiceSync, r as init_tldr_daemon } from "./tldr-daemon-C-69c3OI.js";
35
- import { C as init_operations, S as gitPush, T as listGitOperationsSync, a as init_merge_agent, w as init_git_activity, x as MainDivergedError, y as syncMainIntoWorkspace } from "./merge-agent-4WOWlSYA.js";
36
- import { F as enqueueMerge, I as getAllActiveQueues$1, L as getCurrentMerge, P as dequeueMerge, z as markMergeProcessing } from "./merge-CefQNAnq.js";
37
- import { n as init_release_set, t as getReleaseSetSync } from "./release-set-CQfuN9-v.js";
38
- import { i as init_conflict_gate, r as getCachedConflictGateMergeability } from "./conflict-gate-BaCVrH-N.js";
39
- import { r as runVerificationForIssue } from "./verification-runner-CkgX6EtI.js";
40
- import { t as teardownWorkspace } from "./teardown-workspace-DeTTImn-.js";
41
- import { t as init_rebuild_stack } from "./rebuild-stack-lwtsW0GO.js";
17
+ import { i as getAllActiveQueues, s as init_merge_sync } from "./merge-sync-CQ-LgZ1_.js";
18
+ import { l as resolveWorkspaceRepoRootsSync, r as init_project_repos } from "./project-repos-C0nuoBGv.js";
19
+ import { O as findXBriefByIssue, _ as XBRIEF_INSPECTION_POLICIES, c as mergeRecordStatusOverrides, g as serializeXBriefDocument, j as readXBriefDocument, k as init_xbrief_index, o as init_io, r as findPlan, s as isPlanningComplete, u as readPlan, v as init_types$1 } from "./io-VHvc0Ssp.js";
20
+ import { it as findConversationForCostSessionSync, k as init_conversations } from "./conversations-BUpYsOZg.js";
21
+ import { h as normalizeModelOverrideSync, m as init_model_validation } from "./tmux-dedup-DbN6MGzM.js";
22
+ import { f as init_config, m as loadConfigSync$1 } from "./config-Dr3pW6w6.js";
23
+ import { a as getWorkspaceStackHealth, n as collectDockerContainerLifecycleSnapshot, r as composeProjectNameForWorkspace, s as init_stack_health } from "./stack-health-DqSqx0zv.js";
24
+ import { a as criticalPath, l as init_dag, t as actionableDoc } from "./dag-ombYYt4s.js";
25
+ import { E as verifyAppCanMerge, M as withConcurrencyLimit, f as init_github_app, j as init_concurrency, m as isIntegrationPermissionError } from "./github-app-CQ1Lo6LA.js";
26
+ import { a as readEventsFromLineSync, i as init_events, l as init_wal, o as readEventsSync, r as getLastEventMetadataSync, t as appendCostEventSync } from "./events-D9PR1IC0.js";
27
+ import { n as getContainersReferencingWorkspacePath, r as init_workspace_manager } from "./workspace-manager-CwO-Hek7.js";
28
+ import { r as init_devcontainer_renderer, t as DEVCONTAINER_DIRNAME } from "./devcontainer-renderer-68CSCRnu.js";
29
+ import { a as init_jsonl_parser, t as getActiveSessionModelSync } from "./jsonl-parser-DJOH_O-w.js";
30
+ import { i as findWorkspacePath } from "./archive-planning-C0lAbNB_.js";
31
+ import { n as init_merge_verification, t as handlePostRebaseVerificationDeferral } from "./merge-verification-x3JO8Dtz.js";
32
+ import { r as init_in_flight_guard, t as createInFlightGuard } from "./in-flight-guard-Bq3epG58.js";
33
+ import { a as loadWorkspaceMetadataSync, i as listWorkspaceMetadataSync } from "./workspace-metadata-CQv00QwK.js";
34
+ import { n as enrichReviewStatusFromSessions } from "./review-status-enrichment-QV_hQkgS.js";
35
+ import { n as generateDailySummary, r as init_cli } from "./cli-oCWYA1pE.js";
36
+ import { a as getDiffStat, i as getDiffBase, o as init_review_context, r as getChangedFiles } from "./review-context-oFuBbiEE.js";
37
+ import { n as getTldrDaemonServiceSync, r as init_tldr_daemon } from "./tldr-daemon-CBaWkV9k.js";
38
+ import { C as init_operations, S as gitPush, T as listGitOperationsSync, a as init_merge_agent, w as init_git_activity, x as MainDivergedError, y as syncMainIntoWorkspace } from "./merge-agent-DdMVSV2Y.js";
39
+ import { F as enqueueMerge, I as getAllActiveQueues$1, L as getCurrentMerge, P as dequeueMerge, z as markMergeProcessing } from "./merge-Bpx4jjht.js";
40
+ import { t as rebaseFeatureBranch } from "./merge-rebase-xLnMlw5h.js";
41
+ import { n as init_release_set, t as getReleaseSetSync } from "./release-set-BwGeyZKX.js";
42
+ import { i as init_conflict_gate, r as getCachedConflictGateMergeability } from "./conflict-gate-B9cN3SBi.js";
43
+ import { r as runVerificationForIssue } from "./verification-runner-KDZIsBj4.js";
44
+ import { n as registerDurableReviewPipelineHandler, t as init_durable_review_pipeline } from "./durable-review-pipeline-CGZ5QBxh.js";
45
+ import { t as teardownWorkspace } from "./teardown-workspace-l2F4_zim.js";
46
+ import { t as init_rebuild_stack } from "./rebuild-stack-0EEYReVZ.js";
42
47
  import { basename, dirname, join, resolve, sep } from "node:path";
43
48
  import { Effect, Layer, Option, Stream } from "effect";
44
49
  import { closeSync, existsSync, fstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, renameSync, writeFileSync } from "fs";
@@ -97,7 +102,7 @@ async function captureInterestedAgent(state, agentId) {
97
102
  try {
98
103
  const remoteState = await readFile(join(homedir$1(), ".overdeck", "agents", agentId, "remote-state.json"), "utf-8").then((text) => JSON.parse(text)).catch(() => null);
99
104
  if (remoteState?.location === "remote" && remoteState?.vmName) {
100
- const { getRemoteAgentOutput } = await import("./remote-agents-CA3Ihlxj.js");
105
+ const { getRemoteAgentOutput } = await import("./remote-agents-C1bssi41.js");
101
106
  stdout = await getRemoteAgentOutput(agentId, remoteState.vmName, 50);
102
107
  } else stdout = await Effect.runPromise(capturePane(agentId, 50));
103
108
  } catch {
@@ -390,7 +395,7 @@ var DatabaseProvisionerError = class extends Error {
390
395
  };
391
396
  //#endregion
392
397
  //#region ../../lib/db-provisioners/flyway-postgres.ts
393
- const execAsync$8 = promisify(exec);
398
+ const execAsync$9 = promisify(exec);
394
399
  function shellQuote(value) {
395
400
  return `'${value.replace(/'/g, `'\\''`)}'`;
396
401
  }
@@ -463,7 +468,7 @@ async function cleanFile(filePath) {
463
468
  async function repairFlywayIfNeeded$1(issueId, pgContainer, dbName, projectConfig, workspacePath, log) {
464
469
  const emit = log || ((msg) => console.log(`[flyway-repair] ${msg}`));
465
470
  try {
466
- await execAsync$8(`docker exec "${pgContainer}" pg_isready -U postgres`, {
471
+ await execAsync$9(`docker exec "${pgContainer}" pg_isready -U postgres`, {
467
472
  encoding: "utf-8",
468
473
  timeout: 5e3
469
474
  });
@@ -475,7 +480,7 @@ async function repairFlywayIfNeeded$1(issueId, pgContainer, dbName, projectConfi
475
480
  }
476
481
  let rowCount = 0;
477
482
  try {
478
- const { stdout } = await execAsync$8(`docker exec "${pgContainer}" psql -U postgres -d ${dbName} -t -A -c "SELECT count(*) FROM flyway_schema_history;"`, {
483
+ const { stdout } = await execAsync$9(`docker exec "${pgContainer}" psql -U postgres -d ${dbName} -t -A -c "SELECT count(*) FROM flyway_schema_history;"`, {
479
484
  encoding: "utf-8",
480
485
  timeout: 1e4
481
486
  });
@@ -499,7 +504,7 @@ async function repairFlywayIfNeeded$1(issueId, pgContainer, dbName, projectConfi
499
504
  message: `Flyway baseline not found: ${flywayFile}`
500
505
  };
501
506
  emit(`Loading Flyway baseline from ${flywayFile}`);
502
- await execAsync$8(`docker exec -i "${pgContainer}" psql -U postgres -d ${dbName} < "${flywayFile}"`, {
507
+ await execAsync$9(`docker exec -i "${pgContainer}" psql -U postgres -d ${dbName} < "${flywayFile}"`, {
503
508
  encoding: "utf-8",
504
509
  timeout: 6e4
505
510
  });
@@ -523,7 +528,7 @@ async function repairFlywayIfNeeded$1(issueId, pgContainer, dbName, projectConfi
523
528
  const tmpSql = `/tmp/flyway-checksum-sync-${Date.now()}.sql`;
524
529
  await writeFile(tmpSql, updates.join("\n"));
525
530
  try {
526
- const { stdout } = await execAsync$8(`docker exec -i "${pgContainer}" psql -U postgres -d ${dbName} < "${tmpSql}"`, {
531
+ const { stdout } = await execAsync$9(`docker exec -i "${pgContainer}" psql -U postgres -d ${dbName} < "${tmpSql}"`, {
527
532
  encoding: "utf-8",
528
533
  timeout: 3e4
529
534
  });
@@ -538,7 +543,7 @@ async function repairFlywayIfNeeded$1(issueId, pgContainer, dbName, projectConfi
538
543
  }
539
544
  }
540
545
  try {
541
- const { stdout } = await execAsync$8(`docker exec "${pgContainer}" psql -U postgres -d ${dbName} -t -A -c "SELECT count(*) FROM flyway_schema_history;"`, {
546
+ const { stdout } = await execAsync$9(`docker exec "${pgContainer}" psql -U postgres -d ${dbName} -t -A -c "SELECT count(*) FROM flyway_schema_history;"`, {
542
547
  encoding: "utf-8",
543
548
  timeout: 1e4
544
549
  });
@@ -565,34 +570,34 @@ const flywayPostgresProvisioner = {
565
570
  const logger = requireLogger(ctx.logger, "[refresh-db]");
566
571
  logger.log(`Starting DB refresh for ${ctx.issueId}`);
567
572
  try {
568
- await execAsync$8(`docker stop "${ctx.apiContainer}"`, {
573
+ await execAsync$9(`docker stop "${ctx.apiContainer}"`, {
569
574
  encoding: "utf-8",
570
575
  timeout: 3e4
571
576
  });
572
577
  } catch {
573
578
  logger.log("API container not running or already stopped");
574
579
  }
575
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '${sqlString(ctx.databaseName)}' AND pid <> pg_backend_pid();"`, {
580
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '${sqlString(ctx.databaseName)}' AND pid <> pg_backend_pid();"`, {
576
581
  encoding: "utf-8",
577
582
  timeout: 1e4
578
583
  });
579
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "DROP DATABASE IF EXISTS ${sqlIdentifier(ctx.databaseName)};"`, {
584
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "DROP DATABASE IF EXISTS ${sqlIdentifier(ctx.databaseName)};"`, {
580
585
  encoding: "utf-8",
581
586
  timeout: 1e4
582
587
  });
583
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "CREATE DATABASE ${sqlIdentifier(ctx.databaseName)} OWNER postgres;"`, {
588
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d postgres -c "CREATE DATABASE ${sqlIdentifier(ctx.databaseName)} OWNER postgres;"`, {
584
589
  encoding: "utf-8",
585
590
  timeout: 1e4
586
591
  });
587
592
  logger.log(`Loading seed file: ${ctx.seedFile}`);
588
- await execAsync$8(`docker exec -i ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} < ${shellQuote(ctx.seedFile)}`, {
593
+ await execAsync$9(`docker exec -i ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} < ${shellQuote(ctx.seedFile)}`, {
589
594
  encoding: "utf-8",
590
595
  timeout: 6e5
591
596
  });
592
597
  const repairResult = await repairFlywayIfNeeded$1(ctx.issueId, ctx.pgContainer, ctx.databaseName, ctx.projectConfig, ctx.workspacePath, (msg) => logger.log(msg));
593
598
  logger.log(`Flyway setup: ${repairResult.message}`);
594
599
  try {
595
- await execAsync$8(`docker start "${ctx.apiContainer}"`, {
600
+ await execAsync$9(`docker start "${ctx.apiContainer}"`, {
596
601
  encoding: "utf-8",
597
602
  timeout: 3e4
598
603
  });
@@ -601,7 +606,7 @@ const flywayPostgresProvisioner = {
601
606
  }
602
607
  let seedVerifyResult;
603
608
  if (ctx.seedVerifyQuery) try {
604
- const { stdout } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -t -A -c ${shellQuote(ctx.seedVerifyQuery)}`, {
609
+ const { stdout } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -t -A -c ${shellQuote(ctx.seedVerifyQuery)}`, {
605
610
  encoding: "utf-8",
606
611
  timeout: 1e4
607
612
  });
@@ -614,7 +619,7 @@ const flywayPostgresProvisioner = {
614
619
  const logger = requireLogger(ctx.logger, "[db-seed]");
615
620
  logger.setText(`Finding database container ${ctx.pgContainer}...`);
616
621
  try {
617
- const { stdout } = await execAsync$8(`docker ps --filter "name=${ctx.pgContainer}" --format "{{.Names}}"`);
622
+ const { stdout } = await execAsync$9(`docker ps --filter "name=${ctx.pgContainer}" --format "{{.Names}}"`);
618
623
  if (!stdout.trim()) {
619
624
  logger.fail(`Database container not running: ${ctx.pgContainer}`);
620
625
  logger.log("\nStart the workspace containers first:");
@@ -626,7 +631,7 @@ const flywayPostgresProvisioner = {
626
631
  return;
627
632
  }
628
633
  if (!ctx.force) try {
629
- const { stdout } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT count(*) FROM flyway_schema_history" -t 2>/dev/null`);
634
+ const { stdout } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT count(*) FROM flyway_schema_history" -t 2>/dev/null`);
630
635
  const count = parseInt(stdout.trim(), 10);
631
636
  if (count > 0) {
632
637
  logger.info(`Database already seeded (${count} migrations). Use --force to reseed.`);
@@ -636,16 +641,16 @@ const flywayPostgresProvisioner = {
636
641
  if (ctx.force) {
637
642
  logger.setText("Dropping existing database...");
638
643
  try {
639
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -c "DROP DATABASE IF EXISTS ${sqlIdentifier(ctx.databaseName)}; CREATE DATABASE ${sqlIdentifier(ctx.databaseName)};"`);
644
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -c "DROP DATABASE IF EXISTS ${sqlIdentifier(ctx.databaseName)}; CREATE DATABASE ${sqlIdentifier(ctx.databaseName)};"`);
640
645
  } catch (error) {
641
646
  logger.warn(`Could not drop database: ${error instanceof Error ? error.message : String(error)}`);
642
647
  }
643
648
  }
644
649
  logger.setText("Copying seed file to container...");
645
- await execAsync$8(`docker cp ${shellQuote(ctx.seedFile)} ${shellQuote(`${ctx.pgContainer}:/tmp/seed.sql`)}`);
650
+ await execAsync$9(`docker cp ${shellQuote(ctx.seedFile)} ${shellQuote(`${ctx.pgContainer}:/tmp/seed.sql`)}`);
646
651
  logger.setText("Executing seed...");
647
652
  try {
648
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -f /tmp/seed.sql`, { timeout: 6e5 });
653
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -f /tmp/seed.sql`, { timeout: 6e5 });
649
654
  } catch (error) {
650
655
  const message = error instanceof Error ? error.message : String(error);
651
656
  if (message.includes("ERROR")) {
@@ -653,10 +658,10 @@ const flywayPostgresProvisioner = {
653
658
  return;
654
659
  }
655
660
  }
656
- await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} rm /tmp/seed.sql`);
661
+ await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} rm /tmp/seed.sql`);
657
662
  logger.succeed("Database seeded successfully");
658
663
  try {
659
- const { stdout } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT version, description FROM flyway_schema_history ORDER BY installed_rank DESC LIMIT 3" -t`);
664
+ const { stdout } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT version, description FROM flyway_schema_history ORDER BY installed_rank DESC LIMIT 3" -t`);
660
665
  logger.log("\nRecent migrations:");
661
666
  stdout.trim().split("\n").forEach((line) => logger.log(` ${line.trim()}`));
662
667
  } catch {}
@@ -675,7 +680,7 @@ const flywayPostgresProvisioner = {
675
680
  if (!snapshotCmd) throw new DatabaseProvisionerError("No snapshot configuration found");
676
681
  const fullCmd = `${snapshotCmd} > "${outputPath}" 2>&1`;
677
682
  try {
678
- await execAsync$8(fullCmd, { timeout: 3e5 });
683
+ await execAsync$9(fullCmd, { timeout: 3e5 });
679
684
  } catch (error) {
680
685
  const message = error instanceof Error ? error.message : String(error);
681
686
  if (existsSync$1(outputPath)) if (readFileSync$1(outputPath, "utf-8").includes("PostgreSQL database dump")) {
@@ -692,7 +697,7 @@ const flywayPostgresProvisioner = {
692
697
  if (ctx.sanitize && ctx.dbConfig.seed_command) {
693
698
  logger.setText("Running sanitization...");
694
699
  try {
695
- await execAsync$8(ctx.dbConfig.seed_command, { cwd: ctx.projectConfig.path });
700
+ await execAsync$9(ctx.dbConfig.seed_command, { cwd: ctx.projectConfig.path });
696
701
  } catch (error) {
697
702
  logger.warn(`Sanitization warning: ${error instanceof Error ? error.message : String(error)}`);
698
703
  }
@@ -747,7 +752,7 @@ const flywayPostgresProvisioner = {
747
752
  async status(ctx) {
748
753
  const logger = requireLogger(ctx.logger, "[db-status]");
749
754
  logger.setText(`Checking container ${ctx.pgContainer}...`);
750
- const { stdout: containerStatus } = await execAsync$8(`docker ps --filter "name=${ctx.pgContainer}" --format "{{.Status}}"`);
755
+ const { stdout: containerStatus } = await execAsync$9(`docker ps --filter "name=${ctx.pgContainer}" --format "{{.Status}}"`);
751
756
  if (!containerStatus.trim()) {
752
757
  logger.fail(`Container not running: ${ctx.pgContainer}`);
753
758
  return;
@@ -755,18 +760,18 @@ const flywayPostgresProvisioner = {
755
760
  logger.succeed(`Container: ${ctx.pgContainer}`);
756
761
  logger.log(` Status: ${containerStatus.trim()}`);
757
762
  try {
758
- const { stdout: version } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT version, description FROM flyway_schema_history ORDER BY installed_rank DESC LIMIT 1" -t`);
763
+ const { stdout: version } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT version, description FROM flyway_schema_history ORDER BY installed_rank DESC LIMIT 1" -t`);
759
764
  const [ver, desc] = version.trim().split("|").map((s) => s.trim());
760
765
  logger.log(` Flyway: V${ver} - ${desc}`);
761
766
  } catch {
762
767
  logger.warn(" Flyway: Not initialized");
763
768
  }
764
769
  try {
765
- const { stdout: tableCount } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public'" -t`);
770
+ const { stdout: tableCount } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public'" -t`);
766
771
  logger.log(` Tables: ${tableCount.trim()}`);
767
772
  } catch {}
768
773
  try {
769
- const { stdout: dbSize } = await execAsync$8(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT pg_size_pretty(pg_database_size('${sqlString(ctx.databaseName)}'))" -t`);
774
+ const { stdout: dbSize } = await execAsync$9(`docker exec ${shellQuote(ctx.pgContainer)} psql -U postgres -d ${shellQuote(ctx.databaseName)} -c "SELECT pg_size_pretty(pg_database_size('${sqlString(ctx.databaseName)}'))" -t`);
770
775
  logger.log(` Size: ${dbSize.trim()}`);
771
776
  } catch {}
772
777
  }
@@ -798,7 +803,7 @@ init_issue_id();
798
803
  init_cli();
799
804
  init_projects();
800
805
  init_devcontainer_renderer();
801
- const execAsync$7 = promisify(exec);
806
+ const execAsync$8 = promisify(exec);
802
807
  function requireDatabaseName(dbConfig) {
803
808
  if (!dbConfig) throw new Error("No database configuration found in projects.yaml");
804
809
  const name = dbConfig.name?.trim();
@@ -814,7 +819,7 @@ const postWorkspaceContainerizeRoute = HttpRouter.add("POST", "/api/workspaces/:
814
819
  const workspacePath = join(projectPath, "workspaces", `feature-${issueLower}`);
815
820
  if (existsSync$1(join(workspacePath, ".devcontainer"))) return jsonResponse({ error: "Workspace is already containerized" }, { status: 400 });
816
821
  try {
817
- yield* Effect.promise(() => execAsync$7("docker info >/dev/null 2>&1", { encoding: "utf-8" }));
822
+ yield* Effect.promise(() => execAsync$8("docker info >/dev/null 2>&1", { encoding: "utf-8" }));
818
823
  } catch {
819
824
  return jsonResponse({ error: "Docker is not running. Start Docker Desktop first." }, { status: 400 });
820
825
  }
@@ -931,7 +936,7 @@ const postWorkspaceContainerActionRoute = HttpRouter.add("POST", "/api/workspace
931
936
  }
932
937
  if (!workspacePath) return jsonResponse({ error: `Workspace not found for ${issueId}` }, { status: 404 });
933
938
  if (!composeFile && ["start", "restart"].includes(action)) {
934
- const { ensureDevcontainerSync } = yield* Effect.promise(() => import("./ensure-devcontainer-BZgOhRo7.js"));
939
+ const { ensureDevcontainerSync } = yield* Effect.promise(() => import("./ensure-devcontainer-C98V8yW-.js"));
935
940
  if (ensureDevcontainerSync({
936
941
  workspacePath,
937
942
  issueId
@@ -948,7 +953,7 @@ const postWorkspaceContainerActionRoute = HttpRouter.add("POST", "/api/workspace
948
953
  }
949
954
  if (!composeFile) return jsonResponse({ error: `No docker-compose file found in workspace` }, { status: 404 });
950
955
  try {
951
- yield* Effect.promise(() => execAsync$7("docker info >/dev/null 2>&1", { encoding: "utf-8" }));
956
+ yield* Effect.promise(() => execAsync$8("docker info >/dev/null 2>&1", { encoding: "utf-8" }));
952
957
  } catch {
953
958
  return jsonResponse({ error: "Docker is not running. Start Docker Desktop first." }, { status: 400 });
954
959
  }
@@ -962,7 +967,7 @@ const postWorkspaceContainerActionRoute = HttpRouter.add("POST", "/api/workspace
962
967
  };
963
968
  const serviceNames = serviceMap[containerName.toLowerCase()];
964
969
  if (!serviceNames) return jsonResponse({ error: `Unknown container: ${containerName}. Valid: ${Object.keys(serviceMap).join(", ")}` }, { status: 400 });
965
- const { stdout: projectNameOut } = yield* Effect.promise(() => execAsync$7(`docker compose -f "${composeFile}" config --format json 2>/dev/null | jq -r '.name // empty'`, { encoding: "utf-8" }));
970
+ const { stdout: projectNameOut } = yield* Effect.promise(() => execAsync$8(`docker compose -f "${composeFile}" config --format json 2>/dev/null | jq -r '.name // empty'`, { encoding: "utf-8" }));
966
971
  const projectName = projectNameOut.trim();
967
972
  if (containerName.toLowerCase() === "api" && ["start", "restart"].includes(action)) {
968
973
  const tPrefix = extractTeamPrefix(issueId);
@@ -991,7 +996,7 @@ const postWorkspaceContainerActionRoute = HttpRouter.add("POST", "/api/workspace
991
996
  for (const serviceName of serviceNames) try {
992
997
  const cmd = `docker compose -f "${composeFile}" ${projectName ? `--project-name "${projectName}"` : ""} ${action} ${serviceName}`;
993
998
  console.log(`[container-control] Running: ${cmd}`);
994
- yield* Effect.promise(() => execAsync$7(cmd, {
999
+ yield* Effect.promise(() => execAsync$8(cmd, {
995
1000
  encoding: "utf-8",
996
1001
  timeout: 3e4
997
1002
  }));
@@ -1052,7 +1057,7 @@ const postWorkspaceRefreshDbRoute = HttpRouter.add("POST", "/api/workspaces/:iss
1052
1057
  break;
1053
1058
  }
1054
1059
  if (!composeFile) return jsonResponse({ error: "No docker-compose file found in workspace" }, { status: 404 });
1055
- const { stdout: projectNameOut } = yield* Effect.promise(() => execAsync$7(`docker compose -f "${composeFile}" config --format json 2>/dev/null | jq -r '.name // empty'`, { encoding: "utf-8" }));
1060
+ const { stdout: projectNameOut } = yield* Effect.promise(() => execAsync$8(`docker compose -f "${composeFile}" config --format json 2>/dev/null | jq -r '.name // empty'`, { encoding: "utf-8" }));
1056
1061
  const projectName = projectNameOut.trim();
1057
1062
  if (!projectName) return jsonResponse({ error: "Could not determine docker compose project name" }, { status: 500 });
1058
1063
  const pgContainer = `${projectName}-postgres-1`;
@@ -1086,7 +1091,7 @@ const containerOpsRouteLayer = Layer.mergeAll(postWorkspaceContainerizeRoute, po
1086
1091
  //#endregion
1087
1092
  //#region ../../lib/stashes.ts
1088
1093
  init_errors();
1089
- const execAsync$6 = promisify(exec);
1094
+ const execAsync$7 = promisify(exec);
1090
1095
  const ISO_STASH_TIMESTAMP_PATTERN = "(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2}))";
1091
1096
  const ISSUE_ID_PATTERN = "([A-Z]+(?:-[A-Z]+)*-\\d+)";
1092
1097
  const ISSUE_ID_REGEX = new RegExp(`^${ISSUE_ID_PATTERN}$`);
@@ -1162,16 +1167,22 @@ function parseStashListLine(line) {
1162
1167
  };
1163
1168
  }
1164
1169
  async function listStashesPromise(repoPath) {
1165
- const { stdout } = await execAsync$6("git stash list --format=\"%gd%x09%H%x09%cI%x09%gs\"", {
1166
- cwd: repoPath,
1167
- encoding: "utf-8"
1168
- });
1170
+ let stdout;
1171
+ try {
1172
+ ({stdout} = await execAsync$7("git stash list --format=\"%gd%x09%H%x09%cI%x09%gs\"", {
1173
+ cwd: repoPath,
1174
+ encoding: "utf-8"
1175
+ }));
1176
+ } catch (error) {
1177
+ if ((error instanceof Error ? error.message : String(error)).includes("not a git repository")) return [];
1178
+ throw error;
1179
+ }
1169
1180
  return stdout.split("\n").map((line) => parseStashListLine(line)).filter((entry) => entry !== null);
1170
1181
  }
1171
1182
  async function resolveStashOperationRef(repoPath, ref, stackRef) {
1172
1183
  const candidateRef = /^stash@\{\d+\}$/.test(ref) ? ref : stackRef;
1173
1184
  if (candidateRef) {
1174
- const { stdout: resolvedSha } = await execAsync$6(`git rev-parse --verify ${JSON.stringify(candidateRef)}`, {
1185
+ const { stdout: resolvedSha } = await execAsync$7(`git rev-parse --verify ${JSON.stringify(candidateRef)}`, {
1175
1186
  cwd: repoPath,
1176
1187
  encoding: "utf-8"
1177
1188
  });
@@ -1180,7 +1191,7 @@ async function resolveStashOperationRef(repoPath, ref, stackRef) {
1180
1191
  }
1181
1192
  const matchingEntry = (await Effect.runPromise(listStashes(repoPath))).find((entry) => entry.ref === ref);
1182
1193
  if (!matchingEntry?.stackRef) throw new Error(`Stash ${ref} not found`);
1183
- const { stdout: resolvedSha } = await execAsync$6(`git rev-parse --verify ${JSON.stringify(matchingEntry.stackRef)}`, {
1194
+ const { stdout: resolvedSha } = await execAsync$7(`git rev-parse --verify ${JSON.stringify(matchingEntry.stackRef)}`, {
1184
1195
  cwd: repoPath,
1185
1196
  encoding: "utf-8"
1186
1197
  });
@@ -1189,7 +1200,7 @@ async function resolveStashOperationRef(repoPath, ref, stackRef) {
1189
1200
  }
1190
1201
  async function dropStashPromise(repoPath, ref, stackRef) {
1191
1202
  const operationRef = await resolveStashOperationRef(repoPath, ref, stackRef);
1192
- await execAsync$6(`git stash drop ${JSON.stringify(operationRef)}`, {
1203
+ await execAsync$7(`git stash drop ${JSON.stringify(operationRef)}`, {
1193
1204
  cwd: repoPath,
1194
1205
  encoding: "utf-8"
1195
1206
  });
@@ -1197,7 +1208,7 @@ async function dropStashPromise(repoPath, ref, stackRef) {
1197
1208
  async function createRecoveryBranchFromStashPromise(repoPath, stashRef, issueId, shortDescription, stackRef) {
1198
1209
  const operationRef = await resolveStashOperationRef(repoPath, stashRef, stackRef);
1199
1210
  const branchName = `recovery/${validateIssueId(issueId)}-${sanitizeShortDescription(shortDescription)}`;
1200
- await execAsync$6(`git branch ${JSON.stringify(branchName)} ${JSON.stringify(operationRef)}`, {
1211
+ await execAsync$7(`git branch ${JSON.stringify(branchName)} ${JSON.stringify(operationRef)}`, {
1201
1212
  cwd: repoPath,
1202
1213
  encoding: "utf-8"
1203
1214
  });
@@ -2762,12 +2773,80 @@ const internalEventsRouteLayer = Layer.mergeAll(internalEventsRoute, internalEve
2762
2773
  //#endregion
2763
2774
  //#region routes/workspaces/merge-strike.ts
2764
2775
  init_agents();
2776
+ init_agent_state();
2777
+ init_tmux();
2778
+ const execAsync$6 = promisify(exec);
2765
2779
  function mergeVerificationOptions(request) {
2766
2780
  return {
2767
2781
  syncTargetBranch: false,
2768
2782
  ...request.kind === "strike" ? { skipPlanChecklist: true } : {}
2769
2783
  };
2770
2784
  }
2785
+ /**
2786
+ * PAN-3067: the PAN-2487 CI-green skip bypasses the verification runner — which
2787
+ * is what records verificationStatus on local runs — and that skip is the exact
2788
+ * path every strike merge takes (its CI is already green). Record the verdict
2789
+ * here so DoD row 3 has evidence and close-out can proceed.
2790
+ */
2791
+ async function recordCiGreenVerificationVerdict(issueId, workspacePath) {
2792
+ try {
2793
+ const { snapshotWorkspaceHeadsPromise } = await import("./git-utils-CI6cwyyC.js");
2794
+ const verifiedAnchor = await snapshotWorkspaceHeadsPromise(issueId, workspacePath).catch(() => void 0);
2795
+ const { setReviewStatusSync } = await import("./review-status-BZH8h-6W.js");
2796
+ setReviewStatusSync(issueId, {
2797
+ verificationStatus: "passed",
2798
+ verificationNotes: "merge-verify: CI green on the merged tip (PAN-2487 local-gate skip)",
2799
+ ...verifiedAnchor ? { lastVerifiedCommit: verifiedAnchor } : {}
2800
+ });
2801
+ } catch (recordErr) {
2802
+ const message = recordErr instanceof Error ? recordErr.message : String(recordErr);
2803
+ console.warn(`[merge] Could not record CI-green verification verdict for ${issueId}: ${message}`);
2804
+ }
2805
+ }
2806
+ /**
2807
+ * PAN-3120: resume the work agent for a merge-requested rebase and narrate it to
2808
+ * the operator (Awaiting Merge tracker + ship log), so a scheduler-yielded agent
2809
+ * shows as "Preparing work agent" rather than a silent step or a dead end.
2810
+ * Status writes go through the caller's `setStatus` to keep this module free of
2811
+ * the workspaces-route import cycle.
2812
+ */
2813
+ async function prepareWorkAgentForRebase(opts) {
2814
+ const { appendShipLog } = await import("./ship-log-xplJ8t75.js");
2815
+ opts.setStatus({
2816
+ mergeStep: "preparing-work-agent",
2817
+ mergeNotes: `Preparing work agent ${opts.agentId} to rebase ${opts.scopeNote}…`
2818
+ });
2819
+ appendShipLog(opts.issueId, `Preparing work agent ${opts.agentId} for rebase…`, "rebasing");
2820
+ try {
2821
+ const recovery = await ensureAgentReadyForMerge(opts.issueId, opts.workspacePath, opts.rebaseMsg, {
2822
+ agentId: opts.agentId,
2823
+ ...opts.allowFreshStart === void 0 ? {} : { allowFreshStart: opts.allowFreshStart }
2824
+ });
2825
+ opts.setStatus({
2826
+ mergeStep: "rebasing",
2827
+ mergeNotes: `${recovery.detail} Waiting for ${opts.scopeNote} to be rebased and pushed.`
2828
+ });
2829
+ appendShipLog(opts.issueId, `✓ ${recovery.detail}`, "rebasing");
2830
+ console.log(`[merge] ${recovery.detail}`);
2831
+ return {
2832
+ ok: true,
2833
+ detail: recovery.detail
2834
+ };
2835
+ } catch (prepError) {
2836
+ const message = prepError instanceof Error ? prepError.message : String(prepError);
2837
+ const error = `Work agent ${opts.agentId} could not be prepared for the rebase: ${message}`;
2838
+ opts.setStatus(opts.deferFailureStatus ? { mergeNotes: error } : {
2839
+ mergeStatus: "failed",
2840
+ readyForMerge: false,
2841
+ mergeNotes: error
2842
+ });
2843
+ appendShipLog(opts.issueId, `✗ ${error}`, "rebasing");
2844
+ return {
2845
+ ok: false,
2846
+ error
2847
+ };
2848
+ }
2849
+ }
2771
2850
  function parseStrikeMergeRequest(raw) {
2772
2851
  if (!raw || typeof raw !== "object") return null;
2773
2852
  const request = raw;
@@ -2830,23 +2909,55 @@ async function validateStrikeMergeRequest(issueId, request, status, deps) {
2830
2909
  }
2831
2910
  return null;
2832
2911
  }
2912
+ /**
2913
+ * PAN-3120: clear whatever gate would stop THIS merge from reaching the work
2914
+ * agent. The preemptive scheduler yields idle work agents to free slots, so the
2915
+ * agent a merge needs is routinely paused by the system itself — and a paused
2916
+ * agent silently diverts `messageAgent` into a mail queue nothing drains, which
2917
+ * the merge then waits 30 minutes on. Returns a human-readable note when a gate
2918
+ * was cleared so the operator sees why the agent came back.
2919
+ */
2920
+ async function clearMergePreparationGate(agentId) {
2921
+ const state = getAgentStateSync(agentId);
2922
+ if (!state) return null;
2923
+ const decision = decideResumeGate(getAgentResumeGateBlockReason(state), "merge-preparation");
2924
+ if (decision.decision === "block") throw new Error(decision.reason);
2925
+ if (decision.decision !== "proceed") return null;
2926
+ if (decision.clearYield) {
2927
+ clearYieldForResumeSync(agentId);
2928
+ return `cleared scheduler yield (${state.pausedReason ?? "yielded"})`;
2929
+ }
2930
+ if (decision.clearStoppedByUser) {
2931
+ delete state.stoppedByUser;
2932
+ saveAgentStateSync(state);
2933
+ return "cleared operator-stop gate for the requested merge";
2934
+ }
2935
+ return null;
2936
+ }
2937
+ /** A message diverted to the mail queue never reaches the agent — treat it as a failure, not a resume. */
2938
+ function assertDelivered(agentId, outcome) {
2939
+ if (outcome.delivered) return;
2940
+ throw new Error(`Merge preparation request for ${agentId} was not delivered${outcome.reason ? ` (${outcome.reason})` : ""}${outcome.queuedToMail ? " — it went to the mail queue, so no rebase would ever happen" : ""}.`);
2941
+ }
2833
2942
  async function ensureAgentReadyForMerge(issueId, workspacePath, rebaseMsg, options) {
2834
2943
  const agentId = options?.agentId ?? `agent-${issueId.toLowerCase()}`;
2944
+ const gateNote = await clearMergePreparationGate(agentId);
2945
+ const gateSuffix = gateNote ? ` (${gateNote})` : "";
2835
2946
  const lifecycle = getWorkAgentLifecycleStateSync(agentId);
2836
2947
  if (lifecycle.hasLiveTmuxSession) {
2837
- await messageAgent(agentId, rebaseMsg);
2948
+ assertDelivered(agentId, await messageAgent(agentId, rebaseMsg));
2838
2949
  return {
2839
2950
  recovered: true,
2840
2951
  agentId,
2841
- detail: "Work agent already running; sent merge preparation request."
2952
+ detail: `Work agent already running; sent merge preparation request${gateSuffix}.`
2842
2953
  };
2843
2954
  }
2844
2955
  if (await Effect.runPromise(getAgentState(agentId))) try {
2845
- await messageAgent(agentId, rebaseMsg);
2956
+ assertDelivered(agentId, await messageAgent(agentId, rebaseMsg));
2846
2957
  return {
2847
2958
  recovered: true,
2848
2959
  agentId,
2849
- detail: getWorkAgentLifecycleStateSync(agentId).canResumeSession ? "Resumed work agent and sent merge preparation request." : "Restarted work agent and sent merge preparation request."
2960
+ detail: `${getWorkAgentLifecycleStateSync(agentId).canResumeSession ? "Resumed" : "Restarted"} work agent and sent merge preparation request${gateSuffix}.`
2850
2961
  };
2851
2962
  } catch (error) {
2852
2963
  if (!lifecycle.canStartFresh) throw error;
@@ -2863,6 +2974,97 @@ async function ensureAgentReadyForMerge(issueId, workspacePath, rebaseMsg, optio
2863
2974
  })).id} and sent merge preparation request.`
2864
2975
  };
2865
2976
  }
2977
+ async function rebaseWithAgentFallback(options) {
2978
+ const { issueId, workspacePath, branchName, targetBranch, agentId, rebaseMsg, allowFreshStart, setStatus } = options;
2979
+ let serverRebaseReason;
2980
+ let conflictFiles = [];
2981
+ if (existsSync$1(workspacePath)) try {
2982
+ const result = await Effect.runPromise(rebaseFeatureBranch(workspacePath, branchName, targetBranch, issueId));
2983
+ console.log(`[merge] Server-side rebase completed for ${issueId}`);
2984
+ return {
2985
+ success: true,
2986
+ newHead: result.newHead
2987
+ };
2988
+ } catch (error) {
2989
+ const detail = error;
2990
+ conflictFiles = Array.isArray(detail.conflictedFiles) ? detail.conflictedFiles.filter((file) => typeof file === "string") : [];
2991
+ const message = error instanceof Error ? error.message : typeof detail.message === "string" ? detail.message : void 0;
2992
+ serverRebaseReason = conflictFiles.length > 0 ? `Rebase conflicts in: ${conflictFiles.join(", ")}` : message || "Server-side rebase failed";
2993
+ console.warn(`[merge] ${serverRebaseReason} — escalating to the work agent for ${issueId}`);
2994
+ }
2995
+ try {
2996
+ const preparation = await prepareWorkAgentForRebase({
2997
+ issueId,
2998
+ workspacePath,
2999
+ agentId,
3000
+ rebaseMsg,
3001
+ allowFreshStart,
3002
+ scopeNote: branchName,
3003
+ setStatus,
3004
+ deferFailureStatus: true
3005
+ });
3006
+ if (!preparation.ok) throw new Error(preparation.error);
3007
+ const { stdout: headBefore } = await execAsync$6(`git rev-parse origin/${branchName} 2>/dev/null || echo NONE`, {
3008
+ cwd: workspacePath,
3009
+ encoding: "utf-8",
3010
+ timeout: 1e4
3011
+ });
3012
+ const timeoutMs = 1800 * 1e3;
3013
+ const startTime = Date.now();
3014
+ let newHead = null;
3015
+ while (Date.now() - startTime < timeoutMs) {
3016
+ await new Promise((resolve) => setTimeout(resolve, 5e3));
3017
+ try {
3018
+ await execAsync$6("git fetch origin", {
3019
+ cwd: workspacePath,
3020
+ encoding: "utf-8",
3021
+ timeout: 15e3
3022
+ });
3023
+ const { stdout: headNow } = await execAsync$6(`git rev-parse origin/${branchName}`, {
3024
+ cwd: workspacePath,
3025
+ encoding: "utf-8",
3026
+ timeout: 5e3
3027
+ });
3028
+ if (headNow.trim() !== headBefore.trim()) {
3029
+ newHead = headNow.trim();
3030
+ console.log(`[merge] Work agent pushed rebased branch for ${issueId} (new HEAD: ${newHead.slice(0, 8)})`);
3031
+ break;
3032
+ }
3033
+ } catch {}
3034
+ if (!await Effect.runPromise(sessionExists(agentId))) {
3035
+ console.log(`[merge] Work agent ${agentId} stopped during rebase`);
3036
+ break;
3037
+ }
3038
+ }
3039
+ if (newHead) return {
3040
+ success: true,
3041
+ newHead
3042
+ };
3043
+ if (!await Effect.runPromise(sessionExists(agentId))) {
3044
+ const agentReason = `Work agent ${agentId} stopped before completing the rebase onto ${targetBranch}`;
3045
+ return {
3046
+ success: false,
3047
+ reason: serverRebaseReason ? `${serverRebaseReason}; ${agentReason}` : agentReason,
3048
+ conflictFiles,
3049
+ retryable: conflictFiles.length === 0
3050
+ };
3051
+ }
3052
+ return {
3053
+ success: false,
3054
+ reason: `Work agent did not push the rebased branch within ${timeoutMs / 6e4} minutes`,
3055
+ conflictFiles,
3056
+ retryable: conflictFiles.length === 0
3057
+ };
3058
+ } catch (error) {
3059
+ const agentReason = error instanceof Error ? error.message : `Work agent ${agentId} could not be prepared for merge`;
3060
+ return {
3061
+ success: false,
3062
+ reason: serverRebaseReason ? `${serverRebaseReason}; ${agentReason}` : agentReason,
3063
+ conflictFiles,
3064
+ retryable: conflictFiles.length === 0
3065
+ };
3066
+ }
3067
+ }
2866
3068
  //#endregion
2867
3069
  //#region routes/workspaces/internal-strike-merge.ts
2868
3070
  init_issue_id();
@@ -2916,6 +3118,7 @@ function internalStrikeMergeRoute(triggerMerge) {
2916
3118
  * stay owned by ../workspaces.js and are imported here.
2917
3119
  */
2918
3120
  init_merge_agent();
3121
+ init_merge_verification();
2919
3122
  init_operations();
2920
3123
  init_git_activity();
2921
3124
  init_issue_id();
@@ -2928,7 +3131,7 @@ init_tracker_utils();
2928
3131
  init_tmux();
2929
3132
  init_domain_services();
2930
3133
  const execAsync$5 = promisify(exec);
2931
- const execFileAsync$3 = promisify(execFile);
3134
+ const execFileAsync$4 = promisify(execFile);
2932
3135
  const shouldBlockApproveForDirtyStatus = (status) => status.trim() !== "" && !isStatePlaneOnlyStatus(status);
2933
3136
  /**
2934
3137
  * Check whether origin/branchName already contains origin/targetBranch.
@@ -2936,7 +3139,7 @@ const shouldBlockApproveForDirtyStatus = (status) => status.trim() !== "" && !is
2936
3139
  */
2937
3140
  async function isBranchAlreadyRebased(workspacePath, branchName, targetBranch) {
2938
3141
  try {
2939
- await Promise.all([execFileAsync$3("git", [
3142
+ await Promise.all([execFileAsync$4("git", [
2940
3143
  "fetch",
2941
3144
  "origin",
2942
3145
  targetBranch
@@ -2944,7 +3147,7 @@ async function isBranchAlreadyRebased(workspacePath, branchName, targetBranch) {
2944
3147
  cwd: workspacePath,
2945
3148
  encoding: "utf-8",
2946
3149
  timeout: 15e3
2947
- }), execFileAsync$3("git", [
3150
+ }), execFileAsync$4("git", [
2948
3151
  "fetch",
2949
3152
  "origin",
2950
3153
  branchName
@@ -2953,7 +3156,7 @@ async function isBranchAlreadyRebased(workspacePath, branchName, targetBranch) {
2953
3156
  encoding: "utf-8",
2954
3157
  timeout: 15e3
2955
3158
  })]);
2956
- await execFileAsync$3("git", [
3159
+ await execFileAsync$4("git", [
2957
3160
  "merge-base",
2958
3161
  "--is-ancestor",
2959
3162
  `origin/${targetBranch}`,
@@ -2963,7 +3166,7 @@ async function isBranchAlreadyRebased(workspacePath, branchName, targetBranch) {
2963
3166
  encoding: "utf-8",
2964
3167
  timeout: 5e3
2965
3168
  });
2966
- const { stdout: currentHead } = await execFileAsync$3("git", ["rev-parse", `origin/${branchName}`], {
3169
+ const { stdout: currentHead } = await execFileAsync$4("git", ["rev-parse", `origin/${branchName}`], {
2967
3170
  cwd: workspacePath,
2968
3171
  encoding: "utf-8",
2969
3172
  timeout: 5e3
@@ -2972,7 +3175,8 @@ async function isBranchAlreadyRebased(workspacePath, branchName, targetBranch) {
2972
3175
  alreadyRebased: true,
2973
3176
  currentHead: currentHead.trim()
2974
3177
  };
2975
- } catch {
3178
+ } catch (error) {
3179
+ console.warn(`[merge] Could not determine whether ${branchName} contains origin/${targetBranch}: ${error instanceof Error ? error.message : String(error)}`);
2976
3180
  return { alreadyRebased: false };
2977
3181
  }
2978
3182
  }
@@ -2991,7 +3195,7 @@ async function reconcileGitHubMergeStatus(issueId, status) {
2991
3195
  const prRef = parseGitHubPullRequestUrl(status.prUrl);
2992
3196
  if (!prRef) return false;
2993
3197
  try {
2994
- const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-ClZ2lk8D.js");
3198
+ const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-DtAsvwzK.js");
2995
3199
  if (!isGitHubAppConfigured()) return false;
2996
3200
  const prState = await Effect.runPromise(getPullRequestState(prRef.owner, prRef.repo, prRef.number));
2997
3201
  console.log(`[merge] reconcileGitHubMergeStatus: ${issueId} PR #${prRef.number} merged=${prState.merged} state=${prState.state}`);
@@ -3043,7 +3247,7 @@ async function ensurePRExists(issueId, options) {
3043
3247
  if (options?.cwd) execOptions.cwd = options.cwd;
3044
3248
  let existingOut = "";
3045
3249
  try {
3046
- const { stdout } = await execFileAsync$3("gh", [
3250
+ const { stdout } = await execFileAsync$4("gh", [
3047
3251
  "pr",
3048
3252
  "view",
3049
3253
  branchName,
@@ -3066,7 +3270,7 @@ async function ensurePRExists(issueId, options) {
3066
3270
  const bodyFile = pathJoin(tmpdir(), `pan-pr-body-${issueId}-${Date.now()}.md`);
3067
3271
  await writeFileAsync(bodyFile, prBody, "utf-8");
3068
3272
  try {
3069
- const { stdout: rawOut } = await execFileAsync$3("gh", [
3273
+ const { stdout: rawOut } = await execFileAsync$4("gh", [
3070
3274
  "pr",
3071
3275
  "create",
3072
3276
  "--head",
@@ -3137,20 +3341,23 @@ const postWorkspaceSyncMainRoute = HttpRouter.add("POST", "/api/issues/:issueId/
3137
3341
  if (result.alreadyUpToDate) return jsonResponse({
3138
3342
  success: true,
3139
3343
  alreadyUpToDate: true,
3140
- message: "Already up to date with main"
3344
+ message: "Already up to date with main",
3345
+ repos: result.repos
3141
3346
  });
3142
3347
  return jsonResponse({
3143
3348
  success: true,
3144
3349
  commitCount: result.commitCount || 0,
3145
3350
  changedFiles: result.changedFiles || [],
3146
- message: `Synced ${result.commitCount || 0} commit(s) from main`
3351
+ message: `Synced ${result.commitCount || 0} commit(s) from main`,
3352
+ repos: result.repos
3147
3353
  });
3148
3354
  } else {
3149
3355
  const status = result.reason?.includes("uncommitted") ? 400 : 500;
3150
3356
  return jsonResponse({
3151
3357
  success: false,
3152
3358
  error: result.reason || "Sync failed",
3153
- conflictFiles: result.conflictFiles
3359
+ conflictFiles: result.conflictFiles,
3360
+ repos: result.repos
3154
3361
  }, { status });
3155
3362
  }
3156
3363
  })));
@@ -3180,7 +3387,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3180
3387
  };
3181
3388
  const strikeError = await validateStrikeMergeRequest(issueId, request, reviewStatus, {
3182
3389
  projectPath: getProjectPath(void 0, extractPrefixSync(issueId) ?? issueId.split("-")[0]),
3183
- git: async (args, cwd) => (await execFileAsync$3("git", args, {
3390
+ git: async (args, cwd) => (await execFileAsync$4("git", args, {
3184
3391
  cwd,
3185
3392
  encoding: "utf-8"
3186
3393
  })).stdout.trim()
@@ -3248,7 +3455,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3248
3455
  const normalizedMergeId = issueId.toUpperCase();
3249
3456
  _serverManagedMerges.add(normalizedMergeId);
3250
3457
  setPendingOperation(issueId, "merge");
3251
- let queueAdvanced = false;
3458
+ let queueAdvanced = false, preserveQueue = false;
3252
3459
  const advanceQueue = () => {
3253
3460
  if (queueAdvanced) return;
3254
3461
  queueAdvanced = true;
@@ -3258,8 +3465,8 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3258
3465
  try {
3259
3466
  if (request.kind === "normal" && workspaceInfo.isRemote && workspaceInfo.vmName) {
3260
3467
  console.log(`[merge] Remote workspace detected for ${issueId}, using review artifact merge...`);
3261
- const { getMergeSetSync, ensureMergeSetForIssueSync } = await import("./merge-set-bUqbm3yc.js");
3262
- const { getForgeAdapter } = await import("./forge-DXnS_YFH.js");
3468
+ const { getMergeSetSync, ensureMergeSetForIssueSync } = await import("./merge-set-DzsOTBg5.js");
3469
+ const { getForgeAdapter } = await import("./forge-DK3blQb_.js");
3263
3470
  const remotePrimaryRepo = (getMergeSetSync(issueId) || ensureMergeSetForIssueSync(issueId))?.repos[0];
3264
3471
  const remoteTargetBranch = remotePrimaryRepo?.targetBranch || "main";
3265
3472
  const remoteForge = remotePrimaryRepo?.forge || "github";
@@ -3295,7 +3502,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3295
3502
  ...mergeCompletionStatus(request)
3296
3503
  });
3297
3504
  completePendingOperation(issueId, null);
3298
- const { postMergeLifecycle } = await import("./merge-agent-CKkgIBPB.js");
3505
+ const { postMergeLifecycle } = await import("./merge-agent-DrXa1CpW.js");
3299
3506
  await postMergeLifecycle(issueId, projectPath);
3300
3507
  return {
3301
3508
  success: true,
@@ -3321,21 +3528,30 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3321
3528
  };
3322
3529
  }
3323
3530
  }
3531
+ const projectConfig = findProjectByTeamSync(issuePrefix);
3532
+ const isPolyrepo = projectConfig?.workspace?.type === "polyrepo";
3324
3533
  if (!existsSync$1(workspacePath)) {
3325
- completePendingOperation(issueId, "Workspace does not exist");
3534
+ const error = "Workspace does not exist";
3535
+ const retryable = request.kind === "normal" && !workspaceInfo.isRemote && !isPolyrepo;
3536
+ if (retryable) setReviewStatus(issueId, {
3537
+ mergeStatus: "queued",
3538
+ mergeNotes: error
3539
+ });
3540
+ completePendingOperation(issueId, error);
3326
3541
  return {
3327
3542
  success: false,
3328
- statusCode: 400,
3329
- error: "Workspace does not exist"
3543
+ statusCode: retryable ? 500 : 400,
3544
+ error,
3545
+ ...retryable ? { retryable: true } : {}
3330
3546
  };
3331
3547
  }
3332
- const projectConfig = findProjectByTeamSync(issuePrefix);
3333
- if (projectConfig?.workspace?.type === "polyrepo" && projectConfig?.workspace?.repos) {
3548
+ if (isPolyrepo && projectConfig?.workspace?.repos) {
3334
3549
  console.log(`[merge] Polyrepo detected for ${issueId}, coordinating merge set...`);
3335
- const { getMergeSetSync, ensureMergeSetForIssueSync, upsertMergeSetSync, withRepoStateSync } = await import("./merge-set-bUqbm3yc.js");
3336
- const { runQualityGates } = await import("./validation-CC9OPqJZ.js");
3337
- const { getForgeAdapter } = await import("./forge-DXnS_YFH.js");
3338
- const { messageAgent } = await import("./agents-wi9NWzs2.js");
3550
+ const { getMergeSetSync, ensureMergeSetForIssueSync, upsertMergeSetSync, withRepoStateSync } = await import("./merge-set-DzsOTBg5.js");
3551
+ const { runQualityGates } = await import("./validation-DEaTZafj.js");
3552
+ const { reconcileStrandedRepos } = await import("./merge-completeness-D0ljXbk3.js");
3553
+ const { getForgeAdapter } = await import("./forge-DK3blQb_.js");
3554
+ const { messageAgent } = await import("./agents-BKKkxKgK.js");
3339
3555
  let mergeSet = getMergeSetSync(issueId) || ensureMergeSetForIssueSync(issueId);
3340
3556
  if (!mergeSet) {
3341
3557
  const error = `No merge set found for ${issueId}`;
@@ -3351,21 +3567,59 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3351
3567
  error
3352
3568
  };
3353
3569
  }
3354
- const activeRepos = mergeSet.repos.filter((repo) => repo.mergeStatus !== "skipped" && !!repo.artifactUrl).sort((a, b) => a.mergeOrder - b.mergeOrder);
3355
- if (activeRepos.length === 0) {
3356
- const error = `No changed repos are marked ready for coordinated merge in ${issueId}`;
3570
+ const reconciliation = await reconcileStrandedRepos(mergeSet);
3571
+ mergeSet = reconciliation.mergeSet;
3572
+ if (reconciliation.blockers.length > 0) {
3573
+ const error = reconciliation.blockers.map((blocker) => blocker.reason).join("; ");
3574
+ mergeSet = {
3575
+ ...mergeSet,
3576
+ status: "failed",
3577
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3578
+ };
3579
+ upsertMergeSetSync(mergeSet);
3357
3580
  setReviewStatus(issueId, {
3358
3581
  mergeStatus: "failed",
3359
3582
  readyForMerge: false,
3360
- mergeNotes: error
3583
+ mergeNotes: error,
3584
+ blockerReasons: reconciliation.blockers.map((blocker) => ({
3585
+ type: "unmerged_sibling_repo",
3586
+ summary: blocker.reason,
3587
+ detectedAt: (/* @__PURE__ */ new Date()).toISOString()
3588
+ }))
3361
3589
  });
3362
3590
  completePendingOperation(issueId, error);
3363
3591
  return {
3364
3592
  success: false,
3365
- statusCode: 400,
3593
+ statusCode: 409,
3366
3594
  error
3367
3595
  };
3368
3596
  }
3597
+ const activeRepos = mergeSet.repos.filter((repo) => repo.mergeStatus !== "skipped" && repo.mergeStatus !== "merged" && !!repo.artifactUrl).sort((a, b) => a.mergeOrder - b.mergeOrder);
3598
+ if (activeRepos.length === 0) {
3599
+ mergeSet = {
3600
+ ...mergeSet,
3601
+ status: "merged",
3602
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3603
+ };
3604
+ upsertMergeSetSync(mergeSet);
3605
+ setReviewStatus(issueId, {
3606
+ mergeStatus: "merged",
3607
+ mergeNotes: void 0,
3608
+ readyForMerge: false,
3609
+ ...mergeCompletionStatus(request)
3610
+ });
3611
+ completePendingOperation(issueId, null);
3612
+ const { postMergeLifecycle } = await import("./merge-agent-DrXa1CpW.js");
3613
+ advanceQueue();
3614
+ await postMergeLifecycle(issueId, projectPath);
3615
+ return {
3616
+ success: true,
3617
+ statusCode: 200,
3618
+ message: `No changed repos remain for ${issueId}`,
3619
+ mergeStatus: "merged",
3620
+ repos: []
3621
+ };
3622
+ }
3369
3623
  const agentId = `agent-${issueId.toLowerCase()}`;
3370
3624
  mergeSet = {
3371
3625
  ...mergeSet,
@@ -3428,21 +3682,24 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3428
3682
  };
3429
3683
  }
3430
3684
  const reposNeedingRebase = activeRepos.filter((repo) => !alreadyRebased.has(repo.repoKey));
3431
- if (reposNeedingRebase.length > 0 && !await Effect.runPromise(sessionExists(agentId))) {
3432
- const error = `Work agent ${agentId} is not running. Polyrepo merge requires the work agent to rebase every affected repo and push.`;
3433
- setReviewStatus(issueId, {
3434
- mergeStatus: "failed",
3435
- readyForMerge: false,
3436
- mergeNotes: error
3685
+ if (reposNeedingRebase.length > 0) {
3686
+ const prep = await prepareWorkAgentForRebase({
3687
+ issueId,
3688
+ workspacePath,
3689
+ agentId,
3690
+ rebaseMsg: `MERGE REQUESTED: The human has clicked MERGE for ${issueId}. Rebase and push every affected repo in this merge set:\n\n${reposNeedingRebase.map((repo, index) => `${index + 1}. cd ${repo.repoKey}\n git fetch origin ${repo.targetBranch}\n git rebase origin/${repo.targetBranch}\n git push --force-with-lease`).join("\n")}\n\nResolve any conflicts in the workspaces above, complete every rebase, and push all affected branches. Do NOT merge PRs/MRs yourself.`,
3691
+ scopeNote: `${reposNeedingRebase.length} repo(s)`,
3692
+ setStatus: (u) => setReviewStatus(issueId, u)
3437
3693
  });
3438
- completePendingOperation(issueId, error);
3439
- return {
3440
- success: false,
3441
- statusCode: 400,
3442
- error
3443
- };
3694
+ if (!prep.ok) {
3695
+ completePendingOperation(issueId, prep.error);
3696
+ return {
3697
+ success: false,
3698
+ statusCode: 400,
3699
+ error: prep.error
3700
+ };
3701
+ }
3444
3702
  }
3445
- if (reposNeedingRebase.length > 0) await messageAgent(agentId, `MERGE REQUESTED: The human has clicked MERGE for ${issueId}. Rebase and push every affected repo in this merge set:\n\n${reposNeedingRebase.map((repo, index) => `${index + 1}. cd ${repo.repoKey}\n git fetch origin ${repo.targetBranch}\n git rebase origin/${repo.targetBranch}\n git push --force-with-lease`).join("\n")}\n\nResolve any conflicts in the workspaces above, complete every rebase, and push all affected branches. Do NOT merge PRs/MRs yourself.`);
3446
3703
  const REBASE_TIMEOUT_MS = 1800 * 1e3;
3447
3704
  const POLL_INTERVAL_MS = 5e3;
3448
3705
  const pushedRepos = new Set(alreadyRebased);
@@ -3606,7 +3863,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3606
3863
  ...mergeCompletionStatus(request)
3607
3864
  });
3608
3865
  completePendingOperation(issueId, null);
3609
- const { postMergeLifecycle } = await import("./merge-agent-CKkgIBPB.js");
3866
+ const { postMergeLifecycle } = await import("./merge-agent-DrXa1CpW.js");
3610
3867
  advanceQueue();
3611
3868
  await postMergeLifecycle(issueId, projectPath);
3612
3869
  return {
@@ -3617,8 +3874,8 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3617
3874
  repos: mergeResults
3618
3875
  };
3619
3876
  }
3620
- const { getMergeSetSync, ensureMergeSetForIssueSync } = await import("./merge-set-bUqbm3yc.js");
3621
- const { getForgeAdapter } = await import("./forge-DXnS_YFH.js");
3877
+ const { getMergeSetSync, ensureMergeSetForIssueSync } = await import("./merge-set-DzsOTBg5.js");
3878
+ const { getForgeAdapter } = await import("./forge-DK3blQb_.js");
3622
3879
  const primaryRepo = (getMergeSetSync(issueId) || ensureMergeSetForIssueSync(issueId))?.repos[0];
3623
3880
  const targetBranch = primaryRepo?.targetBranch || "main";
3624
3881
  const primaryForge = primaryRepo?.forge || "github";
@@ -3659,10 +3916,12 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3659
3916
  error
3660
3917
  };
3661
3918
  }
3919
+ let preMergePrState;
3662
3920
  if (githubPrRef) try {
3663
- const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-ClZ2lk8D.js");
3921
+ const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-DtAsvwzK.js");
3664
3922
  if (isGitHubAppConfigured()) {
3665
3923
  const prState = await Effect.runPromise(getPullRequestState(githubPrRef.owner, githubPrRef.repo, githubPrRef.number));
3924
+ preMergePrState = prState;
3666
3925
  if (prState.state !== "OPEN" && !prState.merged) {
3667
3926
  const error = `PR #${githubPrRef.number} is ${prState.state} (not OPEN). Overdeck state is out of sync — likely a cancel-flow left a stale prUrl. Re-open the work agent to create a fresh PR, or reset review state.`;
3668
3927
  console.error(`[merge] ${error}`);
@@ -3722,7 +3981,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3722
3981
  ...mergeCompletionStatus(request)
3723
3982
  });
3724
3983
  completePendingOperation(issueId, null);
3725
- const { postMergeLifecycle } = await import("./merge-agent-CKkgIBPB.js");
3984
+ const { postMergeLifecycle } = await import("./merge-agent-DrXa1CpW.js");
3726
3985
  await postMergeLifecycle(issueId, projectPath, branchName);
3727
3986
  return {
3728
3987
  success: true,
@@ -3736,83 +3995,56 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3736
3995
  } catch (prStateErr) {
3737
3996
  console.warn(`[merge] Pre-merge PR state check failed for ${issueId}: ${prStateErr.message} — proceeding (check is best-effort)`);
3738
3997
  }
3739
- const { postMergeLifecycle } = await import("./merge-agent-CKkgIBPB.js");
3740
- const agentId = request.kind === "strike" ? request.recoveryTarget : `agent-${issueId.toLowerCase()}`;
3741
- const rebaseMsg = request.kind === "strike" ? `STRIKE LANDING REQUEST: Rebase ${branchName} onto ${targetBranch}, resolve conflicts, run the full quality gates, push ${branchName}, then run pan strike-ready ${issueId} to persist the new HEAD. Do NOT merge or push main.` : `MERGE REQUESTED: The human has clicked MERGE for ${issueId}. Please rebase onto ${targetBranch} and push:\n\n1. git fetch origin ${targetBranch}\n2. git rebase origin/${targetBranch}\n3. If conflicts: resolve them, git add, git rebase --continue\n4. git push --force-with-lease\n\nAfter pushing, the server will handle verification and merge automatically. Do NOT run gh pr merge yourself.`;
3742
- setReviewStatus(issueId, { mergeStep: "rebasing" });
3743
- console.log(`[merge] Rebasing ${branchName} onto ${targetBranch} for ${issueId} (agent=${await Effect.runPromise(sessionExists(agentId)) ? "running" : "stopped"})...`);
3744
- {
3745
- const { beginShipLog, appendShipLog } = await import("./ship-log-D9MlVzYU.js");
3746
- beginShipLog(issueId);
3747
- appendShipLog(issueId, `Ship started: rebasing ${branchName} onto ${targetBranch}…`, "rebasing");
3748
- }
3998
+ const { postMergeLifecycle } = await import("./merge-agent-DrXa1CpW.js");
3999
+ const { beginShipLog, appendShipLog } = await import("./ship-log-xplJ8t75.js");
3749
4000
  let rebaseResult;
3750
- const { alreadyRebased, currentHead } = await isBranchAlreadyRebased(workspacePath, branchName, targetBranch);
3751
- if (alreadyRebased && currentHead) {
3752
- console.log(`[merge] ${branchName} already contains origin/${targetBranch} — skipping rebase request for ${issueId}`);
4001
+ if (preMergePrState?.mergeable === true && preMergePrState.mergeableState === "clean" && !preMergePrState.checksFailed && !preMergePrState.checksPending && !preMergePrState.draft && !preMergePrState.merged) {
4002
+ console.log(`[merge] PR is CLEAN — merging directly without rebase for ${issueId}`);
3753
4003
  rebaseResult = {
3754
4004
  success: true,
3755
- newHead: currentHead
4005
+ newHead: preMergePrState.headSha
3756
4006
  };
3757
- } else try {
3758
- const recovery = await ensureAgentReadyForMerge(issueId, workspacePath, rebaseMsg, {
4007
+ } else {
4008
+ const agentId = request.kind === "strike" ? request.recoveryTarget : `agent-${issueId.toLowerCase()}`;
4009
+ const rebaseMsg = request.kind === "strike" ? `STRIKE LANDING REQUEST: Rebase ${branchName} onto ${targetBranch}, resolve conflicts, run the full quality gates, push ${branchName}, then run pan strike-ready ${issueId} to persist the new HEAD. Do NOT merge or push main.` : `MERGE REQUESTED: The human has clicked MERGE for ${issueId}. Please rebase onto ${targetBranch} and push:\n\n1. git fetch origin ${targetBranch}\n2. git rebase origin/${targetBranch}\n3. If conflicts: resolve them, git add, git rebase --continue\n4. git push --force-with-lease\n\nAfter pushing, the server will handle verification and merge automatically. Do NOT run gh pr merge yourself.`;
4010
+ setReviewStatus(issueId, { mergeStep: "rebasing" });
4011
+ console.log(`[merge] Rebasing ${branchName} onto ${targetBranch} for ${issueId} (agent=${await Effect.runPromise(sessionExists(agentId)) ? "running" : "stopped"})...`);
4012
+ beginShipLog(issueId);
4013
+ appendShipLog(issueId, `Ship started: rebasing ${branchName} onto ${targetBranch}…`, "rebasing");
4014
+ const { alreadyRebased, currentHead } = await isBranchAlreadyRebased(workspacePath, branchName, targetBranch);
4015
+ if (alreadyRebased && currentHead) {
4016
+ console.log(`[merge] ${branchName} already contains origin/${targetBranch} — skipping rebase request for ${issueId}`);
4017
+ rebaseResult = {
4018
+ success: true,
4019
+ newHead: currentHead
4020
+ };
4021
+ } else rebaseResult = await rebaseWithAgentFallback({
4022
+ issueId,
4023
+ workspacePath,
4024
+ branchName,
4025
+ targetBranch,
3759
4026
  agentId,
3760
- allowFreshStart: request.kind !== "strike"
4027
+ rebaseMsg,
4028
+ allowFreshStart: request.kind !== "strike",
4029
+ setStatus: (update) => setReviewStatus(issueId, update)
3761
4030
  });
3762
- console.log(`[merge] ${recovery.detail}`);
3763
- const { stdout: headBefore } = await execAsync$5(`git rev-parse origin/${branchName} 2>/dev/null || echo NONE`, {
3764
- cwd: workspacePath,
3765
- encoding: "utf-8",
3766
- timeout: 1e4
3767
- });
3768
- const REBASE_TIMEOUT_MS = 1800 * 1e3;
3769
- const POLL_INTERVAL_MS = 5e3;
3770
- const startTime = Date.now();
3771
- let newHead = null;
3772
- while (Date.now() - startTime < REBASE_TIMEOUT_MS) {
3773
- await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));
3774
- try {
3775
- await execAsync$5("git fetch origin", {
3776
- cwd: workspacePath,
3777
- encoding: "utf-8",
3778
- timeout: 15e3
3779
- });
3780
- const { stdout: headNow } = await execAsync$5(`git rev-parse origin/${branchName}`, {
3781
- cwd: workspacePath,
3782
- encoding: "utf-8",
3783
- timeout: 5e3
3784
- });
3785
- if (headNow.trim() !== headBefore.trim()) {
3786
- newHead = headNow.trim();
3787
- console.log(`[merge] Work agent pushed rebased branch for ${issueId} (new HEAD: ${newHead.slice(0, 8)})`);
3788
- break;
3789
- }
3790
- } catch {}
3791
- if (!await Effect.runPromise(sessionExists(agentId))) {
3792
- console.log(`[merge] Work agent ${agentId} stopped during rebase`);
3793
- break;
3794
- }
3795
- }
3796
- if (newHead) rebaseResult = {
3797
- success: true,
3798
- newHead
3799
- };
3800
- else if (!await Effect.runPromise(sessionExists(agentId))) rebaseResult = {
3801
- success: false,
3802
- reason: `Work agent ${agentId} stopped before completing the rebase onto ${targetBranch}`
3803
- };
3804
- else rebaseResult = {
3805
- success: false,
3806
- reason: `Work agent did not push the rebased branch within ${REBASE_TIMEOUT_MS / 6e4} minutes`
3807
- };
3808
- } catch (recoveryErr) {
3809
- rebaseResult = {
3810
- success: false,
3811
- reason: recoveryErr.message || `Work agent ${agentId} could not be prepared for merge`
3812
- };
3813
4031
  }
4032
+ if (!rebaseResult) throw new Error(`Rebase escalation produced no result for ${issueId}`);
3814
4033
  if (!rebaseResult.success) {
3815
4034
  const error = rebaseResult.reason || "Rebase failed";
4035
+ if (rebaseResult.retryable) {
4036
+ setReviewStatus(issueId, {
4037
+ mergeStatus: "queued",
4038
+ mergeNotes: error
4039
+ });
4040
+ completePendingOperation(issueId, error);
4041
+ return {
4042
+ success: false,
4043
+ statusCode: 500,
4044
+ error,
4045
+ retryable: true
4046
+ };
4047
+ }
3816
4048
  setReviewStatus(issueId, {
3817
4049
  mergeStatus: "failed",
3818
4050
  mergeNotes: error,
@@ -3873,7 +4105,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3873
4105
  });
3874
4106
  let skipLocalVerification = false;
3875
4107
  if (primaryForge === "github" && artifactUrl) try {
3876
- const { parsePullRequestRef, getCiCheckRunsStatePromise, isGitHubAppConfigured } = await import("./github-app-ClZ2lk8D.js");
4108
+ const { parsePullRequestRef, getCiCheckRunsStatePromise, isGitHubAppConfigured } = await import("./github-app-DtAsvwzK.js");
3877
4109
  if (isGitHubAppConfigured()) {
3878
4110
  const ref = parsePullRequestRef({ url: artifactUrl });
3879
4111
  if (ref) {
@@ -3894,17 +4126,27 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3894
4126
  } catch (ciErr) {
3895
4127
  console.warn(`[merge] CI-state check failed (${ciErr.message?.slice(0, 120)}) — falling back to local verification for ${issueId}`);
3896
4128
  }
3897
- const { appendShipLog } = await import("./ship-log-D9MlVzYU.js");
3898
4129
  if (skipLocalVerification) appendShipLog(issueId, "✓ Local verification skipped — CI already green on this exact commit", "verifying");
3899
4130
  const verifyResult = skipLocalVerification ? { outcome: "passed" } : await (async () => {
3900
4131
  console.log(`[merge] Running post-rebase verification for ${issueId}...`);
3901
4132
  appendShipLog(issueId, "Running post-rebase verification (full quality-gate suite)…", "verifying");
3902
- const { runVerificationForIssue } = await import("./verification-runner-BW4HOKAz.js");
4133
+ const { runVerificationForIssue } = await import("./verification-runner-DlZI8yhw.js");
3903
4134
  return Effect.runPromise(runVerificationForIssue(issueId, workspacePath, { isRemote: false }, "merge-verify", {
3904
4135
  ...mergeVerificationOptions(request),
3905
4136
  onGateLog: (line) => appendShipLog(issueId, line, "verifying")
3906
4137
  }));
3907
4138
  })();
4139
+ const verificationDeferral = handlePostRebaseVerificationDeferral(issueId, verifyResult, reviewStatus, {
4140
+ appendShipLog,
4141
+ setReviewStatus,
4142
+ completePendingOperation
4143
+ });
4144
+ if (verificationDeferral) {
4145
+ markMergeProcessing(projectKey, normalizedId, false);
4146
+ _serverManagedMerges.delete(normalizedMergeId);
4147
+ preserveQueue = true;
4148
+ return verificationDeferral;
4149
+ }
3908
4150
  if (verifyResult.outcome === "failed") {
3909
4151
  const error = `Post-rebase verification failed at ${verifyResult.failedCheck}`;
3910
4152
  console.log(`[merge] ${error}`);
@@ -3930,9 +4172,10 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3930
4172
  };
3931
4173
  }
3932
4174
  console.log(`[merge] Post-rebase verification ${verifyResult.outcome} for ${issueId}`);
4175
+ if (skipLocalVerification) await recordCiGreenVerificationVerdict(issueId, workspacePath);
3933
4176
  setReviewStatus(issueId, { mergeStep: "reporting-statuses" });
3934
4177
  try {
3935
- const { getPullRequestState, isGitHubAppConfigured, reportCommitStatus } = await import("./github-app-ClZ2lk8D.js");
4178
+ const { getPullRequestState, isGitHubAppConfigured, reportCommitStatus } = await import("./github-app-DtAsvwzK.js");
3936
4179
  if (githubPrRef && isGitHubAppConfigured()) {
3937
4180
  const sha = (await Effect.runPromise(getPullRequestState(githubPrRef.owner, githubPrRef.repo, githubPrRef.number))).headSha.trim();
3938
4181
  if (sha) {
@@ -3960,7 +4203,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
3960
4203
  } catch (prMergeErr) {
3961
4204
  console.error(`[merge] Review artifact merge threw for ${issueId}:`, prMergeErr);
3962
4205
  try {
3963
- const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-ClZ2lk8D.js");
4206
+ const { getPullRequestState, isGitHubAppConfigured } = await import("./github-app-DtAsvwzK.js");
3964
4207
  if (githubPrRef && isGitHubAppConfigured()) {
3965
4208
  artifactMerged = (await Effect.runPromise(getPullRequestState(githubPrRef.owner, githubPrRef.repo, githubPrRef.number))).merged;
3966
4209
  if (artifactMerged) console.log(`[merge] Race-detected: PR #${githubPrRef.number} for ${issueId} was already merged despite thrown error; proceeding`);
@@ -4055,7 +4298,7 @@ async function triggerMerge(issueId, request = { kind: "normal" }) {
4055
4298
  error: error.message
4056
4299
  };
4057
4300
  } finally {
4058
- advanceQueue();
4301
+ if (!preserveQueue) advanceQueue();
4059
4302
  }
4060
4303
  }
4061
4304
  setMergeQueueTriggerHandler(triggerMerge);
@@ -4079,8 +4322,8 @@ const postForgeApproveRoute = HttpRouter.add("POST", "/api/issues/:issueId/forge
4079
4322
  if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
4080
4323
  if (!/^[A-Z]+-\d+$/i.test(issueId)) return jsonResponse({ error: "Invalid issue ID format" }, { status: 400 });
4081
4324
  return yield* Effect.promise(async () => {
4082
- const { getMergeSetSync, upsertMergeSetSync, withRepoArtifactUrlSync, withRepoStateSync } = await import("./merge-set-bUqbm3yc.js");
4083
- const { getForgeAdapter } = await import("./forge-DXnS_YFH.js");
4325
+ const { getMergeSetSync, upsertMergeSetSync, withRepoArtifactUrlSync, withRepoStateSync } = await import("./merge-set-DzsOTBg5.js");
4326
+ const { getForgeAdapter } = await import("./forge-DK3blQb_.js");
4084
4327
  let mergeSet = getMergeSetSync(issueId);
4085
4328
  if (!mergeSet) return jsonResponse({ error: `No merge set found for ${issueId}` }, { status: 404 });
4086
4329
  const results = [];
@@ -4141,7 +4384,7 @@ const postForgeApproveRoute = HttpRouter.add("POST", "/api/issues/:issueId/forge
4141
4384
  }
4142
4385
  }
4143
4386
  if (results.filter((r) => r.approved).length > 0) {
4144
- const { emitActivityEntrySync, emitActivityTtsSync } = await import("./activity-logger-OEUBdfZ8.js");
4387
+ const { emitActivityEntrySync, emitActivityTtsSync } = await import("./activity-logger-CMthG6Vd.js");
4145
4388
  emitActivityEntrySync({
4146
4389
  source: "dashboard",
4147
4390
  level: "success",
@@ -4168,8 +4411,9 @@ const postForgeMergeRoute = HttpRouter.add("POST", "/api/issues/:issueId/forge-m
4168
4411
  if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
4169
4412
  if (!/^[A-Z]+-\d+$/i.test(issueId)) return jsonResponse({ error: "Invalid issue ID format" }, { status: 400 });
4170
4413
  return yield* Effect.promise(async () => {
4171
- const { getMergeSetSync, upsertMergeSetSync, withRepoArtifactUrlSync, withRepoStateSync } = await import("./merge-set-bUqbm3yc.js");
4172
- const { getForgeAdapter } = await import("./forge-DXnS_YFH.js");
4414
+ const { getMergeSetSync, upsertMergeSetSync, withRepoArtifactUrlSync, withRepoStateSync } = await import("./merge-set-DzsOTBg5.js");
4415
+ const { getForgeAdapter } = await import("./forge-DK3blQb_.js");
4416
+ const { assessRepoMergeCompleteness } = await import("./merge-completeness-D0ljXbk3.js");
4173
4417
  let mergeSet = getMergeSetSync(issueId);
4174
4418
  if (!mergeSet) return jsonResponse({ error: `No merge set found for ${issueId}` }, { status: 404 });
4175
4419
  const results = [];
@@ -4185,34 +4429,44 @@ const postForgeMergeRoute = HttpRouter.add("POST", "/api/issues/:issueId/forge-m
4185
4429
  const workspacePath = mergeSet.workspaceType === "polyrepo" ? join(mergeSet.projectPath, "workspaces", `feature-${issueId.toLowerCase()}`, repo.repoKey) : join(mergeSet.projectPath, "workspaces", `feature-${issueId.toLowerCase()}`);
4186
4430
  let artifactUrl = repo.artifactUrl;
4187
4431
  let artifactId = repo.artifactId;
4188
- if (!artifactUrl && !artifactId) try {
4189
- const discovered = await adapter.discoverArtifact({
4190
- sourceBranch: repo.sourceBranch,
4191
- cwd: existsSync$1(workspacePath) ? workspacePath : repo.repoPath
4192
- });
4193
- if (discovered?.url || discovered?.id) {
4194
- artifactUrl = discovered.url;
4195
- artifactId = discovered.id;
4432
+ if (!artifactUrl && !artifactId) {
4433
+ try {
4434
+ const discovered = await adapter.discoverArtifact({
4435
+ sourceBranch: repo.sourceBranch,
4436
+ cwd: existsSync$1(workspacePath) ? workspacePath : repo.repoPath
4437
+ });
4438
+ artifactUrl = discovered?.url;
4439
+ artifactId = discovered?.id;
4440
+ } catch {}
4441
+ if (artifactUrl || artifactId) {
4196
4442
  mergeSet = withRepoArtifactUrlSync(mergeSet, repo.repoKey, artifactUrl ?? "", artifactId);
4197
4443
  upsertMergeSetSync(mergeSet);
4198
4444
  console.log(`[forge-merge] Discovered artifact for ${issueId}/${repo.repoKey}: ${artifactUrl}`);
4199
4445
  } else {
4200
- mergeSet = withRepoStateSync(mergeSet, repo.repoKey, { mergeStatus: "skipped" });
4446
+ const classification = await assessRepoMergeCompleteness(repo);
4447
+ if (classification.state === "merged") {
4448
+ mergeSet = withRepoStateSync(mergeSet, repo.repoKey, { mergeStatus: "merged" });
4449
+ results.push({
4450
+ repoKey: repo.repoKey,
4451
+ merged: true
4452
+ });
4453
+ } else if (classification.state === "no-changes") {
4454
+ mergeSet = withRepoStateSync(mergeSet, repo.repoKey, { mergeStatus: "skipped" });
4455
+ results.push({
4456
+ repoKey: repo.repoKey,
4457
+ merged: true
4458
+ });
4459
+ } else {
4460
+ mergeSet = withRepoStateSync(mergeSet, repo.repoKey, { mergeStatus: "blocked" });
4461
+ results.push({
4462
+ repoKey: repo.repoKey,
4463
+ merged: false,
4464
+ error: classification.reason
4465
+ });
4466
+ }
4201
4467
  upsertMergeSetSync(mergeSet);
4202
- results.push({
4203
- repoKey: repo.repoKey,
4204
- merged: true
4205
- });
4206
4468
  continue;
4207
4469
  }
4208
- } catch {
4209
- mergeSet = withRepoStateSync(mergeSet, repo.repoKey, { mergeStatus: "skipped" });
4210
- upsertMergeSetSync(mergeSet);
4211
- results.push({
4212
- repoKey: repo.repoKey,
4213
- merged: true
4214
- });
4215
- continue;
4216
4470
  }
4217
4471
  try {
4218
4472
  await adapter.mergeReviewArtifact({
@@ -4237,7 +4491,7 @@ const postForgeMergeRoute = HttpRouter.add("POST", "/api/issues/:issueId/forge-m
4237
4491
  }
4238
4492
  }
4239
4493
  if (results.filter((r) => r.merged).length > 0) {
4240
- const { emitActivityEntrySync, emitActivityTtsSync } = await import("./activity-logger-OEUBdfZ8.js");
4494
+ const { emitActivityEntrySync, emitActivityTtsSync } = await import("./activity-logger-CMthG6Vd.js");
4241
4495
  emitActivityEntrySync({
4242
4496
  source: "dashboard",
4243
4497
  level: "success",
@@ -4362,7 +4616,7 @@ const postWorkspaceApproveRoute = HttpRouter.add("POST", "/api/issues/:issueId/a
4362
4616
  console.log(`[approve] Starting role pipeline for ${issueId}...`);
4363
4617
  let reviewResult;
4364
4618
  try {
4365
- const { spawnReviewRoleForIssue } = await import("./review-agent-DNboMyW4.js");
4619
+ const { spawnReviewRoleForIssue } = await import("./review-agent-CD4RCI0Y.js");
4366
4620
  reviewResult = await Effect.runPromise(spawnReviewRoleForIssue({
4367
4621
  issueId,
4368
4622
  workspace: workspacePath,
@@ -4409,7 +4663,7 @@ const postWorkspaceApproveRoute = HttpRouter.add("POST", "/api/issues/:issueId/a
4409
4663
  }
4410
4664
  console.log(`[approve] Step 3/3: Running server-side rebase for ${issueId}...`);
4411
4665
  try {
4412
- const { rebaseFeatureBranch } = await import("./merge-rebase-BfaTyXsw.js");
4666
+ const { rebaseFeatureBranch } = await import("./merge-rebase-DGQpYJU3.js");
4413
4667
  const workspacePathForRebase = join(projectPath, "workspaces", `feature-${issueId.toLowerCase()}`);
4414
4668
  const rebaseResult = await Effect.runPromise(rebaseFeatureBranch(workspacePathForRebase, branchName, "main", issueId));
4415
4669
  if (!rebaseResult.success) {
@@ -4429,7 +4683,7 @@ const postWorkspaceApproveRoute = HttpRouter.add("POST", "/api/issues/:issueId/a
4429
4683
  completePendingOperation(issueId, pushResult.error);
4430
4684
  return jsonResponse({ error: pushResult.error }, { status: pushResult.httpStatus });
4431
4685
  }
4432
- const { approve: lifecycleApprove } = await import("./lifecycle-xmBfK2GJ.js");
4686
+ const { approve: lifecycleApprove } = await import("./lifecycle-DDN8ApVY.js");
4433
4687
  const ghResolved = resolveGitHubIssueSync(issueId);
4434
4688
  const isGitHubIssueFlag = ghResolved.isGitHub;
4435
4689
  const lifecycleCtx = {
@@ -4463,7 +4717,7 @@ const getMergeQueueRoute = HttpRouter.add("GET", "/api/merge-queue", httpHandler
4463
4717
  })));
4464
4718
  const postInternalPipelineNotifyRoute = HttpRouter.add("POST", "/api/internal/pipeline/notify", httpHandler(Effect.gen(function* () {
4465
4719
  const request = yield* HttpServerRequest.HttpServerRequest;
4466
- const { INTERNAL_TOKEN_HEADER, getInternalTokenSync } = yield* Effect.promise(() => import("./internal-token-BrcU6qfe.js"));
4720
+ const { INTERNAL_TOKEN_HEADER, getInternalTokenSync } = yield* Effect.promise(() => import("./internal-token-M9omeXM1.js"));
4467
4721
  const expected = getInternalTokenSync();
4468
4722
  if (!expected) return jsonResponse({
4469
4723
  ok: false,
@@ -4477,7 +4731,7 @@ const postInternalPipelineNotifyRoute = HttpRouter.add("POST", "/api/internal/pi
4477
4731
  }, 403);
4478
4732
  const event = yield* readJsonBody;
4479
4733
  const type = event.type;
4480
- const { notifyPipelineSync } = yield* Effect.promise(() => import("./pipeline-notifier-BJr8gQX6.js"));
4734
+ const { notifyPipelineSync } = yield* Effect.promise(() => import("./pipeline-notifier-ImNXknf0.js"));
4481
4735
  switch (type) {
4482
4736
  case "status_changed": {
4483
4737
  const issueId = event.issueId;
@@ -4645,7 +4899,7 @@ init_types$1();
4645
4899
  init_review_context();
4646
4900
  init_tldr_daemon();
4647
4901
  const execAsync$4 = promisify(exec);
4648
- const execFileAsync$2 = promisify(execFile);
4902
+ const execFileAsync$3 = promisify(execFile);
4649
4903
  function getWorkspaceLocation(issueId) {
4650
4904
  try {
4651
4905
  const meta = loadWorkspaceMetadataSync(issueId);
@@ -4704,7 +4958,7 @@ async function getRepoGitStatusAsync(workspacePath) {
4704
4958
  }
4705
4959
  async function getMrUrlAsync(issueId, workspacePath) {
4706
4960
  try {
4707
- const { stdout } = await execFileAsync$2("gh", [
4961
+ const { stdout } = await execFileAsync$3("gh", [
4708
4962
  "pr",
4709
4963
  "view",
4710
4964
  `feature/${issueId.toLowerCase()}`,
@@ -5252,7 +5506,7 @@ const patchWorkspaceTieredExecutionRoute = HttpRouter.add("PATCH", "/api/workspa
5252
5506
  if (override !== "on" && override !== "off" && override !== null && override !== void 0) return jsonResponse({ error: "Invalid tiered-execution override" }, { status: 400 });
5253
5507
  const project = getProjectSync(extractPrefixSync(issueId) ?? issueId.split("-")[0]);
5254
5508
  if (!project) return jsonResponse({ error: "Project not found" }, { status: 404 });
5255
- yield* Effect.promise(() => import("./record-CN0pj4_5.js").then((m) => m.writeRecordTieredExecutionOverride(project, issueId, override)));
5509
+ yield* Effect.promise(() => import("./record-CtroO946.js").then((m) => m.writeRecordTieredExecutionOverride(project, issueId, override)));
5256
5510
  const projectPath = project.path;
5257
5511
  const location = yield* resolvePlanLocation(projectPath, issueId);
5258
5512
  if (!location) return jsonResponse({ error: "No xBRIEF plan found for this workspace" }, { status: 404 });
@@ -5540,6 +5794,48 @@ const postWorkspaceCleanRoute = HttpRouter.add("POST", "/api/workspaces/:issueId
5540
5794
  })));
5541
5795
  const stashCleanRouteLayer = Layer.mergeAll(getWorkspaceStashesRoute, postWorkspaceRecoverStashRoute, deleteWorkspaceStashRoute, getWorkspaceCleanPreviewRoute, postWorkspaceCleanRoute);
5542
5796
  //#endregion
5797
+ //#region ../../lib/cloister/review-branch-push.ts
5798
+ init_project_repos();
5799
+ const execFileAsync$2 = promisify(execFile);
5800
+ const REVIEW_PUSH_TIMEOUT_MS = 3e4;
5801
+ async function runReviewGit(args, options) {
5802
+ await execFileAsync$2("git", args, options);
5803
+ }
5804
+ function reviewGitOptions(cwd) {
5805
+ return {
5806
+ cwd,
5807
+ timeout: REVIEW_PUSH_TIMEOUT_MS,
5808
+ killSignal: "SIGKILL",
5809
+ env: {
5810
+ ...process.env,
5811
+ GIT_TERMINAL_PROMPT: "0",
5812
+ GIT_ASKPASS: "true",
5813
+ SSH_ASKPASS: "true"
5814
+ }
5815
+ };
5816
+ }
5817
+ async function pushLocalReviewBranches(issueId, workspacePath, dependencies = {}) {
5818
+ const roots = (dependencies.resolveRoots ?? resolveWorkspaceRepoRootsSync)(issueId, workspacePath);
5819
+ const runGit = dependencies.runGit ?? runReviewGit;
5820
+ for (const root of roots) {
5821
+ try {
5822
+ await runGit([
5823
+ "rev-parse",
5824
+ "--verify",
5825
+ "--quiet",
5826
+ `refs/heads/${root.sourceBranch}`
5827
+ ], reviewGitOptions(root.dir));
5828
+ } catch {
5829
+ continue;
5830
+ }
5831
+ await runGit([
5832
+ "push",
5833
+ "origin",
5834
+ root.sourceBranch
5835
+ ], reviewGitOptions(root.dir));
5836
+ }
5837
+ }
5838
+ //#endregion
5543
5839
  //#region ../../lib/cloister/request-review-pipeline.ts
5544
5840
  init_in_flight_guard();
5545
5841
  /**
@@ -5560,6 +5856,10 @@ function createRequestReviewPipeline() {
5560
5856
  await deps.onVerificationError(outcome);
5561
5857
  return;
5562
5858
  }
5859
+ if (outcome.outcome === "deferred") {
5860
+ await deps.onVerificationDeferred?.(outcome);
5861
+ return;
5862
+ }
5563
5863
  await deps.pushBranch();
5564
5864
  await deps.dispatchReview();
5565
5865
  }, deps.onError);
@@ -5569,6 +5869,92 @@ function createRequestReviewPipeline() {
5569
5869
  }
5570
5870
  };
5571
5871
  }
5872
+ /** Shared host-side pipeline so HTTP requests and durable intent recovery coalesce. */
5873
+ const requestReviewPipeline = createRequestReviewPipeline();
5874
+ //#endregion
5875
+ //#region services/durable-review-pipeline.ts
5876
+ init_durable_review_pipeline();
5877
+ init_projects();
5878
+ async function startDashboardDurableReviewPipeline(input, dependencies) {
5879
+ const { issueId, prUrl, setReviewPending, dispatchReview } = input;
5880
+ const resolved = dependencies.resolveWorkspace(issueId);
5881
+ if (!resolved) return false;
5882
+ const { workspacePath, workspaceInfo, branchName } = resolved;
5883
+ return requestReviewPipeline.start(issueId, {
5884
+ verify: () => dependencies.verify ? dependencies.verify(issueId, workspacePath, workspaceInfo) : Effect.runPromise(runVerificationForIssue(issueId, workspacePath, workspaceInfo, "durable-review")),
5885
+ onVerificationFailed: (outcome) => {
5886
+ setReviewPending({
5887
+ reviewStatus: "pending",
5888
+ reviewNotes: `Verification failed at ${outcome.failedCheck} — fix and resubmit`
5889
+ });
5890
+ },
5891
+ onVerificationError: (outcome) => {
5892
+ setReviewPending({
5893
+ reviewStatus: "pending",
5894
+ reviewNotes: `Verification infrastructure error: ${outcome.message}`
5895
+ });
5896
+ },
5897
+ onVerificationDeferred: (outcome) => {
5898
+ setReviewPending({
5899
+ reviewStatus: "pending",
5900
+ reviewNotes: outcome.reason
5901
+ });
5902
+ console.log(`[review-status] durable review verification deferred for ${issueId}: ${outcome.reason}`);
5903
+ },
5904
+ pushBranch: () => dependencies.pushBranch(resolved),
5905
+ dispatchReview: async () => {
5906
+ const result = await dispatchReview({
5907
+ issueId,
5908
+ workspace: workspacePath,
5909
+ branch: branchName,
5910
+ ...prUrl ? { prUrl } : {}
5911
+ });
5912
+ if (!result.success) {
5913
+ setReviewPending({
5914
+ reviewStatus: "pending",
5915
+ reviewNotes: result.error || result.message || "Failed to dispatch review"
5916
+ });
5917
+ return;
5918
+ }
5919
+ const message = result.message?.startsWith("Review already in progress") ? "already in progress — no-op" : "auto-dispatched from durable journal intent";
5920
+ console.log(`[review-status] review dispatch for ${issueId}: ${message} (host-side)`);
5921
+ },
5922
+ onError: (error) => {
5923
+ const detail = error instanceof Error ? error.message : String(error);
5924
+ setReviewPending({
5925
+ reviewStatus: "pending",
5926
+ reviewNotes: `Review pipeline error: ${detail}`
5927
+ });
5928
+ console.warn(`[review-status] host-side durable review pipeline for ${issueId} failed (non-fatal): ${detail}`);
5929
+ }
5930
+ });
5931
+ }
5932
+ async function pushDashboardReviewBranch(workspace, dependencies) {
5933
+ if (workspace.workspaceInfo.isRemote && workspace.workspaceInfo.vmName) {
5934
+ await dependencies.pushRemote(workspace.workspaceInfo.vmName, workspace.workspacePath, workspace.branchName);
5935
+ return;
5936
+ }
5937
+ await pushLocalReviewBranches(workspace.issueId, workspace.workspacePath);
5938
+ }
5939
+ function registerDashboardDurableReviewPipeline(dependencies) {
5940
+ registerDurableReviewPipelineHandler((input) => startDashboardDurableReviewPipeline(input, {
5941
+ resolveWorkspace: (issueId) => {
5942
+ const workspaceInfo = dependencies.getWorkspaceInfo(issueId);
5943
+ if (!workspaceInfo.exists) return null;
5944
+ const resolved = resolveProjectFromIssueSync(issueId);
5945
+ if (!resolved) return null;
5946
+ const workspacePath = workspaceInfo.isRemote ? workspaceInfo.remotePath : workspaceInfo.localPath || join(resolved.projectPath, "workspaces", `feature-${issueId.toLowerCase()}`);
5947
+ if (!workspacePath) return null;
5948
+ return {
5949
+ issueId,
5950
+ workspacePath,
5951
+ workspaceInfo,
5952
+ branchName: `feature/${issueId.toLowerCase()}`
5953
+ };
5954
+ },
5955
+ pushBranch: (workspace) => pushDashboardReviewBranch(workspace, dependencies)
5956
+ }));
5957
+ }
5572
5958
  //#endregion
5573
5959
  //#region routes/workspaces/review-pipeline.ts
5574
5960
  /**
@@ -5596,7 +5982,16 @@ init_conflict_gate();
5596
5982
  init_agents();
5597
5983
  const execAsync$2 = promisify(exec);
5598
5984
  const MAX_AUTO_REQUEUE = 25;
5599
- const requestReviewPipeline = createRequestReviewPipeline();
5985
+ const pushRemoteReviewBranch = async (vmName, workspacePath, branchName) => {
5986
+ await execAsync$2(flyExecCmd(vmName, `cd ${workspacePath} && GIT_TERMINAL_PROMPT=0 GIT_ASKPASS=true SSH_ASKPASS=true git push origin ${branchName}`), {
5987
+ encoding: "utf-8",
5988
+ timeout: 3e4
5989
+ });
5990
+ };
5991
+ registerDashboardDurableReviewPipeline({
5992
+ getWorkspaceInfo: getWorkspaceInfoForIssue,
5993
+ pushRemote: pushRemoteReviewBranch
5994
+ });
5600
5995
  /** Safe `.message` read for caught values of unknown shape. */
5601
5996
  const errorMessage = (e) => e instanceof Error ? e.message : void 0;
5602
5997
  /**
@@ -5610,21 +6005,7 @@ const errorMessage = (e) => e instanceof Error ? e.message : void 0;
5610
6005
  * the workspace path, preserving the previous behavior.
5611
6006
  */
5612
6007
  async function pushFeatureBranches(issueId, workspacePath) {
5613
- const { resolveWorkspaceRepoRootsSync } = await import("./project-repos-DXKQsc_m.js");
5614
- for (const root of resolveWorkspaceRepoRootsSync(issueId, workspacePath)) {
5615
- try {
5616
- await execAsync$2(`git rev-parse --verify --quiet refs/heads/${root.sourceBranch}`, {
5617
- cwd: root.dir,
5618
- encoding: "utf-8"
5619
- });
5620
- } catch {
5621
- continue;
5622
- }
5623
- await execAsync$2(`git push origin ${root.sourceBranch}`, {
5624
- cwd: root.dir,
5625
- encoding: "utf-8"
5626
- });
5627
- }
6008
+ await pushLocalReviewBranches(issueId, workspacePath);
5628
6009
  }
5629
6010
  function shouldTreatAsRerun(status) {
5630
6011
  if (!status) return false;
@@ -5742,7 +6123,7 @@ const postWorkspaceReviewRoute = HttpRouter.add("POST", "/api/review/:issueId/tr
5742
6123
  console.log(`Feature branch push note: ${errorMessage(pushErr)}`);
5743
6124
  }
5744
6125
  try {
5745
- const { createReviewArtifactsForIssue } = await import("./review-artifacts-nRDPuMxd.js");
6126
+ const { createReviewArtifactsForIssue } = await import("./review-artifacts-DSMRIfuJ.js");
5746
6127
  const artifactResult = await Effect.runPromise(createReviewArtifactsForIssue(issueId, workspacePath));
5747
6128
  const primaryArtifact = artifactResult.mergeSet?.repos.find((repo) => !!repo.artifactUrl);
5748
6129
  artifactResult.mergeSet?.repos.find((repo) => repo.mergeStatus !== "skipped")?.targetBranch;
@@ -5797,7 +6178,12 @@ const postWorkspaceReviewRoute = HttpRouter.add("POST", "/api/review/:issueId/tr
5797
6178
  } catch {}
5798
6179
  return;
5799
6180
  }
5800
- const { spawnReviewRoleForIssue } = await import("./review-agent-DNboMyW4.js");
6181
+ if (verifyOutcome.outcome === "deferred") {
6182
+ console.log(`[review] Verification deferred for ${issueId}: ${verifyOutcome.reason}`);
6183
+ completePendingOperation(issueId, verifyOutcome.reason);
6184
+ return;
6185
+ }
6186
+ const { spawnReviewRoleForIssue } = await import("./review-agent-CD4RCI0Y.js");
5801
6187
  const prUrl = getReviewStatusSync(issueId)?.prUrl;
5802
6188
  const reviewResult = await Effect.runPromise(spawnReviewRoleForIssue({
5803
6189
  issueId,
@@ -5933,7 +6319,7 @@ const postWorkspaceRequestReviewRoute = HttpRouter.add("POST", "/api/review/:iss
5933
6319
  console.log(`[request-review] Feature branch push note: ${errorMessage(pushErr)}`);
5934
6320
  }
5935
6321
  const prUrl = getReviewStatusSync(issueId)?.prUrl;
5936
- const { spawnReviewRoleForIssue } = await import("./review-agent-DNboMyW4.js");
6322
+ const { spawnReviewRoleForIssue } = await import("./review-agent-CD4RCI0Y.js");
5937
6323
  const result = await Effect.runPromise(spawnReviewRoleForIssue({
5938
6324
  issueId,
5939
6325
  workspace: workspacePathRerun,
@@ -5983,7 +6369,7 @@ const postWorkspaceRequestReviewRoute = HttpRouter.add("POST", "/api/review/:iss
5983
6369
  });
5984
6370
  } else {
5985
6371
  const workspacePath = join(resolved.projectPath, "workspaces", `feature-${issueId.toLowerCase()}`);
5986
- const { spawnRun } = yield* Effect.promise(() => import("./agents-wi9NWzs2.js"));
6372
+ const { spawnRun } = yield* Effect.promise(() => import("./agents-BKKkxKgK.js"));
5987
6373
  try {
5988
6374
  const testRun = yield* Effect.promise(() => spawnRun(issueId, "test", { workspace: workspacePath }));
5989
6375
  setReviewStatus(issueId, { testStatus: "testing" });
@@ -6060,6 +6446,7 @@ const postWorkspaceRequestReviewRoute = HttpRouter.add("POST", "/api/review/:iss
6060
6446
  verificationStatus: "pending",
6061
6447
  reviewNotes
6062
6448
  });
6449
+ clearFeedbackDeliveryStuck(canonicalIssueId);
6063
6450
  if (!requestReviewPipeline.start(canonicalIssueId, {
6064
6451
  verify: () => Effect.runPromise(runVerificationForIssue(issueId, workspacePath, workspaceInfo, "request-review")),
6065
6452
  onVerificationFailed: (outcome) => {
@@ -6078,9 +6465,17 @@ const postWorkspaceRequestReviewRoute = HttpRouter.add("POST", "/api/review/:iss
6078
6465
  autoRequeueCount: currentCount
6079
6466
  });
6080
6467
  },
6468
+ onVerificationDeferred: (outcome) => {
6469
+ console.log(`[request-review] Verification deferred for ${issueId}: ${outcome.reason}`);
6470
+ completePendingOperation(issueId, outcome.reason);
6471
+ },
6081
6472
  pushBranch: async () => {
6082
- if (workspaceInfo.isRemote && workspaceInfo.vmName) await execAsync$2(flyExecCmd(workspaceInfo.vmName, `cd ${workspacePath} && git push origin ${branchName}`), { encoding: "utf-8" });
6083
- else await pushFeatureBranches(issueId, workspacePath);
6473
+ await pushDashboardReviewBranch({
6474
+ issueId,
6475
+ workspacePath,
6476
+ workspaceInfo,
6477
+ branchName
6478
+ }, { pushRemote: pushRemoteReviewBranch });
6084
6479
  console.log(`[request-review] Pushed verified branch ${branchName} for ${issueId}`);
6085
6480
  },
6086
6481
  dispatchReview: async () => {
@@ -6089,7 +6484,7 @@ const postWorkspaceRequestReviewRoute = HttpRouter.add("POST", "/api/review/:iss
6089
6484
  testStatus: "pending",
6090
6485
  reviewNotes
6091
6486
  });
6092
- const { spawnReviewRoleForIssue } = await import("./review-agent-DNboMyW4.js");
6487
+ const { spawnReviewRoleForIssue } = await import("./review-agent-CD4RCI0Y.js");
6093
6488
  const result = await Effect.runPromise(spawnReviewRoleForIssue({
6094
6489
  issueId,
6095
6490
  workspace: workspacePath,
@@ -6176,12 +6571,12 @@ const reviewPipelineRouteLayer = Layer.mergeAll(postWorkspaceReviewRoute, postWo
6176
6571
  * stay owned by ../workspaces.js.
6177
6572
  */
6178
6573
  init_issue_id();
6179
- init_archive_planning();
6180
6574
  init_projects();
6181
6575
  init_review_status();
6182
6576
  init_agents();
6183
6577
  init_model_validation();
6184
6578
  init_config_yaml();
6579
+ init_pipeline_notifier();
6185
6580
  const execAsync$1 = promisify(exec);
6186
6581
  function resolveConfiguredReviewModel() {
6187
6582
  try {
@@ -6191,6 +6586,32 @@ function resolveConfiguredReviewModel() {
6191
6586
  }
6192
6587
  }
6193
6588
  /**
6589
+ * Read and re-emit canonical review status without mutating it. This is the
6590
+ * operator escape hatch for PAN-2988-style lost review.status_changed events.
6591
+ */
6592
+ function processResyncReviewStatus(issueId) {
6593
+ const status = getReviewStatusSync(issueId);
6594
+ if (!status) return {
6595
+ httpStatus: 404,
6596
+ body: {
6597
+ ok: false,
6598
+ error: `no review status found for ${issueId}`
6599
+ }
6600
+ };
6601
+ notifyPipelineSync({
6602
+ type: "status_changed",
6603
+ issueId,
6604
+ status
6605
+ });
6606
+ return {
6607
+ httpStatus: 200,
6608
+ body: {
6609
+ ok: true,
6610
+ status
6611
+ }
6612
+ };
6613
+ }
6614
+ /**
6194
6615
  * Core logic for POST /api/review/:issueId/reset (synchronous, testable).
6195
6616
  *
6196
6617
  * Resets the specialist pipeline state (review / test / merge / verification) for
@@ -6398,7 +6819,7 @@ const postWorkspaceResetReviewRoute = HttpRouter.add("POST", "/api/review/:issue
6398
6819
  const result = processResetReviewPipeline(issueId, resetWorkspace.exists);
6399
6820
  if (result.httpStatus !== 200) return jsonResponse(result.body, { status: result.httpStatus });
6400
6821
  try {
6401
- const { resetPostMergeState } = yield* Effect.promise(() => import("./merge-agent-CKkgIBPB.js"));
6822
+ const { resetPostMergeState } = yield* Effect.promise(() => import("./merge-agent-DrXa1CpW.js"));
6402
6823
  resetPostMergeState(issueId);
6403
6824
  } catch (err) {
6404
6825
  console.warn(`[reset-review] resetPostMergeState best-effort failed for ${issueId}:`, err);
@@ -6407,7 +6828,7 @@ const postWorkspaceResetReviewRoute = HttpRouter.add("POST", "/api/review/:issue
6407
6828
  const rerun = body?.rerun === true;
6408
6829
  if (rerun) try {
6409
6830
  yield* Effect.promise(async () => {
6410
- const { spawnReviewRoleForIssue } = await import("./review-agent-DNboMyW4.js");
6831
+ const { spawnReviewRoleForIssue } = await import("./review-agent-CD4RCI0Y.js");
6411
6832
  const dispatchArgs = buildReviewRedispatchArgs(issueId, resetWorkspace, workspaceInfo, resolved);
6412
6833
  if (dispatchArgs) {
6413
6834
  const result = await Effect.runPromise(spawnReviewRoleForIssue({
@@ -6433,10 +6854,16 @@ const postWorkspaceResetReviewRoute = HttpRouter.add("POST", "/api/review/:issue
6433
6854
  rerun
6434
6855
  });
6435
6856
  })));
6857
+ const postReviewResyncRoute = HttpRouter.add("POST", "/api/review/:issueId/resync", httpHandler(Effect.gen(function* () {
6858
+ const issueId = (yield* HttpRouter.params)["issueId"] ?? "";
6859
+ if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
6860
+ const result = processResyncReviewStatus(issueId.toUpperCase());
6861
+ return jsonResponse(result.body, { status: result.httpStatus });
6862
+ })));
6436
6863
  const postWorkspaceReviewPurgeRoute = HttpRouter.add("POST", "/api/review/:issueId/purge", httpHandler(Effect.gen(function* () {
6437
6864
  const issueId = (yield* HttpRouter.params)["issueId"] ?? "";
6438
6865
  if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
6439
- const { purgeReviewAgentsForIssue } = yield* Effect.promise(() => import("./review-agent-DNboMyW4.js"));
6866
+ const { purgeReviewAgentsForIssue } = yield* Effect.promise(() => import("./review-agent-CD4RCI0Y.js"));
6440
6867
  const projectKey = resolveProjectFromIssueSync(issueId)?.projectKey;
6441
6868
  const purge = yield* Effect.promise(() => purgeReviewAgentsForIssue(projectKey, issueId));
6442
6869
  const workspaceInfo = getWorkspaceInfoForIssue(issueId);
@@ -6466,8 +6893,8 @@ const postWorkspaceAbortReviewRoute = HttpRouter.add("POST", "/api/review/:issue
6466
6893
  success: false,
6467
6894
  error: "Workspace does not exist"
6468
6895
  }, { status: 400 });
6469
- const { resolveProjectFromIssueSync } = yield* Effect.promise(() => import("./projects-vjjcmiN8.js"));
6470
- const { killAllReviewerSessions } = yield* Effect.promise(() => import("./review-agent-DNboMyW4.js"));
6896
+ const { resolveProjectFromIssueSync } = yield* Effect.promise(() => import("./projects-B03Wr-xc.js"));
6897
+ const { killAllReviewerSessions } = yield* Effect.promise(() => import("./review-agent-CD4RCI0Y.js"));
6471
6898
  const { killed, failed } = yield* killAllReviewerSessions(resolveProjectFromIssueSync(issueId)?.projectKey, issueId);
6472
6899
  setReviewStatus(issueId, {
6473
6900
  reviewStatus: "pending",
@@ -6539,8 +6966,8 @@ const getReviewConfigRoute = HttpRouter.add("GET", "/api/review/:issueId/config"
6539
6966
  const issueId = ((yield* HttpRouter.params)["issueId"] ?? "").toUpperCase();
6540
6967
  if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
6541
6968
  return jsonResponse(yield* Effect.promise(async () => {
6542
- const { readIssueRecordSync, resolveProjectForIssue } = await import("./record-CN0pj4_5.js");
6543
- const { resolveReviewMode, resolveReReviewScope } = await import("./review-agent-DNboMyW4.js");
6969
+ const { readIssueRecordSync, resolveProjectForIssue } = await import("./record-CtroO946.js");
6970
+ const { resolveReviewMode, resolveReReviewScope } = await import("./review-agent-CD4RCI0Y.js");
6544
6971
  const project = resolveProjectForIssue(issueId);
6545
6972
  const record = project ? readIssueRecordSync(project, issueId) : null;
6546
6973
  return {
@@ -6575,9 +7002,9 @@ const postReviewConfigRoute = HttpRouter.add("POST", "/api/review/:issueId/confi
6575
7002
  return jsonResponse({ error: error instanceof Error ? error.message : String(error) }, { status: 400 });
6576
7003
  }
6577
7004
  return jsonResponse(yield* Effect.promise(async () => {
6578
- const { resolveProjectForIssue } = await import("./record-CN0pj4_5.js");
6579
- const { updateIssueRecord } = await import("./record-update-bLJxAXH4.js");
6580
- const { resolveReviewMode, resolveReReviewScope } = await import("./review-agent-DNboMyW4.js");
7005
+ const { resolveProjectForIssue } = await import("./record-CtroO946.js");
7006
+ const { updateIssueRecord } = await import("./record-update-DH6dLJID.js");
7007
+ const { resolveReviewMode, resolveReReviewScope } = await import("./review-agent-CD4RCI0Y.js");
6581
7008
  const record = await updateIssueRecord(resolveProjectForIssue(issueId), issueId, (current) => {
6582
7009
  if (hasMode) if (body.reviewMode === null) delete current.reviewMode;
6583
7010
  else current.reviewMode = body.reviewMode;
@@ -6602,7 +7029,7 @@ const postReviewConfigRoute = HttpRouter.add("POST", "/api/review/:issueId/confi
6602
7029
  };
6603
7030
  }));
6604
7031
  })));
6605
- const reviewControlRouteLayer = Layer.mergeAll(postWorkspaceResetReviewRoute, postWorkspaceReviewPurgeRoute, postWorkspaceAbortReviewRoute, postWorkspaceUnstickRoute, postWorkspaceDeaconIgnoreRoute, postWorkspaceAutoMergeRoute, deleteWorkspacePendingRoute, getReviewConfigRoute, postReviewConfigRoute);
7032
+ const reviewControlRouteLayer = Layer.mergeAll(postWorkspaceResetReviewRoute, postReviewResyncRoute, postWorkspaceReviewPurgeRoute, postWorkspaceAbortReviewRoute, postWorkspaceUnstickRoute, postWorkspaceDeaconIgnoreRoute, postWorkspaceAutoMergeRoute, deleteWorkspacePendingRoute, getReviewConfigRoute, postReviewConfigRoute);
6606
7033
  //#endregion
6607
7034
  //#region routes/workspaces/uat-stack-actions.ts
6608
7035
  init_activity_logger();
@@ -7010,7 +7437,7 @@ async function readWorkspacePlanningMarkdown(issueId, fileName) {
7010
7437
  */
7011
7438
  async function readWorkspaceContinueFile(_projectPath, workspacePath, issueId) {
7012
7439
  try {
7013
- const { readRecordContinueViewSync, getProjectConfigFromWorkspacePath, resolveProjectForIssue } = await import("./record-CN0pj4_5.js");
7440
+ const { readRecordContinueViewSync, getProjectConfigFromWorkspacePath, resolveProjectForIssue } = await import("./record-CtroO946.js");
7014
7441
  const recordView = readRecordContinueViewSync(resolveProjectForIssue(issueId) ?? getProjectConfigFromWorkspacePath(workspacePath), issueId);
7015
7442
  return recordView ? JSON.stringify(recordView, null, 2) : null;
7016
7443
  } catch {
@@ -7769,7 +8196,7 @@ const getWorkspaceReviewStatusRoute = HttpRouter.add("GET", "/api/review/:issueI
7769
8196
  if (queuePosition === null) try {
7770
8197
  const resolved = resolveProjectFromIssueSync(issueId);
7771
8198
  if (resolved) {
7772
- const { getQueueForProject } = yield* Effect.promise(() => import("./merge-B1DiziGU.js"));
8199
+ const { getQueueForProject } = yield* Effect.promise(() => import("./merge-idOG--29.js"));
7773
8200
  const mergePos = findPositionInQueueSync(issueId, getQueueForProject(resolved.projectKey).map((e) => ({
7774
8201
  id: String(e.id),
7775
8202
  type: "task",
@@ -7807,10 +8234,10 @@ const postWorkspaceReviewStatusRoute = HttpRouter.add("POST", "/api/review/:issu
7807
8234
  const workspaceInfo = getWorkspaceInfoForIssue(issueId);
7808
8235
  if (workspaceInfo.exists && workspaceInfo.localPath) {
7809
8236
  const localPath = workspaceInfo.localPath;
7810
- const { getWorkspaceGitInfo } = yield* Effect.promise(() => import("./git-utils-D0_yhCgF.js"));
8237
+ const { snapshotWorkspaceHeadsPromise } = yield* Effect.promise(() => import("./git-utils-CI6cwyyC.js"));
7811
8238
  try {
7812
- const gitInfo = yield* getWorkspaceGitInfo(localPath);
7813
- if (gitInfo.HEAD) update.reviewedAtCommit = gitInfo.HEAD;
8239
+ const headAnchor = yield* Effect.promise(() => snapshotWorkspaceHeadsPromise(issueId, localPath));
8240
+ if (headAnchor) update.reviewedAtCommit = headAnchor;
7814
8241
  } catch {}
7815
8242
  }
7816
8243
  }
@@ -7822,7 +8249,7 @@ const postWorkspaceReviewStatusRoute = HttpRouter.add("POST", "/api/review/:issu
7822
8249
  if (verificationStatus) update.verificationStatus = verificationStatus;
7823
8250
  if (readyForMerge !== void 0) update.readyForMerge = readyForMerge;
7824
8251
  const status = setReviewStatus(issueId, update);
7825
- const { getTmuxSessionName } = yield* Effect.promise(() => import("./specialists-DM6bWjsi.js"));
8252
+ const { getTmuxSessionName } = yield* Effect.promise(() => import("./specialists-Tdezg_6N.js"));
7826
8253
  const projectKey = resolveProjectFromIssueSync(issueId)?.projectKey;
7827
8254
  if (reviewStatus && [
7828
8255
  "passed",
@@ -7840,7 +8267,7 @@ const postWorkspaceReviewStatusRoute = HttpRouter.add("POST", "/api/review/:issu
7840
8267
  const agentId = `agent-${issueId.toLowerCase()}`;
7841
8268
  const feedbackBody = `CODE REVIEW ${reviewStatus.toUpperCase()} for ${issueId}:\n\n${reviewNotes}\n\n## REQUIRED: Fix ALL issues above, then invoke the /rebase-and-submit skill\n\n1. Read each blocking issue carefully\n2. Fix the code for EVERY issue listed\n3. Run tests locally to verify your fixes\n4. Commit every change\n5. Invoke the /rebase-and-submit skill for ${issueId} — this is an atomic task that runs pan done (which handles rebase + push + re-submit internally)\n\nDo NOT stop between steps. Do NOT run git push manually — the skill handles it. Do NOT stop until pan done has completed successfully.`;
7842
8269
  try {
7843
- const { writeFeedbackFile } = yield* Effect.promise(() => import("./feedback-writer-D3a22RCd.js"));
8270
+ const { writeFeedbackFile } = yield* Effect.promise(() => import("./feedback-writer-D1fm-5Z8.js"));
7844
8271
  const wsInfo = getWorkspaceInfoForIssue(issueId);
7845
8272
  const fileResult = yield* Effect.promise(() => writeFeedbackFile({
7846
8273
  issueId,
@@ -7904,7 +8331,7 @@ const postWorkspaceReviewStatusRoute = HttpRouter.add("POST", "/api/review/:issu
7904
8331
  const agentId = `agent-${issueId.toLowerCase()}`;
7905
8332
  const feedbackBody = `TESTS FAILED for ${issueId}:\n\n${testNotes}\n\n## REQUIRED: Fix ALL test failures, then invoke the /rebase-and-submit skill\n\n1. Read each test failure carefully\n2. Fix the code causing EVERY failure\n3. Run the test suite locally to verify your fixes pass\n4. Commit every change\n5. Invoke the /rebase-and-submit skill for ${issueId} — this is an atomic task that runs pan done (which handles rebase + push + re-submit internally)\n\nDo NOT stop between steps. Do NOT run git push manually — the skill handles it. Do NOT stop until pan done has completed successfully.`;
7906
8333
  try {
7907
- const { writeFeedbackFile } = yield* Effect.promise(() => import("./feedback-writer-D3a22RCd.js"));
8334
+ const { writeFeedbackFile } = yield* Effect.promise(() => import("./feedback-writer-D1fm-5Z8.js"));
7908
8335
  const wsInfo = getWorkspaceInfoForIssue(issueId);
7909
8336
  const fileResult = yield* Effect.promise(() => writeFeedbackFile({
7910
8337
  issueId,
@@ -7937,14 +8364,14 @@ const postWorkspaceReviewStatusRoute = HttpRouter.add("POST", "/api/review/:issu
7937
8364
  });
7938
8365
  yield* Effect.promise(async () => {
7939
8366
  try {
7940
- const { resolveProjectFromIssueSync, getProjectSync } = await import("./projects-vjjcmiN8.js");
8367
+ const { resolveProjectFromIssueSync, getProjectSync } = await import("./projects-B03Wr-xc.js");
7941
8368
  const project = resolveProjectFromIssueSync(issueId);
7942
8369
  const repo = (project ? getProjectSync(project.projectKey) : null)?.github_repo;
7943
8370
  if (!repo || !repo.includes("/")) return;
7944
8371
  const [owner, name] = repo.split("/");
7945
8372
  const wsInfo = getWorkspaceInfoForIssue(issueId);
7946
8373
  if (!wsInfo?.localPath) return;
7947
- const { postOverdeckTestsStatus } = await import("./github-app-ClZ2lk8D.js");
8374
+ const { postOverdeckTestsStatus } = await import("./github-app-DtAsvwzK.js");
7948
8375
  await postOverdeckTestsStatus(wsInfo.localPath, owner, name, "success", "Test specialist passed");
7949
8376
  } catch (err) {
7950
8377
  console.warn(`[review-status] Failed to post overdeck/tests for ${issueId}: ${err.message}`);
@@ -7986,7 +8413,7 @@ const postWorkspaceRefreshTokenRoute = HttpRouter.add("POST", "/api/workspaces/:
7986
8413
  if (!parseIssueIdSync(issueId)) return jsonResponse({ error: "Invalid issue ID" }, { status: 400 });
7987
8414
  const issueLower = issueId.toLowerCase();
7988
8415
  const workspacePath = join(getProjectPath(void 0, extractPrefixSync(issueId) ?? issueId.split("-")[0]), "workspaces", `feature-${issueLower}`);
7989
- const { refreshWorkspaceToken, isGitHubAppConfigured } = yield* Effect.promise(() => import("./github-app-ClZ2lk8D.js"));
8416
+ const { refreshWorkspaceToken, isGitHubAppConfigured } = yield* Effect.promise(() => import("./github-app-DtAsvwzK.js"));
7990
8417
  if (!isGitHubAppConfigured()) return jsonResponse({
7991
8418
  success: false,
7992
8419
  error: "GitHub App not configured"
@@ -8001,4 +8428,4 @@ const workspacesRouteLayer = Layer.mergeAll(workspaceDataRouteLayer, postWorkspa
8001
8428
  //#endregion
8002
8429
  export { getWorkspacePathForIssue as C, stopAgentOutputService as E, resolveIssueHeadlineCost as S, startAgentOutputService as T, getCostsForIssueSync as _, pushApproveMain as a, processPendingFeedbackDeliveries as b, triggerMerge as c, resumeQueuedMerges as d, syncWalFromAllProjects as f, migrateAllSessionsSync as g, reclassifyUnknownCostEventsSync as h, mergeOpsRouteLayer as i, internalEventsRouteLayer as l, reconcilePiTranscripts as m, buildRichPRBody as n, reconcileGitHubMergeStatus as o, reconcile as p, isBranchAlreadyRebased as r, shouldBlockApproveForDirtyStatus as s, workspacesRouteLayer as t, eventsRouteLayer as u, rebuildCacheSync as v, retainAgentOutputInterest as w, getCachedRunningAgents as x, syncCacheSync as y };
8003
8430
 
8004
- //# sourceMappingURL=workspaces-Do_9J0LQ.js.map
8431
+ //# sourceMappingURL=workspaces-j1e_6aAT.js.map