@telora/daemon 0.20.32 → 0.20.54

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 (203) hide show
  1. package/build-info.json +2 -2
  2. package/dist/agent-state.d.ts +4 -6
  3. package/dist/agent-state.d.ts.map +1 -1
  4. package/dist/agent-state.js +4 -10
  5. package/dist/agent-state.js.map +1 -1
  6. package/dist/branch-status.d.ts +25 -3
  7. package/dist/branch-status.d.ts.map +1 -1
  8. package/dist/branch-status.js +130 -59
  9. package/dist/branch-status.js.map +1 -1
  10. package/dist/completion/completion-decision.d.ts +29 -3
  11. package/dist/completion/completion-decision.d.ts.map +1 -1
  12. package/dist/completion/completion-decision.js +15 -3
  13. package/dist/completion/completion-decision.js.map +1 -1
  14. package/dist/completion/event-entry-phases.d.ts +57 -0
  15. package/dist/completion/event-entry-phases.d.ts.map +1 -0
  16. package/dist/completion/event-entry-phases.js +205 -0
  17. package/dist/completion/event-entry-phases.js.map +1 -0
  18. package/dist/completion/event-phases.d.ts +14 -42
  19. package/dist/completion/event-phases.d.ts.map +1 -1
  20. package/dist/completion/event-phases.js +63 -190
  21. package/dist/completion/event-phases.js.map +1 -1
  22. package/dist/completion/event.d.ts +11 -1
  23. package/dist/completion/event.d.ts.map +1 -1
  24. package/dist/completion/event.js +5 -2
  25. package/dist/completion/event.js.map +1 -1
  26. package/dist/completion/index.d.ts +0 -3
  27. package/dist/completion/index.d.ts.map +1 -1
  28. package/dist/completion/index.js +0 -3
  29. package/dist/completion/index.js.map +1 -1
  30. package/dist/completion/review-exit-phase.d.ts +2 -1
  31. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  32. package/dist/completion/review-exit-phase.js +41 -1
  33. package/dist/completion/review-exit-phase.js.map +1 -1
  34. package/dist/completion/status-advance-phase.d.ts +2 -0
  35. package/dist/completion/status-advance-phase.d.ts.map +1 -1
  36. package/dist/completion/status-advance-phase.js +14 -28
  37. package/dist/completion/status-advance-phase.js.map +1 -1
  38. package/dist/completion/team-completion.js +1 -1
  39. package/dist/completion/team-completion.js.map +1 -1
  40. package/dist/completion/terminated-work-reconcile.d.ts.map +1 -1
  41. package/dist/completion/terminated-work-reconcile.js +10 -0
  42. package/dist/completion/terminated-work-reconcile.js.map +1 -1
  43. package/dist/constants.d.ts +0 -8
  44. package/dist/constants.d.ts.map +1 -1
  45. package/dist/constants.js +0 -8
  46. package/dist/constants.js.map +1 -1
  47. package/dist/delivery-close-actions.d.ts +39 -0
  48. package/dist/delivery-close-actions.d.ts.map +1 -0
  49. package/dist/delivery-close-actions.js +53 -0
  50. package/dist/delivery-close-actions.js.map +1 -0
  51. package/dist/delivery-lifecycle.d.ts +11 -0
  52. package/dist/delivery-lifecycle.d.ts.map +1 -1
  53. package/dist/delivery-lifecycle.js +13 -14
  54. package/dist/delivery-lifecycle.js.map +1 -1
  55. package/dist/delivery-reconciler.d.ts +18 -4
  56. package/dist/delivery-reconciler.d.ts.map +1 -1
  57. package/dist/delivery-reconciler.js +18 -4
  58. package/dist/delivery-reconciler.js.map +1 -1
  59. package/dist/directive-executor.d.ts +1 -1
  60. package/dist/directive-executor.js +1 -1
  61. package/dist/discovery-fetch.d.ts +76 -0
  62. package/dist/discovery-fetch.d.ts.map +1 -0
  63. package/dist/discovery-fetch.js +206 -0
  64. package/dist/discovery-fetch.js.map +1 -0
  65. package/dist/discovery-poll.d.ts +1 -51
  66. package/dist/discovery-poll.d.ts.map +1 -1
  67. package/dist/discovery-poll.js +10 -192
  68. package/dist/discovery-poll.js.map +1 -1
  69. package/dist/drain-teardown.d.ts +11 -6
  70. package/dist/drain-teardown.d.ts.map +1 -1
  71. package/dist/drain-teardown.js +3 -2
  72. package/dist/drain-teardown.js.map +1 -1
  73. package/dist/focus-branch-ahead.d.ts +42 -0
  74. package/dist/focus-branch-ahead.d.ts.map +1 -0
  75. package/dist/focus-branch-ahead.js +45 -0
  76. package/dist/focus-branch-ahead.js.map +1 -0
  77. package/dist/focus-engine.d.ts.map +1 -1
  78. package/dist/focus-engine.js +21 -43
  79. package/dist/focus-engine.js.map +1 -1
  80. package/dist/focus-executor.js +2 -2
  81. package/dist/focus-executor.js.map +1 -1
  82. package/dist/focus-lifecycle.d.ts.map +1 -1
  83. package/dist/focus-lifecycle.js +32 -3
  84. package/dist/focus-lifecycle.js.map +1 -1
  85. package/dist/focus-loop.d.ts +34 -12
  86. package/dist/focus-loop.d.ts.map +1 -1
  87. package/dist/focus-loop.js +78 -15
  88. package/dist/focus-loop.js.map +1 -1
  89. package/dist/focus-merge.d.ts.map +1 -1
  90. package/dist/focus-merge.js +6 -1
  91. package/dist/focus-merge.js.map +1 -1
  92. package/dist/focus-phase.d.ts +18 -3
  93. package/dist/focus-phase.d.ts.map +1 -1
  94. package/dist/focus-phase.js +85 -31
  95. package/dist/focus-phase.js.map +1 -1
  96. package/dist/focus-prompt-builder.d.ts.map +1 -1
  97. package/dist/focus-prompt-builder.js +8 -0
  98. package/dist/focus-prompt-builder.js.map +1 -1
  99. package/dist/focus-provisioning.d.ts.map +1 -1
  100. package/dist/focus-provisioning.js +4 -0
  101. package/dist/focus-provisioning.js.map +1 -1
  102. package/dist/focus-stage-lifecycle/planning-release.d.ts +35 -17
  103. package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
  104. package/dist/focus-stage-lifecycle/planning-release.js +53 -22
  105. package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
  106. package/dist/focus-worktree-state.d.ts +17 -6
  107. package/dist/focus-worktree-state.d.ts.map +1 -1
  108. package/dist/focus-worktree-state.js +21 -11
  109. package/dist/focus-worktree-state.js.map +1 -1
  110. package/dist/guard-engine.d.ts +1 -2
  111. package/dist/guard-engine.d.ts.map +1 -1
  112. package/dist/guard-engine.js +1 -2
  113. package/dist/guard-engine.js.map +1 -1
  114. package/dist/health-events.d.ts +10 -0
  115. package/dist/health-events.d.ts.map +1 -0
  116. package/dist/health-events.js +10 -0
  117. package/dist/health-events.js.map +1 -0
  118. package/dist/heartbeat.d.ts +19 -0
  119. package/dist/heartbeat.d.ts.map +1 -1
  120. package/dist/heartbeat.js +58 -22
  121. package/dist/heartbeat.js.map +1 -1
  122. package/dist/host-control/catalog.d.ts.map +1 -1
  123. package/dist/host-control/catalog.js +4 -1
  124. package/dist/host-control/catalog.js.map +1 -1
  125. package/dist/host-control/client.d.ts +3 -4
  126. package/dist/host-control/client.d.ts.map +1 -1
  127. package/dist/host-control/client.js +4 -5
  128. package/dist/host-control/client.js.map +1 -1
  129. package/dist/listener-auto-advance.d.ts +2 -1
  130. package/dist/listener-auto-advance.d.ts.map +1 -1
  131. package/dist/listener-auto-advance.js +36 -40
  132. package/dist/listener-auto-advance.js.map +1 -1
  133. package/dist/listener.d.ts +2 -7
  134. package/dist/listener.d.ts.map +1 -1
  135. package/dist/listener.js +11 -9
  136. package/dist/listener.js.map +1 -1
  137. package/dist/operator-hold.d.ts +66 -0
  138. package/dist/operator-hold.d.ts.map +1 -0
  139. package/dist/operator-hold.js +99 -0
  140. package/dist/operator-hold.js.map +1 -0
  141. package/dist/poll-trigger.d.ts +28 -0
  142. package/dist/poll-trigger.d.ts.map +1 -0
  143. package/dist/poll-trigger.js +31 -0
  144. package/dist/poll-trigger.js.map +1 -0
  145. package/dist/prompt-listing.js +6 -0
  146. package/dist/prompt-listing.js.map +1 -1
  147. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  148. package/dist/prompt-sections/execution-sections.js +24 -0
  149. package/dist/prompt-sections/execution-sections.js.map +1 -1
  150. package/dist/queries/context-lock-queries.d.ts.map +1 -1
  151. package/dist/queries/context-lock-queries.js +4 -1
  152. package/dist/queries/context-lock-queries.js.map +1 -1
  153. package/dist/queries/deliveries.d.ts +17 -0
  154. package/dist/queries/deliveries.d.ts.map +1 -1
  155. package/dist/queries/deliveries.js.map +1 -1
  156. package/dist/queries/issues.d.ts +98 -0
  157. package/dist/queries/issues.d.ts.map +1 -1
  158. package/dist/queries/issues.js +135 -0
  159. package/dist/queries/issues.js.map +1 -1
  160. package/dist/queries/schemas.d.ts +3 -3
  161. package/dist/spawn/worktree-session.d.ts.map +1 -1
  162. package/dist/spawn/worktree-session.js +2 -0
  163. package/dist/spawn/worktree-session.js.map +1 -1
  164. package/dist/spawner/index.d.ts +7 -9
  165. package/dist/spawner/index.d.ts.map +1 -1
  166. package/dist/spawner/index.js +13 -11
  167. package/dist/spawner/index.js.map +1 -1
  168. package/dist/spawner/lifecycle.d.ts +1 -18
  169. package/dist/spawner/lifecycle.d.ts.map +1 -1
  170. package/dist/spawner/lifecycle.js +1 -54
  171. package/dist/spawner/lifecycle.js.map +1 -1
  172. package/dist/spawner/liveness.d.ts +5 -14
  173. package/dist/spawner/liveness.d.ts.map +1 -1
  174. package/dist/spawner/liveness.js +5 -67
  175. package/dist/spawner/liveness.js.map +1 -1
  176. package/dist/spawner/state.d.ts +8 -20
  177. package/dist/spawner/state.d.ts.map +1 -1
  178. package/dist/spawner/state.js +8 -34
  179. package/dist/spawner/state.js.map +1 -1
  180. package/dist/types/focus.d.ts +9 -0
  181. package/dist/types/focus.d.ts.map +1 -1
  182. package/dist/types/session.d.ts +0 -44
  183. package/dist/types/session.d.ts.map +1 -1
  184. package/dist/unified-shell.d.ts.map +1 -1
  185. package/dist/unified-shell.js +8 -0
  186. package/dist/unified-shell.js.map +1 -1
  187. package/package.json +1 -2
  188. package/dist/completion/agent-completion.d.ts +0 -48
  189. package/dist/completion/agent-completion.d.ts.map +0 -1
  190. package/dist/completion/agent-completion.js +0 -205
  191. package/dist/completion/agent-completion.js.map +0 -1
  192. package/dist/delivery-guards.d.ts +0 -41
  193. package/dist/delivery-guards.d.ts.map +0 -1
  194. package/dist/delivery-guards.js +0 -200
  195. package/dist/delivery-guards.js.map +0 -1
  196. package/dist/spawner/spawn-team.d.ts +0 -20
  197. package/dist/spawner/spawn-team.d.ts.map +0 -1
  198. package/dist/spawner/spawn-team.js +0 -19
  199. package/dist/spawner/spawn-team.js.map +0 -1
  200. package/dist/spawner/timeout.d.ts +0 -32
  201. package/dist/spawner/timeout.d.ts.map +0 -1
  202. package/dist/spawner/timeout.js +0 -126
  203. package/dist/spawner/timeout.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Entry phases of the completion-event pipeline -- the three that run BEFORE
