@telora/daemon 0.15.4 → 0.15.6

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.
@@ -1,37 +1,23 @@
1
1
  /**
2
- * Review-defect re-engagement loop.
2
+ * Review-defect classification utilities.
3
3
  *
4
- * The review subsystem (review_requested_at + review session_type) audits
5
- * completed work and files defects. Without this module, defects sit
6
- * indefinitely in `in_review` because nothing drives them to resolution.
7
- *
8
- * This module closes that quality loop:
9
- * * Detector -- finds strategies in `in_review` with open issues filed
10
- * during the most recent review pass, and transitions them back to
11
- * `building` so the executor spawns a remediation team.
12
- * * Re-entry -- when all review-filed issues for a focus are Done
13
- * (and the focus is back in `building`), transitions the focus
14
- * to `verify` so the existing review subsystem can pass it through to
15
- * `in_review` for a fresh review pass.
16
- * * Bound -- tracks per-focus remediation cycle count. After N
17
- * consecutive cycles, escalates to humans via `agent_escalations`.
4
+ * The state-cascade engine drives review re-engagement off the focus
5
+ * execution phase (verifying / reviewing) -- the older detector that
6
+ * mutated focus.status (in_review/building/verify) was retired with the
7
+ * focus_status enum trim. What remains here is the issue classifier used
8
+ * by focus-executor and the per-focus remediation cycle counter, which
9
+ * may be folded into a future bounded-iteration check.
18
10
  *
19
11
  * Identifying review-filed issues:
20
12
  * We use `created_by_role_id` (filters out human/UI-filed issues, which
21
13
  * leave the column NULL) AND timing -- the issue was created after the
22
- * focus's most recent `review_requested_at` while in `in_review`. A
23
- * single role is often shared across team and review sessions, so role
24
- * alone is insufficient; the timing-plus-focus-status combination is
25
- * what reliably identifies "filed during a review pass".
14
+ * focus's most recent `review_requested_at`. A single role is often
15
+ * shared across team and review sessions, so role alone is insufficient;
16
+ * the timing-plus-role combination is what reliably identifies
17
+ * "filed during a review pass".
26
18
  */
27
- import { withRetry, ESCALATION_REASONS } from '@telora/daemon-core';
28
- import { getActiveFocuses } from './supabase.js';
29
- import { getFocusDeliveries, getFocusIssues, updateFocusStatus, fetchFocusWorkflowWithTransitions, } from './queries/focuses.js';
30
- import { createEscalation as defaultCreateEscalation } from './queries/issues.js';
31
19
  import { OPEN_ISSUE_STATUSES } from './constants.js';
32
20
  // ── Configuration ────────────────────────────────────────────────────────
33
- /** Reason string emitted when remediation cycles exceed the bound. */
34
- export const REVIEW_REMEDIATION_ESCALATION_REASON = 'review-defect remediation exceeded N cycles';
35
21
  /** Default cap on remediation cycles before escalation. Configurable via env. */
