@telora/daemon 0.24.25 → 0.24.26

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 (375) hide show
  1. package/build-info.json +9 -3
  2. package/dist/audit/audit-prompt.d.ts.map +1 -1
  3. package/dist/audit/audit-prompt.js +15 -0
  4. package/dist/audit/audit-prompt.js.map +1 -1
  5. package/dist/completion/completion-event/event.d.ts +4 -3
  6. package/dist/completion/completion-event/event.d.ts.map +1 -1
  7. package/dist/completion/completion-event/event.js.map +1 -1
  8. package/dist/completion/review-cycle-budget/review-cycle-cap.d.ts +19 -11
  9. package/dist/completion/review-cycle-budget/review-cycle-cap.d.ts.map +1 -1
  10. package/dist/completion/review-cycle-budget/review-cycle-cap.js +36 -36
  11. package/dist/completion/review-cycle-budget/review-cycle-cap.js.map +1 -1
  12. package/dist/completion/review-cycle-budget/review-loop-detection.d.ts +101 -0
  13. package/dist/completion/review-cycle-budget/review-loop-detection.d.ts.map +1 -0
  14. package/dist/completion/review-cycle-budget/review-loop-detection.js +105 -0
  15. package/dist/completion/review-cycle-budget/review-loop-detection.js.map +1 -0
  16. package/dist/completion/review-cycle-budget/spent-budget-release.d.ts +70 -0
  17. package/dist/completion/review-cycle-budget/spent-budget-release.d.ts.map +1 -0
  18. package/dist/completion/review-cycle-budget/spent-budget-release.js +98 -0
  19. package/dist/completion/review-cycle-budget/spent-budget-release.js.map +1 -0
  20. package/dist/completion/review-exit/review-defect-detector.d.ts +71 -49
  21. package/dist/completion/review-exit/review-defect-detector.d.ts.map +1 -1
  22. package/dist/completion/review-exit/review-defect-detector.js +75 -69
  23. package/dist/completion/review-exit/review-defect-detector.js.map +1 -1
  24. package/dist/completion/review-exit/review-exit-attribution.d.ts +1 -1
  25. package/dist/completion/review-exit/review-exit-attribution.js +1 -1
  26. package/dist/completion/review-exit/review-exit-deps.d.ts +5 -2
  27. package/dist/completion/review-exit/review-exit-deps.d.ts.map +1 -1
  28. package/dist/completion/review-exit/review-exit-deps.js +1 -1
  29. package/dist/completion/review-exit/review-exit-evidence.d.ts +10 -1
  30. package/dist/completion/review-exit/review-exit-evidence.d.ts.map +1 -1
  31. package/dist/completion/review-exit/review-exit-evidence.js +17 -14
  32. package/dist/completion/review-exit/review-exit-evidence.js.map +1 -1
  33. package/dist/completion/review-exit/review-exit-foreign-findings.d.ts +1 -1
  34. package/dist/completion/review-exit/review-exit-foreign-findings.d.ts.map +1 -1
  35. package/dist/completion/review-exit/review-exit-phase.d.ts.map +1 -1
  36. package/dist/completion/review-exit/review-exit-phase.js +12 -8
  37. package/dist/completion/review-exit/review-exit-phase.js.map +1 -1
  38. package/dist/completion/state-cascade/review-next-step.d.ts +12 -3
  39. package/dist/completion/state-cascade/review-next-step.d.ts.map +1 -1
  40. package/dist/completion/state-cascade/review-next-step.js +10 -1
  41. package/dist/completion/state-cascade/review-next-step.js.map +1 -1
  42. package/dist/completion/state-cascade/standing-approval-convergence.d.ts +1 -1
  43. package/dist/completion/state-cascade/standing-approval-convergence.d.ts.map +1 -1
  44. package/dist/completion/state-cascade/standing-approval-convergence.js +10 -4
  45. package/dist/completion/state-cascade/standing-approval-convergence.js.map +1 -1
  46. package/dist/completion/state-cascade/state-cascade.d.ts +3 -0
  47. package/dist/completion/state-cascade/state-cascade.d.ts.map +1 -1
  48. package/dist/completion/state-cascade/state-cascade.js +16 -1
  49. package/dist/completion/state-cascade/state-cascade.js.map +1 -1
  50. package/dist/completion/team-exit/status-advance-phase.d.ts +1 -1
  51. package/dist/completion/team-exit/status-advance-phase.d.ts.map +1 -1
  52. package/dist/completion/team-exit/status-advance-phase.js +6 -4
  53. package/dist/completion/team-exit/status-advance-phase.js.map +1 -1
  54. package/dist/completion/team-outcome/apply-turn.d.ts.map +1 -1
  55. package/dist/completion/team-outcome/apply-turn.js +9 -4
  56. package/dist/completion/team-outcome/apply-turn.js.map +1 -1
  57. package/dist/completion/team-outcome/decide-turn-entry-rows.d.ts.map +1 -1
  58. package/dist/completion/team-outcome/decide-turn-entry-rows.js +28 -3
  59. package/dist/completion/team-outcome/decide-turn-entry-rows.js.map +1 -1
  60. package/dist/completion/team-outcome/decide.d.ts.map +1 -1
  61. package/dist/completion/team-outcome/decide.js +1 -0
  62. package/dist/completion/team-outcome/decide.js.map +1 -1
  63. package/dist/completion/team-outcome/exit-limits.d.ts +6 -0
  64. package/dist/completion/team-outcome/exit-limits.d.ts.map +1 -1
  65. package/dist/completion/team-outcome/exit-limits.js +6 -0
  66. package/dist/completion/team-outcome/exit-limits.js.map +1 -1
  67. package/dist/completion/team-outcome/exit-pipeline-state.d.ts +5 -0
  68. package/dist/completion/team-outcome/exit-pipeline-state.d.ts.map +1 -1
  69. package/dist/completion/team-outcome/exit-pipeline-state.js.map +1 -1
  70. package/dist/completion/team-teardown/session-hold-bounds.d.ts +10 -1
  71. package/dist/completion/team-teardown/session-hold-bounds.d.ts.map +1 -1
  72. package/dist/completion/team-teardown/session-hold-bounds.js +11 -0
  73. package/dist/completion/team-teardown/session-hold-bounds.js.map +1 -1
  74. package/dist/completion/team-teardown/session-hold.d.ts.map +1 -1
  75. package/dist/completion/team-teardown/session-hold.js +2 -0
  76. package/dist/completion/team-teardown/session-hold.js.map +1 -1
  77. package/dist/composition/engine-start-context.d.ts.map +1 -1
  78. package/dist/composition/engine-start-context.js +9 -1
  79. package/dist/composition/engine-start-context.js.map +1 -1
  80. package/dist/composition/execution-spawn-context.d.ts.map +1 -1
  81. package/dist/composition/execution-spawn-context.js +2 -0
  82. package/dist/composition/execution-spawn-context.js.map +1 -1
  83. package/dist/composition/judgement-contexts.d.ts.map +1 -1
  84. package/dist/composition/judgement-contexts.js +8 -2
  85. package/dist/composition/judgement-contexts.js.map +1 -1
  86. package/dist/composition/review-exit-context.d.ts.map +1 -1
  87. package/dist/composition/review-exit-context.js +2 -0
  88. package/dist/composition/review-exit-context.js.map +1 -1
  89. package/dist/composition/review-loop-context.d.ts +28 -0
  90. package/dist/composition/review-loop-context.d.ts.map +1 -0
  91. package/dist/composition/review-loop-context.js +147 -0
  92. package/dist/composition/review-loop-context.js.map +1 -0
  93. package/dist/composition/runtime-heartbeat-context.d.ts.map +1 -1
  94. package/dist/composition/runtime-heartbeat-context.js +8 -2
  95. package/dist/composition/runtime-heartbeat-context.js.map +1 -1
  96. package/dist/composition/spawn-pass-deps.d.ts.map +1 -1
  97. package/dist/composition/spawn-pass-deps.js +3 -0
  98. package/dist/composition/spawn-pass-deps.js.map +1 -1
  99. package/dist/composition/state-cascade-context.d.ts.map +1 -1
  100. package/dist/composition/state-cascade-context.js +3 -1
  101. package/dist/composition/state-cascade-context.js.map +1 -1
  102. package/dist/composition/tower-escalation-context.d.ts +12 -0
  103. package/dist/composition/tower-escalation-context.d.ts.map +1 -0
  104. package/dist/composition/tower-escalation-context.js +109 -0
  105. package/dist/composition/tower-escalation-context.js.map +1 -0
  106. package/dist/composition/workstation-intervals-context.d.ts +3 -0
  107. package/dist/composition/workstation-intervals-context.d.ts.map +1 -0
  108. package/dist/composition/workstation-intervals-context.js +33 -0
  109. package/dist/composition/workstation-intervals-context.js.map +1 -0
  110. package/dist/daemon-state/awaiting-slot.d.ts +18 -1
  111. package/dist/daemon-state/awaiting-slot.d.ts.map +1 -1
  112. package/dist/daemon-state/awaiting-slot.js +7 -0
  113. package/dist/daemon-state/awaiting-slot.js.map +1 -1
  114. package/dist/delivery/delivery-reconciler.d.ts +7 -7
  115. package/dist/delivery/recorded-concerns.d.ts +63 -28
  116. package/dist/delivery/recorded-concerns.d.ts.map +1 -1
  117. package/dist/delivery/recorded-concerns.js +72 -28
  118. package/dist/delivery/recorded-concerns.js.map +1 -1
  119. package/dist/directive/directive-queue.d.ts +8 -0
  120. package/dist/directive/directive-queue.d.ts.map +1 -1
  121. package/dist/directive/directive-queue.js +1 -1
  122. package/dist/directive/directive-queue.js.map +1 -1
  123. package/dist/focus/control-state.d.ts +6 -4
  124. package/dist/focus/control-state.d.ts.map +1 -1
  125. package/dist/focus/control-state.js +6 -4
  126. package/dist/focus/control-state.js.map +1 -1
  127. package/dist/focus/daemon-contexts-judgement.d.ts +6 -0
  128. package/dist/focus/daemon-contexts-judgement.d.ts.map +1 -1
  129. package/dist/focus/daemon-contexts.d.ts +6 -0
  130. package/dist/focus/daemon-contexts.d.ts.map +1 -1
  131. package/dist/focus/daemon-contexts.js.map +1 -1
  132. package/dist/focus/focus-engine.d.ts.map +1 -1
  133. package/dist/focus/focus-engine.js +3 -1
  134. package/dist/focus/focus-engine.js.map +1 -1
  135. package/dist/focus/focus-executor.d.ts.map +1 -1
  136. package/dist/focus/focus-executor.js +3 -2
  137. package/dist/focus/focus-executor.js.map +1 -1
  138. package/dist/focus/focus-loop-registry.d.ts.map +1 -1
  139. package/dist/focus/focus-loop-registry.js +42 -0
  140. package/dist/focus/focus-loop-registry.js.map +1 -1
  141. package/dist/focus/focus-poller-auto-advance.d.ts +4 -2
  142. package/dist/focus/focus-poller-auto-advance.d.ts.map +1 -1
  143. package/dist/focus/focus-poller-auto-advance.js +24 -18
  144. package/dist/focus/focus-poller-auto-advance.js.map +1 -1
  145. package/dist/focus/focus-poller-spawn.d.ts.map +1 -1
  146. package/dist/focus/focus-poller-spawn.js +8 -6
  147. package/dist/focus/focus-poller-spawn.js.map +1 -1
  148. package/dist/focus/heartbeat.d.ts +9 -2
  149. package/dist/focus/heartbeat.d.ts.map +1 -1
  150. package/dist/focus/heartbeat.js +9 -1
  151. package/dist/focus/heartbeat.js.map +1 -1
  152. package/dist/focus/pending-directive-gates.d.ts +14 -0
  153. package/dist/focus/pending-directive-gates.d.ts.map +1 -1
  154. package/dist/focus/pending-directive-gates.js +25 -1
  155. package/dist/focus/pending-directive-gates.js.map +1 -1
  156. package/dist/focus/pending-spawn-pass-deps.d.ts +7 -0
  157. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
  158. package/dist/focus/pending-spawn-review-next-step.d.ts +1 -1
  159. package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -1
  160. package/dist/focus/pending-spawn-review-next-step.js +2 -0
  161. package/dist/focus/pending-spawn-review-next-step.js.map +1 -1
  162. package/dist/focus/ready-focus-team-work.d.ts +9 -4
  163. package/dist/focus/ready-focus-team-work.d.ts.map +1 -1
  164. package/dist/focus/ready-focus-team-work.js +14 -3
  165. package/dist/focus/ready-focus-team-work.js.map +1 -1
  166. package/dist/focus/verify-open-issues.d.ts +3 -2
  167. package/dist/focus/verify-open-issues.d.ts.map +1 -1
  168. package/dist/focus/verify-open-issues.js +6 -4
  169. package/dist/focus/verify-open-issues.js.map +1 -1
  170. package/dist/focus/workstation-intervals.d.ts +83 -0
  171. package/dist/focus/workstation-intervals.d.ts.map +1 -0
  172. package/dist/focus/workstation-intervals.js +81 -0
  173. package/dist/focus/workstation-intervals.js.map +1 -0
  174. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +5 -2
  175. package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
  176. package/dist/focus-stage-lifecycle/wedge-watchdog.js +2 -2
  177. package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
  178. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  179. package/dist/prompt-sections/persona-sections.js +4 -1
  180. package/dist/prompt-sections/persona-sections.js.map +1 -1
  181. package/dist/prompt-sections/qa-author-section.d.ts.map +1 -1
  182. package/dist/prompt-sections/qa-author-section.js +18 -1
  183. package/dist/prompt-sections/qa-author-section.js.map +1 -1
  184. package/dist/prompt-sections/scoping-sections.d.ts +0 -12
  185. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
  186. package/dist/prompt-sections/scoping-sections.js +16 -2
  187. package/dist/prompt-sections/scoping-sections.js.map +1 -1
  188. package/dist/prompts/bounded-universals.d.ts +13 -0
  189. package/dist/prompts/bounded-universals.d.ts.map +1 -0
  190. package/dist/prompts/bounded-universals.js +32 -0
  191. package/dist/prompts/bounded-universals.js.map +1 -0
  192. package/dist/queries/api-client/shared.d.ts +2 -1
  193. package/dist/queries/api-client/shared.d.ts.map +1 -1
  194. package/dist/queries/api-client/shared.js +31 -1
  195. package/dist/queries/api-client/shared.js.map +1 -1
  196. package/dist/queries/deliveries/issues.d.ts.map +1 -1
  197. package/dist/queries/deliveries/issues.js +1 -0
  198. package/dist/queries/deliveries/issues.js.map +1 -1
  199. package/dist/queries/escalations/escalation-consumption.d.ts +13 -0
  200. package/dist/queries/escalations/escalation-consumption.d.ts.map +1 -1
  201. package/dist/queries/escalations/escalation-consumption.js +12 -2
  202. package/dist/queries/escalations/escalation-consumption.js.map +1 -1
  203. package/dist/queries/escalations/tower-escalations.d.ts +82 -0
  204. package/dist/queries/escalations/tower-escalations.d.ts.map +1 -0
  205. package/dist/queries/escalations/tower-escalations.js +97 -0
  206. package/dist/queries/escalations/tower-escalations.js.map +1 -0
  207. package/dist/queries/focus-review/recorded-concern-ids.d.ts +48 -11
  208. package/dist/queries/focus-review/recorded-concern-ids.d.ts.map +1 -1
  209. package/dist/queries/focus-review/recorded-concern-ids.js +42 -12
  210. package/dist/queries/focus-review/recorded-concern-ids.js.map +1 -1
  211. package/dist/queries/focus-review/review-criterion-verdicts.d.ts +37 -0
  212. package/dist/queries/focus-review/review-criterion-verdicts.d.ts.map +1 -0
  213. package/dist/queries/focus-review/review-criterion-verdicts.js +64 -0
  214. package/dist/queries/focus-review/review-criterion-verdicts.js.map +1 -0
  215. package/dist/queries/focus-review/review-finding-facts.d.ts +18 -6
  216. package/dist/queries/focus-review/review-finding-facts.d.ts.map +1 -1
  217. package/dist/queries/focus-review/review-finding-facts.js +21 -8
  218. package/dist/queries/focus-review/review-finding-facts.js.map +1 -1
  219. package/dist/queries/focuses/ended-arm.d.ts +56 -13
  220. package/dist/queries/focuses/ended-arm.d.ts.map +1 -1
  221. package/dist/queries/focuses/ended-arm.js +40 -14
  222. package/dist/queries/focuses/ended-arm.js.map +1 -1
  223. package/dist/queries/focuses/focus-criteria-standing.d.ts +12 -0
  224. package/dist/queries/focuses/focus-criteria-standing.d.ts.map +1 -1
  225. package/dist/queries/focuses/focus-criteria-standing.js +13 -0
  226. package/dist/queries/focuses/focus-criteria-standing.js.map +1 -1
  227. package/dist/queries/focuses/focus-discovery.d.ts +14 -3
  228. package/dist/queries/focuses/focus-discovery.d.ts.map +1 -1
  229. package/dist/queries/focuses/focus-discovery.js +2 -19
  230. package/dist/queries/focuses/focus-discovery.js.map +1 -1
  231. package/dist/queries/focuses/focuses.d.ts +15 -12
  232. package/dist/queries/focuses/focuses.d.ts.map +1 -1
  233. package/dist/queries/focuses/focuses.js +15 -13
  234. package/dist/queries/focuses/focuses.js.map +1 -1
  235. package/dist/queries/sessions/sessions.d.ts.map +1 -1
  236. package/dist/queries/sessions/sessions.js +2 -1
  237. package/dist/queries/sessions/sessions.js.map +1 -1
  238. package/dist/queries/tower-decisions/tower-decisions.d.ts +103 -0
  239. package/dist/queries/tower-decisions/tower-decisions.d.ts.map +1 -0
  240. package/dist/queries/tower-decisions/tower-decisions.js +138 -0
  241. package/dist/queries/tower-decisions/tower-decisions.js.map +1 -0
  242. package/dist/queries/wire-schemas/schemas.d.ts +2 -0
  243. package/dist/queries/wire-schemas/schemas.d.ts.map +1 -1
  244. package/dist/queries/wire-schemas/schemas.js +8 -2
  245. package/dist/queries/wire-schemas/schemas.js.map +1 -1
  246. package/dist/queries/workstation-intervals/workstation-intervals.d.ts +52 -0
  247. package/dist/queries/workstation-intervals/workstation-intervals.d.ts.map +1 -0
  248. package/dist/queries/workstation-intervals/workstation-intervals.js +49 -0
  249. package/dist/queries/workstation-intervals/workstation-intervals.js.map +1 -0
  250. package/dist/resolvers/escalation-answers.d.ts +31 -0
  251. package/dist/resolvers/escalation-answers.d.ts.map +1 -1
  252. package/dist/resolvers/escalation-answers.js +31 -17
  253. package/dist/resolvers/escalation-answers.js.map +1 -1
  254. package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -1
  255. package/dist/resolvers/focus-criteria-standing.js +20 -0
  256. package/dist/resolvers/focus-criteria-standing.js.map +1 -1
  257. package/dist/shell/unified-engine-lifecycle.d.ts +11 -1
  258. package/dist/shell/unified-engine-lifecycle.d.ts.map +1 -1
  259. package/dist/shell/unified-engine-lifecycle.js +10 -1
  260. package/dist/shell/unified-engine-lifecycle.js.map +1 -1
  261. package/dist/spawn/directive-dispatch.d.ts.map +1 -1
  262. package/dist/spawn/directive-dispatch.js +1 -0
  263. package/dist/spawn/directive-dispatch.js.map +1 -1
  264. package/dist/spawn/lead-continuation.d.ts +4 -3
  265. package/dist/spawn/lead-continuation.d.ts.map +1 -1
  266. package/dist/spawn/lead-continuation.js.map +1 -1
  267. package/dist/spawn/live-answer-delivery.d.ts +53 -0
  268. package/dist/spawn/live-answer-delivery.d.ts.map +1 -0
  269. package/dist/spawn/live-answer-delivery.js +26 -0
  270. package/dist/spawn/live-answer-delivery.js.map +1 -0
  271. package/dist/spawn/routing-decider-spawn.d.ts +64 -2
  272. package/dist/spawn/routing-decider-spawn.d.ts.map +1 -1
  273. package/dist/spawn/routing-decider-spawn.js +65 -20
  274. package/dist/spawn/routing-decider-spawn.js.map +1 -1
  275. package/dist/spawn/worktree-session.d.ts +7 -5
  276. package/dist/spawn/worktree-session.d.ts.map +1 -1
  277. package/dist/spawn/worktree-session.js +11 -7
  278. package/dist/spawn/worktree-session.js.map +1 -1
  279. package/dist/supervision/review-cycle-cap-hold.d.ts +11 -5
  280. package/dist/supervision/review-cycle-cap-hold.d.ts.map +1 -1
  281. package/dist/supervision/review-cycle-cap-hold.js +29 -11
  282. package/dist/supervision/review-cycle-cap-hold.js.map +1 -1
  283. package/dist/supervision/review-loop-detector.d.ts +48 -0
  284. package/dist/supervision/review-loop-detector.d.ts.map +1 -0
  285. package/dist/supervision/review-loop-detector.js +13 -0
  286. package/dist/supervision/review-loop-detector.js.map +1 -0
  287. package/dist/supervision/review-loop-hold.d.ts +29 -0
  288. package/dist/supervision/review-loop-hold.d.ts.map +1 -0
  289. package/dist/supervision/review-loop-hold.js +99 -0
  290. package/dist/supervision/review-loop-hold.js.map +1 -0
  291. package/dist/supervision/stall-detector-config.d.ts +8 -0
  292. package/dist/supervision/stall-detector-config.d.ts.map +1 -1
  293. package/dist/supervision/stall-detector-config.js +14 -3
  294. package/dist/supervision/stall-detector-config.js.map +1 -1
  295. package/dist/supervision/stop-registry.d.ts +3 -0
  296. package/dist/supervision/stop-registry.d.ts.map +1 -1
  297. package/dist/supervision/stop-registry.js +3 -1
  298. package/dist/supervision/stop-registry.js.map +1 -1
  299. package/dist/supervision/stop-rows-review-loop.d.ts +35 -0
  300. package/dist/supervision/stop-rows-review-loop.d.ts.map +1 -0
  301. package/dist/supervision/stop-rows-review-loop.js +150 -0
  302. package/dist/supervision/stop-rows-review-loop.js.map +1 -0
  303. package/dist/supervision/stop-rows-team-session.d.ts +1 -1
  304. package/dist/supervision/stop-rows-team-session.d.ts.map +1 -1
  305. package/dist/supervision/stop-rows-team-session.js.map +1 -1
  306. package/dist/supervision/unreviewed-settle-detector.d.ts +7 -2
  307. package/dist/supervision/unreviewed-settle-detector.d.ts.map +1 -1
  308. package/dist/supervision/unreviewed-settle-detector.js +15 -2
  309. package/dist/supervision/unreviewed-settle-detector.js.map +1 -1
  310. package/dist/templates/agents-md.d.ts.map +1 -1
  311. package/dist/templates/agents-md.js +1 -0
  312. package/dist/templates/agents-md.js.map +1 -1
  313. package/dist/templates/claude-md.d.ts +1 -1
  314. package/dist/templates/claude-md.d.ts.map +1 -1
  315. package/dist/templates/claude-md.js +12 -0
  316. package/dist/templates/claude-md.js.map +1 -1
  317. package/dist/testing/fixtures/api-client.js +1 -1
  318. package/dist/testing/fixtures/index.js +1 -1
  319. package/dist/testing/fixtures/pending-spawn-world.d.ts +4 -0
  320. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
  321. package/dist/testing/fixtures/pending-spawn-world.js +15 -2
  322. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
  323. package/dist/testing/fixtures/recording-api-client.js +1 -1
  324. package/dist/testing/fixtures/review-exit-deps.d.ts.map +1 -1
  325. package/dist/testing/fixtures/review-exit-deps.js +3 -1
  326. package/dist/testing/fixtures/review-exit-deps.js.map +1 -1
  327. package/dist/testing/fixtures/review-loop.d.ts +19 -0
  328. package/dist/testing/fixtures/review-loop.d.ts.map +1 -0
  329. package/dist/testing/fixtures/review-loop.js +30 -0
  330. package/dist/testing/fixtures/review-loop.js.map +1 -0
  331. package/dist/testing/fixtures/shortfall-rework-hold-deps.d.ts.map +1 -1
  332. package/dist/testing/fixtures/shortfall-rework-hold-deps.js +1 -0
  333. package/dist/testing/fixtures/shortfall-rework-hold-deps.js.map +1 -1
  334. package/dist/testing/fixtures/tower-loop.d.ts +28 -0
  335. package/dist/testing/fixtures/tower-loop.d.ts.map +1 -0
  336. package/dist/testing/fixtures/tower-loop.js +83 -0
  337. package/dist/testing/fixtures/tower-loop.js.map +1 -0
  338. package/dist/tower/tower-escalation-gather.d.ts +33 -0
  339. package/dist/tower/tower-escalation-gather.d.ts.map +1 -0
  340. package/dist/tower/tower-escalation-gather.js +38 -0
  341. package/dist/tower/tower-escalation-gather.js.map +1 -0
  342. package/dist/tower/tower-escalation-prompt.d.ts +62 -0
  343. package/dist/tower/tower-escalation-prompt.d.ts.map +1 -0
  344. package/dist/tower/tower-escalation-prompt.js +130 -0
  345. package/dist/tower/tower-escalation-prompt.js.map +1 -0
  346. package/dist/tower/tower-escalation-routing.d.ts +49 -0
  347. package/dist/tower/tower-escalation-routing.d.ts.map +1 -0
  348. package/dist/tower/tower-escalation-routing.js +53 -0
  349. package/dist/tower/tower-escalation-routing.js.map +1 -0
  350. package/dist/tower/tower-escalation-session.d.ts +149 -0
  351. package/dist/tower/tower-escalation-session.d.ts.map +1 -0
  352. package/dist/tower/tower-escalation-session.js +238 -0
  353. package/dist/tower/tower-escalation-session.js.map +1 -0
  354. package/dist/tower/tower-supervisor-history.d.ts +129 -0
  355. package/dist/tower/tower-supervisor-history.d.ts.map +1 -0
  356. package/dist/tower/tower-supervisor-history.js +217 -0
  357. package/dist/tower/tower-supervisor-history.js.map +1 -0
  358. package/dist/tower/tower-supervisor-prompt.d.ts +21 -0
  359. package/dist/tower/tower-supervisor-prompt.d.ts.map +1 -0
  360. package/dist/tower/tower-supervisor-prompt.js +205 -0
  361. package/dist/tower/tower-supervisor-prompt.js.map +1 -0
  362. package/dist/tower/tower-supervisor-session.d.ts +220 -0
  363. package/dist/tower/tower-supervisor-session.d.ts.map +1 -0
  364. package/dist/tower/tower-supervisor-session.js +307 -0
  365. package/dist/tower/tower-supervisor-session.js.map +1 -0
  366. package/dist/tower/tower-supervisor.d.ts +86 -0
  367. package/dist/tower/tower-supervisor.d.ts.map +1 -0
  368. package/dist/tower/tower-supervisor.js +8 -0
  369. package/dist/tower/tower-supervisor.js.map +1 -0
  370. package/dist/types/index.js +1 -1
  371. package/dist/verify/outcome-routing/verification-rework-issue.d.ts +4 -4
  372. package/dist/verify/outcome-routing/verification-rework-issue.d.ts.map +1 -1
  373. package/dist/verify/outcome-routing/verification-rework-issue.js +16 -6
  374. package/dist/verify/outcome-routing/verification-rework-issue.js.map +1 -1
  375. package/package.json +3 -3