3
+ * any factual picture is computed, each able to short-circuit the pipeline:
4
+ *
5
+ * 1. applyPlanningRefresh planning-team delivery discovery / failure
6
+ * 2. routeReviewWindowCompletion review routing (review pass vs coding pass)
7
+ * 3. runWakeCycleSelfHeal pre-guard advanceDeliveryStatuses self-heal
8
+ *
9
+ * Split out of event-phases.ts (which kept phases 4-6: the factual picture,
10
+ * the advancement watchdog, and action side effects) purely to hold both
11
+ * files under the 800-line daemon module limit. Behavior is unchanged: same
12
+ * reads, same order, same log lines, same early returns, and delivery
13
+ * execution_status transition semantics remain owned by the single-writer
14
+ * reconciler.
15
+ */
16
+ import type { FocusDeliveryInfo, FocusIssueInfo } from '../types.js';
17
+ import type { CompletionEventContext, CompletionEventDeps } from './event.js';
18
+ /**
19
+ * Wake-cycle refresh (Option A): planning teams spawn with knownDeliveryIds
20
+ * empty. The MCP-driven planning turn writes deliveries to the DB, so we
21
+ * re-snapshot them here before any downstream merge/completion logic looks
22
+ * at the set. WHY Option A: keeps the refresh on the existing wake path
23
+ * instead of polling, so it runs exactly when new deliveries become visible.
24
+ *
25
+ * Returns true when the team was terminated (planning produced nothing).
26
+ */
27
+ export declare function applyPlanningRefresh(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[]): Promise<boolean>;
28
+ export type ReviewWindowOutcome = 'terminated' | 'leave_running' | 'not_in_review';
29
+ /**
30
+ * Review-window handling. Resolves review_requested_at FRESH because it can
31
+ * be set/cleared between spawn and this event.
32
+ *
33
+ * - A completing REVIEW pass routes verify deliveries deterministically
34
+ * (runReviewExitHandler) and terminates -> 'terminated'.
35
+ * - A completing CODING pass during a review window is left alive so the
36
+ * review's own completion closes the focus -> 'leave_running'.
37
+ * - Otherwise -> 'not_in_review' and the pipeline continues.
38
+ */
39
+ export declare function routeReviewWindowCompletion(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[]): Promise<ReviewWindowOutcome>;
40
+ /**
41
+ * Self-heal BEFORE the no-progress guard. When actionable deliveries exist
42
+ * but none carry open issues, the team has nothing left to code. The common
43
+ * cause is a review that bounced a delivery to verify_failed while all its
44
+ * issues are already Done. The daemon's transparent
45
+ * verify_failed -> coding -> verify stepping (advanceDeliveryStatuses) clears
46
+ * that. Running it here -- before snapshotting -- means a benign "no work to
47
+ * do" cycle either terminates the team cleanly (all deliveries now terminal)
48
+ * or shows up as real progress (the delivery status moved), instead of being
49
+ * counted as coder no-progress. Either way it can no longer accrue toward a
50
+ * spurious team_failure escalation. (Previously this advance ran only AFTER
51
+ * the guard, so the counter could reach the limit and escalate first.)
52
+ */
53
+ export declare function runWakeCycleSelfHeal(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[], currentIssues: FocusIssueInfo[]): Promise<{
54
+ terminated: boolean;
55
+ effectiveDeliveries: FocusDeliveryInfo[];
56
+ }>;
57
+ //# sourceMappingURL=event-entry-phases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-entry-phases.d.ts","sourceRoot":"","sources":["../../src/completion/event-entry-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAO9E;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,GACrC,OAAO,CAAC,OAAO,CAAC,CA8BlB;AAID,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAC;AAEnF;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,GACrC,OAAO,CAAC,mBAAmB,CAAC,CA+F9B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,EACtC,aAAa,EAAE,cAAc,EAAE,GAC9B,OAAO,CAAC;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,mBAAmB,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAAC,CAiD5E"}
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Entry phases of the completion-event pipeline -- the three that run BEFORE
3
+ * any factual picture is computed, each able to short-circuit the pipeline:
4
+ *
5
+ * 1. applyPlanningRefresh planning-team delivery discovery / failure
6
+ * 2. routeReviewWindowCompletion review routing (review pass vs coding pass)
7
+ * 3. runWakeCycleSelfHeal pre-guard advanceDeliveryStatuses self-heal
8
+ *
9
+ * Split out of event-phases.ts (which kept phases 4-6: the factual picture,
10
+ * the advancement watchdog, and action side effects) purely to hold both
11
+ * files under the 800-line daemon module limit. Behavior is unchanged: same
12
+ * reads, same order, same log lines, same early returns, and delivery
13
+ * execution_status transition semantics remain owned by the single-writer
14
+ * reconciler.
15
+ */
16
+ import { DELIVERY_STATUS } from '@telora/daemon-core';
17
+ import { isStatusCascadable, isStatusAgentActionable } from '../stage-classifier.js';
18
+ import { OPEN_ISSUE_STATUSES } from '../constants.js';
19
+ import { isInReviewWindow } from './advanceability.js';
20
+ import { escalatePlanningFailure } from './event-escalations.js';
21
+ import { createLogger } from '../log.js';
22
+ const log = createLogger({ module: 'focus-executor' });
23
+ // ── Phase 1: planning refresh ───────────────────────────────────────────
24
+ /**
25
+ * Wake-cycle refresh (Option A): planning teams spawn with knownDeliveryIds
26
+ * empty. The MCP-driven planning turn writes deliveries to the DB, so we
27
+ * re-snapshot them here before any downstream merge/completion logic looks
28
+ * at the set. WHY Option A: keeps the refresh on the existing wake path
29
+ * instead of polling, so it runs exactly when new deliveries become visible.
30
+ *
31
+ * Returns true when the team was terminated (planning produced nothing).
32
+ */
33
+ export async function applyPlanningRefresh(ctx, deps, currentDeliveries) {
34
+ const { focusId, focusName, teamState } = ctx;
35
+ if (!teamState.planningPhase)
36
+ return false;
37
+ if (currentDeliveries.length === 0) {
38
+ log.warn(`Planning team for "${focusName}" produced no deliveries ` +
39
+ `-- escalating and terminating`);
40
+ await escalatePlanningFailure({
41
+ organizationId: teamState.organizationId,
42
+ sessionId: teamState.leadSessionId ?? '',
43
+ focusId,
44
+ focusName,
45
+ agentRoleId: teamState.roleId,
46
+ }, deps);
47
+ teamState.shutdownReason = 'work_complete';
48
+ deps.terminateTeam(focusId);
49
+ return true;
50
+ }
51
+ for (const d of currentDeliveries) {
52
+ teamState.knownDeliveryIds.add(d.id);
53
+ teamState.deliveryStageIds.set(d.id, d.currentWorkflowStageId);
54
+ }
55
+ teamState.planningPhase = false;
56
+ log.info(`Planning refresh for "${focusName}": ` +
57
+ `${currentDeliveries.length} delivery(ies) discovered`);
58
+ return false;
59
+ }
60
+ /**
61
+ * Review-window handling. Resolves review_requested_at FRESH because it can
62
+ * be set/cleared between spawn and this event.
63
+ *
64
+ * - A completing REVIEW pass routes verify deliveries deterministically
65
+ * (runReviewExitHandler) and terminates -> 'terminated'.
66
+ * - A completing CODING pass during a review window is left alive so the
67
+ * review's own completion closes the focus -> 'leave_running'.
68
+ * - Otherwise -> 'not_in_review' and the pipeline continues.
69
+ */
70
+ export async function routeReviewWindowCompletion(ctx, deps, currentDeliveries) {
71
+ const { focusId, focusName, teamState } = ctx;
72
+ let reviewRequestedAt = null;
73
+ if (deps.getReviewRequestedAt) {
74
+ try {
75
+ reviewRequestedAt = await deps.getReviewRequestedAt(ctx.config, focusId);
76
+ }
77
+ catch (err) {
78
+ log.warn(`getReviewRequestedAt failed for "${focusName}": ${err.message}`);
79
+ // Fail open: a read failure must not block the existing teardown logic.
80
+ }
81
+ }
82
+ if (!isInReviewWindow(reviewRequestedAt, currentDeliveries))
83
+ return 'not_in_review';
84
+ const verifyCount = currentDeliveries.filter(d => d.executionStatus === DELIVERY_STATUS.VERIFY).length;
85
+ if (teamState.sessionType === 'review') {
86
+ // A REVIEW pass just completed -- it emitted its result, which IS the
87
+ // "a review cycle ran" signal. Close the focus DETERMINISTICALLY now,
88
+ // keyed on THIS completion event rather than on process exit. A review
89
+ // resumes its prior session to preserve context (INJ-D) and runs as an
90
+ // interactive stream-json process that emits a result but never exits;
91
+ // the old exit-keyed close therefore waited forever (the review-resume
92
+ // deadlock). runReviewExitHandler routes verify deliveries by the
93
+ // deterministic signal -- a pass that filed zero new issues and has no
94
+ // open work closes verify->done; open work routes verify->verify_failed
95
+ // to re-iterate -- and clears review_requested_at. The review team is then
96
+ // torn down: closure has ALREADY happened, so it no longer matters whether
97
+ // the process exits cleanly or is SIGTERM'd, and the next review cycle
98
+ // resumes the same session id to review only the new delta.
99
+ //
100
+ // succeeded is the ACTUAL result of the review turn (!isError), NOT a
101
+ // hardcoded true. A review that erred (e.g. the CLI failed to start, or a
102
+ // model/engine mismatch) emits a result event with isError=true and files
103
+ // no defects -- the old `succeeded: true` made that indistinguishable from
104
+ // a genuinely clean review, so an errored/no-op review auto-approved
105
+ // verify->done WITHOUT a real review. With the real flag, an errored
106
+ // review leaves the delivery in verify; the next auto-review poll
107
+ // re-triggers, and a persistently failing review is bounded by the
108
+ // review_window_stalled escalation.
109
+ const reviewSucceeded = !ctx.completionInfo.result.isError;
110
+ log.info(`Review pass completed for "${focusName}" (${verifyCount} ` +
111
+ `delivery(ies) in verify, succeeded=${reviewSucceeded}) -- routing deterministically ` +
112
+ `by filed issues, then terminating.`);
113
+ // Coverage evidence: spawn-tip (what the review saw, carried on the team
114
+ // state) is stamped as the watermark; exit-tip (HEAD now) is compared to
115
+ // it to detect mid-review drift. Exit-tip is best-effort via injected git
116
+ // deps; null makes coverage unconfirmable (auto-approve withheld).
117
+ const reviewSpawnTip = teamState.reviewSpawnTip;
118
+ let currentBranchTip = null;
119
+ try {
120
+ const wt = deps.getFocusWorktree?.(focusId);
121
+ if (wt?.worktreePath) {
122
+ currentBranchTip = deps.readWorktreeHeadSha?.(wt.worktreePath) ?? null;
123
+ }
124
+ }
125
+ catch (err) {
126
+ log.warn(`Could not resolve exit-tip for "${focusName}" coverage gate: ${err.message}`);
127
+ }
128
+ try {
129
+ await deps.runReviewExitHandler({
130
+ focusId,
131
+ focusName,
132
+ organizationId: teamState.organizationId,
133
+ productId: teamState.productId,
134
+ sessionId: teamState.leadSessionId ?? '',
135
+ sessionType: 'review',
136
+ succeeded: reviewSucceeded,
137
+ reviewSpawnTip,
138
+ currentBranchTip,
139
+ });
140
+ }
141
+ catch (err) {
142
+ log.warn(`Deterministic review routing failed for "${focusName}": ${err.message}`);
143
+ }
144
+ teamState.shutdownReason = 'work_complete';
145
+ deps.terminateTeam(focusId);
146
+ return 'terminated';
147
+ }
148
+ // A non-review (coding) team completed a cycle while a review is in flight.
149
+ // Do NOT tear it down on the all-terminal / no-actionable-work branches
150
+ // below: `verify` is cascadable, so they would SIGTERM the team mid-review.
151
+ // Leave it running; the review team's own completion closes the focus.
152
+ log.info(`"${focusName}" is in a review window (review_requested_at set, ` +
153
+ `${verifyCount} delivery(ies) in verify) and the completing session is a ` +
154
+ `${teamState.sessionType} pass -- not tearing down; the review pass completion routes ` +
155
+ `the verify deliveries.`);
156
+ return 'leave_running';
157
+ }
158
+ // ── Phase 3: wake-cycle self-heal advance ───────────────────────────────
159
+ /**
160
+ * Self-heal BEFORE the no-progress guard. When actionable deliveries exist
161
+ * but none carry open issues, the team has nothing left to code. The common
162
+ * cause is a review that bounced a delivery to verify_failed while all its
163
+ * issues are already Done. The daemon's transparent
164
+ * verify_failed -> coding -> verify stepping (advanceDeliveryStatuses) clears
165
+ * that. Running it here -- before snapshotting -- means a benign "no work to
166
+ * do" cycle either terminates the team cleanly (all deliveries now terminal)
167
+ * or shows up as real progress (the delivery status moved), instead of being
168
+ * counted as coder no-progress. Either way it can no longer accrue toward a
169
+ * spurious team_failure escalation. (Previously this advance ran only AFTER
170
+ * the guard, so the counter could reach the limit and escalate first.)
171
+ */
172
+ export async function runWakeCycleSelfHeal(ctx, deps, currentDeliveries, currentIssues) {
173
+ const { focusId, focusName, teamState } = ctx;
174
+ const actionableDeliveryIds = new Set(currentDeliveries
175
+ .filter(d => isStatusAgentActionable(d.executionStatus ?? ''))
176
+ .map(d => d.id));
177
+ const hasActionableWithOpenIssues = currentIssues.some(i => actionableDeliveryIds.has(i.deliveryId) && OPEN_ISSUE_STATUSES.has(i.status));
178
+ let effectiveDeliveries = currentDeliveries;
179
+ if (actionableDeliveryIds.size > 0 && !hasActionableWithOpenIssues) {
180
+ try {
181
+ await deps.advanceDeliveryStatuses(ctx.config, teamState, teamState.leadSessionId ?? '');
182
+ }
183
+ catch (err) {
184
+ log.warn(`Wake-cycle advanceDeliveryStatuses failed for "${focusName}": ${err.message}`);
185
+ }
186
+ // Re-fetch and re-check termination after the advance -- if every delivery
187
+ // is now terminal-for-the-team, exit cleanly and hand off to review
188
+ // routing / verification instead of sending a stale re-engagement.
189
+ try {
190
+ effectiveDeliveries = await deps.getFocusDeliveries(focusId);
191
+ const stillNonTerminal = effectiveDeliveries.filter(d => !isStatusCascadable(d.executionStatus ?? ''));
192
+ if (stillNonTerminal.length === 0) {
193
+ log.info(`All deliveries terminal after wake-cycle advance for "${focusName}" -- terminating team`);
194
+ teamState.shutdownReason = 'work_complete';
195
+ deps.terminateTeam(focusId);
196
+ return { terminated: true, effectiveDeliveries };
197
+ }
198
+ }
199
+ catch (err) {
200
+ log.warn(`Failed to re-fetch deliveries after wake-cycle advance for "${focusName}": ${err.message}`);
201
+ }
202
+ }
203
+ return { terminated: false, effectiveDeliveries };
204
+ }
205
+ //# sourceMappingURL=event-entry-phases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-entry-phases.js","sourceRoot":"","sources":["../../src/completion/event-entry-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAEvD,2EAA2E;AAE3E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAA2B,EAC3B,IAAyB,EACzB,iBAAsC;IAEtC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC;IAC9C,IAAI,CAAC,SAAS,CAAC,aAAa;QAAE,OAAO,KAAK,CAAC;IAE3C,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,IAAI,CACN,sBAAsB,SAAS,2BAA2B;YAC1D,+BAA+B,CAChC,CAAC;QACF,MAAM,uBAAuB,CAAC;YAC5B,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,SAAS,EAAE,SAAS,CAAC,aAAa,IAAI,EAAE;YACxC,OAAO;YACP,SAAS;YACT,WAAW,EAAE,SAAS,CAAC,MAAM;SAC9B,EAAE,IAAI,CAAC,CAAC;QACT,SAAS,CAAC,cAAc,GAAG,eAAe,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,OAAO,CA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AAmB,EAAE,CAAC;AACpD,CAAC"}
@@ -5,13 +5,16 @@
5
5
  * (completion/event.ts) so each sub-decision is independently testable
