@telora/daemon 0.23.0 → 0.23.5

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 (317) hide show
  1. package/build-info.json +6 -3
  2. package/dist/completion/review-exit/review-census-record.d.ts.map +1 -1
  3. package/dist/completion/review-exit/review-census-record.js +1 -0
  4. package/dist/completion/review-exit/review-census-record.js.map +1 -1
  5. package/dist/completion/review-exit/review-exit-deps.d.ts +2 -1
  6. package/dist/completion/review-exit/review-exit-deps.d.ts.map +1 -1
  7. package/dist/completion/review-exit/review-exit-phase.d.ts +9 -0
  8. package/dist/completion/review-exit/review-exit-phase.d.ts.map +1 -1
  9. package/dist/completion/review-exit/review-exit-phase.js +5 -4
  10. package/dist/completion/review-exit/review-exit-phase.js.map +1 -1
  11. package/dist/completion/review-exit-holds/commit-verdict-release.d.ts.map +1 -1
  12. package/dist/completion/review-exit-holds/commit-verdict-release.js +34 -12
  13. package/dist/completion/review-exit-holds/commit-verdict-release.js.map +1 -1
  14. package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts +35 -2
  15. package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts.map +1 -1
  16. package/dist/completion/review-exit-holds/review-exit-verdict-gate.js +38 -6
  17. package/dist/completion/review-exit-holds/review-exit-verdict-gate.js.map +1 -1
  18. package/dist/completion/state-cascade/review-approved-head-gate.d.ts +6 -0
  19. package/dist/completion/state-cascade/review-approved-head-gate.d.ts.map +1 -1
  20. package/dist/completion/state-cascade/review-approved-head-gate.js +2 -1
  21. package/dist/completion/state-cascade/review-approved-head-gate.js.map +1 -1
  22. package/dist/completion/state-cascade/review-next-step.d.ts.map +1 -1
  23. package/dist/completion/state-cascade/review-next-step.js +15 -8
  24. package/dist/completion/state-cascade/review-next-step.js.map +1 -1
  25. package/dist/completion/state-cascade/standing-approval-convergence.d.ts.map +1 -1
  26. package/dist/completion/state-cascade/standing-approval-convergence.js +24 -12
  27. package/dist/completion/state-cascade/standing-approval-convergence.js.map +1 -1
  28. package/dist/completion/team-exit/status-advance-phase.d.ts.map +1 -1
  29. package/dist/completion/team-exit/status-advance-phase.js +6 -6
  30. package/dist/completion/team-exit/status-advance-phase.js.map +1 -1
  31. package/dist/completion/team-liveness/supervision-firing-record.d.ts +6 -0
  32. package/dist/completion/team-liveness/supervision-firing-record.d.ts.map +1 -1
  33. package/dist/completion/team-liveness/supervision-firing-record.js +10 -1
  34. package/dist/completion/team-liveness/supervision-firing-record.js.map +1 -1
  35. package/dist/completion/team-outcome/apply-advance.d.ts.map +1 -1
  36. package/dist/completion/team-outcome/apply-advance.js +3 -2
  37. package/dist/completion/team-outcome/apply-advance.js.map +1 -1
  38. package/dist/completion/team-outcome/decide-close-rows.d.ts +9 -0
  39. package/dist/completion/team-outcome/decide-close-rows.d.ts.map +1 -1
  40. package/dist/completion/team-outcome/decide-close-rows.js +18 -4
  41. package/dist/completion/team-outcome/decide-close-rows.js.map +1 -1
  42. package/dist/completion/team-outcome/delivery-advance-types.d.ts +19 -2
  43. package/dist/completion/team-outcome/delivery-advance-types.d.ts.map +1 -1
  44. package/dist/composition/completion-event-context.js +2 -2
  45. package/dist/composition/completion-event-context.js.map +1 -1
  46. package/dist/composition/daemon-contexts.d.ts.map +1 -1
  47. package/dist/composition/daemon-contexts.js +5 -1
  48. package/dist/composition/daemon-contexts.js.map +1 -1
  49. package/dist/composition/engine-start-context.d.ts +3 -0
  50. package/dist/composition/engine-start-context.d.ts.map +1 -0
  51. package/dist/composition/engine-start-context.js +24 -0
  52. package/dist/composition/engine-start-context.js.map +1 -0
  53. package/dist/composition/execution-spawn-context.d.ts.map +1 -1
  54. package/dist/composition/execution-spawn-context.js +13 -1
  55. package/dist/composition/execution-spawn-context.js.map +1 -1
  56. package/dist/composition/runtime-delivery-advance-context.js +3 -3
  57. package/dist/composition/runtime-delivery-advance-context.js.map +1 -1
  58. package/dist/composition/runtime-heartbeat-context.d.ts.map +1 -1
  59. package/dist/composition/runtime-heartbeat-context.js +3 -0
  60. package/dist/composition/runtime-heartbeat-context.js.map +1 -1
  61. package/dist/composition/runtime-poll-context.d.ts +29 -2
  62. package/dist/composition/runtime-poll-context.d.ts.map +1 -1
  63. package/dist/composition/runtime-poll-context.js +51 -4
  64. package/dist/composition/runtime-poll-context.js.map +1 -1
  65. package/dist/composition/runtime-prd-context.d.ts.map +1 -1
  66. package/dist/composition/runtime-prd-context.js +25 -1
  67. package/dist/composition/runtime-prd-context.js.map +1 -1
  68. package/dist/composition/runtime-spawn-pass-context.js +1 -1
  69. package/dist/composition/runtime-spawn-pass-context.js.map +1 -1
  70. package/dist/composition/spawn-pass-deps.d.ts +1 -1
  71. package/dist/composition/spawn-pass-deps.d.ts.map +1 -1
  72. package/dist/composition/spawn-pass-deps.js +3 -0
  73. package/dist/composition/spawn-pass-deps.js.map +1 -1
  74. package/dist/composition/standing-approval-context.d.ts.map +1 -1
  75. package/dist/composition/standing-approval-context.js +2 -1
  76. package/dist/composition/standing-approval-context.js.map +1 -1
  77. package/dist/composition/state-cascade-context.js +1 -1
  78. package/dist/composition/state-cascade-context.js.map +1 -1
  79. package/dist/composition/tower-pass-context.d.ts +9 -0
  80. package/dist/composition/tower-pass-context.d.ts.map +1 -0
  81. package/dist/composition/tower-pass-context.js +53 -0
  82. package/dist/composition/tower-pass-context.js.map +1 -0
  83. package/dist/composition/verify-rework-context.d.ts +26 -2
  84. package/dist/composition/verify-rework-context.d.ts.map +1 -1
  85. package/dist/composition/verify-rework-context.js +34 -10
  86. package/dist/composition/verify-rework-context.js.map +1 -1
  87. package/dist/config/live-daemon-config.d.ts.map +1 -1
  88. package/dist/config/live-daemon-config.js +1 -19
  89. package/dist/config/live-daemon-config.js.map +1 -1
  90. package/dist/daemon-state/awaiting-slot.d.ts.map +1 -1
  91. package/dist/daemon-state/awaiting-slot.js +2 -1
  92. package/dist/daemon-state/awaiting-slot.js.map +1 -1
  93. package/dist/daemon-state/focus-team-state.js +1 -1
  94. package/dist/daemon-state/intake-control.d.ts.map +1 -1
  95. package/dist/daemon-state/intake-control.js +2 -1
  96. package/dist/daemon-state/intake-control.js.map +1 -1
  97. package/dist/delivery/recorded-concerns.d.ts +19 -2
  98. package/dist/delivery/recorded-concerns.d.ts.map +1 -1
  99. package/dist/delivery/recorded-concerns.js +32 -6
  100. package/dist/delivery/recorded-concerns.js.map +1 -1
  101. package/dist/directive/directive-queue.js +1 -1
  102. package/dist/focus/closed-review-window.d.ts +12 -0
  103. package/dist/focus/closed-review-window.d.ts.map +1 -1
  104. package/dist/focus/closed-review-window.js +18 -0
  105. package/dist/focus/closed-review-window.js.map +1 -1
  106. package/dist/focus/control-state.d.ts +30 -26
  107. package/dist/focus/control-state.d.ts.map +1 -1
  108. package/dist/focus/control-state.js +60 -46
  109. package/dist/focus/control-state.js.map +1 -1
  110. package/dist/focus/daemon-contexts.d.ts +23 -0
  111. package/dist/focus/daemon-contexts.d.ts.map +1 -1
  112. package/dist/focus/daemon-contexts.js +1 -1
  113. package/dist/focus/daemon-contexts.js.map +1 -1
  114. package/dist/focus/engine-ready-pass.d.ts +11 -0
  115. package/dist/focus/engine-ready-pass.d.ts.map +1 -0
  116. package/dist/focus/engine-ready-pass.js +25 -0
  117. package/dist/focus/engine-ready-pass.js.map +1 -0
  118. package/dist/focus/failed-head-wedge.d.ts +95 -0
  119. package/dist/focus/failed-head-wedge.d.ts.map +1 -0
  120. package/dist/focus/failed-head-wedge.js +85 -0
  121. package/dist/focus/failed-head-wedge.js.map +1 -0
  122. package/dist/focus/focus-engine.d.ts.map +1 -1
  123. package/dist/focus/focus-engine.js +20 -20
  124. package/dist/focus/focus-engine.js.map +1 -1
  125. package/dist/focus/focus-loop-registry.d.ts.map +1 -1
  126. package/dist/focus/focus-loop-registry.js +2 -1
  127. package/dist/focus/focus-loop-registry.js.map +1 -1
  128. package/dist/focus/focus-poller-auto-advance.d.ts.map +1 -1
  129. package/dist/focus/focus-poller-auto-advance.js +4 -4
  130. package/dist/focus/focus-poller-auto-advance.js.map +1 -1
  131. package/dist/focus/focus-poller-spawn.d.ts +42 -49
  132. package/dist/focus/focus-poller-spawn.d.ts.map +1 -1
  133. package/dist/focus/focus-poller-spawn.js +129 -83
  134. package/dist/focus/focus-poller-spawn.js.map +1 -1
  135. package/dist/focus/focus-poller-state.d.ts.map +1 -1
  136. package/dist/focus/focus-poller-state.js +1 -19
  137. package/dist/focus/focus-poller-state.js.map +1 -1
  138. package/dist/focus/focus-poller.d.ts.map +1 -1
  139. package/dist/focus/focus-poller.js +2 -1
  140. package/dist/focus/focus-poller.js.map +1 -1
  141. package/dist/focus/focus-respawn-guard.d.ts +7 -0
  142. package/dist/focus/focus-respawn-guard.d.ts.map +1 -1
  143. package/dist/focus/focus-respawn-guard.js +20 -1
  144. package/dist/focus/focus-respawn-guard.js.map +1 -1
  145. package/dist/focus/focus-spawn-decision.d.ts +11 -3
  146. package/dist/focus/focus-spawn-decision.d.ts.map +1 -1
  147. package/dist/focus/focus-spawn-decision.js +3 -1
  148. package/dist/focus/focus-spawn-decision.js.map +1 -1
  149. package/dist/focus/heartbeat-metadata.d.ts +3 -0
  150. package/dist/focus/heartbeat-metadata.d.ts.map +1 -1
  151. package/dist/focus/heartbeat-metadata.js +6 -1
  152. package/dist/focus/heartbeat-metadata.js.map +1 -1
  153. package/dist/focus/heartbeat.d.ts.map +1 -1
  154. package/dist/focus/heartbeat.js +2 -0
  155. package/dist/focus/heartbeat.js.map +1 -1
  156. package/dist/focus/pending-directive-gates.d.ts +47 -0
  157. package/dist/focus/pending-directive-gates.d.ts.map +1 -0
  158. package/dist/focus/pending-directive-gates.js +76 -0
  159. package/dist/focus/pending-directive-gates.js.map +1 -0
  160. package/dist/focus/pending-review-approved-head.d.ts +2 -1
  161. package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
  162. package/dist/focus/pending-review-approved-head.js +3 -4
  163. package/dist/focus/pending-review-approved-head.js.map +1 -1
  164. package/dist/focus/pending-spawn-pass-deps.d.ts +5 -0
  165. package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
  166. package/dist/focus/pending-spawn-pass-deps.js +4 -1
  167. package/dist/focus/pending-spawn-pass-deps.js.map +1 -1
  168. package/dist/focus/pending-spawn-verify-hold.d.ts +13 -0
  169. package/dist/focus/pending-spawn-verify-hold.d.ts.map +1 -0
  170. package/dist/focus/pending-spawn-verify-hold.js +30 -0
  171. package/dist/focus/pending-spawn-verify-hold.js.map +1 -0
  172. package/dist/focus/ready-focus-spawn-action.d.ts +15 -2
  173. package/dist/focus/ready-focus-spawn-action.d.ts.map +1 -1
  174. package/dist/focus/ready-focus-spawn-action.js +25 -8
  175. package/dist/focus/ready-focus-spawn-action.js.map +1 -1
  176. package/dist/focus/spawn-demand-probe.d.ts +45 -0
  177. package/dist/focus/spawn-demand-probe.d.ts.map +1 -0
  178. package/dist/focus/spawn-demand-probe.js +74 -0
  179. package/dist/focus/spawn-demand-probe.js.map +1 -0
  180. package/dist/focus/stranded-review-reroute.d.ts.map +1 -1
  181. package/dist/focus/stranded-review-reroute.js +5 -3
  182. package/dist/focus/stranded-review-reroute.js.map +1 -1
  183. package/dist/focus/verify-routing-passes.d.ts +8 -3
  184. package/dist/focus/verify-routing-passes.d.ts.map +1 -1
  185. package/dist/focus/verify-routing-passes.js +1 -0
  186. package/dist/focus/verify-routing-passes.js.map +1 -1
  187. package/dist/git/focus-branch-containment.d.ts +39 -0
  188. package/dist/git/focus-branch-containment.d.ts.map +1 -0
  189. package/dist/git/focus-branch-containment.js +47 -0
  190. package/dist/git/focus-branch-containment.js.map +1 -0
  191. package/dist/git/types.d.ts.map +1 -1
  192. package/dist/git/types.js +1 -0
  193. package/dist/git/types.js.map +1 -1
  194. package/dist/poll-trigger.js +1 -1
  195. package/dist/poll-trigger.js.map +1 -1
  196. package/dist/prd/arm-readiness.d.ts.map +1 -1
  197. package/dist/prd/arm-readiness.js +2 -1
  198. package/dist/prd/arm-readiness.js.map +1 -1
  199. package/dist/prd/controller-shared.d.ts +32 -8
  200. package/dist/prd/controller-shared.d.ts.map +1 -1
  201. package/dist/prd/controller-shared.js +34 -18
  202. package/dist/prd/controller-shared.js.map +1 -1
  203. package/dist/prd/controller.d.ts.map +1 -1
  204. package/dist/prd/controller.js +3 -8
  205. package/dist/prd/controller.js.map +1 -1
  206. package/dist/prd/done-sweep.d.ts.map +1 -1
  207. package/dist/prd/done-sweep.js +2 -7
  208. package/dist/prd/done-sweep.js.map +1 -1
  209. package/dist/prd/frontier-arming.d.ts +13 -1
  210. package/dist/prd/frontier-arming.d.ts.map +1 -1
  211. package/dist/prd/frontier-arming.js +50 -2
  212. package/dist/prd/frontier-arming.js.map +1 -1
  213. package/dist/prd/index.d.ts.map +1 -1
  214. package/dist/prd/index.js +2 -1
  215. package/dist/prd/index.js.map +1 -1
  216. package/dist/queries/api-client/shared.d.ts +1 -0
  217. package/dist/queries/api-client/shared.d.ts.map +1 -1
  218. package/dist/queries/api-client/shared.js +16 -1
  219. package/dist/queries/api-client/shared.js.map +1 -1
  220. package/dist/queries/deliveries/issues.d.ts.map +1 -1
  221. package/dist/queries/deliveries/issues.js +3 -0
  222. package/dist/queries/deliveries/issues.js.map +1 -1
  223. package/dist/queries/focuses/focus-discovery.d.ts +15 -0
  224. package/dist/queries/focuses/focus-discovery.d.ts.map +1 -1
  225. package/dist/queries/focuses/focus-discovery.js +10 -1
  226. package/dist/queries/focuses/focus-discovery.js.map +1 -1
  227. package/dist/queries/prd/prd.d.ts.map +1 -1
  228. package/dist/queries/prd/prd.js +2 -1
  229. package/dist/queries/prd/prd.js.map +1 -1
  230. package/dist/queries/tower/tower-state.d.ts +56 -0
  231. package/dist/queries/tower/tower-state.d.ts.map +1 -0
  232. package/dist/queries/tower/tower-state.js +76 -0
  233. package/dist/queries/tower/tower-state.js.map +1 -0
  234. package/dist/queries/wire-schemas/schemas.d.ts +12 -0
  235. package/dist/queries/wire-schemas/schemas.d.ts.map +1 -1
  236. package/dist/queries/wire-schemas/schemas.js +11 -0
  237. package/dist/queries/wire-schemas/schemas.js.map +1 -1
  238. package/dist/spawn/lead-continuation.d.ts +9 -1
  239. package/dist/spawn/lead-continuation.d.ts.map +1 -1
  240. package/dist/spawn/lead-continuation.js +37 -11
  241. package/dist/spawn/lead-continuation.js.map +1 -1
  242. package/dist/spawn/spawn-decision.d.ts.map +1 -1
  243. package/dist/spawn/spawn-decision.js +4 -1
  244. package/dist/spawn/spawn-decision.js.map +1 -1
  245. package/dist/supervision/spawn-cooldown.js +1 -1
  246. package/dist/supervision/stop-rows-team-session.d.ts.map +1 -1
  247. package/dist/supervision/stop-rows-team-session.js +11 -10
  248. package/dist/supervision/stop-rows-team-session.js.map +1 -1
  249. package/dist/supervision/team-work.d.ts.map +1 -1
  250. package/dist/supervision/team-work.js +3 -1
  251. package/dist/supervision/team-work.js.map +1 -1
  252. package/dist/testing/fixtures/api-client.js +1 -1
  253. package/dist/testing/fixtures/approved-head-inert-deps.js +1 -1
  254. package/dist/testing/fixtures/approved-head-inert-deps.js.map +1 -1
  255. package/dist/testing/fixtures/index.js +1 -1
  256. package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
  257. package/dist/testing/fixtures/pending-spawn-world.js +3 -1
  258. package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
  259. package/dist/testing/fixtures/review-exit-deps.js +1 -1
  260. package/dist/testing/fixtures/review-exit-deps.js.map +1 -1
  261. package/dist/testing/fixtures/verification-feedback-deps.d.ts.map +1 -1
  262. package/dist/testing/fixtures/verification-feedback-deps.js +2 -0
  263. package/dist/testing/fixtures/verification-feedback-deps.js.map +1 -1
  264. package/dist/tower/focus-landed.d.ts +4 -0
  265. package/dist/tower/focus-landed.d.ts.map +1 -0
  266. package/dist/tower/focus-landed.js +45 -0
  267. package/dist/tower/focus-landed.js.map +1 -0
  268. package/dist/tower/tower-admission.d.ts +91 -0
  269. package/dist/tower/tower-admission.d.ts.map +1 -0
  270. package/dist/tower/tower-admission.js +137 -0
  271. package/dist/tower/tower-admission.js.map +1 -0
  272. package/dist/tower/tower-graph.d.ts +23 -0
  273. package/dist/tower/tower-graph.d.ts.map +1 -0
  274. package/dist/tower/tower-graph.js +53 -0
  275. package/dist/tower/tower-graph.js.map +1 -0
  276. package/dist/tower/tower-heartbeat-status.d.ts +28 -0
  277. package/dist/tower/tower-heartbeat-status.d.ts.map +1 -0
  278. package/dist/tower/tower-heartbeat-status.js +11 -0
  279. package/dist/tower/tower-heartbeat-status.js.map +1 -0
  280. package/dist/tower/tower-mode.d.ts +9 -0
  281. package/dist/tower/tower-mode.d.ts.map +1 -0
  282. package/dist/tower/tower-mode.js +16 -0
  283. package/dist/tower/tower-mode.js.map +1 -0
  284. package/dist/tower/tower-pass-standing.d.ts +8 -0
  285. package/dist/tower/tower-pass-standing.d.ts.map +1 -0
  286. package/dist/tower/tower-pass-standing.js +50 -0
  287. package/dist/tower/tower-pass-standing.js.map +1 -0
  288. package/dist/tower/tower-pass.d.ts +55 -0
  289. package/dist/tower/tower-pass.d.ts.map +1 -0
  290. package/dist/tower/tower-pass.js +59 -0
  291. package/dist/tower/tower-pass.js.map +1 -0
  292. package/dist/tower/tower-production-pass.d.ts +3 -0
  293. package/dist/tower/tower-production-pass.d.ts.map +1 -0
  294. package/dist/tower/tower-production-pass.js +24 -0
  295. package/dist/tower/tower-production-pass.js.map +1 -0
  296. package/dist/tower/tower-spawn-intent.d.ts +72 -0
  297. package/dist/tower/tower-spawn-intent.d.ts.map +1 -0
  298. package/dist/tower/tower-spawn-intent.js +138 -0
  299. package/dist/tower/tower-spawn-intent.js.map +1 -0
  300. package/dist/tower/tower-verdicts.d.ts +81 -0
  301. package/dist/tower/tower-verdicts.d.ts.map +1 -0
  302. package/dist/tower/tower-verdicts.js +139 -0
  303. package/dist/tower/tower-verdicts.js.map +1 -0
  304. package/dist/types/index.js +1 -1
  305. package/dist/types/issue-status.d.ts +14 -0
  306. package/dist/types/issue-status.d.ts.map +1 -1
  307. package/dist/types/issue-status.js +14 -0
  308. package/dist/types/issue-status.js.map +1 -1
  309. package/dist/verify/gate-verdicts/commit-verdict-record.js +1 -1
  310. package/dist/verify/outcome-routing/verification-rework-issue.d.ts +44 -5
  311. package/dist/verify/outcome-routing/verification-rework-issue.d.ts.map +1 -1
  312. package/dist/verify/outcome-routing/verification-rework-issue.js +85 -27
  313. package/dist/verify/outcome-routing/verification-rework-issue.js.map +1 -1
  314. package/dist/worktree/focus-worktree-state.d.ts.map +1 -1
  315. package/dist/worktree/focus-worktree-state.js +1 -0
  316. package/dist/worktree/focus-worktree-state.js.map +1 -1
  317. package/package.json +3 -3