@@ -0,0 +1,98 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/completion/review-cycle-budget/review-cycle-churn-meter.test.ts,
3
+ // packages/daemon/src/completion/review-cycle-budget/spent-budget-release.test.ts
4
+ // PINNED-BY-END
5
+ /**
6
+ * The spent-budget release RETRY: a focus whose review_cycle_count stands at
7
+ * TELORA_REVIEW_CYCLE_CAP while its role is still assigned gets its arm
8
+ * released, with arm_ended_reason = 'review_budget_spent', on the next cascade
9
+ * poll -- and on every poll after until the write lands.
10
+ *
11
+ * WHY. The budget crossing (review-cycle-cap.ts) writes the count first and
12
+ * then releases the arm. When the release write fails, the count alone holds
13
+ * every spawn gate (supervision/review-cycle-cap-hold.ts) -- with the role still
14
+ * set and no reason recorded, a hold nobody can read. This pass gives the hold a
15
+ * writer behind it, so the held state is transient by construction. History:
16
+ * docs/daemon/history-team-lifecycle.md (review-cycle-cap.ts).
17
+ *
18
+ * The same condition also arises with no failed write at all -- the cap lowered
19
+ * below a focus's standing count -- and is the same spent budget, so it is
20
+ * released the same way.
21
+ *
22
+ * WHAT IT SENDS. The record the failed crossing composed (remembered in this
23
+ * process, together with whether that crossing meant to close the review
24
+ * window), so the end names the findings the exit counted. With no remembered
25
+ * record (a daemon restart in between, or a lowered cap) it sends the count and
26
+ * the cap with `findingsBasis: 'not_measured'` -- the empty finding lists are an
27
+ * absence, not a reading -- and leaves the review window as it is (nothing
28
+ * read whether a gate verdict needs it).
29
+ *
30
+ * The decision is the stop registry's review_budget_spent row, read through
31
+ * isReviewCycleCapHeld -- but only on a READ count: an unreadable count holds
32
+ * every gate (fail closed) and releases nothing, because ending a run needs the
33
+ * fact, not its absence.
34
+ *
35
+ * @module completion/review-cycle-budget/spent-budget-release
36
+ */
37
+ import { ARM_ENDED_REVIEW_BUDGET_SPENT, } from '../../queries/focuses/ended-arm.js';
38
+ import { isReviewCycleCapHeld } from '../../supervision/review-cycle-cap-hold.js';
39
+ import { createLogger } from '../../log/daemon-log.js';
40
+ const log = createLogger({ module: 'focus-executor' });
41
+ /** Per-process: focus id -> the release its crossing could not land. */
42
+ const pendingReleases = new Map();
43
+ /** Remember a release the crossing could not land, for the next cascade poll to retry. */
44
+ export function rememberPendingSpentBudgetRelease(focusId, pending) {
45
+ pendingReleases.set(focusId, pending);
46
+ }
47
+ /** Test seam: drop every remembered release. */
48
+ export function __resetPendingSpentBudgetReleases() {
49
+ pendingReleases.clear();
50
+ }
51
+ /** Test/diagnostic read: the release remembered for a focus, if any. */
52
+ export function pendingSpentBudgetRelease(focusId) {
53
+ return pendingReleases.get(focusId);
54
+ }
55
+ /** Pure: the record a retry sends when no crossing record was remembered. */
56
+ export function unmeasuredSpentBudgetRecord(reviewCycleCount, cap) {
57
+ return {
58
+ reason: ARM_ENDED_REVIEW_BUDGET_SPENT,
59
+ detail: { reviewCycleCount, cap, openBlockingFindings: [], openConcerns: [], findingsBasis: 'not_measured' },
60
+ };
61
+ }
62
+ /**
63
+ * Release a still-armed focus whose review budget is spent. Never throws: a
64
+ * failed write stays pending and is re-attempted on the next poll.
65
+ */
66
+ export async function releaseArmUnderSpentBudget(facts, deps) {
67
+ if (facts.assignedAgentRoleId === null) {
68
+ // Released (by this path, the crossing, an operator, or the lifecycle clear): nothing owed.
69
+ pendingReleases.delete(facts.focusId);
70
+ return 'not_armed';
71
+ }
72
+ const cap = deps.resolveReviewCycleCap();
73
+ if (facts.reviewCycleCount === null || !isReviewCycleCapHeld({ reviewCycleCount: facts.reviewCycleCount, cap })) {
74
+ // A re-arm reset the count (or it was never spent): a remembered release is stale.
75
+ if (facts.reviewCycleCount !== null)
76
+ pendingReleases.delete(facts.focusId);
77
+ return 'not_spent';
78
+ }
79
+ const pending = pendingReleases.get(facts.focusId);
80
+ const record = pending?.record ?? unmeasuredSpentBudgetRecord(facts.reviewCycleCount, cap);
81
+ try {
82
+ await deps.releaseFocusArm(facts.focusId, record, { closeReviewWindow: pending?.closeReviewWindow ?? false });
83
+ }
84
+ catch (err) {
85
+ log.warn(`[spent-budget-release] "${facts.focusName}" is still armed with its review budget spent ` +
86
+ `(cycles=${facts.reviewCycleCount} >= cap=${cap}) and the release failed again: ${err.message}. ` +
87
+ `Re-attempting next poll.`);
88
+ return 'failed';
89
+ }
90
+ pendingReleases.delete(facts.focusId);
91
+ log.warn(`[spent-budget-release] "${facts.focusName}" was still armed with its review budget spent ` +
92
+ `(cycles=${facts.reviewCycleCount} >= cap=${cap}): the armed run has ENDED -- un-armed with ` +
93
+ `arm_ended_reason='${ARM_ENDED_REVIEW_BUDGET_SPENT}'` +
94
+ (pending ? ' (the record the crossing measured).' : " (findings not measured: findingsBasis='not_measured').") +
95
+ ' Only a new arm grants further cycles.');
96
+ return 'released';
97
+ }
98
+ //# sourceMappingURL=spent-budget-release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spent-budget-release.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QAC7F,qBAAqB,6BAA6B,GAAG;QACrD,CAAC,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,yDAAyD,CAAC;QAC9G,wCAAwC,CACzC,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -35,8 +35,12 @@ export declare function _resetAllRemediationCyclesForTest(): void;
35
35
  * - It has a non-null created_by_role_id (excludes human/UI creates).
