@telora/daemon 0.24.42 → 0.24.55

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 (343) hide show
  1. package/build-info.json +9 -3
  2. package/dist/completion/completion-event/unfinished-work.d.ts +3 -3
  3. package/dist/completion/review-cycle-budget/review-loop-detection.d.ts.map +1 -1
  4. package/dist/completion/review-cycle-budget/review-loop-detection.js +2 -1
  5. package/dist/completion/review-cycle-budget/review-loop-detection.js.map +1 -1
  6. package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts +1 -1
  7. package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts.map +1 -1
  8. package/dist/completion/review-exit-holds/review-exit-verdict-gate.js +2 -3
  9. package/dist/completion/review-exit-holds/review-exit-verdict-gate.js.map +1 -1
  10. package/dist/completion/state-cascade/focus-next-step-read.d.ts +38 -0
  11. package/dist/completion/state-cascade/focus-next-step-read.d.ts.map +1 -0
  12. package/dist/completion/state-cascade/focus-next-step-read.js +188 -0
  13. package/dist/completion/state-cascade/focus-next-step-read.js.map +1 -0
  14. package/dist/completion/state-cascade/review-request-gate.d.ts.map +1 -1
  15. package/dist/completion/state-cascade/review-request-gate.js +1 -0
  16. package/dist/completion/state-cascade/review-request-gate.js.map +1 -1
  17. package/dist/completion/state-cascade/review-request-next-step.d.ts +56 -0
  18. package/dist/completion/state-cascade/review-request-next-step.d.ts.map +1 -0
  19. package/dist/completion/state-cascade/review-request-next-step.js +47 -0
  20. package/dist/completion/state-cascade/review-request-next-step.js.map +1 -0
  21. package/dist/completion/state-cascade/review-verify-judgment-gate.d.ts +1 -1
  22. package/dist/completion/state-cascade/review-verify-judgment-gate.d.ts.map +1 -1
  23. package/dist/completion/state-cascade/review-verify-judgment-gate.js +1 -0
  24. package/dist/completion/state-cascade/review-verify-judgment-gate.js.map +1 -1
  25. package/dist/completion/state-cascade/state-cascade.d.ts +12 -7
  26. package/dist/completion/state-cascade/state-cascade.d.ts.map +1 -1
  27. package/dist/completion/state-cascade/state-cascade.js +36 -105
  28. package/dist/completion/state-cascade/state-cascade.js.map +1 -1
  29. package/dist/composition/commit-gate-context.d.ts.map +1 -1
  30. package/dist/composition/commit-gate-context.js +1 -0
  31. package/dist/composition/commit-gate-context.js.map +1 -1
  32. package/dist/composition/daemon-contexts.js +1 -1
  33. package/dist/composition/execution-migrations-context.d.ts.map +1 -1
  34. package/dist/composition/execution-migrations-context.js +3 -1
  35. package/dist/composition/execution-migrations-context.js.map +1 -1
  36. package/dist/composition/execution-process-context.js +1 -1
  37. package/dist/composition/execution-recovery-context.d.ts +4 -3
  38. package/dist/composition/execution-recovery-context.d.ts.map +1 -1
  39. package/dist/composition/execution-recovery-context.js +6 -3
  40. package/dist/composition/execution-recovery-context.js.map +1 -1
  41. package/dist/composition/execution-worktree-context.js +1 -1
  42. package/dist/composition/focus-next-step-context.d.ts +19 -0
  43. package/dist/composition/focus-next-step-context.d.ts.map +1 -0
  44. package/dist/composition/focus-next-step-context.js +51 -0
  45. package/dist/composition/focus-next-step-context.js.map +1 -0
  46. package/dist/composition/runtime-contexts.d.ts.map +1 -1
  47. package/dist/composition/runtime-contexts.js +6 -18
  48. package/dist/composition/runtime-contexts.js.map +1 -1
  49. package/dist/composition/runtime-poll-context.d.ts +8 -53
  50. package/dist/composition/runtime-poll-context.d.ts.map +1 -1
  51. package/dist/composition/runtime-poll-context.js +35 -94
  52. package/dist/composition/runtime-poll-context.js.map +1 -1
  53. package/dist/composition/runtime-prd-context.d.ts +8 -0
  54. package/dist/composition/runtime-prd-context.d.ts.map +1 -1
  55. package/dist/composition/runtime-prd-context.js +32 -0
  56. package/dist/composition/runtime-prd-context.js.map +1 -1
  57. package/dist/composition/runtime-spawn-pass-context.d.ts.map +1 -1
  58. package/dist/composition/runtime-spawn-pass-context.js +2 -3
  59. package/dist/composition/runtime-spawn-pass-context.js.map +1 -1
  60. package/dist/composition/state-cascade-context.d.ts +2 -0
  61. package/dist/composition/state-cascade-context.d.ts.map +1 -1
  62. package/dist/composition/state-cascade-context.js +9 -0
  63. package/dist/composition/state-cascade-context.js.map +1 -1
  64. package/dist/composition/verification-context.d.ts.map +1 -1
  65. package/dist/composition/verification-context.js +15 -3
  66. package/dist/composition/verification-context.js.map +1 -1
  67. package/dist/config/live-daemon-config.js +1 -1
  68. package/dist/daemon-state/branch-removal-record.d.ts +30 -0
  69. package/dist/daemon-state/branch-removal-record.d.ts.map +1 -0
  70. package/dist/daemon-state/branch-removal-record.js +103 -0
  71. package/dist/daemon-state/branch-removal-record.js.map +1 -0
  72. package/dist/delivery/advance-hold.d.ts +8 -19
  73. package/dist/delivery/advance-hold.d.ts.map +1 -1
  74. package/dist/delivery/advance-hold.js +11 -36
  75. package/dist/delivery/advance-hold.js.map +1 -1
  76. package/dist/delivery/commit-verdict-hold.d.ts +1 -1
  77. package/dist/delivery/commit-verdict-hold.js +1 -1
  78. package/dist/delivery/recorded-concerns.d.ts.map +1 -1
  79. package/dist/delivery/recorded-concerns.js +0 -2
  80. package/dist/delivery/recorded-concerns.js.map +1 -1
  81. package/dist/directive/directive-queue.d.ts +4 -16
  82. package/dist/directive/directive-queue.d.ts.map +1 -1
  83. package/dist/directive/directive-queue.js +5 -13
  84. package/dist/directive/directive-queue.js.map +1 -1
  85. package/dist/directive/phase-sync.d.ts +1 -1
  86. package/dist/directive/phase-sync.js +1 -1
  87. package/dist/focus/crash-recovery.d.ts +10 -32
  88. package/dist/focus/crash-recovery.d.ts.map +1 -1
  89. package/dist/focus/crash-recovery.js +55 -150
  90. package/dist/focus/crash-recovery.js.map +1 -1
  91. package/dist/focus/daemon-contexts-runtime.d.ts +3 -3
  92. package/dist/focus/daemon-contexts-runtime.d.ts.map +1 -1
  93. package/dist/focus/daemon-contexts.js +1 -1
  94. package/dist/focus/directive-executor.d.ts.map +1 -1
  95. package/dist/focus/directive-executor.js +3 -7
  96. package/dist/focus/directive-executor.js.map +1 -1
  97. package/dist/focus/failed-head-rework-start.d.ts +61 -0
  98. package/dist/focus/failed-head-rework-start.d.ts.map +1 -0
  99. package/dist/focus/failed-head-rework-start.js +52 -0
  100. package/dist/focus/failed-head-rework-start.js.map +1 -0
  101. package/dist/focus/focus-activity-record.d.ts +4 -2
  102. package/dist/focus/focus-activity-record.d.ts.map +1 -1
  103. package/dist/focus/focus-activity-record.js +4 -2
  104. package/dist/focus/focus-activity-record.js.map +1 -1
  105. package/dist/focus/focus-liveness-pass.d.ts +62 -0
  106. package/dist/focus/focus-liveness-pass.d.ts.map +1 -0
  107. package/dist/focus/focus-liveness-pass.js +197 -0
  108. package/dist/focus/focus-liveness-pass.js.map +1 -0
  109. package/dist/focus/focus-poller-spawn.js +1 -1
  110. package/dist/focus/focus-poller-state.js +1 -1
  111. package/dist/focus/live-branch-preservation.d.ts +123 -0
  112. package/dist/focus/live-branch-preservation.d.ts.map +1 -0
  113. package/dist/focus/live-branch-preservation.js +192 -0
  114. package/dist/focus/live-branch-preservation.js.map +1 -0
  115. package/dist/focus/migration-claim-pass.d.ts +2 -0
  116. package/dist/focus/migration-claim-pass.d.ts.map +1 -1
  117. package/dist/focus/migration-claim-pass.js +57 -22
  118. package/dist/focus/migration-claim-pass.js.map +1 -1
  119. package/dist/focus/migration-held-set-publish.d.ts +28 -2
  120. package/dist/focus/migration-held-set-publish.d.ts.map +1 -1
  121. package/dist/focus/migration-held-set-publish.js +14 -0
  122. package/dist/focus/migration-held-set-publish.js.map +1 -1
  123. package/dist/focus/pending-spawn-review-next-step.d.ts +5 -11
  124. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -1
  125. package/dist/focus/pending-spawn-review-next-step.js +26 -72
  126. package/dist/focus/pending-spawn-review-next-step.js.map +1 -1
  127. package/dist/focus/review-refire-gate.d.ts +25 -0
  128. package/dist/focus/review-refire-gate.d.ts.map +1 -0
  129. package/dist/focus/review-refire-gate.js +68 -0
  130. package/dist/focus/review-refire-gate.js.map +1 -0
  131. package/dist/focus/verify-routing-passes.d.ts +8 -11
  132. package/dist/focus/verify-routing-passes.d.ts.map +1 -1
  133. package/dist/focus/verify-routing-passes.js +1 -2
  134. package/dist/focus/verify-routing-passes.js.map +1 -1
  135. package/dist/git/types.js +1 -1
  136. package/dist/prd/arm-refusal-streak.d.ts +102 -0
  137. package/dist/prd/arm-refusal-streak.d.ts.map +1 -0
  138. package/dist/prd/arm-refusal-streak.js +136 -0
  139. package/dist/prd/arm-refusal-streak.js.map +1 -0
  140. package/dist/prd/arm-refusal.d.ts.map +1 -1
  141. package/dist/prd/arm-refusal.js +7 -4
  142. package/dist/prd/arm-refusal.js.map +1 -1
  143. package/dist/prd/controller-shared.d.ts +40 -1
  144. package/dist/prd/controller-shared.d.ts.map +1 -1
  145. package/dist/prd/controller-shared.js +28 -2
  146. package/dist/prd/controller-shared.js.map +1 -1
  147. package/dist/prd/controller.d.ts.map +1 -1
  148. package/dist/prd/controller.js +3 -1
  149. package/dist/prd/controller.js.map +1 -1
  150. package/dist/prd/frontier-arming.d.ts +10 -2
  151. package/dist/prd/frontier-arming.d.ts.map +1 -1
  152. package/dist/prd/frontier-arming.js +91 -7
  153. package/dist/prd/frontier-arming.js.map +1 -1
  154. package/dist/prd/scoping-prompt.d.ts +8 -0
  155. package/dist/prd/scoping-prompt.d.ts.map +1 -1
  156. package/dist/prd/scoping-prompt.js +18 -0
  157. package/dist/prd/scoping-prompt.js.map +1 -1
  158. package/dist/prompt-sections/qa-failure-section.d.ts.map +1 -1
  159. package/dist/prompt-sections/qa-failure-section.js +3 -1
  160. package/dist/prompt-sections/qa-failure-section.js.map +1 -1
  161. package/dist/queries/api-client/shared.js +1 -1
  162. package/dist/queries/deliveries/deliveries.js +1 -1
  163. package/dist/queries/delivery-gate-state/delivery-gate-holds.d.ts +4 -3
  164. package/dist/queries/delivery-gate-state/delivery-gate-holds.d.ts.map +1 -1
  165. package/dist/queries/delivery-gate-state/delivery-gate-state.js +1 -1
  166. package/dist/queries/escalations/escalations.d.ts.map +1 -1
  167. package/dist/queries/escalations/escalations.js +0 -1
  168. package/dist/queries/escalations/escalations.js.map +1 -1
  169. package/dist/queries/escalations/incident-record.d.ts.map +1 -1
  170. package/dist/queries/escalations/incident-record.js +1 -0
  171. package/dist/queries/escalations/incident-record.js.map +1 -1
  172. package/dist/queries/focus-review/review-criterion-verdicts.d.ts.map +1 -1
  173. package/dist/queries/focus-review/review-criterion-verdicts.js +1 -0
  174. package/dist/queries/focus-review/review-criterion-verdicts.js.map +1 -1
  175. package/dist/queries/migrations/live-focus-branches.d.ts +23 -0
  176. package/dist/queries/migrations/live-focus-branches.d.ts.map +1 -1
  177. package/dist/queries/migrations/live-focus-branches.js +32 -1
  178. package/dist/queries/migrations/live-focus-branches.js.map +1 -1
  179. package/dist/queries/prd/prd.d.ts.map +1 -1
  180. package/dist/queries/prd/prd.js +1 -16
  181. package/dist/queries/prd/prd.js.map +1 -1
  182. package/dist/queries/qa-packets/focus-qa-failure.d.ts +18 -0
  183. package/dist/queries/qa-packets/focus-qa-failure.d.ts.map +1 -1
  184. package/dist/queries/qa-packets/focus-qa-failure.js +14 -1
  185. package/dist/queries/qa-packets/focus-qa-failure.js.map +1 -1
  186. package/dist/queries/tower-decisions/tower-decisions.d.ts.map +1 -1
  187. package/dist/queries/tower-decisions/tower-decisions.js +1 -0
  188. package/dist/queries/tower-decisions/tower-decisions.js.map +1 -1
  189. package/dist/queries/verification/verification.d.ts +10 -0
  190. package/dist/queries/verification/verification.d.ts.map +1 -1
  191. package/dist/queries/verification/verification.js +1 -1
  192. package/dist/queries/verification/verification.js.map +1 -1
  193. package/dist/supervision/escalation-suppression.js +1 -1
  194. package/dist/supervision/failed-head-rerun.d.ts +7 -0
  195. package/dist/supervision/failed-head-rerun.d.ts.map +1 -0
  196. package/dist/supervision/failed-head-rerun.js +41 -0
  197. package/dist/supervision/failed-head-rerun.js.map +1 -0
  198. package/dist/supervision/focus-delivery-aggregate-phase.js +1 -1
  199. package/dist/supervision/focus-delivery-aggregate-phase.js.map +1 -1
  200. package/dist/supervision/focus-liveness.d.ts +89 -0
  201. package/dist/supervision/focus-liveness.d.ts.map +1 -0
  202. package/dist/supervision/focus-liveness.js +94 -0
  203. package/dist/supervision/focus-liveness.js.map +1 -0
  204. package/dist/supervision/focus-next-step.d.ts +175 -0
  205. package/dist/supervision/focus-next-step.d.ts.map +1 -0
  206. package/dist/supervision/focus-next-step.js +129 -0
  207. package/dist/supervision/focus-next-step.js.map +1 -0
  208. package/dist/supervision/prd-frontier-rule.d.ts +52 -0
  209. package/dist/supervision/prd-frontier-rule.d.ts.map +1 -0
  210. package/dist/supervision/prd-frontier-rule.js +51 -0
  211. package/dist/supervision/prd-frontier-rule.js.map +1 -0
  212. package/dist/supervision/prt-frontier.d.ts +22 -7
  213. package/dist/supervision/prt-frontier.d.ts.map +1 -1
  214. package/dist/supervision/prt-frontier.js +17 -7
  215. package/dist/supervision/prt-frontier.js.map +1 -1
  216. package/dist/supervision/review-loop-detector.d.ts.map +1 -1
  217. package/dist/supervision/review-loop-detector.js +2 -1
  218. package/dist/supervision/review-loop-detector.js.map +1 -1
  219. package/dist/supervision/spawn-cooldown.js +1 -1
  220. package/dist/supervision/stop-registry.d.ts +1 -0
  221. package/dist/supervision/stop-registry.d.ts.map +1 -1
  222. package/dist/supervision/stop-rows-focus-health.d.ts +14 -0
  223. package/dist/supervision/stop-rows-focus-health.d.ts.map +1 -1
  224. package/dist/supervision/stop-rows-focus-health.js +32 -0
  225. package/dist/supervision/stop-rows-focus-health.js.map +1 -1
  226. package/dist/supervision/stop-rows-spawn.d.ts +3 -2
  227. package/dist/supervision/stop-rows-spawn.d.ts.map +1 -1
  228. package/dist/supervision/stop-rows-spawn.js +9 -6
  229. package/dist/supervision/stop-rows-spawn.js.map +1 -1
  230. package/dist/supervision/team-work.js +1 -1
  231. package/dist/supervision/team-work.js.map +1 -1
  232. package/dist/testing/fixtures/api-client.js +1 -1
  233. package/dist/testing/fixtures/index.js +1 -1
  234. package/dist/testing/fixtures/migration-namespace-repo.d.ts.map +1 -1
  235. package/dist/testing/fixtures/migration-namespace-repo.js +1 -0
  236. package/dist/testing/fixtures/migration-namespace-repo.js.map +1 -1
  237. package/dist/testing/fixtures/pending-spawn-world.d.ts +24 -0
  238. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
  239. package/dist/testing/fixtures/pending-spawn-world.js +46 -19
  240. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
  241. package/dist/testing/fixtures/recording-api-client.js +1 -1
  242. package/dist/testing/fixtures/verification-deps.d.ts +27 -0
  243. package/dist/testing/fixtures/verification-deps.d.ts.map +1 -1
  244. package/dist/testing/fixtures/verification-deps.js +77 -1
  245. package/dist/testing/fixtures/verification-deps.js.map +1 -1
  246. package/dist/testing/fixtures/vitest-failure-log.d.ts.map +1 -1
  247. package/dist/testing/fixtures/vitest-failure-log.js +1 -0
  248. package/dist/testing/fixtures/vitest-failure-log.js.map +1 -1
  249. package/dist/tower/tower-supervisor-history.d.ts.map +1 -1
  250. package/dist/tower/tower-supervisor-history.js +2 -1
  251. package/dist/tower/tower-supervisor-history.js.map +1 -1
  252. package/dist/tower/tower-supervisor-prompt.d.ts.map +1 -1
  253. package/dist/tower/tower-supervisor-prompt.js +40 -8
  254. package/dist/tower/tower-supervisor-prompt.js.map +1 -1
  255. package/dist/tower/tower-supervisor-session.d.ts.map +1 -1
  256. package/dist/tower/tower-supervisor-session.js +1 -0
  257. package/dist/tower/tower-supervisor-session.js.map +1 -1
  258. package/dist/types/issue-status.d.ts.map +1 -1
  259. package/dist/types/issue-status.js +6 -1
  260. package/dist/types/issue-status.js.map +1 -1
  261. package/dist/verify/attribution/code-failure-evidence.d.ts +77 -0
  262. package/dist/verify/attribution/code-failure-evidence.d.ts.map +1 -0
  263. package/dist/verify/attribution/code-failure-evidence.js +92 -0
  264. package/dist/verify/attribution/code-failure-evidence.js.map +1 -0
  265. package/dist/verify/attribution/verification-attribution.d.ts +18 -0
  266. package/dist/verify/attribution/verification-attribution.d.ts.map +1 -1
  267. package/dist/verify/attribution/verification-attribution.js +49 -2
  268. package/dist/verify/attribution/verification-attribution.js.map +1 -1
  269. package/dist/verify/attribution/verification-baseline.d.ts.map +1 -1
  270. package/dist/verify/attribution/verification-baseline.js +1 -0
  271. package/dist/verify/attribution/verification-baseline.js.map +1 -1
  272. package/dist/verify/attribution/verification-diagnostics.d.ts +10 -0
  273. package/dist/verify/attribution/verification-diagnostics.d.ts.map +1 -1
  274. package/dist/verify/attribution/verification-diagnostics.js +39 -10
  275. package/dist/verify/attribution/verification-diagnostics.js.map +1 -1
  276. package/dist/verify/deterministic-gate/verification-deterministic.d.ts +19 -0
  277. package/dist/verify/deterministic-gate/verification-deterministic.d.ts.map +1 -1
  278. package/dist/verify/deterministic-gate/verification-deterministic.js +1 -1
  279. package/dist/verify/deterministic-gate/verification-deterministic.js.map +1 -1
  280. package/dist/verify/engine/verification-commit-sharing.d.ts.map +1 -1
  281. package/dist/verify/engine/verification-commit-sharing.js +36 -4
  282. package/dist/verify/engine/verification-commit-sharing.js.map +1 -1
  283. package/dist/verify/engine/verification-deps.d.ts +7 -0
  284. package/dist/verify/engine/verification-deps.d.ts.map +1 -1
  285. package/dist/verify/engine/verification-engine.d.ts.map +1 -1
  286. package/dist/verify/engine/verification-engine.js +6 -3
  287. package/dist/verify/engine/verification-engine.js.map +1 -1
  288. package/dist/verify/escaped-tests/escaped-test-run.d.ts +5 -1
  289. package/dist/verify/escaped-tests/escaped-test-run.d.ts.map +1 -1
  290. package/dist/verify/escaped-tests/escaped-test-run.js +24 -2
  291. package/dist/verify/escaped-tests/escaped-test-run.js.map +1 -1
  292. package/dist/verify/failing-test-rerun/failing-test-retry.d.ts +4 -1
  293. package/dist/verify/failing-test-rerun/failing-test-retry.d.ts.map +1 -1
  294. package/dist/verify/failing-test-rerun/failing-test-retry.js.map +1 -1
  295. package/dist/verify/gate-verdicts/commit-verdict-record.js +1 -1
  296. package/dist/verify/gate-verdicts/commit-verdict-record.js.map +1 -1
  297. package/dist/verify/gate-verdicts/no-verdict-record.d.ts +27 -3
  298. package/dist/verify/gate-verdicts/no-verdict-record.d.ts.map +1 -1
  299. package/dist/verify/gate-verdicts/no-verdict-record.js +36 -6
  300. package/dist/verify/gate-verdicts/no-verdict-record.js.map +1 -1
  301. package/dist/verify/outcome-routing/verification-rework-issue.d.ts.map +1 -1
  302. package/dist/verify/outcome-routing/verification-rework-issue.js +5 -4
  303. package/dist/verify/outcome-routing/verification-rework-issue.js.map +1 -1
  304. package/dist/verify/run-selection/default-on-guards.d.ts +15 -4
  305. package/dist/verify/run-selection/default-on-guards.d.ts.map +1 -1
  306. package/dist/verify/run-selection/default-on-guards.js +14 -4
  307. package/dist/verify/run-selection/default-on-guards.js.map +1 -1
  308. package/dist/verify/run-selection/explicit-next-step-gate.d.ts +39 -0
  309. package/dist/verify/run-selection/explicit-next-step-gate.d.ts.map +1 -0
  310. package/dist/verify/run-selection/explicit-next-step-gate.js +70 -0
  311. package/dist/verify/run-selection/explicit-next-step-gate.js.map +1 -0
  312. package/dist/verify/run-selection/pre-review-gate-dispatch.d.ts +0 -9
  313. package/dist/verify/run-selection/pre-review-gate-dispatch.d.ts.map +1 -1
  314. package/dist/verify/run-selection/pre-review-gate-dispatch.js +21 -62
  315. package/dist/verify/run-selection/pre-review-gate-dispatch.js.map +1 -1
  316. package/dist/verify/run-selection/reselection-log-line.d.ts +1 -1
  317. package/dist/verify/run-selection/reselection-log-line.d.ts.map +1 -1
  318. package/dist/verify/run-selection/reselection-log-line.js +2 -0
  319. package/dist/verify/run-selection/reselection-log-line.js.map +1 -1
  320. package/dist/verify/run-selection/verification-default-on.d.ts +32 -4
  321. package/dist/verify/run-selection/verification-default-on.d.ts.map +1 -1
  322. package/dist/verify/run-selection/verification-default-on.js +83 -19
  323. package/dist/verify/run-selection/verification-default-on.js.map +1 -1
  324. package/dist/verify/shortfalls/shortfall-park.js +1 -1
  325. package/dist/worktree/focus-worktree-state.js +1 -1
  326. package/dist/worktree/focus-worktree-state.js.map +1 -1
  327. package/package.json +3 -3
  328. package/dist/completion/state-cascade/review-next-step.d.ts +0 -107
  329. package/dist/completion/state-cascade/review-next-step.d.ts.map +0 -1
  330. package/dist/completion/state-cascade/review-next-step.js +0 -90
  331. package/dist/completion/state-cascade/review-next-step.js.map +0 -1
  332. package/dist/focus/failed-head-wedge.d.ts +0 -124
  333. package/dist/focus/failed-head-wedge.d.ts.map +0 -1
  334. package/dist/focus/failed-head-wedge.js +0 -120
  335. package/dist/focus/failed-head-wedge.js.map +0 -1
  336. package/dist/focus/stranded-review-reroute.d.ts +0 -70
  337. package/dist/focus/stranded-review-reroute.d.ts.map +0 -1
  338. package/dist/focus/stranded-review-reroute.js +0 -193
  339. package/dist/focus/stranded-review-reroute.js.map +0 -1
  340. package/dist/focus/uncommitted-work-backstop.d.ts +0 -115
  341. package/dist/focus/uncommitted-work-backstop.d.ts.map +0 -1
  342. package/dist/focus/uncommitted-work-backstop.js +0 -259
  343. package/dist/focus/uncommitted-work-backstop.js.map +0 -1