6
6
  * without constructing the whole completion world:
7
7
  *
8
- * 1. applyPlanningRefresh planning-team delivery discovery / failure
9
- * 2. routeReviewWindowCompletion review routing (review pass vs coding pass)
10
- * 3. runWakeCycleSelfHeal pre-guard advanceDeliveryStatuses self-heal
11
8
  * 4. computeCompletionFacts the post-advance factual picture
12
9
  * 5. checkDeliveryAdvancementStall cross-respawn advancement watchdog
13
10
  * 6. executeCompletionAction side effects of the chosen action
14
11
  *
12
+ * Phases 1-3 -- the pre-decision entry phases that can short-circuit the
13
+ * pipeline (applyPlanningRefresh, routeReviewWindowCompletion,
14
+ * runWakeCycleSelfHeal) -- live in event-entry-phases.ts. The split is purely
15
+ * to hold both files under the 800-line daemon module limit; the pipeline
16
+ * order and semantics are unchanged.
17
+ *
15
18
  * The decision itself stays pure in completion-decision.ts. Behavior is
16
19
  * preserved exactly: same reads, same order, same log lines, same early
17
20
  * returns; delivery execution_status transition semantics are untouched
@@ -20,45 +23,6 @@
20
23
  import type { FocusDeliveryInfo, FocusIssueInfo, ProgressSnapshot } from '../types.js';