36
36
  * - Its created_at is later than the focus's review_requested_at.
37
37
  * - Its status is open (To Do / In Progress / Blocked).
38
+ * - It is not a daemon-filed rework Bug (recorded-concern-ids.ts
39
+ * isDaemonReworkIssue), which is owed work whatever filed it.
38
40
  */
39
- export declare function isReviewFiledIssue(issue: Pick<FocusIssueInfo, 'createdByRoleId' | 'createdAt' | 'status'>, reviewRequestedAt: string | null): boolean;
41
+ export declare function isReviewFiledIssue(issue: Pick<FocusIssueInfo, 'createdByRoleId' | 'createdAt' | 'status'> & {
42
+ title?: string | null;
43
+ }, reviewRequestedAt: string | null): boolean;
40
44
  /**
41
45
  * Filter a focus's issues to only those that were filed during the most
42
46
  * recent review pass and are still open.
@@ -47,57 +51,55 @@ export declare function filterReviewFiledIssues(issues: FocusIssueInfo[], review
47
51
  * since the most recent review pass.
48
52
  */
49
53
  export declare function reviewFiledIssueExists(issues: FocusIssueInfo[], reviewRequestedAt: string | null): boolean;
50
- /**
51
- * Whether a priority label is an explicit, low (deferrable) severity. Null,
52
- * empty, P0, and P1 are all NOT deferrable.
53
- *
54
- * This is the FALLBACK of isBlockingReviewFinding only, for a finding with no
55
- * recorded class. Do not call it to decide whether a review finding blocks --
56
- * call isBlockingReviewFinding (pinned by review-finding-blocking-predicate.test.ts,
57
- * which fails on any non-test caller outside this module).
58
- */
59
- export declare function isLowPriority(priority: string | null | undefined): boolean;
60
54
  /**
61
55
  * Recorded finding classes keyed by issue id. An issue ABSENT from the map has
62
- * no recorded fact (an older edge, or a review that linked no criterion) and is
63
- * classified by the priority fallback.
56
+ * no recorded class (an older edge's link-less review, or a failed read); under
57
+ * the one rule it does not block.
64
58
  */