@@ -1,70 +0,0 @@
1
- import type { createEscalation } from '../supervision/escalation-filing.js';
2
- import type { CommitVerdict } from '../verify/gate-verdicts/commit-verdict-record.js';
3
- import { type FailedVerdictReworkDeps } from '../verify/outcome-routing/verification-rework-issue.js';
4
- /** Re-fires of one unchanged (window, HEAD, verdict) before the reroute. */
5
- export declare const STRANDED_REVIEW_REFIRE_BOUND = 3;
6
- /** escalation_kind of the observation a non-failed reroute files. */
7
- export declare const STRANDED_REVIEW_REROUTED_KIND = "stranded_review_rerouted";
8
- /** The focus slice the bound reads. */
9
- export interface StrandedReviewFocus {
10
- focus_id: string;
11
- focus_name: string;
12
- review_requested_at: string | null;
13
- }
14
- /** The bound's own reads and writes (with the rework filing, the root's `strandedReviewReroute` binding). */
15
- export interface StrandedReviewRerouteOwnDeps {
16
- resolveJudgedCommit: (focusId: string) => string | null;
17
- readCommitVerdict: (productId: string, focusId: string, sha: string) => CommitVerdict | null;
18
- clearPendingSpawnDirective: (focusId: string) => void;
19
- clearReviewRequestedAt: (focusId: string) => Promise<void>;
20
- createEscalation: typeof createEscalation;
21
- hasOpenFocusEscalation: (focusId: string, escalationKind: string) => Promise<boolean>;
22
- }
23
- /** Everything the bound acts through: its own collaborators plus the rework filing. */
24
- export interface StrandedReviewRerouteDeps extends Omit<FailedVerdictReworkDeps, 'getFocusDeliveries'>, StrandedReviewRerouteOwnDeps {
25
- /** The focus's deliveries with their gate_state: the rework filing's read, and the gate-verdict hold read. */
26
- getFocusDeliveries: (focusId: string) => Promise<ReadonlyArray<{
27
- id: string;
28
- executionStatus?: string | null;
29
- gateState?: unknown;
30
- }>>;
31
- }
32
- /** Test seam: forget every count. */
33
- export declare function __resetStrandedReviewRefiresForTests(): void;
34
- /**
35
- * The gate-verdict hold read, tri-state: 'held' when some verify delivery carries
36
- * the commit-verdict hold marker the review exit wrote (delivery/commit-verdict-hold.ts,
37
- * the same read the review park uses), 'clear' when the deliveries read and none
38
- * does, 'unreadable' when the read failed.
39
- */
40
- export declare function readStrandedReviewGateHold(focus: StrandedReviewFocus, deps: Pick<StrandedReviewRerouteDeps, 'getFocusDeliveries'>): Promise<'held' | 'clear' | 'unreadable'>;
41
- /**
42
- * Whether the stranded-review re-fire must leave this window alone because it may
43
- * be held open for a gate verdict. Such a window is the release pass's to route,
44
- * not a strand to re-fire (directive/phase-sync.ts shouldRefireStrandedReview).
45
- * FAIL-CLOSED: an unreadable hold answers true -- re-firing on a guess queued the
46
- * review that re-judged the held commit -- so the re-fire waits a poll and re-reads;
47
- * a readable window with no hold is a genuine strand and answers false.
48
- */
49
- export declare function strandedReviewAwaitsGateVerdict(focus: StrandedReviewFocus, deps: Pick<StrandedReviewRerouteDeps, 'getFocusDeliveries'>): Promise<boolean>;
50
- /**
51
- * The stranded-review re-fire decision checkDirectives (focus/directive-executor.ts)
52
- * takes for a focus whose current stage was already processed: the pure
53
- * shouldRefireStrandedReview over the live team / operator-stop facts and the
54
- * fail-closed gate-verdict hold read above. True = re-fire the review directive.
55
- */
56
- export declare function strandedReviewMayRefire(focus: StrandedReviewFocus & {
57
- operator_stopped_at?: string | null;
58
- }, stageName: string | undefined, hasActiveTeam: boolean, deps: Pick<StrandedReviewRerouteDeps, 'getFocusDeliveries'>): Promise<boolean>;
59
- /** What the bound decided for one re-fire. */
60
- export type StrandedReviewRefireDecision = 'refire' | 'rerouted';
61
- /**
62
- * Count a stranded-review re-fire the caller is about to make, or -- once the
63
- * same key has been re-fired STRANDED_REVIEW_REFIRE_BOUND times -- reroute instead
64
- * (module header). Never throws.
65
- */
66
- export declare function boundStrandedReviewRefire(focus: StrandedReviewFocus, ctx: {
67
- productId: string;
68
- organizationId: string;
69
- }, deps: StrandedReviewRerouteDeps): Promise<StrandedReviewRefireDecision>;
70
- //# sourceMappingURL=stranded-review-reroute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stranded-review-reroute.d.ts","sourceRoot":"","sources":["../../src/focus/stranded-review-reroute.ts"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAA2D,KAAK,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAO/J,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AAExE,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,6GAA6G;AAC7G,MAAM,WAAW,4BAA4B;IAC3C,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACxD,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAA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AM,GAAG,SAAS,EAC7B,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,GAC1D,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,8CAA8C;AAC9C,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,EAClD,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,4BAA4B,CAAC,CAgBvC"}
@@ -1,193 +0,0 @@
1
- // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: packages/daemon/src/focus/held-review-window-not-stranded.test.ts,
3
- // packages/daemon/src/focus/stranded-review-refire-bound.test.ts,
4
- // packages/daemon/src/focus/stranded-review-reroute.test.ts,
5
- // packages/daemon/src/integration/failed-verdict-review-exit-respawn-regression.test.ts,
6
- // packages/daemon/src/integration/failed-verdict-review-loop-regression.test.ts
7
- // PINNED-BY-END
8
- /**
9
- * The stranded-review re-fire is bounded per unchanged (focus, review window, HEAD,
10
- * gate verdict), and at the bound it takes a different route instead of queuing
11
- * the same review again.
12
- *
13
- * shouldRefireStrandedReview (directive/phase-sync.ts) re-queues the review
14
- * directive for a focus stuck in review with a pending request and no team. That
15
- * recovers a review a crash or teardown dropped. It does not recover a review that
16
- * RAN and could route nothing -- an exit held on a failed gate verdict leaves the
17
- * window set on purpose, and every re-fire would spawn another review of the same
18
- * range that stamps the same result and exits held again.
19
- * The review spawn gate declines such a range when it can read it
20
- * (focus/unchanged-reviewed-head.ts); this bound is the backstop for when it
21
- * cannot (no census, no recorded verdict, an unreadable read that failed open).
22
- *
23
- * Counting: each re-fire of a focus is counted under the key of what a review
24
- * would see -- the review window (review_requested_at), the judged commit (focus
25
- * worktree HEAD) and that commit's recorded gate verdict. A new window, a new
26
- * commit or a new verdict is a new key and starts over, so a review that has
27
- * something new to judge is never held back. In memory: a restart re-arms the
28
- * bound, which costs at most STRANDED_REVIEW_REFIRE_BOUND more re-fires.
29
- *
30
- * At the bound (reroute): logged with the focus, HEAD, verdict and bound, then
31
- * - a FAILED verdict: every verify delivery gets the rework Bug naming the
32
- * failure (verify/outcome-routing/verification-rework-issue.ts; deduped per commit, skipped
33
- * beside open work), so the live open-work pass routes it verify ->
34
- * verify_failed and a coding pass fixes it;
35
- * - otherwise (passed, or no verdict): one agent_resolvable observation
36
- * (stranded_review_rerouted) names the stuck window for a routing decider --
37
- * re-reviewing an unchanged range cannot answer it;
38
- * - either way the queued directive is dropped and the review window closed, so
39
- * the re-fire has nothing left to re-fire.
40
- * Best-effort throughout: a failed step is logged; the window stays set only when
41
- * its clear fails, and the next poll re-reaches the bound and retries.
42
- *
43
- * Not a strand at all: a window the review exit HELD for a gate verdict
44
- * (strandedReviewAwaitsGateVerdict -- an unreadable hold counts as held). The
45
- * release pass routes it when the verdict lands, so the re-fire
46
- * (strandedReviewMayRefire) leaves it alone and nothing is counted.
47
- *
48
- * Every read and write is a REQUIRED collaborator (StrandedReviewRerouteDeps),
49
- * handed in by the directive executor from the composition root's
50
- * `strandedReviewReroute` context (composition/runtime-contexts.ts): the
51
- * failed-verdict rework filing and this bound's own reads and writes.
52
- *
53
- * History: docs/daemon/history-platform.md (focus/stranded-review-reroute.ts).
54
- *
55
- * @module focus/stranded-review-reroute
56
- */
57
- import { ESCALATION_REASONS } from '@telora/daemon-core';
58
- import { DISPOSITION_AGENT_RESOLVABLE } from '../queries/escalations/escalation-dispositions.js';
59
- import { describeFailedVerdictRework, fileReworkForFailedVerdict } from '../verify/outcome-routing/verification-rework-issue.js';
60
- import { commitVerdictHeldDeliveryIds } from '../delivery/commit-verdict-hold.js';
61
- import { shouldRefireStrandedReview } from '../directive/phase-sync.js';
62
- import { createLogger } from '../log/daemon-log.js';
63
- const log = createLogger({ module: 'directive-executor' });
64
- /** Re-fires of one unchanged (window, HEAD, verdict) before the reroute. */
65
- export const STRANDED_REVIEW_REFIRE_BOUND = 3;
66
- /** escalation_kind of the observation a non-failed reroute files. */
67
- export const STRANDED_REVIEW_REROUTED_KIND = 'stranded_review_rerouted';
68
- /** focusId -> the key re-fires are being counted under, and how many. */
69
- const refires = new Map();
70
- /** Test seam: forget every count. */
71
- export function __resetStrandedReviewRefiresForTests() {
72
- refires.clear();
73
- }
74
- function subjectOf(focus, productId, deps) {
75
- const head = deps.resolveJudgedCommit(focus.focus_id);
76
- const verdict = head && productId ? deps.readCommitVerdict(productId, focus.focus_id, head) : null;
77
- const verdictKey = verdict ? `${verdict.outcome}@${verdict.recordedAt}` : 'none';
78
- return { key: `${focus.review_requested_at ?? ''}|${head ?? '?'}|${verdictKey}`, head, verdict };
79
- }
80
- /**
81
- * The gate-verdict hold read, tri-state: 'held' when some verify delivery carries
82
- * the commit-verdict hold marker the review exit wrote (delivery/commit-verdict-hold.ts,
83
- * the same read the review park uses), 'clear' when the deliveries read and none
84
- * does, 'unreadable' when the read failed.
85
- */
86
- export async function readStrandedReviewGateHold(focus, deps) {
87
- try {
88
- return commitVerdictHeldDeliveryIds(await deps.getFocusDeliveries(focus.focus_id)).size > 0 ? 'held' : 'clear';
89
- }
90
- catch (err) {
91
- log.debug(`[directive-executor] gate-verdict hold unreadable for "${focus.focus_name}": ${err.message}`);
92
- return 'unreadable';
93
- }
94
- }
95
- /**
96
- * Whether the stranded-review re-fire must leave this window alone because it may
97
- * be held open for a gate verdict. Such a window is the release pass's to route,
98
- * not a strand to re-fire (directive/phase-sync.ts shouldRefireStrandedReview).
99
- * FAIL-CLOSED: an unreadable hold answers true -- re-firing on a guess queued the
100
- * review that re-judged the held commit -- so the re-fire waits a poll and re-reads;
101
- * a readable window with no hold is a genuine strand and answers false.
102
- */
103
- export async function strandedReviewAwaitsGateVerdict(focus, deps) {
104
- return (await readStrandedReviewGateHold(focus, deps)) !== 'clear';
105
- }
106
- /**
107
- * The stranded-review re-fire decision checkDirectives (focus/directive-executor.ts)
108
- * takes for a focus whose current stage was already processed: the pure
109
- * shouldRefireStrandedReview over the live team / operator-stop facts and the
110
- * fail-closed gate-verdict hold read above. True = re-fire the review directive.
111
- */
112
- export async function strandedReviewMayRefire(focus, stageName, hasActiveTeam, deps) {
113
- return shouldRefireStrandedReview({
114
- stageName,
115
- reviewRequestedAt: focus.review_requested_at,
116
- hasActiveTeam,
117
- operatorStopped: !!focus.operator_stopped_at,
118
- awaitingGateVerdict: await strandedReviewAwaitsGateVerdict(focus, deps),
119
- });
120
- }
121
- /**
122
- * Count a stranded-review re-fire the caller is about to make, or -- once the
123
- * same key has been re-fired STRANDED_REVIEW_REFIRE_BOUND times -- reroute instead
124
- * (module header). Never throws.
125
- */
126
- export async function boundStrandedReviewRefire(focus, ctx, deps) {
127
- let subject;
128
- try {
129
- subject = subjectOf(focus, ctx.productId, deps);
130
- }
131
- catch (err) {
132
- log.warn(`[directive-executor] stranded-review bound unreadable for "${focus.focus_name}" -- re-firing: ${err.message}`);
133
- return 'refire';
134
- }
135
- const prior = refires.get(focus.focus_id);
136
- const count = prior?.key === subject.key ? prior.count : 0;
137
- if (count < STRANDED_REVIEW_REFIRE_BOUND) {
138
- refires.set(focus.focus_id, { key: subject.key, count: count + 1 });
139
- return 'refire';
140
- }
141
- await reroute(focus, ctx, subject, deps);
142
- return 'rerouted';
143
- }
144
- async function reroute(focus, ctx, { head, verdict }, deps) {
145
- const at = head ? head.slice(0, 12) : '<unreadable HEAD>';
146
- const failed = verdict?.outcome === 'failed' && head !== null;
147
- log.warn(`[directive-executor] Stranded-review re-fire bound (${STRANDED_REVIEW_REFIRE_BOUND}) reached for "${focus.focus_name}" ` +
148
- `at HEAD ${at} (gate verdict: ${verdict?.outcome ?? 'none recorded'}): the same review was re-fired ` +
149
- `${STRANDED_REVIEW_REFIRE_BOUND} times with nothing changed -- not queuing another identical review; ` +
150
- (failed
151
- ? 'routing the failed verdict to rework (a Bug naming the failure on the verify delivery whose commits caused it) and closing the review window'
152
- : `closing the review window and filing a ${STRANDED_REVIEW_REROUTED_KIND} observation`));
153
- if (failed) {
154
- const result = await fileReworkForFailedVerdict(focus.focus_id, verdict, deps);
155
- log.info(`[directive-executor] "${focus.focus_name}": failed verdict at ${at} -- ${describeFailedVerdictRework(result)}`);
156
- }
157
- else
158
- await reportStuckWindow(focus, ctx, head, verdict, deps);
159
- deps.clearPendingSpawnDirective(focus.focus_id);
160
- try {
161
- await deps.clearReviewRequestedAt(focus.focus_id);
162
- refires.delete(focus.focus_id);
163
- }
164
- catch (err) {
165
- log.warn(`[directive-executor] "${focus.focus_name}": could not close the stranded review window (retried next poll): ${err.message}`);
166
- }
167
- }
168
- async function reportStuckWindow(focus, ctx, head, verdict, deps) {
169
- try {
170
- if (await deps.hasOpenFocusEscalation(focus.focus_id, STRANDED_REVIEW_REROUTED_KIND))
171
- return;
172
- await deps.createEscalation({
173
- organizationId: ctx.organizationId,
174
- issueId: null,
175
- reasonType: ESCALATION_REASONS.ERROR_ENCOUNTERED,
176
- disposition: DISPOSITION_AGENT_RESOLVABLE,
177
- escalationKind: STRANDED_REVIEW_REROUTED_KIND,
178
- anchor: { focusId: focus.focus_id },
179
- description: `Focus "${focus.focus_name}" re-fired the same stranded review ${STRANDED_REVIEW_REFIRE_BOUND} times at HEAD ` +
180
- `${head ?? '<unreadable>'} (gate verdict: ${verdict?.outcome ?? 'none recorded'}) with no active team and nothing ` +
181
- 'changed, so its review window was closed instead of queuing the review again.',
182
- whatWasTried: 'Each re-fire queued the review directive because review_requested_at stayed set; no review exit routed the ' +
183
- 'focus\'s verify deliveries at this commit.',
184
- helpNeeded: 'Find why the review of this commit cannot route its verify deliveries (daemon log: [focus-executor] review exit ' +
185
- 'lines, [commit-verdict-release], gate_state on the verify deliveries) and fix that; a new commit re-arms review.',
186
- metadata: { head, verdict: verdict?.outcome ?? null, bound: STRANDED_REVIEW_REFIRE_BOUND },
187
- });
188
- }
189
- catch (err) {
190
- log.warn(`[directive-executor] "${focus.focus_name}": failed to file the ${STRANDED_REVIEW_REROUTED_KIND} observation: ${err.message}`);
191
- }
192
- }
193
- //# sourceMappingURL=stranded-review-reroute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stranded-review-reroute.js","sourceRoot":"","sources":["../../src/focus/stranded-review-reroute.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,gFAAgF;AAChF,oEAAoE;AACpE,+DAA+D;AAC/D,2FAA2F;AAC3F,kFAAkF;AAClF,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAEjG,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAgC,MAAM,wDAAwD,CAAC;AAC/J,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,qEAAqE;AACrE,MAAM,CAAC,MAAM,6BAA6B,GAAG,0BAA0B,CAAC;AAyBxE,yEAAyE;AACzE,MAAM,OAAO,GAAG,IAAI,GAAG,EAA0C,CAAC;AAElE,qCAAqC;AACrC,MAAM,UAAU,oCAAoC;IAClD,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AASD,SAAS,SAAS,CAAC,KAA0B,EAAE,SAAiB,EAAE,IAA+B;IAC/F,MAAM,IAAI,GAAG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yB,KAAK,CAAC,UAAU,sEAAuE,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACpJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,iBAAiB,CAC9B,KAA0B,EAC1B,GAAkD,EAClD,IAAmB,EACnB,OAA6B,EAC7B,IAA+B;IAE/B,IAAI,CAAC;QACH,IAAI,MAAM,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,QAAQ,EAAE,6BAA6B,CAAC;YAAE,OAAO;QAC7F,MAAM,IAAI,CAAC,gBAAgB,CAAC;YAC1B,cAAc,EAAE,GAAG,CAAC,cAAc;YAClC,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,kBAAkB,CAAC,iBAAiB;YAChD,WAAW,EAAE,4BAA4B;YACzC,cAAc,EAAE,6BAA6B;YAC7C,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE;YACnC,WAAW,EACT,UAAU,KAAK,CAAC,UAAU,uCAAuC,4BAA4B,iBAAiB;gBAC9G,GAAG,IAAI,IAAI,cAAc,mBAAmB,OAAO,EAAE,OAAO,IAAI,eAAe,oCAAoC;gBACnH,+EAA+E;YACjF,YAAY,EACV,6GAA6G;gBAC7G,4CAA4C;YAC9C,UAAU,EACR,kHAAkH;gBAClH,kHAAkH;YACpH,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,EAAE,4BAA4B,EAAE;SAC3F,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,yBAAyB,KAAK,CAAC,UAAU,yBAAyB,6BAA6B,iBAAkB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACrJ,CAAC;AACH,CAAC"}
@@ -1,115 +0,0 @@
1
- import type { PipelineConfig } from '../types/index.js';
2
- import type { CreateEscalationParams } from '../supervision/escalation-filing.js';
3
- import type { DeliveryGateRowIo } from '../queries/deliveries/deliveries.js';
4
- /** How long the state must stand, teamless, before the pass acts (and again before it records). */
5
- export declare const UNCOMMITTED_WORK_GRACE_MS: number;
6
- /** How long a queued respawn may wait to spawn (cooldown, a parked guard) before the record is filed anyway. */
7
- export declare const UNCOMMITTED_WORK_RESPAWN_WAIT_MS: number;
8
- /** At most this many paths are named in the respawn prompt and the record; the count carries the rest. */
9
- export declare const UNCOMMITTED_WORK_PATH_CAP = 20;
10
- /** The focus slice the pass reads (queries/focuses/focus-discovery.ts ActiveFocusRow). */
11
- export interface UncommittedWorkFocusRow {
12
- focus_id: string;
13
- focus_name: string;
14
- assigned_agent_role_id: string | null;
15
- operator_stopped_at?: string | null;
16
- read_only?: boolean | null;
17
- pipeline_config?: PipelineConfig | null;
18
- }
19
- /** The coding respawn the pass queues (directive/directive-queue.ts queueDaemonCodingRespawn). */
20
- export interface CodingRespawnRequest {
21
- focusId: string;
22
- message: string;
23
- contentHash: string;
24
- focusOverrideModel: string | null;
25
- }
26
- /** What the record names. */
27
- export interface UncommittedWorkRecord {
28
- organizationId: string;
29
- focusId: string;
30
- focusName: string;
31
- worktreePath: string;
32
- paths: readonly string[];
33
- }
34
- /** The pass's collaborators, every one REQUIRED (composition/runtime-poll-context.ts binds them). */
35
- export interface UncommittedWorkBackstopDeps {
36
- getActiveFocuses: (organizationId: string, productId: string) => Promise<readonly UncommittedWorkFocusRow[]>;
37
- /** Whether a team process is live for the focus on this host. */
38
- hasLiveTeam: (focusId: string) => boolean;
39
- /** The focus worktree, or null when the daemon holds none. */
40
- resolveWorktreePath: (focusId: string) => string | null;
41
- listUncommittedPaths: (worktreePath: string) => readonly string[];
42
- /** Queue the respawn unless a spawn directive is already queued; true when this call queued it. */
43
- queueCodingRespawn: (request: CodingRespawnRequest) => boolean;
44
- /** Whether a spawn directive is still queued for the focus (the respawn has not spawned yet). */
45
- hasQueuedSpawn: (focusId: string) => boolean;
46
- /** Withdraw this pass's own queued respawn (and nothing else); true when one was withdrawn. */
47
- withdrawCodingRespawn: (focusId: string) => boolean;
48
- /** File the record (deduped per focus by the caller's binding); never throws past its own logging. */
49
- recordUncommittedWork: (record: UncommittedWorkRecord) => Promise<void>;
50
- /** Close the record once the worktree is clean; the count closed. */
51
- resolveRecord: (focusId: string) => Promise<number>;
52
- now: () => number;
53
- }
54
- /** Test seam: forget every episode. */
55
- export declare function __resetUncommittedWorkBackstopForTests(): void;
56
- /** What the pass did for one focus. */
57
- export type UncommittedWorkAction = {
58
- kind: 'respawned';
59
- paths: readonly string[];
60
- queued: boolean;
61
- } | {
62
- kind: 'recorded';
63
- paths: readonly string[];
64
- } | {
65
- kind: 'cleared';
66
- resolved: number;
67
- };
68
- /** The respawned team's directive: what is uncommitted and what finishes it. Pure. */
69
- export declare function buildUncommittedWorkRespawnMessage(focusName: string, paths: readonly string[]): string;
70
- /** The pass for one focus (module header). Never throws. */
71
- export declare function checkUncommittedWork(focus: UncommittedWorkFocusRow, organizationId: string, deps: UncommittedWorkBackstopDeps): Promise<UncommittedWorkAction | null>;
72
- /** The seams the operator-visible record goes through. */
73
- export interface StrandedWorkRecordDeps {
74
- getFocusDeliveries: (focusId: string) => Promise<ReadonlyArray<{
75
- id: string;
76
- executionStatus?: string | null;
77
- }>>;
78
- gateRowIo: DeliveryGateRowIo;
79
- now: () => number;
80
- }
81
- /**
82
- * Write the OPERATOR-VISIBLE record (module header, step 2) on every cycling
83
- * delivery of the focus: gate_state.advanceHold, reason worktree_uncommitted_no_team,
84
- * naming the worktree and the paths. Returns how many rows carry it. Throws what a
85
- * read or write throws (the pass retries).
86
- */
87
- export declare function recordStrandedWorkOnFocus(record: UncommittedWorkRecord, deps: StrandedWorkRecordDeps): Promise<number>;
88
- /** Clear the record from every delivery of the focus that carries it. Throws what a read or write throws. */
89
- export declare function clearStrandedWorkOnFocus(focusId: string, deps: StrandedWorkRecordDeps): Promise<void>;
90
- /** The filing seams the record goes through. */
91
- export interface UncommittedWorkRecordDeps {
92
- createEscalation: (params: CreateEscalationParams) => Promise<unknown>;
93
- /** Whether a sibling worktree-dirty escalation is already open for the focus (one dirty tree, one row). */
94
- hasOpenWorktreeDirtyEscalation: (focusId: string) => Promise<boolean>;
95
- }
96
- /**
97
- * File the record (module header, step 2): ONE agent-resolvable worktree-dirty
98
- * observation naming the uncommitted paths, unless a sibling worktree-dirty row
99
- * is already open for the focus. Committing or discarding the work is git work an
100
- * agent session can do, so it proposes no human act. A failed dedupe read files
101
- * (a genuine first record is not swallowed); a failed create throws to the caller.
102
- */
103
- export declare function fileUncommittedWorkRecord(record: UncommittedWorkRecord, deps: UncommittedWorkRecordDeps): Promise<void>;
104
- /**
105
- * The backstop pass over one product's active focuses (module header). Returns
106
- * what it did per focus it acted on. Never throws.
107
- */
108
- export declare function recoverUncommittedWork(config: {
109
- organizationId: string;
110
- productId: string;
111
- }, deps: UncommittedWorkBackstopDeps): Promise<Array<{
112
- focusId: string;
113
- action: UncommittedWorkAction;
114
- }>>;
115
- //# sourceMappingURL=uncommitted-work-backstop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uncommitted-work-backstop.d.ts","sourceRoot":"","sources":["../../src/focus/uncommitted-work-backstop.ts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAK7E,mGAAmG;AACnG,eAAO,MAAM,yBAAyB,QAAa,CAAC;AAEpD,gHAAgH;AAChH,eAAO,MAAM,gCAAgC,QAAc,CAAC;AAE5D,0GAA0G;AAC1G,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,0FAA0F;AAC1F,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,mBA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