21
24
  import { type CompletionAction } from './completion-decision.js';
22
25
  import type { CompletionEventContext, CompletionEventDeps } from './event.js';
23
- /**
24
- * Wake-cycle refresh (Option A): planning teams spawn with knownDeliveryIds
25
- * empty. The MCP-driven planning turn writes deliveries to the DB, so we
26
- * re-snapshot them here before any downstream merge/completion logic looks
27
- * at the set. WHY Option A: keeps the refresh on the existing wake path
28
- * instead of polling, so it runs exactly when new deliveries become visible.
29
- *
30
- * Returns true when the team was terminated (planning produced nothing).
31
- */
32
- export declare function applyPlanningRefresh(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[]): Promise<boolean>;
33
- export type ReviewWindowOutcome = 'terminated' | 'leave_running' | 'not_in_review';
34
- /**
35
- * Review-window handling. Resolves review_requested_at FRESH because it can
36
- * be set/cleared between spawn and this event.
37
- *
38
- * - A completing REVIEW pass routes verify deliveries deterministically
39
- * (runReviewExitHandler) and terminates -> 'terminated'.
40
- * - A completing CODING pass during a review window is left alive so the
41
- * review's own completion closes the focus -> 'leave_running'.
42
- * - Otherwise -> 'not_in_review' and the pipeline continues.
43
- */
44
- export declare function routeReviewWindowCompletion(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[]): Promise<ReviewWindowOutcome>;
45
- /**
46
- * Self-heal BEFORE the no-progress guard. When actionable deliveries exist
47
- * but none carry open issues, the team has nothing left to code. The common
48
- * cause is a review that bounced a delivery to verify_failed while all its
49
- * issues are already Done. The daemon's transparent
50
- * verify_failed -> coding -> verify stepping (advanceDeliveryStatuses) clears
51
- * that. Running it here -- before snapshotting -- means a benign "no work to
52
- * do" cycle either terminates the team cleanly (all deliveries now terminal)
53
- * or shows up as real progress (the delivery status moved), instead of being
54
- * counted as coder no-progress. Either way it can no longer accrue toward a
55
- * spurious team_failure escalation. (Previously this advance ran only AFTER
56
- * the guard, so the counter could reach the limit and escalate first.)
57
- */
58
- export declare function runWakeCycleSelfHeal(ctx: CompletionEventContext, deps: CompletionEventDeps, currentDeliveries: FocusDeliveryInfo[], currentIssues: FocusIssueInfo[]): Promise<{
59
- terminated: boolean;
60
- effectiveDeliveries: FocusDeliveryInfo[];
61
- }>;
62
26
  /** Everything the decision + action execution need, computed once. */