65
59
  export type ReviewFindingClasses = ReadonlyMap<string, ReviewFindingClass>;
66
- /** No recorded finding classes: every finding is classified by its priority alone. */
60
+ /** No recorded finding classes: no review finding blocks. */
67
61
  export declare const NO_RECORDED_CLASSES: ReviewFindingClasses;
68
62
  /**
69
- * THE blocking predicate for a review-filed finding -- the ONE place the daemon
70
- * decides whether a review finding may hold its delivery (route it to
71
- * verify_failed, target it with a gaps_found verdict, keep the review-cycle
72
- * count climbing). Every such decision -- the review exit's evidence
73
- * (review-exit-evidence.ts), the verify routing it tags for the reconciler
74
- * (delivery-reconciler.ts `deferrable`), the review-cycle cap's "open blocking
75
- * finding" (review-cycle-cap.ts, fed openBlockingFindings), delivery
76
- * attribution (review-exit-attribution.ts) and foreign-finding location
77
- * (review-exit-foreign-findings.ts) -- reads it; none reads priority directly.
63
+ * THE blocking predicate for a review-filed finding at the review exit -- the
64
+ * ONE place this path decides whether a review finding may hold its delivery
65
+ * (route it to verify_failed, target it with a gaps_found verdict, keep the
66
+ * review-cycle count climbing). Every such decision -- the review exit's
67
+ * evidence (review-exit-evidence.ts), the verify routing it tags for the
68
+ * reconciler (delivery-reconciler.ts `deferrable`), the review-cycle cap's
69
+ * "open blocking finding" (fed openBlockingFindings), delivery attribution
70
+ * (review-exit-attribution.ts) and foreign-finding location
71
+ * (review-exit-foreign-findings.ts) -- reads it; none reads priority.
78
72
  *
79
- * - a RECORDED fact wins, whatever the priority: `blocking` blocks, `concern`
80
- * does not. A finding blocks by falsifying an agreed criterion, not by the
81
- * severity a reviewer typed.
82
- * - NO recorded fact -> today's priority rule: only an explicit P2/P3 is
83
- * non-blocking; P0/P1 and unset block (the bar is never lowered by absence).
73
+ * It is the daemon mirror of the one rule (recorded-concern-ids.ts
74
+ * isBlockingFinding, pinned to supabase/functions/_shared/review-finding-class.ts):
75
+ * a finding blocks ONLY when a not_met criterion names it -- its recorded class
76
+ * is `blocking`. A recorded `concern`, and a finding with no recorded class (an
77
+ * older edge's link-less review, a review that never stamped, a failed read),
78
+ * do not block, whatever priority the reviewer typed. Until 2026-10-20 the
79
+ * no-class case fell back to priority here while the live writers counted it
80
+ * as owed work (docs/DECISIONS.md 2026-10-20, "A review concern never holds its
81
+ * delivery out of done").
84
82
  *
85
- * It classifies severity only; whether the issue is review-filed and open is
83
+ * It classifies the finding only; whether the issue is review-filed and open is
86
84
  * the caller's filter (isReviewFiledIssue / isReviewFiledComplete).
87
85
  */