@@ -1,27 +1,53 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: packages/daemon/src/delivery/recorded-concerns.test.ts
2
+ // Pinned by: packages/daemon/src/delivery/recorded-concerns.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
+ // packages/daemon/src/integration/verify-failure-rework-route.test.ts,
8
+ // packages/daemon/src/verify/outcome-routing/verification-rework-issue.test.ts
3
9
  // PINNED-BY-END
4
10
  import { recordedConcernIds } from '../queries/focus-review/recorded-concern-ids.js';
5
- import { OPEN_ISSUE_STATUSES } from '../types/issue-status.js';
11
+ import { OPEN_ISSUE_STATUSES, isGateReworkIssue } from '../types/issue-status.js';
6
12
  import { createLogger } from '../log/daemon-log.js';
7
13
  const log = createLogger({ module: 'recorded-concerns' });
8
14
  /** No recorded concerns: every open issue counts as work. */
9
15
  export const NO_RECORDED_CONCERNS = new Set();
16
+ /**
17
+ * The fail-closed answer of a reader whose facts read FAILED: empty like
18
+ * NO_RECORDED_CONCERNS (every open issue counts as work), but a distinct object, so
19
+ * a caller that reports WHY it treated an issue as owed can say the concerns were
20
+ * unreadable rather than absent (concernsUnreadable).
21
+ */
22
+ export const UNREADABLE_RECORDED_CONCERNS = new Set();
23
+ /** Whether a reader's answer is the fail-closed one for an unreadable facts read. */
24
+ export function concernsUnreadable(concernIds) {
25
+ return concernIds === UNREADABLE_RECORDED_CONCERNS;
26
+ }
10
27
  /**
11
28
  * Bind the production reader over the focus review-finding-facts read
12
29
  * (queries/focus-review/review-finding-facts.ts getFocusReviewFindingFacts),
13
30
  * keeping the recorded concerns (that module's recordedConcernIds -- the same
14
- * definition the team prompt's listing uses).
31
+ * definition the team prompt's listing uses) LESS every daemon-filed gate rework
32
+ * Bug (types/issue-status.ts isGateReworkIssue). issue_create credits an issue to
33
+ * the focus's live session, so a rework Bug filed while a review runs lands in
34
+ * that review's created ids, and an approving review records it as a concern --
35
+ * which would leave the failed gate with no owed work. `readFocusIssues` is read
36
+ * only when there are concerns to check; its failure fails closed like the facts.
15
37
  */