36
22
  export const REVIEW_REMEDIATION_LIMIT = (() => {
37
23
  const raw = process.env.TELORA_REVIEW_REMEDIATION_LIMIT;
@@ -43,11 +29,9 @@ export const REVIEW_REMEDIATION_LIMIT = (() => {
43
29
  // ── Per-focus cycle counter ──────────────────────────────────────────
44
30
  /**
45
31
  * In-memory map of focus ID -> consecutive remediation cycles. Cycle
46
- * counts are not persisted to the database -- a daemon restart resets the
47
- * counter, which is acceptable because the bound exists to prevent runaway
48
- * loops within a single daemon lifetime, not across restarts.
49
- *
50
- * Exported for testability.
32
+ * counts are not persisted -- a daemon restart resets the counter, which
33
+ * is acceptable because the bound exists to prevent runaway loops within
34
+ * a single daemon lifetime, not across restarts.
51
35
  */
52
36
  const remediationCycles = new Map();
53
37
  export function getRemediationCycles(focusId) {
@@ -67,14 +51,11 @@ export function _resetAllRemediationCyclesForTest() {
67
51
  }
68
52
  // ── Issue classification ────────────────────────────────────────────────
69
53
  /**
70
- * Returns true when an issue was filed during the most recent review pass
71
- * on the given focus.
54
+ * Returns true when an issue was filed during the most recent review pass.
72
55
  *
73
56
  * An issue is "review-filed" when ALL of:
74
57
  * - It has a non-null created_by_role_id (excludes human/UI creates).
75
- * - Its created_at is later than the focus's review_requested_at
76
- * (or the focus is in `in_review` with no recorded request time --
77
- * covers manual review trigger).
58
+ * - Its created_at is later than the focus's review_requested_at.
78
59
  * - Its status is open (To Do / In Progress / Blocked).
79
60
  */
80
61
  export function isReviewFiledIssue(issue, reviewRequestedAt) {
@@ -82,28 +63,22 @@ export function isReviewFiledIssue(issue, reviewRequestedAt) {
82
63
  return false;
83
64
  if (!OPEN_ISSUE_STATUSES.has(issue.status))
84
65
  return false;
85
- if (!reviewRequestedAt) {
86
- // No review timestamp -- conservative: do not treat as review-filed.
66
+ if (!reviewRequestedAt)
87
67
  return false;
88
- }
89
68
  if (!issue.createdAt)
90
69
  return false;
91
70
  return new Date(issue.createdAt).getTime() >= new Date(reviewRequestedAt).getTime();
92
71
  }
93
72
  /**
94
73
  * Filter a focus's issues to only those that were filed during the most
95
- * recent review pass and are still open. Used to drive both the detector
96
- * (transition to building) and the re-entry check (return to in_review when
97
- * all are Done).
74
+ * recent review pass and are still open.
98
75
  */
99
76
  export function filterReviewFiledIssues(issues, reviewRequestedAt) {
100
77
  return issues.filter(i => isReviewFiledIssue(i, reviewRequestedAt));
101
78
  }
102
79
  /**
103
80
  * Returns true when there are any review-filed issues (open or closed)
104
- * since the most recent review pass. Used by the re-entry check: if there
105
- * were review-filed issues AND all of them are Done, the focus is
106
- * eligible to return to in_review.
81
+ * since the most recent review pass.
107
82
  */
108
83
  export function reviewFiledIssueExists(issues, reviewRequestedAt) {
109
84
  if (!reviewRequestedAt)
@@ -119,171 +94,4 @@ export function reviewFiledIssueExists(issues, reviewRequestedAt) {
119
94
  }
120
95
  return false;
121
96
  }
122
- const defaultDeps = {
123
- getActiveFocuses,
124
- getFocusDeliveries,
125
- getFocusIssues,
126
- updateFocusStatus,
127
- fetchFocusWorkflowWithTransitions,
128
- createEscalation: defaultCreateEscalation,
129
- };
130
- // ── Detector and re-entry ───────────────────────────────────────────────
131
- /**
132
- * For each active focus in `in_review` status, check whether any
133
- * review-filed issues remain open. If so, transition the focus back to
134
- * `building` and bump the remediation counter. When the counter exceeds
135
- * the bound, escalate instead of transitioning -- the team has been
136
- * stuck in a remediation loop and a human needs to intervene.
137
- *
138
- * Designed to be called from the daemon poll loop on every tick; it is
139
- * a no-op for strategies that don't satisfy the trigger conditions.
140
- */
141
- export async function detectAndHandleReviewDefects(config, deps = defaultDeps) {
142
- let strategies;
143
- try {
144
- strategies = await deps.getActiveFocuses(config.organizationId, config.productId);
145
- }
146
- catch (err) {
147
- console.warn('[review-defect-detector] Failed to fetch active strategies:', err.message);
148
- return;
149
- }
150
- for (const s of strategies) {
151
- if (s.status !== 'in_review')
152
- continue;
153
- try {
154
- const issues = await deps.getFocusIssues(s.focus_id);
155
- const reviewOpen = filterReviewFiledIssues(issues, s.review_requested_at ?? null);
156
- if (reviewOpen.length === 0)
157
- continue;
158
- const cycles = incrementRemediationCycles(s.focus_id);
159
- if (cycles > REVIEW_REMEDIATION_LIMIT) {
160
- console.warn(`[review-defect-detector] Remediation bound exceeded for "${s.focus_name}" ` +
161
- `(cycle ${cycles}/${REVIEW_REMEDIATION_LIMIT}); escalating`);
162
- await escalateReviewRemediation({
163
- organizationId: config.organizationId,
164
- focusId: s.focus_id,
165
- focusName: s.focus_name,
166
- cycles,
167
- openIssues: reviewOpen,
168
- }, deps);
169
- // Reset so a future review pass starts fresh after human intervention.
170
- resetRemediationCycles(s.focus_id);
171
- continue;
172
- }
173
- // Transition the focus from in_review back to building so the
174
- // focus executor's poll loop spawns a remediation team.
175
- const workflow = await deps.fetchFocusWorkflowWithTransitions(s.focus_id);
176
- const buildingStage = workflow.stages.find(st => st.name === 'building');
177
- try {
178
- await deps.updateFocusStatus(s.focus_id, 'building', buildingStage?.id ?? null);
179
- console.log(`[review-defect-detector] Focus "${s.focus_name}" -> building ` +
180
- `(${reviewOpen.length} review-filed issue(s) open, remediation cycle ${cycles}/${REVIEW_REMEDIATION_LIMIT})`);
181
- }
182
- catch (err) {
183
- console.warn(`[review-defect-detector] Failed to move "${s.focus_name}" to building: ${err.message}`);
184
- }
185
- }
186
- catch (err) {
187
- console.warn(`[review-defect-detector] Error checking focus "${s.focus_name}":`, err.message);
188
- }
189
- }
190
- }
191
- /**
192
- * For each active focus in `building` status that has had a review pass
193
- * (review_requested_at set) and review-filed issues since, check whether
194
- * all of those issues are now Done. If so, transition the focus back to
195
- * `verify` so the existing review pipeline can re-run and either close it
196
- * out or file new defects.
197
- *
198
- * Called alongside the detector; safe to invoke on every poll tick.
199
- */
200
- export async function detectAndHandleRemediationComplete(config, deps = defaultDeps) {
201
- let strategies;
202
- try {
203
- strategies = await deps.getActiveFocuses(config.organizationId, config.productId);
204
- }
205
- catch (err) {
206
- console.warn('[review-defect-detector] Failed to fetch active strategies:', err.message);
207
- return;
208
- }
209
- for (const s of strategies) {
210
- // Only act on strategies that were just remediating: status='building'
211
- // with a recorded review request.
212
- if (s.status !== 'building')
213
- continue;
214
- if (!s.review_requested_at)
215
- continue;
216
- try {
217
- const issues = await deps.getFocusIssues(s.focus_id);
218
- const allReviewFiled = issues.filter(i => i.createdByRoleId && i.createdAt &&
219
- new Date(i.createdAt).getTime() >= new Date(s.review_requested_at).getTime());
220
- if (allReviewFiled.length === 0)
221
- continue; // no remediation in progress
222
- const stillOpen = allReviewFiled.filter(i => OPEN_ISSUE_STATUSES.has(i.status));
223
- if (stillOpen.length > 0)
224
- continue; // still remediating
225
- // All review-filed issues are Done -- transition to verify so the
226
- // review pipeline re-runs.
227
- const workflow = await deps.fetchFocusWorkflowWithTransitions(s.focus_id);
228
- const verifyStage = workflow.stages.find(st => st.name === 'verify');
229
- await deps.updateFocusStatus(s.focus_id, 'verify', verifyStage?.id ?? null);
230
- console.log(`[review-defect-detector] Focus "${s.focus_name}" -> verify ` +
231
- `(${allReviewFiled.length} review-filed issue(s) all Done, remediation cycle complete)`);
232
- }
233
- catch (err) {
234
- console.warn(`[review-defect-detector] Error checking remediation completion for "${s.focus_name}":`, err.message);
235
- }
236
- }
237
- }
238
- /**
239
- * Escalate when remediation cycles exceed the configured bound. Surfaces
240
- * the issue list and a clear call to action so the human reviewer can
241
- * unblock the loop.
242
- */
243
- export async function escalateReviewRemediation(params, deps = defaultDeps) {
244
- const issueList = params.openIssues
245
- .slice(0, 25)
246
- .map(i => `- [${i.status}] ${i.key}: ${i.title}`)
247
- .join('\n');
248
- const overflow = params.openIssues.length > 25
249
- ? `\n(... and ${params.openIssues.length - 25} more)`
250
- : '';
251
- try {
252
- await withRetry(() => deps.createEscalation({
253
- organizationId: params.organizationId,
254
- sessionId: '',
255
- issueId: null,
256
- reasonType: ESCALATION_REASONS.BLOCKED_BY_EXTERNAL,
257
- description: `Focus "${params.focusName}" has cycled through review-defect remediation ` +
258
- `${params.cycles} time(s). Reason: ${REVIEW_REMEDIATION_ESCALATION_REASON}.\n\n` +
259
- `**Focus:** ${params.focusName}\n` +
260
- `**Focus ID:** ${params.focusId}\n` +
261
- `**Cycles:** ${params.cycles} (limit: ${REVIEW_REMEDIATION_LIMIT})\n\n` +
262
- `**Open review-filed issues (${params.openIssues.length}):**\n${issueList}${overflow}`,
263
- whatWasTried: `The daemon respawned remediation teams ${params.cycles} time(s) and the team ` +
264
- `was unable to close all review-filed defects between review passes.`,
265
- helpNeeded: `Review the open issues above. Either close out genuinely-blocked items, ` +
266
- `clarify acceptance criteria so the next remediation cycle can succeed, or ` +
267
- `cancel the focus if it is no longer viable.`,
268
- }), { maxAttempts: 3, label: `escalation-review-remediation-${params.focusId}` });
269
- console.log(`[review-defect-detector] Created remediation escalation for "${params.focusName}" ` +
270
- `(reason: ${REVIEW_REMEDIATION_ESCALATION_REASON})`);
271
- }
272
- catch (err) {
273
- console.error(`[review-defect-detector] Failed to create remediation escalation for "${params.focusName}": ${err.message}`);
274
- }
275
- }
276
- /**
277
- * Combined entry point: call both halves of the loop on each poll tick.
278
- *
279
- * Order matters slightly: handle remediation completion first (returns
280
- * Done strategies to verify) before the defect detector (kicks fresh
281
- * defects to building). Doing it in this order means a focus can flow
282
- * verify -> in_review -> building -> verify in a single cycle when work
283
- * is fast.
284
- */
285
- export async function tickReviewDefectLoop(config, deps = defaultDeps) {
286
- await detectAndHandleRemediationComplete(config, deps);
287
- await detectAndHandleReviewDefects(config, deps);
288
- }
289
97
  //# sourceMappingURL=review-defect-detector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-defect-detector.js","sourceRoot":"","sources":["../src/review-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Deterministic state cascade engine.
3
3
  *
4
- * Implements upward state cascades from child to parent entities:
5
- * - Delivery -> Focus: all non-cancelled deliveries verify => focus building -> verify
4
+ * Operates on the focus EXECUTION PHASE axis (derived from delivery
5
+ * aggregate via deriveFocusPhase). Three behaviors live here:
6
6
  *
7
- * Note: Issue -> Delivery cascade is handled by checkDeliveryAutoAdvance
8
- * in listener-auto-advance.ts.
7
+ * 1. Auto-review: phase === 'verifying' + pipelineConfig.review.enabled
8
+ * -> set review_requested_at and transition verify deliveries to
9
+ * in_review. The phase will become 'reviewing' on the next
10
+ * syncFocusPhase poll.
9
11
  *
10
- * And downward reactions when parents revert:
11
- * - Focus regression: if a delivery reverts from verify, focus reverts from verify -> building
12
+ * 2. Review completion: phase === 'reviewing' + no team running +
13
+ * all in_review deliveries pass (no open work issues)
14
+ * -> deliveries -> done, clear review_requested_at.
12
15
  *
13
- * Called from the daemon poll loop via runCascadeChecks().
16
+ * 3. Stale review clearing: review_requested_at set but a delivery has
17
+ * regressed back to active work -> clear review_requested_at so the
18
+ * user can request a fresh review when verify is reached again.
19
+ *
20
+ * The "deliveries all reach verify -> focus advances" cascade and focus
21
+ * phase regression are handled by syncFocusPhase in directive-executor.ts;
22
+ * they no longer live here.
14
23
  */
15
24
  import type { DaemonConfig, PipelineConfig, Workflow } from './types.js';
16
25
  import type { FocusDeliveryInfo } from './types.js';
26
+ import { type FocusExecutionPhase } from './focus-phase.js';
17
27
  /** Injectable dependencies for cascade functions (testing). */
18
28
  export interface CascadeDeps {
19
29
  getFocusDeliveries: (focusId: string) => Promise<FocusDeliveryInfo[]>;
20
- updateFocusStatus: (focusId: string, status: string, stageId?: string | null, extraFields?: {
21
- reviewRequestedAt?: string | null;
22
- }) => Promise<void>;
23
- fetchFocusWorkflowWithTransitions: (focusId: string) => Promise<Workflow>;
30
+ setReviewRequestedAt: (focusId: string, isoTimestamp: string) => Promise<void>;
31
+ clearReviewRequestedAt: (focusId: string) => Promise<void>;
24
32
  fetchEffectiveWorkflow: (deliveryId: string) => Promise<Workflow>;
25
33
  updateDeliveryStatus: (deliveryId: string, status: string, stageId?: string | null) => Promise<void>;
26
34
  getDeliveryIssues: (deliveryId: string) => Promise<Array<{
@@ -31,41 +39,37 @@ export interface CascadeDeps {
31
39
  }>>;
32
40
  }
33
41
  /**
34
- * Check if all non-cancelled deliveries within a focus have reached verify,
35
- * and if so, advance the focus from building -> verify.
36
- */
37
- export declare function checkDeliveryToFocusCascade(config: DaemonConfig, focusId: string, focusStatus: string, deps?: CascadeDeps): Promise<void>;
38
- /**
39
- * If a focus is in verify/in_review but a delivery has reverted to a
40
- * non-complete status, regress the focus back to building.
42
+ * When a focus reaches the verifying phase and pipelineConfig.review is
43
+ * enabled, set review_requested_at and transition verify deliveries to
44
+ * in_review. The phase derivation will pick up review_requested_at on the
45
+ * next poll and emit phase = 'reviewing', firing the reviewing-stage
46
+ * directive.
41
47
  */
42
- export declare function handleFocusRegression(config: DaemonConfig, focusId: string, focusStatus: string, deps?: CascadeDeps): Promise<void>;
48
+ export declare function checkAutoReview(focusId: string, phase: FocusExecutionPhase, pipelineConfig: PipelineConfig | null, reviewRequestedAt: string | null, deliveries: FocusDeliveryInfo[], deps?: CascadeDeps): Promise<void>;
43
49
  /**
44
- * When a focus reaches verify and has pipeline_config.review.enabled,
45
- * automatically trigger AI review by setting review_requested_at,
46
- * transitioning the focus to in_review, and cascading deliveries
47
- * from verify to in_review.
50
+ * When a focus is in the reviewing phase but no review team is running,
51
+ * route each in_review delivery to its outcome and clear
52
+ * review_requested_at:
53
+ * - delivery has open work issues -> iterating (a team will pick it up)
54
+ * - delivery has none -> done
55
+ *
56
+ * Without this, a focus is stuck in reviewing forever if the review team
57
+ * exits without the focus-completion exit handler running (e.g., manual
58
+ * Review request without an in-flight team) or if review never spawned
59
+ * (no agent_directive on the reviewing stage).
48
60
  */
49
- export declare function checkAutoReview(config: DaemonConfig, focusId: string, focusStatus: string, pipelineConfig: PipelineConfig | null, deps?: CascadeDeps): Promise<void>;
61
+ export declare function checkReviewCompletion(focusId: string, phase: FocusExecutionPhase, deliveries: FocusDeliveryInfo[], deps?: CascadeDeps): Promise<void>;
50
62
  /**
51
- * When a focus is in_review but no review team is running, check whether
52
- * all in_review deliveries have passed (no open work issues). If so, route
53
- * them to done and move the focus back to verify.
54
- *
55
- * This handles the case where auto-review triggers but no review team spawns
56
- * (e.g., no agent_directive on the in_review stage, or no active team to
57
- * receive an inject directive). Without this, the focus is stuck in
58
- * in_review forever.
63
+ * If a focus has review_requested_at set but a delivery has reverted to
64
+ * active work, the prior review request is stale -- clear it so the user
65
+ * can request a fresh review once verify is reached again. Phase
66
+ * regression itself is handled by syncFocusPhase.
59
67
  */
60
- export declare function checkReviewCompletion(focusId: string, deps?: CascadeDeps): Promise<void>;
68
+ export declare function clearStaleReviewRequest(focusId: string, phase: FocusExecutionPhase, reviewRequestedAt: string | null, deps?: CascadeDeps): Promise<void>;
61
69
  /**
62
- * Run all cascade checks for active focuses across all configured products.
63
- *
64
- * Called from the daemon poll loop. For each active focus:
65
- * 1. Check delivery->focus cascade (all deliveries verify => focus verify)
66
- * 2. Check auto-review (focus in verify + review.enabled)
67
- * 3. Complete stuck reviews (focus in_review + no team running + all pass)
68
- * 4. Check for focus regression (delivery reverted => focus back to building)
70
+ * Run cascade checks for active focuses across all configured products.
71
+ * Called from the daemon poll loop after syncFocusPhase has updated
72
+ * current_workflow_stage_id, so the derived phase is authoritative.
69
73
  */
70
74
  export declare function runCascadeChecks(config: DaemonConfig): Promise<void>;
71
75
  //# sourceMappingURL=state-cascade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state-cascade.d.ts","sourceRoot":"","sources":["../src/state-cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASpD,+D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