88
- export declare function isBlockingReviewFinding(issue: Pick<FocusIssueInfo, 'id' | 'priority'>, findingClasses: ReviewFindingClasses): boolean;
86
+ export declare function isBlockingReviewFinding(issue: Pick<FocusIssueInfo, 'id'>, findingClasses: ReviewFindingClasses): boolean;
89
87
  /**
90
88
  * Whether an issue is a DEFERRABLE review note: a review-filed, still-open
91
- * issue (per isReviewFiledIssue) that is NOT a blocking finding
92
- * (isBlockingReviewFinding -- a recorded `concern`, or, with no recorded fact,
93
- * an explicit P2/P3). A deferrable note must NOT route a verify delivery to
89
+ * issue (per isReviewFiledIssue) that a review RECORDED (it carries a class)
90
+ * and that is NOT a blocking finding (isBlockingReviewFinding -- no not_met
91
+ * criterion names it). A deferrable note must NOT route a verify delivery to
94
92
  * verify_failed -- the review should converge (approve) and leave the note
95
93
  * tracked.
96
94
  *
97
- * Any open work that is NOT review-filed (e.g. pre-existing coding work) is
98
- * blocking. Deferrability is a property of review findings only.
95
+ * A filing no review recorded (window-matched, no class) is not a recorded
96
+ * concern -- nothing records it for the human -- so it is owed work, exactly as
97
+ * the live writers count it. Any other open work (pre-existing coding work) is
98
+ * owed too. Deferrability is a property of recorded review findings only.
99
99
  */
100
- export declare function isDeferrableReviewNote(issue: Pick<FocusIssueInfo, 'id' | 'createdByRoleId' | 'createdAt' | 'status' | 'priority'>, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): boolean;
100
+ export declare function isDeferrableReviewNote(issue: Pick<FocusIssueInfo, 'id' | 'createdByRoleId' | 'createdAt' | 'status'> & {
101
+ title?: string | null;
102
+ }, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): boolean;
101
103
  /**
102
104
  * Filter a focus's issues to the open, review-filed notes that are deferrable
103
105
  * (not blocking). The caller uses the ids to mark the matching reconciler
@@ -107,33 +109,53 @@ export declare function isDeferrableReviewNote(issue: Pick<FocusIssueInfo, 'id'
107
109
  export declare function filterDeferrableReviewNotes(issues: FocusIssueInfo[], reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): FocusIssueInfo[];
108
110
  /**
109
111
  * Returns true when there is at least one BLOCKING review-filed issue since the
110
- * most recent review pass -- a review-filed, still-open issue that is a
111
- * blocking finding (isBlockingReviewFinding). This is the gate for the
112
- * review_missing_report notice: a review that filed ONLY deferrable notes
113
- * converged cleanly and must not raise the "review skipped its outcome"
114
- * escalation.
112
+ * most recent review pass -- a review-filed, still-open issue that is not a
113
+ * deferrable note (a recorded blocking finding, or a filing no review
114
+ * recorded). This is the gate for the review_missing_report notice: a review
115
+ * that filed ONLY recorded concerns converged cleanly and must not raise the
116
+ * "review skipped its outcome" escalation.
115
117
  */
116
118
  export declare function blockingReviewFiledIssueExists(issues: FocusIssueInfo[], reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): boolean;