16
- export function makeRecordedConcernReader(readFacts) {
38
+ export function makeRecordedConcernReader(readFacts, readFocusIssues) {
17
39
  return async (focusId) => {
18
40
  try {
19
- return recordedConcernIds(await readFacts(focusId));
41
+ const concerns = recordedConcernIds(await readFacts(focusId));
42
+ if (concerns.size === 0)
43
+ return concerns;
44
+ const rework = new Set((await readFocusIssues(focusId)).filter(isGateReworkIssue).map((i) => i.id));
45
+ return new Set([...concerns].filter((id) => !rework.has(id)));
20
46
  }
21
47
  catch (err) {
22
48
  log.warn(`[recorded-concerns] review finding facts unreadable for focus ${focusId} -- ` +
23
49
  `every open issue counts as work this tick: ${err.message}`);
24
- return NO_RECORDED_CONCERNS;
50
+ return UNREADABLE_RECORDED_CONCERNS;
25
51
  }
26
52
  };
27
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"recorded-concerns.js","sourceRoot":"","sources":["../../src/delivery/recorded-concerns.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,oEAAoE;AACpE,gBAAgB;AA2BhB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EAA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C,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE;QAChE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AACrD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: 44 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/directive/directive-queue.ts
2
+ // Pinned by: 46 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/directive/directive-queue.ts
3
3
  // PINNED-BY-END
4
4
  /**
5
5
  * Directive queue: the pending spawn-directive store + its identity/guard logic.
@@ -12,6 +12,18 @@ export declare function dropReviewDirectiveOfClosedWindow(focus: {
12
12
  focus_name: string;
13
13
  review_requested_at: string | null;
14
14
  }): boolean;
15
+ /**
16
+ * The window guard's verdict WITHOUT its effects (no log, no discard): would
17
+ * gateReadyReviewDirectiveOnWindow withhold this focus's spawn now? True when a
18
+ * review directive is queued and its window cannot be read -- exactly when the
19
+ * guard withholds. A closed window is not a withhold (the guard discards the
20
+ * directive and the coding spawn proceeds). The tower's demand probe reads it
21
+ * (focus/spawn-demand-probe.ts) so a withheld focus reserves no product slot.
22
+ */
23
+ export declare function readyReviewWindowWouldWithhold(organizationId: string, focus: {
24
+ focus_id: string;
25
+ product_id: string | null;
26
+ }, readReviewWindow: ReadReviewWindow): Promise<boolean>;
15
27
  /**
16
28
  * The ready-focus pass's window guard, read before its spawn consumes a queued
17
29
  * directive. 'spawn': no review directive is queued, its window is open, or it
@@ -1 +1 @@
1
- {"version":3,"file":"closed-review-window.d.ts","sourceRoot":"","sources":["../../src/focus/closed-review-window.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;I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EACtD,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC1E,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,OAAO,GAAG,UAAU,CAAC,CAkB/B"}
@@ -34,6 +34,24 @@ export function dropReviewDirectiveOfClosedWindow(focus) {
34
34
  `queued for has closed; the next team spawned for the focus is a coding team, not a re-review of the same commit.`);
35
35
  return true;
36
36
  }
37
+ /**
38
+ * The window guard's verdict WITHOUT its effects (no log, no discard): would
39
+ * gateReadyReviewDirectiveOnWindow withhold this focus's spawn now? True when a
40
+ * review directive is queued and its window cannot be read -- exactly when the
41
+ * guard withholds. A closed window is not a withhold (the guard discards the
42
+ * directive and the coding spawn proceeds). The tower's demand probe reads it
43
+ * (focus/spawn-demand-probe.ts) so a withheld focus reserves no product slot.
44
+ */
45
+ export async function readyReviewWindowWouldWithhold(organizationId, focus, readReviewWindow) {
46
+ if (getPendingSpawnDirective(focus.focus_id)?.lineage !== 'review')
47
+ return false;
48
+ try {
49
+ return (await readReviewWindow(organizationId, focus)) === 'absent';
50
+ }
51
+ catch {
52
+ return true;
53
+ }
54
+ }
37
55
  /**
38
56
  * The ready-focus pass's window guard, read before its spawn consumes a queued
39
57
  * directive. 'spawn': no review directive is queued, its window is open, or it
@@ -1 +1 @@
1
- {"version":3,"file":"closed-review-window.js","sourceRoot":"","sources":["../../src/focus/closed-review-window.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC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AAkC;IAElC,IAAI,wBAAwB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IACnF,IAAI,MAAgC,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,gBAAgB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,QAAQ,CAAC;QAClB,GAAG,CAAC,KAAK,CAAC,gDAAgD,KAAK,CAAC,UAAU,MAAO,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IACD,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CACN,6CAA6C,KAAK,CAAC,UAAU,kDAAkD;YAC/G,mGAAmG,CACpG,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,iCAAiC,CAAC,EAAE,GAAG,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -73,33 +73,36 @@ export interface ReapDisarmedTeamsDeps {
73
73
  getActiveFocuses: typeof getActiveFocuses;
74
74
  initiateCooperativeStop: (focusId: string, options: CooperativeStopOptions) => void;
75
75
  }
76
+ /** The active-focus facts that say WHY a focus's arm is cleared. */
77
+ type DisarmCause = Pick<Awaited<ReturnType<typeof getActiveFocuses>>[number], 'operator_stopped_at' | 'arm_ended_reason'>;
76
78
  /**
77
- * Stop running teams whose focus has been STOPPED BY AN OPERATOR via the
78
- * dashboard Stop. This reaper brings the operator Stop toggle to parity with
79
- * the cockpit Stop: stop means stop.
80
- *
81
- * A null assigned_agent_role_id means one of TWO things, and they must be told
82
- * apart -- exactly the distinction the spawn side already draws in
83
- * decideNullRoleSpawn (supervision/null-role-spawn.ts):
84
- * - OPERATOR STOP (operator_stopped_at set): the human pulled the Play toggle
85
- * to halt the focus. This is what the reaper exists to enforce -> reap it.
86
- * - LIFECYCLE CLEAR (operator_stopped_at null): auto_terminate_focus_team()
87
- * nulled the role at completion. Reaping a team still winding down here would
88
- * tear it down before it can finish (e.g. write its focus_reviews row) -- the
89
- * exact bug this gate closes. LEAVE it running. (Note: a review pass now runs
90
- * under the HELD arm -- the arm is not cleared until the review window closes
91
- * -- so a null role here is a genuine completion, never a substituted role.)
79
+ * The shutdown reason a disarm reap stamps, PURE. The reap itself fires on any
80
+ * cleared arm; the reason is what the exit path keys on:
81
+ * - OPERATOR STOP (operator_stopped_at set: an operator unarm or a PRD pause)
82
+ * -> 'user_stopped'. The exit takes no WIP commit and runs no focus merge:
83
+ * the operator owns the branch and the worktree from here.
84
+ * - ARM ENDED by the daemon (arm_ended_reason set, e.g. a spent review budget)
85
+ * -> 'deactivated', a controlled stop with the ordinary exit.
86
+ * - LIFECYCLE CLEAR (neither): auto_terminate_focus_team() cleared the role
87
+ * because the work is complete (and, since the review window gates it, after
88
+ * the review closed) -> 'work_complete', the same teardown the completion
89
+ * pipeline makes, so a team still winding down exits as succeeded.
90
+ */
91
+ export declare function disarmReapShutdownReason(cause: DisarmCause): 'user_stopped' | 'deactivated' | 'work_complete';
92
+ /**
93
+ * Stop running teams whose focus is no longer ARMED. A cleared arm is the stop
94
+ * signal, whatever cleared it: an operator unarm (dashboard Stop / focus_update),
95
+ * a PRD pause, a spent review budget, or the lifecycle clear. This reaper brings
96
+ * every one of them to parity with the cockpit Stop: stop means stop.
92
97
  *
93
- * The reaper is the half of the spawn/reap pair the operator-stop marker was
94
- * never applied to; consulting operator_stopped_at here keeps the two sides
95
- * consistent (a future reader should not have to discover that one half reads
96
- * the marker and the other does not).
98
+ * It used to reap ONLY when operator_stopped_at was set, so an unarm that wrote
99
+ * the role without the stamp left the team running under no arm (the 2026-10-01
100
+ * incident). The stamp now decides only HOW the team is stopped (the shutdown
101
+ * reason, see disarmReapShutdownReason), never WHETHER.
97
102
  *
98
103
  * getActiveFocuses returns ALL status='active' focuses REGARDLESS of role
99
104
  * (daemon-focus-handlers handleDaemonGetActiveFocuses), so:
100
- * - PRESENT, null role, operator_stopped_at SET -> operator stop -> reap it;
101
- * - PRESENT, null role, operator_stopped_at NULL -> lifecycle clear (review
102
- * running or coding off-state) -> leave it;
105
+ * - PRESENT with a null role -> disarmed -> reap it;
103
106
  * - PRESENT with a non-null role -> still armed (idle/in-review/paused) -> leave it;
104
107
  * - ABSENT -> the focus is no longer status='active' (genuine deactivation),
105
108
  * owned by checkForDeactivatedFocuses (which runs earlier in the poll and
@@ -108,10 +111,10 @@ export interface ReapDisarmedTeamsDeps {
108
111
  * stopped focus keeps its worktree so a re-arm can resume.
109
112
  *
110
113
  * Re-arm within the grace window: the chosen rule is "complete the stop, then
111
- * allow a fresh spawn". The scheduled SIGTERM still fires (the team exits as a
112
- * clean operator stop); if the focus has since been re-armed, the next poll's
113
- * processReadyFocuses spawns a fresh team once the old one is gone. The stop is
114
- * never cancelled mid-flight, which keeps the path deterministic.
114
+ * allow a fresh spawn". The scheduled SIGTERM still fires; if the focus has
115
+ * since been re-armed, the next poll's processReadyFocuses spawns a fresh team
116
+ * once the old one is gone. The stop is never cancelled mid-flight, which keeps
117
+ * the path deterministic.
115
118
  */
116
119
  export declare function reapDisarmedTeams(config: DaemonConfig, deps: ReapDisarmedTeamsDeps): Promise<void>;
117
120
  /**
@@ -126,4 +129,5 @@ export declare function clearSuspendedFocuses(): void;
126
129
  * Clear the reaper's in-flight-stop dedup set (for testing).
127
130
  */
128
131
  export declare function clearPendingDisarmStops(): void;
132
+ export {};
129
133
  //# sourceMappingURL=control-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-state.d.ts","sourceRoot":"","sources":["../../src/focus/control-state.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,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gB,mBAAmB,IAAI,WAAW,CAAC,MAAM,CAAC,CAEzD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
@@ -227,32 +227,50 @@ export function initiateCooperativeStop(focusId, options, deps) {
227
227
  */
228
228
  const pendingDisarmStops = new Set();
229
229
  /**
230
- * Stop running teams whose focus has been STOPPED BY AN OPERATOR via the
231
- * dashboard Stop. This reaper brings the operator Stop toggle to parity with
232
- * the cockpit Stop: stop means stop.
233
- *
234
- * A null assigned_agent_role_id means one of TWO things, and they must be told
235
- * apart -- exactly the distinction the spawn side already draws in
236
- * decideNullRoleSpawn (supervision/null-role-spawn.ts):
237
- * - OPERATOR STOP (operator_stopped_at set): the human pulled the Play toggle
238
- * to halt the focus. This is what the reaper exists to enforce -> reap it.
239
- * - LIFECYCLE CLEAR (operator_stopped_at null): auto_terminate_focus_team()
240
- * nulled the role at completion. Reaping a team still winding down here would
241
- * tear it down before it can finish (e.g. write its focus_reviews row) -- the
242
- * exact bug this gate closes. LEAVE it running. (Note: a review pass now runs
243
- * under the HELD arm -- the arm is not cleared until the review window closes
244
- * -- so a null role here is a genuine completion, never a substituted role.)
230
+ * The shutdown reason a disarm reap stamps, PURE. The reap itself fires on any
231
+ * cleared arm; the reason is what the exit path keys on:
232
+ * - OPERATOR STOP (operator_stopped_at set: an operator unarm or a PRD pause)
233
+ * -> 'user_stopped'. The exit takes no WIP commit and runs no focus merge:
234
+ * the operator owns the branch and the worktree from here.
235
+ * - ARM ENDED by the daemon (arm_ended_reason set, e.g. a spent review budget)
236
+ * -> 'deactivated', a controlled stop with the ordinary exit.
237
+ * - LIFECYCLE CLEAR (neither): auto_terminate_focus_team() cleared the role
238
+ * because the work is complete (and, since the review window gates it, after
239
+ * the review closed) -> 'work_complete', the same teardown the completion
240
+ * pipeline makes, so a team still winding down exits as succeeded.
241
+ */
242
+ export function disarmReapShutdownReason(cause) {
243
+ if (cause.operator_stopped_at != null)
244
+ return 'user_stopped';
245
+ if (cause.arm_ended_reason != null)
246
+ return 'deactivated';
247
+ return 'work_complete';
248
+ }
249
+ function disarmReapMessage(reason) {
250
+ switch (reason) {
251
+ case 'user_stopped':
252
+ return 'This focus has been disarmed by an operator (its agent role was cleared). Stop now and exit. ' +
253
+ 'Do not commit: leave your uncommitted work in the worktree for the operator.';
254
+ case 'deactivated':
255
+ return "This focus's arm has ended (its agent role was cleared). Commit your current work and exit.";
256
+ case 'work_complete':
257
+ return "This focus's work is complete and its arm was cleared. Finish what you are writing, commit, and exit.";
258
+ }
259
+ }
260
+ /**
261
+ * Stop running teams whose focus is no longer ARMED. A cleared arm is the stop
262
+ * signal, whatever cleared it: an operator unarm (dashboard Stop / focus_update),
263
+ * a PRD pause, a spent review budget, or the lifecycle clear. This reaper brings
264
+ * every one of them to parity with the cockpit Stop: stop means stop.
245
265
  *
246
- * The reaper is the half of the spawn/reap pair the operator-stop marker was
247
- * never applied to; consulting operator_stopped_at here keeps the two sides
248
- * consistent (a future reader should not have to discover that one half reads
249
- * the marker and the other does not).
266
+ * It used to reap ONLY when operator_stopped_at was set, so an unarm that wrote
267
+ * the role without the stamp left the team running under no arm (the 2026-10-01
268
+ * incident). The stamp now decides only HOW the team is stopped (the shutdown
269
+ * reason, see disarmReapShutdownReason), never WHETHER.
250
270
  *
251
271
  * getActiveFocuses returns ALL status='active' focuses REGARDLESS of role
252
272
  * (daemon-focus-handlers handleDaemonGetActiveFocuses), so:
253
- * - PRESENT, null role, operator_stopped_at SET -> operator stop -> reap it;
254
- * - PRESENT, null role, operator_stopped_at NULL -> lifecycle clear (review
255
- * running or coding off-state) -> leave it;
273
+ * - PRESENT with a null role -> disarmed -> reap it;
256
274
  * - PRESENT with a non-null role -> still armed (idle/in-review/paused) -> leave it;
257
275
  * - ABSENT -> the focus is no longer status='active' (genuine deactivation),
258
276
  * owned by checkForDeactivatedFocuses (which runs earlier in the poll and
@@ -261,10 +279,10 @@ const pendingDisarmStops = new Set();
261
279
  * stopped focus keeps its worktree so a re-arm can resume.
262
280
  *
263
281
  * Re-arm within the grace window: the chosen rule is "complete the stop, then
264
- * allow a fresh spawn". The scheduled SIGTERM still fires (the team exits as a
265
- * clean operator stop); if the focus has since been re-armed, the next poll's
266
- * processReadyFocuses spawns a fresh team once the old one is gone. The stop is
267
- * never cancelled mid-flight, which keeps the path deterministic.
282
+ * allow a fresh spawn". The scheduled SIGTERM still fires; if the focus has
283
+ * since been re-armed, the next poll's processReadyFocuses spawns a fresh team
284
+ * once the old one is gone. The stop is never cancelled mid-flight, which keeps
285
+ * the path deterministic.
268
286
  */
269
287
  export async function reapDisarmedTeams(config, deps) {
270
288
  const activeTeams = deps.getActiveTeams();
@@ -287,23 +305,22 @@ export async function reapDisarmedTeams(config, deps) {
287
305
  log.warn(`[disarm-reaper] Cannot determine armed focuses (skipping reap): ${err.message}`);
288
306
  return;
289
307
  }
290
- // focusId -> reap? Decided by the stop registry's disarm_reap row
291
- // (supervision/stop-rows-team-session.ts). Only status='active' focuses are returned. A focus is
292
- // reaped ONLY when an operator stopped it (operator_stopped_at set). A
293
- // non-null role is still armed (leave); a null role with no operator stop is
294
- // a lifecycle clear -- a review may be running on it (leave). This mirrors
295
- // decideNullRoleSpawn's operator-stop-vs-lifecycle-clear split on the spawn
296
- // side. `present` records membership so an ABSENT focus (owned by
297
- // checkForDeactivatedFocuses) is told apart from a present-but-not-reaped one.
308
+ // focusId -> the focus row when the stop registry's disarm_reap row fires
309
+ // (supervision/stop-rows-team-session.ts): only status='active' focuses are
310
+ // returned, and a null role reaps. `present` records membership so an ABSENT
311
+ // focus (owned by checkForDeactivatedFocuses) is told apart from a
312
+ // present-but-armed one.
298
313
  const present = new Set();
299
314
  const reap = new Map();
300
315
  for (const f of activeFocuses) {
301
316
  present.add(f.focus_id);
302
- reap.set(f.focus_id, evaluateStop('disarm_reap', {
317
+ const fires = evaluateStop('disarm_reap', {
303
318
  assignedAgentRoleId: f.assigned_agent_role_id,
304
319
  focusStatus: f.status,
305
320
  operatorStoppedAt: f.operator_stopped_at,
306
- }));
321
+ });
322
+ if (fires)
323
+ reap.set(f.focus_id, f);
307
324
  }
308
325
  for (const [focusId, team] of activeTeams) {
309
326
  // Multi-product safety: only act on THIS product's teams (the global map
@@ -318,18 +335,15 @@ export async function reapDisarmedTeams(config, deps) {
318
335
  // Absent -> non-active focus -> owned by checkForDeactivatedFocuses.
319
336
  if (!present.has(focusId))
320
337
  continue;
321
- // Present but not operator-stopped (still armed, or a lifecycle clear with a
322
- // review possibly running) -> leave it running.
323
- if (!reap.get(focusId))
338
+ const cause = reap.get(focusId);
339
+ // Present and still armed -> leave it running.
340
+ if (!cause)
324
341
  continue;
325
- log.info(`[disarm-reaper] Focus "${team.focusName}" stopped by operator (role cleared, ` +
326
- `operator_stopped_at set) -- cooperatively stopping the running team`);
342
+ const shutdownReason = disarmReapShutdownReason(cause);
343
+ log.info(`[disarm-reaper] Focus "${team.focusName}" is disarmed (role cleared; ${shutdownReason}) -- ` +
344
+ 'cooperatively stopping the running team');
327
345
  pendingDisarmStops.add(focusId);
328
- deps.initiateCooperativeStop(focusId, {
329
- shutdownReason: 'user_stopped',
330
- message: 'This focus has been disarmed (its agent role was cleared via the dashboard Stop). ' +
331
- 'Commit your current work and exit.',
332
- });
346
+ deps.initiateCooperativeStop(focusId, { shutdownReason, message: disarmReapMessage(shutdownReason) });
333
347
  }
334
348
  }
335
349
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"control-state.js","sourceRoot":"","sources":["../../src/focus/control-state.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8GAA8G;AAC9G,gBAAgB;AAkBhB,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAGrG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OA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uB;IACrC,kBAAkB,CAAC,KAAK,EAAE,CAAC;AAC7B,CAAC"}
@@ -22,6 +22,25 @@ import type { RuntimeContexts } from './daemon-contexts-runtime.js';
22
22
  import type { ExecutionContexts } from './daemon-contexts-execution.js';
23
23
  import type { JudgementContexts } from './daemon-contexts-judgement.js';
24
24
  import type { PendingSpawnPassDeps, ReadyFocusPassDeps } from './pending-spawn-pass-deps.js';
25
+ import type { TowerPassDepsSource } from '../tower/tower-pass.js';
26
+ import type { VersionCheckResult } from '../update/version-check.js';
27
+ /**
28
+ * What FocusEngine.start() starts, bound at the composition root
29
+ * (composition/engine-start-context.ts) so start() runs in a test exactly as in
30
+ * production, over stand-ins for its timers and its network edges.
31
+ */
32
+ export interface EngineStartSeams {
33
+ /** Start the 30s focus poll (production: focus-poller.ts startFocusPoller over the contexts' tick deadline and poll seams). */
34
+ startPolling: (contexts: DaemonContexts) => void;
35
+ /** Start the heartbeat (production: heartbeat.ts startHeartbeat over the contexts' heartbeat beat). */
36
+ startHeartbeat: (contexts: DaemonContexts) => Promise<void>;
37
+ /** The non-blocking registry version check (production: update/version-check.ts checkForUpdates). */
38
+ checkForUpdates: (currentVersion: string) => Promise<VersionCheckResult | null>;
39
+ /** The interval scheduler the engine's own timers run on (production: daemon-core safeInterval). */
40
+ schedule: (callback: () => Promise<void> | void, intervalMs: number, label: string, options: {
41
+ skipIfRunning: boolean;
42
+ }) => ReturnType<typeof setInterval>;
43
+ }
25
44
  export interface DaemonContexts extends TeamExitContexts, RuntimeContexts, ExecutionContexts, JudgementContexts {
26
45
  /** The verification loop's collaborators (runVerificationTick). */
27
46
  readonly verification: VerificationDeps;
@@ -29,6 +48,10 @@ export interface DaemonContexts extends TeamExitContexts, RuntimeContexts, Execu
29
48
  readonly readyFocusPass: ReadyFocusPassDeps;
30
49
  /** The pending-spawn pass's collaborators, mapped from the other contexts (focus/focus-poller-spawn.ts runPendingSpawnPass). */
31
50
  readonly pendingSpawnPass: PendingSpawnPassDeps;
51
+ /** The product towers' verdict pass, over the live config (composition/tower-pass-context.ts). */
52
+ readonly towerPass: TowerPassDepsSource;
53
+ /** What FocusEngine.start() starts: the poll, the heartbeat, the version check and its timers. */
54
+ readonly engineStart: EngineStartSeams;
32
55
  }
33
56
  /** Builds the daemon's contexts from its validated config. */
34
57
  export type DaemonContextsBuilder = (config: DaemonConfig) => DaemonContexts;
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-contexts.d.ts","sourceRoot":"","sources":["../../src/focus/daemon-contexts.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAE7F,MAAM,WAAW,cAAe,SAAQ,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB;IAC7G,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;IACxC,oIAAoI;IACpI,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAC5C,gIAAgI;IAChI,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;CACjD;AAED,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,cAAc,CAAC;AAI7E,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,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;KAAE,KAChC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB;IAC7G,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;IACxC,oIAAoI;IACpI,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAC5C,gIAAgI;IAChI,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;IAChD,kGAAkG;IAClG,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,kGAAkG;IAClG,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;CACxC;AAED,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,cAAc,CAAC;AAI7E,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAE3E;AAED,yFAAyF;AACzF,wBAAgB,uBAAuB,IAAI,cAAc,CAGxD"}
@@ -1,5 +1,5 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
- // Pinned by: 23 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/focus/daemon-contexts.ts
2
+ // Pinned by: 28 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/focus/daemon-contexts.ts
3
3
  // PINNED-BY-END
4
4
  let installed = null;
5
5
  /** Install the contexts the engine built. Called once, by FocusEngine.init(). */
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-contexts.js","sourceRoot":"","sources":["../../src/focus/daemon-contexts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,2GAA2G;AAC3G,gBAAgB;AAwChB,IAAI,SAAS,GAA0B,IAAI,CAAC;AAE5C,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CAAC,QAA+B;IACnE,SAAS,GAAG,QAAQ,CAAC;AACvB,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,uBAAuB;IACrC,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"daemon-contexts.js","sourceRoot":"","sources":["../../src/focus/daemon-contexts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,2GAA2G;AAC3G,gBAAgB;AAmEhB,IAAI,SAAS,GAA0B,IAAI,CAAC;AAE5C,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CAAC,QAA+B;IACnE,SAAS,GAAG,QAAQ,CAAC;AACvB,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,uBAAuB;IACrC,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { DaemonContexts, EngineStartSeams } from './daemon-contexts.js';
2
+ /** The engine's ready-pass cadence (with the role refresh). */
3
+ export declare const ENGINE_READY_PASS_INTERVAL_MS = 60000;
4
+ /** The interval scheduler (the contexts' engineStart.schedule; production: daemon-core safeInterval). */
5
+ export type EngineIntervalScheduler = EngineStartSeams['schedule'];
6
+ /**
7
+ * Run the engine's start-up ready pass, then schedule the 60s one. Returns the
8
+ * interval for the engine to clear on stop.
9
+ */
10
+ export declare function startEngineReadyPasses(contexts: Pick<DaemonContexts, 'towerPass' | 'readyFocusPass' | 'pendingSpawnPass'>, refreshRoles: () => Promise<void>, schedule: EngineIntervalScheduler): Promise<ReturnType<typeof setInterval>>;
11
+ //# sourceMappingURL=engine-ready-pass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-ready-pass.d.ts","sourceRoot":"","sources":["../../src/focus/engine-ready-pass.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,QAAS,CAAC;AAEpD,yGAAyG;AACzG,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,EACnF,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACjC,QAAQ,EAAE,uBAAuB,GAChC,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAMzC"}
@@ -0,0 +1,25 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/tower/tower-entrypoints.test.ts
3
+ // PINNED-BY-END
4
+ /**
5
+ * The focus engine's own triggers of the ready-focus pass: once at start, then
6
+ * every 60s after a role refresh. Both go through runReadyFocusPassThroughTower
7
+ * (focus-poller-spawn.ts) -- the demand reconcile and the tower pass head every
8
+ * spawn the engine starts. Split out of focus-engine.ts so the triggers run in
9
+ * a test exactly as the engine runs them (tower/tower-entrypoints.test.ts).
10
+ */
11
+ import { runReadyFocusPassThroughTower } from './focus-poller-spawn.js';
12
+ /** The engine's ready-pass cadence (with the role refresh). */
13
+ export const ENGINE_READY_PASS_INTERVAL_MS = 60_000;
14
+ /**
15
+ * Run the engine's start-up ready pass, then schedule the 60s one. Returns the
16
+ * interval for the engine to clear on stop.
17
+ */
18
+ export async function startEngineReadyPasses(contexts, refreshRoles, schedule) {
19
+ await runReadyFocusPassThroughTower(contexts);
20
+ return schedule(async () => {
21
+ await refreshRoles();
22
+ await runReadyFocusPassThroughTower(contexts);
23
+ }, ENGINE_READY_PASS_INTERVAL_MS, 'role-refresh', { skipIfRunning: true });
24
+ }
25
+ //# sourceMappingURL=engine-ready-pass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-ready-pass.js","sourceRoot":"","sources":["../../src/focus/engine-ready-pass.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iEAAiE;AACjE,gBAAgB;AAEhB;;;;;;GAMG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGxE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAKpD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,QAAmF,EACnF,YAAiC,EACjC,QAAiC;IAEjC,MAAM,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,QAAQ,CAAC,KAAK,IAAI,EAAE;QACzB,MAAM,YAAY,EAAE,CAAC;QACrB,MAAM,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC,EAAE,6BAA6B,EAAE,cAAc,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC"}