63
27
  export interface CompletionFacts {
64
28
  /** The ORIGINAL pre-advance delivery list (tracking-state update uses it). */
@@ -76,6 +40,14 @@ export interface CompletionFacts {
76
40
  advancedThisCycle: boolean;
77
41
  stuck: FocusDeliveryInfo | null;
78
42
  updatedNoProgressCycles: number;
43
+ /**
44
+ * True when the team is parked on an open, unanswered directed escalation
45
+ * (needs_intent / needs_clarification) anchored to a delivery it is working.
46
+ * Fail-open (a lookup error resolves to false). Routes the decision to the
47
+ * `hold_blocked_on_directed_escalation` action and suppresses the cross-respawn
48
+ * advancement watchdog so a blocked team is neither escalated nor re-engaged.
49
+ */
50
+ blockedOnDirectedEscalation: boolean;
79
51
  }
80
52
  /**
81
53
  * Recompute the picture on the post-advance state. The team owns exactly two
@@ -1 +1 @@
1
- {"version":3,"file":"event-phases.d.ts","sourceRoot":"","sources":["../../src/completion/event-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMvF,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAkB5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAO9E;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,GACrC,OAAO,CAAC,OAAO,CAAC,CA8BlB;AAID,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAC;AAEnF;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,GACrC,OAAO,CAAC,mBAAmB,CAAC,CA+F9B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,mBAAmB,EACzB,iBAAiB,EAAE,iBAAiB,EAAE,EACtC,aAAa,EAAE,cAAc,EAAE,GAC9B,OAAO,CAAC;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,mBAAmB,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAAC,CAiD5E;AAID,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,iBAAiB,EAAE,iBAAiB,EAAE,C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