117
119
  /**
118
120
  * Time-independent review-filed test: the issue is a member of the focus's
119
- * review-filed id union AND is still open.
121
+ * review-filed id union AND is still open AND is no daemon rework Bug.
120
122
  */
121
- export declare function isReviewFiledById(issue: Pick<FocusIssueInfo, 'id' | 'status'>, reviewFiledIds: ReadonlySet<string>): boolean;
123
+ export declare function isReviewFiledById(issue: Pick<FocusIssueInfo, 'id' | 'status'> & {
124
+ title?: string | null;
125
+ }, reviewFiledIds: ReadonlySet<string>): boolean;
122
126
  /** Review-filed via the non-lossy id set OR the legacy review-window heuristic. */
123
- export declare function isReviewFiledComplete(issue: Pick<FocusIssueInfo, 'id' | 'createdByRoleId' | 'createdAt' | 'status'>, reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null): boolean;
127
+ export declare function isReviewFiledComplete(issue: Pick<FocusIssueInfo, 'id' | 'createdByRoleId' | 'createdAt' | 'status'> & {
128
+ title?: string | null;
129
+ }, reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null): boolean;
124
130
  /** Complete-set counterpart of reviewFiledIssueExists. */
125
131
  export declare function reviewFiledIssueExistsComplete(issues: FocusIssueInfo[], reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null): boolean;
132
+ /**
133
+ * THE review-exit classification of one issue against the complete set:
134
+ * - a RECORDED finding (in the review-filed id set) blocks only when a not_met
135
+ * criterion names it (isBlockingReviewFinding); otherwise it is a concern --
136
+ * deferrable;
137
+ * - a filing NO review recorded (matched by the review window only) is owed
138
+ * work: nothing records it as a concern for the human, so it routes like
139
+ * any open work, exactly as the live writers count it;
140
+ * - anything else is not review-filed (null).
141
+ * The membership is the live writers' membership (recorded = in the id set),
142
+ * so the review exit and the live writers never disagree about one issue.
143
+ */
144
+ export declare function reviewExitFindingClass(issue: Pick<FocusIssueInfo, 'id' | 'createdByRoleId' | 'createdAt' | 'status'> & {
145
+ title?: string | null;
146
+ }, reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): 'blocking' | 'concern' | 'unrecorded' | null;
126
147
  /** Complete-set counterpart of blockingReviewFiledIssueExists. */
127
148
  export declare function blockingReviewFiledIssueExistsComplete(issues: FocusIssueInfo[], reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): boolean;
128
149
  /**
129
150
  * Complete-set counterpart of blockingReviewFiledIssueExists returning the LIST
130
- * (not just existence): the OPEN, BLOCKING review-filed issues on the focus. Used
131
- * by the hand-off breaker to ENUMERATE the outstanding findings in its escalation
132
- * -- so an operator can tell whether the focus carries outstanding review
133
- * findings without opening the daemon log, rather than reading the breaker's old
151
+ * (not just existence): the OPEN review-filed issues on the focus that hold
152
+ * their delivery (reviewExitFindingClass blocking or unrecorded). Used by the
153
+ * hand-off breaker to ENUMERATE the outstanding findings in its escalation --
154
+ * so an operator can tell whether the focus carries outstanding review findings
155
+ * without opening the daemon log, rather than reading the breaker's old
134
156
  * untested "there was no work left to route" assertion.
135
157
  */
136
158
  export declare function filterBlockingReviewFiledComplete(issues: FocusIssueInfo[], reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): FocusIssueInfo[];
137
- /** Complete-set counterpart of filterDeferrableReviewNotes. */
159
+ /** Complete-set counterpart of filterDeferrableReviewNotes: the RECORDED concerns. */
138
160
  export declare function filterDeferrableReviewNotesComplete(issues: FocusIssueInfo[], reviewFiledIds: ReadonlySet<string>, reviewRequestedAt: string | null, findingClasses: ReviewFindingClasses): FocusIssueInfo[];
139
161
  //# sourceMappingURL=review-defect-detector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-defect-detector.d.ts","sourceRoot":"","sources":["../../../src/completion/review-exit/review-defect-detector.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAI7F;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MACU,CAAC;AAYlD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED,wCAAwC;AACxC,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAID;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC,EACvE,iBAAiB,E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,CAC5C,MAAM,EAAE,cAAc,EAAE,EACxB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAC/B,OAAO,CAET;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC1G,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,cAAc,EAAE,oBAAoB,GACnC,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,IAAI,CAK9C;AAaD,kEAAkE;AAClE,wBAAgB,sCAAsC,CACpD,MAAM,EAAE,cAAc,EAAE,EACxB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,cAAc,EAAE,oBAAoB,GACnC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,cAAc,EAAE,EACxB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,cAAc,EAAE,oBAAoB,GACnC,cAAc,EAAE,CAElB;AAED,sFAAsF;AACtF,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,cAAc,EAAE,EACxB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,EACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,cAAc,EAAE,oBAAoB,GACnC,cAAc,EAAE,CAElB"}
@@ -1,12 +1,11 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/completion/review-exit/review-defect-loop.test.ts,
3
3
  // packages/daemon/src/completion/review-exit/review-deferrable-classification.test.ts,
4
- // packages/daemon/src/completion/review-exit/review-exit-foreign-findings.test.ts,
5
- // packages/daemon/src/completion/review-exit/review-exit-foreign-focus-regression.test.ts,
6
4
  // packages/daemon/src/completion/review-exit/review-finding-blocking-predicate.test.ts
7
5
  // PINNED-BY-END
8
6
  import { OPEN_ISSUE_STATUSES } from '../../types/issue-status.js';
9
7
  import { loadEnvConfig } from '@telora/daemon-core';
8
+ import { isBlockingFinding, isDaemonReworkIssue } from '../../queries/focus-review/recorded-concern-ids.js';
10
9
  // ── Configuration ────────────────────────────────────────────────────────
11
10
  /**
12
11
  * Cap on remediation cycles before escalation. Sourced from the typed
@@ -44,10 +43,14 @@ export function _resetAllRemediationCyclesForTest() {
44
43
  * - It has a non-null created_by_role_id (excludes human/UI creates).
45
44
  * - Its created_at is later than the focus's review_requested_at.
46
45
  * - Its status is open (To Do / In Progress / Blocked).
46
+ * - It is not a daemon-filed rework Bug (recorded-concern-ids.ts
47
+ * isDaemonReworkIssue), which is owed work whatever filed it.
47
48
  */
48
49
  export function isReviewFiledIssue(issue, reviewRequestedAt) {
49
50
  if (!issue.createdByRoleId)
50
51
  return false;
52
+ if (isDaemonReworkIssue(issue))
53
+ return false;
51
54
  if (!OPEN_ISSUE_STATUSES.has(issue.status))
52
55
  return false;
53
56
  if (!reviewRequestedAt)
@@ -81,72 +84,51 @@ export function reviewFiledIssueExists(issues, reviewRequestedAt) {
81
84
  }
82
85
  return false;
83
86
  }
84
- // ── Deferrability classification ──────────────────────────────────────────
85
- /**
86
- * Priority labels that mark a review-filed note as DEFERRABLE when NO finding
87
- * class is recorded for it (the fallback inside isBlockingReviewFinding -- a
88
- * recorded blocking/concern fact always wins). The blocking set is everything
89
- * else -- P0/P1 AND a null/unset priority. The asymmetry is deliberate: the
90
- * control loop moves reality toward intent and never lowers the bar, so an
91
- * unprioritized note is treated as BLOCKING (route to verify_failed), not
92
- * silently converged. Only an EXPLICIT low priority makes a note deferrable.
93
- */
94
- const DEFERRABLE_PRIORITIES = new Set(['P2', 'P3']);
95
- /**
96
- * Whether a priority label is an explicit, low (deferrable) severity. Null,
97
- * empty, P0, and P1 are all NOT deferrable.
98
- *
99
- * This is the FALLBACK of isBlockingReviewFinding only, for a finding with no
100
- * recorded class. Do not call it to decide whether a review finding blocks --
101
- * call isBlockingReviewFinding (pinned by review-finding-blocking-predicate.test.ts,
102
- * which fails on any non-test caller outside this module).
103
- */
104
- export function isLowPriority(priority) {
105
- if (!priority)
106
- return false;
107
- return DEFERRABLE_PRIORITIES.has(priority.trim().toUpperCase());
108
- }
109
- /** No recorded finding classes: every finding is classified by its priority alone. */
87
+ /** No recorded finding classes: no review finding blocks. */
110
88
  export const NO_RECORDED_CLASSES = new Map();
111
89
  /**
112
- * THE blocking predicate for a review-filed finding -- the ONE place the daemon
113
- * decides whether a review finding may hold its delivery (route it to
114
- * verify_failed, target it with a gaps_found verdict, keep the review-cycle
115
- * count climbing). Every such decision -- the review exit's evidence
116
- * (review-exit-evidence.ts), the verify routing it tags for the reconciler
117
- * (delivery-reconciler.ts `deferrable`), the review-cycle cap's "open blocking
118
- * finding" (review-cycle-cap.ts, fed openBlockingFindings), delivery
119
- * attribution (review-exit-attribution.ts) and foreign-finding location
120
- * (review-exit-foreign-findings.ts) -- reads it; none reads priority directly.
90
+ * THE blocking predicate for a review-filed finding at the review exit -- the
91
+ * ONE place this path decides whether a review finding may hold its delivery
92
+ * (route it to verify_failed, target it with a gaps_found verdict, keep the
93
+ * review-cycle count climbing). Every such decision -- the review exit's
94
+ * evidence (review-exit-evidence.ts), the verify routing it tags for the
95
+ * reconciler (delivery-reconciler.ts `deferrable`), the review-cycle cap's
96
+ * "open blocking finding" (fed openBlockingFindings), delivery attribution
97
+ * (review-exit-attribution.ts) and foreign-finding location
98
+ * (review-exit-foreign-findings.ts) -- reads it; none reads priority.
121
99
  *
122
- * - a RECORDED fact wins, whatever the priority: `blocking` blocks, `concern`
123
- * does not. A finding blocks by falsifying an agreed criterion, not by the
124
- * severity a reviewer typed.
125
- * - NO recorded fact -> today's priority rule: only an explicit P2/P3 is
126
- * non-blocking; P0/P1 and unset block (the bar is never lowered by absence).
100
+ * It is the daemon mirror of the one rule (recorded-concern-ids.ts
101
+ * isBlockingFinding, pinned to supabase/functions/_shared/review-finding-class.ts):
102
+ * a finding blocks ONLY when a not_met criterion names it -- its recorded class
103
+ * is `blocking`. A recorded `concern`, and a finding with no recorded class (an
104
+ * older edge's link-less review, a review that never stamped, a failed read),
105
+ * do not block, whatever priority the reviewer typed. Until 2026-10-20 the
106
+ * no-class case fell back to priority here while the live writers counted it
107
+ * as owed work (docs/DECISIONS.md 2026-10-20, "A review concern never holds its
108
+ * delivery out of done").
127
109
  *
128
- * It classifies severity only; whether the issue is review-filed and open is
110
+ * It classifies the finding only; whether the issue is review-filed and open is
129
111
  * the caller's filter (isReviewFiledIssue / isReviewFiledComplete).
130
112
  */
131
113
  export function isBlockingReviewFinding(issue, findingClasses) {
132
- const recorded = findingClasses.get(issue.id);
133
- if (recorded !== undefined)
134
- return recorded === 'blocking';
135
- return !isLowPriority(issue.priority);
114
+ return isBlockingFinding(issue.id, findingClasses);
136
115
  }
137
116
  /**
138
117
  * Whether an issue is a DEFERRABLE review note: a review-filed, still-open
139
- * issue (per isReviewFiledIssue) that is NOT a blocking finding
140
- * (isBlockingReviewFinding -- a recorded `concern`, or, with no recorded fact,
141
- * an explicit P2/P3). A deferrable note must NOT route a verify delivery to
118
+ * issue (per isReviewFiledIssue) that a review RECORDED (it carries a class)
119
+ * and that is NOT a blocking finding (isBlockingReviewFinding -- no not_met
120
+ * criterion names it). A deferrable note must NOT route a verify delivery to
142
121
  * verify_failed -- the review should converge (approve) and leave the note
143
122
  * tracked.
144
123
  *
145
- * Any open work that is NOT review-filed (e.g. pre-existing coding work) is
146
- * blocking. Deferrability is a property of review findings only.
124
+ * A filing no review recorded (window-matched, no class) is not a recorded
125
+ * concern -- nothing records it for the human -- so it is owed work, exactly as
126
+ * the live writers count it. Any other open work (pre-existing coding work) is
127
+ * owed too. Deferrability is a property of recorded review findings only.
147
128
  */
148
129
  export function isDeferrableReviewNote(issue, reviewRequestedAt, findingClasses) {
149
- return isReviewFiledIssue(issue, reviewRequestedAt) && !isBlockingReviewFinding(issue, findingClasses);
130
+ return isReviewFiledIssue(issue, reviewRequestedAt) && findingClasses.has(issue.id)
131
+ && !isBlockingReviewFinding(issue, findingClasses);
150
132
  }
151
133
  /**
152
134
  * Filter a focus's issues to the open, review-filed notes that are deferrable
@@ -159,14 +141,14 @@ export function filterDeferrableReviewNotes(issues, reviewRequestedAt, findingCl
159
141
  }
160
142
  /**
161
143
  * Returns true when there is at least one BLOCKING review-filed issue since the
162
- * most recent review pass -- a review-filed, still-open issue that is a
163
- * blocking finding (isBlockingReviewFinding). This is the gate for the
164
- * review_missing_report notice: a review that filed ONLY deferrable notes
165
- * converged cleanly and must not raise the "review skipped its outcome"
166
- * escalation.
144
+ * most recent review pass -- a review-filed, still-open issue that is not a
145
+ * deferrable note (a recorded blocking finding, or a filing no review
146
+ * recorded). This is the gate for the review_missing_report notice: a review
147
+ * that filed ONLY recorded concerns converged cleanly and must not raise the
148
+ * "review skipped its outcome" escalation.
167
149
  */
168
150
  export function blockingReviewFiledIssueExists(issues, reviewRequestedAt, findingClasses) {
169
- return issues.some(i => isReviewFiledIssue(i, reviewRequestedAt) && isBlockingReviewFinding(i, findingClasses));
151
+ return issues.some(i => isReviewFiledIssue(i, reviewRequestedAt) && !isDeferrableReviewNote(i, reviewRequestedAt, findingClasses));
170
152
  }
171
153
  // ── Non-lossy (complete-set) classification ───────────────────────────────
172
154
  //
@@ -186,10 +168,10 @@ export function blockingReviewFiledIssueExists(issues, reviewRequestedAt, findin
186
168
  // stable across passes (the fix for the deferrable-note-re-blocked loop).
187
169
  /**
188
170
  * Time-independent review-filed test: the issue is a member of the focus's
189
- * review-filed id union AND is still open.
171
+ * review-filed id union AND is still open AND is no daemon rework Bug.
190
172
  */
191
173
  export function isReviewFiledById(issue, reviewFiledIds) {
192
- return reviewFiledIds.has(issue.id) && OPEN_ISSUE_STATUSES.has(issue.status);
174
+ return reviewFiledIds.has(issue.id) && OPEN_ISSUE_STATUSES.has(issue.status) && !isDaemonReworkIssue(issue);
193
175
  }
194
176
  /** Review-filed via the non-lossy id set OR the legacy review-window heuristic. */
195
177
  export function isReviewFiledComplete(issue, reviewFiledIds, reviewRequestedAt) {
@@ -199,23 +181,47 @@ export function isReviewFiledComplete(issue, reviewFiledIds, reviewRequestedAt)
199
181
  export function reviewFiledIssueExistsComplete(issues, reviewFiledIds, reviewRequestedAt) {
200
182
  return issues.some(i => isReviewFiledComplete(i, reviewFiledIds, reviewRequestedAt));
201
183
  }
184
+ /**
185
+ * THE review-exit classification of one issue against the complete set:
186
+ * - a RECORDED finding (in the review-filed id set) blocks only when a not_met
187
+ * criterion names it (isBlockingReviewFinding); otherwise it is a concern --
188
+ * deferrable;
189
+ * - a filing NO review recorded (matched by the review window only) is owed
190
+ * work: nothing records it as a concern for the human, so it routes like
191
+ * any open work, exactly as the live writers count it;
192
+ * - anything else is not review-filed (null).
193
+ * The membership is the live writers' membership (recorded = in the id set),
194
+ * so the review exit and the live writers never disagree about one issue.
195
+ */
196
+ export function reviewExitFindingClass(issue, reviewFiledIds, reviewRequestedAt, findingClasses) {
197
+ if (isReviewFiledById(issue, reviewFiledIds)) {
198
+ return isBlockingReviewFinding(issue, findingClasses) ? 'blocking' : 'concern';
199
+ }
200
+ return isReviewFiledIssue(issue, reviewRequestedAt) ? 'unrecorded' : null;
201
+ }
202
+ /** Whether an issue is open review-filed work that holds its delivery: a named finding, or an unrecorded filing. */
203
+ function holdsAsReviewFiled(issue, reviewFiledIds, reviewRequestedAt, findingClasses) {
204
+ const cls = reviewExitFindingClass(issue, reviewFiledIds, reviewRequestedAt, findingClasses);
205
+ return cls === 'blocking' || cls === 'unrecorded';
206
+ }
202
207
  /** Complete-set counterpart of blockingReviewFiledIssueExists. */
203
208
  export function blockingReviewFiledIssueExistsComplete(issues, reviewFiledIds, reviewRequestedAt, findingClasses) {
204
- return issues.some(i => isReviewFiledComplete(i, reviewFiledIds, reviewRequestedAt) && isBlockingReviewFinding(i, findingClasses));
209
+ return issues.some(i => holdsAsReviewFiled(i, reviewFiledIds, reviewRequestedAt, findingClasses));
205
210
  }
206
211
  /**
207
212
  * Complete-set counterpart of blockingReviewFiledIssueExists returning the LIST
208
- * (not just existence): the OPEN, BLOCKING review-filed issues on the focus. Used
209
- * by the hand-off breaker to ENUMERATE the outstanding findings in its escalation
210
- * -- so an operator can tell whether the focus carries outstanding review
211
- * findings without opening the daemon log, rather than reading the breaker's old
213
+ * (not just existence): the OPEN review-filed issues on the focus that hold
214
+ * their delivery (reviewExitFindingClass blocking or unrecorded). Used by the
215
+ * hand-off breaker to ENUMERATE the outstanding findings in its escalation --
216
+ * so an operator can tell whether the focus carries outstanding review findings
217
+ * without opening the daemon log, rather than reading the breaker's old
212
218
  * untested "there was no work left to route" assertion.
213
219
  */
214
220
  export function filterBlockingReviewFiledComplete(issues, reviewFiledIds, reviewRequestedAt, findingClasses) {
215
- return issues.filter(i => isReviewFiledComplete(i, reviewFiledIds, reviewRequestedAt) && isBlockingReviewFinding(i, findingClasses));
221
+ return issues.filter(i => holdsAsReviewFiled(i, reviewFiledIds, reviewRequestedAt, findingClasses));
216
222
  }
217
- /** Complete-set counterpart of filterDeferrableReviewNotes. */
223
+ /** Complete-set counterpart of filterDeferrableReviewNotes: the RECORDED concerns. */
218
224
  export function filterDeferrableReviewNotesComplete(issues, reviewFiledIds, reviewRequestedAt, findingClasses) {
219
- return issues.filter(i => isReviewFiledComplete(i, reviewFiledIds, reviewRequestedAt) && !isBlockingReviewFinding(i, findingClasses));
225
+ return issues.filter(i => reviewExitFindingClass(i, reviewFiledIds, reviewRequestedAt, findingClasses) === 'concern');
220
226
  }
221
227
  //# sourceMappingURL=review-defect-detector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-defect-detector.js","sourceR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E,iBAAiB,CAAC,IAAI,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,CAC/G,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,mCAAmC,CACjD,MAAwB,EACxB,cAAmC,EACnC,iBAAgC,EAChC,cAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,EAAE,cAAc,EAAE,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,CAChH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"review-defect-detector.js","sourceRoot":"","sources":["../../../src/completion/review-exit/review-defect-detector.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,oFAAoF;AACpF,yFAAyF;AACzF,yFAAyF;AACzF,gBAAgB;AAsBhB,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAE5G,4EAA4E;AAE5E;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACnC,aAAa,EAAE,CAAC,+BAA+B,CAAC;AAElD,wEAAwE;AAExE;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,MAAM,IAAI,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACvD,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,OAAO,IA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,iBAAiB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC;AAED,oHAAoH;AACpH,SAAS,kBAAkB,CACzB,KAAqB,EACrB,cAAmC,EACnC,iBAAgC,EAChC,cAAoC;IAEpC,MAAM,GAAG,GAAG,sBAAsB,CAAC,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC;IAC7F,OAAO,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,YAAY,CAAC;AACpD,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,sCAAsC,CACpD,MAAwB,EACxB,cAAmC,EACnC,iBAAgC,EAChC,cAAoC;IAEpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AACpG,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAAwB,EACxB,cAAmC,EACnC,iBAAgC,EAChC,cAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AACtG,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,mCAAmC,CACjD,MAAwB,EACxB,cAAmC,EACnC,iBAAgC,EAChC,cAAoC;IAEpC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,CAAC,KAAK,SAAS,CAAC,CAAC;AACxH,CAAC"}
@@ -23,7 +23,7 @@ export type GapsAttribution = 'targeted' | 'not_targeted' | 'unresolvable';
23
23
  * each issue's delivery). A closed or non-blocking note does not target its
24
24
  * delivery -- only an actionable open gap does. Blocking is
25
25
  * isBlockingReviewFinding over the findings' recorded classes (a recorded
26
- * concern never targets, a recorded blocking always does; no fact -> priority).
26
+ * concern never targets, a recorded blocking always does; no class -> concern).
27
27
  */
28
28
  export declare function resolveAttributedDeliveryIds(focusIssues: FocusIssueInfo[], createdIssueIds: ReadonlySet<string>, findingClasses: ReviewFindingClasses): Set<string>;
29
29
  /**
@@ -9,7 +9,7 @@ import { isBlockingReviewFinding } from './review-defect-detector.js';
9
9
  * each issue's delivery). A closed or non-blocking note does not target its
10
10
  * delivery -- only an actionable open gap does. Blocking is
11
11
  * isBlockingReviewFinding over the findings' recorded classes (a recorded
12
- * concern never targets, a recorded blocking always does; no fact -> priority).
12
+ * concern never targets, a recorded blocking always does; no class -> concern).
13
13
  */
14
14
  export function resolveAttributedDeliveryIds(focusIssues, createdIssueIds, findingClasses) {
15
15
  const attributed = new Set();
@@ -17,7 +17,8 @@ import type { ReviewWindowCommit } from '../../git/review-window-commits.js';
17
17
  import type { getActiveFocuses } from '../../queries/focuses/focus-discovery.js';
18
18
  import type { hasPendingSpawnDirective } from '../../directive/directive-queue.js';
19
19
  import type { emitLoopTrigger } from '../../loops/index.js';
20
- import type { getFocusDeliveries, getFocusIssues, clearReviewRequestedAt, releaseFocusArm, setReviewCycleCount, setReviewHandoffCount, getFocusReviewReportForSession } from '../../queries/focuses/focuses.js';
20
+ import type { getFocusDeliveries, getFocusIssues, clearReviewRequestedAt, setReviewCycleCount, setReviewHandoffCount, getFocusReviewReportForSession } from '../../queries/focuses/focuses.js';
21
+ import type { SpentBudgetRelease } from '../review-cycle-budget/spent-budget-release.js';
21
22
  import type { getFocusReviewFindingFacts } from '../../queries/focus-review/review-finding-facts.js';
22
23
  import type { resolveReviewCycleCap, resolveReviewHandoffCap } from '../../supervision/stall-detector-config.js';
23
24
  import type { getDeliveryIssues, rehomeIssueToDelivery } from '../../queries/deliveries/issues.js';
@@ -31,6 +32,7 @@ import type { CommitGateSeams } from '../../verify/gate-config/commit-gate-confi
31
32
  import type { ReviewAutoApproval } from '../../merge/review-auto-approval-record.js';
32
33
  import type { ReviewCensus } from './review-census-record.js';
33
34
  import type { ReopeningFalsifierResult } from './review-exit-falsifiers.js';
35
+ import type { ReviewLoopDetectionDeps } from '../review-cycle-budget/review-loop-detection.js';
34
36
  /**
35
37
  * Dependencies for runReviewExitHandler. Every member is required: production
36
38
  * wires them at the composition root, and a test names every collaborator it
@@ -65,8 +67,9 @@ export interface ReviewExitDeps {
65
67
  setReviewedThroughSha: (focusId: string, sha: string) => Promise<void>;
66
68
  setReviewCycleCount: typeof setReviewCycleCount;
67
69
  resolveReviewCycleCap: typeof resolveReviewCycleCap;
68
- releaseFocusArm: typeof releaseFocusArm;
70
+ releaseFocusArm: SpentBudgetRelease;
69
71
  isShuttingDown: () => boolean;
72
+ reviewLoop: ReviewLoopDetectionDeps;
70
73
  setReviewHandoffCount: typeof setReviewHandoffCount;
71
74
  resolveReviewHandoffCap: typeof resolveReviewHandoffCap;
72
75
  resolveHandoffExhaustedHold: (focusId: string, notes: string) => Promise<number>;