@telora/daemon 0.18.18 → 0.18.28

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 (39) hide show
  1. package/build-info.json +13 -3
  2. package/dist/discovery-poll.d.ts +14 -0
  3. package/dist/discovery-poll.d.ts.map +1 -1
  4. package/dist/discovery-poll.js +12 -2
  5. package/dist/discovery-poll.js.map +1 -1
  6. package/dist/focus-executor.d.ts +11 -0
  7. package/dist/focus-executor.d.ts.map +1 -1
  8. package/dist/focus-executor.js +17 -1
  9. package/dist/focus-executor.js.map +1 -1
  10. package/dist/focus-stage-lifecycle.d.ts +222 -1
  11. package/dist/focus-stage-lifecycle.d.ts.map +1 -1
  12. package/dist/focus-stage-lifecycle.js +512 -2
  13. package/dist/focus-stage-lifecycle.js.map +1 -1
  14. package/dist/listener.d.ts.map +1 -1
  15. package/dist/listener.js +4 -0
  16. package/dist/listener.js.map +1 -1
  17. package/dist/nexus-endpoint-clearance.d.ts +105 -0
  18. package/dist/nexus-endpoint-clearance.d.ts.map +1 -0
  19. package/dist/nexus-endpoint-clearance.js +175 -0
  20. package/dist/nexus-endpoint-clearance.js.map +1 -0
  21. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  22. package/dist/prompt-sections/execution-sections.js +19 -6
  23. package/dist/prompt-sections/execution-sections.js.map +1 -1
  24. package/dist/queries/endpoints.d.ts +34 -0
  25. package/dist/queries/endpoints.d.ts.map +1 -0
  26. package/dist/queries/endpoints.js +39 -0
  27. package/dist/queries/endpoints.js.map +1 -0
  28. package/dist/queries/issues.d.ts +19 -0
  29. package/dist/queries/issues.d.ts.map +1 -1
  30. package/dist/queries/issues.js +34 -0
  31. package/dist/queries/issues.js.map +1 -1
  32. package/dist/resolvers/focus-endpoint-catalog.d.ts +22 -0
  33. package/dist/resolvers/focus-endpoint-catalog.d.ts.map +1 -0
  34. package/dist/resolvers/focus-endpoint-catalog.js +73 -0
  35. package/dist/resolvers/focus-endpoint-catalog.js.map +1 -0
  36. package/dist/resolvers/index.d.ts.map +1 -1
  37. package/dist/resolvers/index.js +2 -0
  38. package/dist/resolvers/index.js.map +1 -1
  39. package/package.json +3 -3
@@ -30,10 +30,12 @@ import { configForProduct } from './config.js';
30
30
  import { getActiveFocuses as defaultGetActiveFocuses } from './supabase.js';
31
31
  import { getFocusDeliveries as defaultGetFocusDeliveries, getLatestCompletedFocusReview as defaultGetLatestCompletedFocusReview, getInFlightRemediationCount as defaultGetInFlightRemediationCount, getFocusReviewIterationCount as defaultGetFocusReviewIterationCount, updateFocusStage as defaultUpdateFocusStage, updateFocusReadOnly as defaultUpdateFocusReadOnly, } from './queries/focuses.js';
32
32
  import { updateDeliveryStatus as defaultUpdateDeliveryStatus } from './queries/deliveries.js';
33
- import { createEscalation as defaultCreateEscalation } from './queries/issues.js';
34
- import { ESCALATION_REASONS, ESCALATION_KINDS, ESCALATION_DISPOSITIONS, FOCUS_STAGE, DELIVERY_STATUS } from '@telora/daemon-core';
33
+ import { createEscalation as defaultCreateEscalation, hasOpenWedgedFocusEscalation as defaultHasOpenWedgedFocusEscalation, WEDGED_FOCUS_ESCALATION_KIND, } from './queries/issues.js';
34
+ import { ESCALATION_REASONS, ESCALATION_KINDS, ESCALATION_DISPOSITIONS, FOCUS_STAGE, DELIVERY_STATUS, } from '@telora/daemon-core';
35
35
  import { emitLoopTrigger } from './loop-event-bus.js';
36
36
  import { isReviewEnabled } from './pipeline-config.js';
37
+ import { deriveFocusPhase } from './focus-phase.js';
38
+ import { hasActiveTeam as defaultHasActiveTeam } from './focus-team-state.js';
37
39
  // ── Constants ─────────────────────────────────────────────────────
38
40
  /**
39
41
  * Default cap on review iterations before the daemon files a
@@ -368,6 +370,459 @@ export async function releaseRatifiedReadOnlyFocus(focus, deps = defaultRatifyRe
368
370
  });
369
371
  return released;
370
372
  }
373
+ // ── Writable-focus planning->queued release (planning-wedge prevention D1) ──
374
+ /**
375
+ * Pure predicate: a writable focus is PAST its planning/kickoff window -- i.e. a
376
+ * lingering 'planning' delivery on it is a WEDGE to release, not work a scoping
377
+ * team is still shaping.
378
+ *
379
+ * Stage-column-INDEPENDENT by design. The previous version gated on
380
+ * `isPostPlanning(focus.stage)`, but `product_focuses.stage` is a documented-stale
381
+ * column: NO live path advances it to 'queued'/'in_progress' (the daemon writes
382
+ * only review/close_loop/done; everything else keeps the 'planning' default).
383
+ * supabase/.../focus/lifecycle.ts says so explicitly ("nothing advances `stage`
384
+ * to 'verify'"), which is why the newer code (checkAutoReview, focus_transition_stage)
385
+ * gates on the DERIVED phase instead. The old stage gate therefore NEVER fired for
386
+ * the founding wedge -- a post-backfill writable focus whose stage stays 'planning'
387
+ * forever (review finding, delivery 18055ddd). Worse, it was self-defeating: a
388
+ * delivery is born 'planning' PRECISELY because focus.stage was not post-planning
389
+ * (MCP resolveDefaultExecutionStatus reads the same column), and nothing changes
390
+ * the column before this tick -- so the release could never see a post-planning
391
+ * stage for exactly the focuses that have born-planning deliveries.
392
+ *
393
+ * The replacement uses two stage-free signals:
394
+ * 1. read_only === false -- a NORMAL execute focus, not a read-only audit focus
395
+ * (whose held planning deliveries are released only by the human-ratified
396
+ * `releaseRatifiedReadOnlyFocus`).
397
+ * 2. "past kickoff" via the delivery aggregate + active-team:
398
+ * - deriveFocusPhase(deliveries) !== 'kickoff' => real work already exists
399
+ * (some delivery is queued/coding/verify/done), so a lingering 'planning'
400
+ * row is a wedge behind/ahead of it -> past kickoff.
401
+ * - phase === 'kickoff' (all deliveries planning/draft, or none): genuinely
402
+ * ambiguous between a live scoping window and a full wedge. An ACTIVE TEAM
403
+ * is the discriminator -- a scoping team running for the focus is (or just
404
+ * was) creating/releasing deliveries, so DON'T pre-empt it; no team means
405
+ * nothing can make progress (the rank-0 planning delivery blocks the ready
406
+ * selector so no team will ever spawn) -> wedge -> past kickoff.
407
+ *
408
+ * Exported so tests can drive it with synthetic shapes.
409
+ */
410
+ export function isWritableFocusPastKickoff(input) {
411
+ if (input.readOnly !== false)
412
+ return false;
413
+ const phase = deriveFocusPhase({
414
+ deliveries: input.deliveries.map((d) => ({ executionStatus: d.executionStatus })),
415
+ reviewRequestedAt: input.reviewRequestedAt ?? null,
416
+ });
417
+ // Any non-kickoff phase => real work exists => a held planning row is a wedge.
418
+ if (phase !== 'kickoff')
419
+ return true;
420
+ // Pure all-planning/draft (or empty) 'kickoff': a wedge only when no team is
421
+ // (or can be) working it. An active scoping team is shaping deliveries -- leave it.
422
+ return !input.hasActiveTeam;
423
+ }
424
+ const defaultWritableReleaseDeps = {
425
+ getFocusDeliveries: defaultGetFocusDeliveries,
426
+ updateDeliveryStatus: defaultUpdateDeliveryStatus,
427
+ emitLoopTrigger,
428
+ hasActiveTeam: defaultHasActiveTeam,
429
+ };
430
+ /**
431
+ * The writable-focus analogue of `releaseRatifiedReadOnlyFocus`: the missing
432
+ * planning->queued release for a NORMAL (read_only=false) executing focus.
433
+ *
434
+ * Closes the silent wedge: a writable focus whose deliveries were born
435
+ * 'planning' (created during the planning stage, or via the MCP focus_list
436
+ * lookup falling back to 'planning') has NO transition that releases them once
437
+ * the focus is past planning -- the only planning->queued release in the
438
+ * codebase (`releaseRatifiedReadOnlyFocus`) is gated to ratified read-only audit
439
+ * focuses, and listener-auto-advance only moves queued/coding -> verify. So
440
+ * `daemon_get_ready_focuses` hits the rank-0 'planning' delivery, treats it as a
441
+ * hard block, and the focus never spawns a team.
442
+ *
443
+ * Fetch the focus's deliveries, and when `isWritableFocusPastKickoff` holds (the
444
+ * stage-column-independent gate), sweep every held delivery (execution_status
445
+ * 'planning') to 'queued'. Guarded so ONLY 'planning' rows move --
446
+ * draft/paused/queued/further-along are left untouched, which also makes the
447
+ * release idempotent: once swept, there are no 'planning' rows left so a re-run is
448
+ * a no-op. Unlike the ratify path there is no read_only flip to defer, so each
449
+ * delivery move stands on its own; a per-delivery failure is logged and retried on
450
+ * the next tick.
451
+ *
452
+ * FRT effect #6 (a completed/merged delivery stuck in 'planning' must advance out
453
+ * of 'planning' and never block at rank 0): planning's ONLY valid forward
454
+ * transition is 'queued' (DELIVERY_STATUS machine: planning -> queued|cancelled;
455
+ * planning -> done is illegal). So 'queued' is the correct -- and only -- forward
456
+ * move here even for a complete-but-mislabeled row: it advances out of 'planning'
457
+ * and re-enters the normal lifecycle, which re-settles already-done work quickly
458
+ * (its issues are already Done -> coding -> verify -> done). Re-running merged work
459
+ * is bounded by that; skipping the row instead would leave it 'planning' and
460
+ * re-wedge the focus, which is worse.
461
+ *
462
+ * Returns the number of deliveries released (0 when the gate does not hold or
463
+ * there were no held deliveries).
464
+ */
465
+ export async function releaseWritableFocusPlanningDeliveries(focus, deps = defaultWritableReleaseDeps) {
466
+ // Read-only audit focuses are owned by the ratify-release path -- cheap exit
467
+ // before the fetch (the full gate re-checks read_only too).
468
+ if (focus.readOnly !== false)
469
+ return 0;
470
+ let deliveries;
471
+ try {
472
+ deliveries = await deps.getFocusDeliveries(focus.focusId);
473
+ }
474
+ catch (err) {
475
+ console.warn(`[focus-stage-lifecycle] Writable-release: failed to fetch deliveries to ` +
476
+ `release for "${focus.focusName}" (retry next tick): ${err.message}`);
477
+ return 0;
478
+ }
479
+ // Stage-column-INDEPENDENT gate: derived phase + active-team, never focus.stage.
480
+ if (!isWritableFocusPastKickoff({
481
+ readOnly: focus.readOnly,
482
+ deliveries,
483
+ reviewRequestedAt: focus.reviewRequestedAt,
484
+ hasActiveTeam: deps.hasActiveTeam(focus.focusId),
485
+ })) {
486
+ return 0;
487
+ }
488
+ let released = 0;
489
+ for (const d of deliveries) {
490
+ if (d.executionStatus !== DELIVERY_STATUS.PLANNING)
491
+ continue;
492
+ try {
493
+ await deps.updateDeliveryStatus(d.id, DELIVERY_STATUS.QUEUED, undefined, undefined, undefined, { organizationId: focus.organizationId, fromStatus: DELIVERY_STATUS.PLANNING });
494
+ released += 1;
495
+ }
496
+ catch (err) {
497
+ console.warn(`[focus-stage-lifecycle] Writable-release: failed to queue held delivery ` +
498
+ `${d.id.slice(0, 8)} on "${focus.focusName}": ${err.message}`);
499
+ }
500
+ }
501
+ if (released > 0) {
502
+ console.log(`[focus-stage-lifecycle] Focus "${focus.focusName}" (writable, past kickoff): ` +
503
+ `released ${released} born-planning deliver${released === 1 ? 'y' : 'ies'} to queued.`);
504
+ deps.emitLoopTrigger({
505
+ type: 'focus_status_changed',
506
+ focusId: focus.focusId,
507
+ detail: 'writable:planning->queued',
508
+ });
509
+ }
510
+ return released;
511
+ }
512
+ // ── Planning-wedge watchdog + zero-actionable log (D2 + D3) ───────
513
+ /**
514
+ * Delivery execution_status sets that mirror the server-side ready-focus
515
+ * selector (supabase/functions/product-api/handlers/daemon-focus-handlers.ts:
516
+ * NON_BLOCKING_STATUSES / ACTIONABLE_STATUSES). The edge is the SSOT; this
517
+ * daemon-side mirror exists because the daemon receives an empty ready list for
518
+ * a blocked focus and has no other window onto WHY. The status->class mapping is
519
+ * kept in lockstep with the edge -- a divergence there would make the wedge log /
520
+ * escalation disagree with what the daemon actually surfaces.
521
+ *
522
+ * non-blocking = terminal-ish; never blocks a focus (skipped in the walk).
523
+ * actionable = a delivery the daemon can spawn a team for.
524
+ * everything else (planning, draft, paused) is non-terminal + non-actionable:
525
+ * it BLOCKS the focus when encountered first in rank order.
526
+ *
527
+ * DELIBERATE simplification vs the edge (review finding, deliveries 66c7d4d8 /
528
+ * bbe01d7d): the edge ALSO skips an actionable delivery that already has an active
529
+ * agent_session (`if (activeDeliveryIds.has(d.id)) continue;`), continuing the
530
+ * rank walk past it. This daemon mirror does NOT model per-delivery active
531
+ * sessions -- it has no equivalent of that DB query, and its in-memory team map is
532
+ * focus-grained, not delivery-grained. The omission is BENIGN for wedge detection:
533
+ * an actionable delivery with an active session means a team IS running, i.e. the
534
+ * focus is making progress and is definitionally NOT wedged -- exactly what
535
+ * `surfacesActionable: true` already reports. So the mirror can over-report
536
+ * "surfaces actionable" relative to the edge's "ready" list, but never under-report
537
+ * a wedge. We do not claim byte-for-byte parity, only that the wedge verdict agrees.
538
+ */
539
+ const WEDGE_NON_BLOCKING_STATUSES = new Set([
540
+ DELIVERY_STATUS.DONE,
541
+ DELIVERY_STATUS.CANCELLED,
542
+ DELIVERY_STATUS.VERIFY,
543
+ ]);
544
+ const WEDGE_ACTIONABLE_STATUSES = new Set([
545
+ DELIVERY_STATUS.QUEUED,
546
+ DELIVERY_STATUS.CODING,
547
+ DELIVERY_STATUS.VERIFY_FAILED,
548
+ ]);
549
+ /**
550
+ * Held statuses that constitute a WEDGE worth escalating: work that should be
551
+ * advancing but is stuck. Deliberately EXCLUDES 'paused' -- a pause is an
552
+ * intentional human hold, not a wedge (AC: the watchdog must not fire for a
553
+ * focus paused by a human).
554
+ */
555
+ const WEDGE_HELD_STATUSES = new Set([
556
+ DELIVERY_STATUS.PLANNING,
557
+ DELIVERY_STATUS.DRAFT,
558
+ ]);
559
+ /**
560
+ * Replicate the server-side ready-focus rank-walk to decide whether a focus
561
+ * surfaces actionable work, and if not, which delivery blocks it.
562
+ *
563
+ * The walk (rank-ascending, matching the edge): skip terminal-ish deliveries;
564
+ * the FIRST non-terminal delivery decides -- actionable => the focus surfaces
565
+ * (not wedged); non-actionable (planning/draft/paused) => that delivery blocks
566
+ * the focus and everything behind it. This is why a low-rank 'planning' delivery
567
+ * wedges a focus even when a higher-rank 'queued' delivery exists.
568
+ *
569
+ * Pure and exported for unit testing. Expects deliveries pre-sorted by
570
+ * priorityRank ascending (as daemon_get_focus_deliveries returns them); it does
571
+ * not re-sort, mirroring the edge which relies on the query's ORDER BY.
572
+ */
573
+ export function classifyFocusActionability(deliveries) {
574
+ const totalCount = deliveries.length;
575
+ for (const d of deliveries) {
576
+ const status = d.executionStatus ?? '';
577
+ if (WEDGE_NON_BLOCKING_STATUSES.has(status))
578
+ continue;
579
+ if (WEDGE_ACTIONABLE_STATUSES.has(status)) {
580
+ return { totalCount, surfacesActionable: true, blockingDelivery: null, allTerminal: false };
581
+ }
582
+ // First non-terminal, non-actionable delivery -- it blocks the focus.
583
+ return {
584
+ totalCount,
585
+ surfacesActionable: false,
586
+ blockingDelivery: {
587
+ id: d.id,
588
+ name: d.name,
589
+ status,
590
+ priorityRank: d.priorityRank,
591
+ updatedAt: d.updatedAt ?? null,
592
+ },
593
+ allTerminal: false,
594
+ };
595
+ }
596
+ // Every delivery was terminal-ish (or there were none): not a wedge.
597
+ return { totalCount, surfacesActionable: false, blockingDelivery: null, allTerminal: true };
598
+ }
599
+ // Per-focus watchdog state. Module-level so it persists across poll ticks.
600
+ // firstSeenAt: in-memory first-seen (ms) FALLBACK clock, used only when the
601
+ // blocking delivery has no updatedAt to ground the wedge age on.
602
+ // logSig: last D3 log signature (blockingDeliveryId:status:char), for dampening.
603
+ const focusWedgeFirstSeenAt = new Map();
604
+ const focusZeroActionableLogSig = new Map();
605
+ /** Clear a focus's watchdog state (called when it is no longer zero-actionable). */
606
+ function clearFocusWedgeState(focusId) {
607
+ focusWedgeFirstSeenAt.delete(focusId);
608
+ focusZeroActionableLogSig.delete(focusId);
609
+ }
610
+ /**
611
+ * Evict watchdog state for any focus NOT in `liveFocusIds`. A focus that goes
612
+ * terminal (complete/cancelled) or whose product is unclaimed simply stops being
613
+ * returned by getActiveFocuses, so `evaluateFocusWedge` never runs again to clear
614
+ * its entry -- leaving a slow unbounded leak keyed by focusId (review finding,
615
+ * delivery 66c7d4d8). The poll loop calls this once per run with the set of
616
+ * focusIds it actually saw, bounding both maps to currently-active focuses.
617
+ */
618
+ export function pruneWedgeWatchdogState(liveFocusIds) {
619
+ for (const id of focusWedgeFirstSeenAt.keys()) {
620
+ if (!liveFocusIds.has(id))
621
+ focusWedgeFirstSeenAt.delete(id);
622
+ }
623
+ for (const id of focusZeroActionableLogSig.keys()) {
624
+ if (!liveFocusIds.has(id))
625
+ focusZeroActionableLogSig.delete(id);
626
+ }
627
+ }
628
+ /** Test seam: reset all watchdog state between cases. */
629
+ export function __resetWedgeWatchdogState() {
630
+ focusWedgeFirstSeenAt.clear();
631
+ focusZeroActionableLogSig.clear();
632
+ }
633
+ /** Default wedge threshold (minutes) when the env var is unset / invalid. */
634
+ const DEFAULT_WEDGED_FOCUS_THRESHOLD_MIN = 30;
635
+ /**
636
+ * Resolve the wedge threshold (ms).
637
+ *
638
+ * The canonical typed declaration of this knob lives in @telora/daemon-core
639
+ * env-config (TELORA_WEDGED_FOCUS_THRESHOLD_MIN, positiveInt default 30) -- the
640
+ * single source of truth for every operational knob. We read it directly from
641
+ * process.env here (rather than via loadEnvConfig) so the daemon works against
642
+ * the currently-installed daemon-core (a registry dep, not a workspace symlink)
643
+ * before that package is republished with the new field -- the same pattern the
644
+ * drift-eval list backoff and the stuck-shutdown watchdog use. Non-numeric /
645
+ * non-positive falls back to the 30-minute default.
646
+ */
647
+ function defaultWedgeThresholdMs() {
648
+ const raw = process.env.TELORA_WEDGED_FOCUS_THRESHOLD_MIN;
649
+ const parsed = raw === undefined || raw === '' ? NaN : Number(raw);
650
+ const minutes = Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_WEDGED_FOCUS_THRESHOLD_MIN;
651
+ return minutes * 60_000;
652
+ }
653
+ function defaultWedgeWatchdogDeps() {
654
+ return {
655
+ getFocusDeliveries: defaultGetFocusDeliveries,
656
+ hasOpenWedgedFocusEscalation: defaultHasOpenWedgedFocusEscalation,
657
+ createEscalation: defaultCreateEscalation,
658
+ hasActiveTeam: defaultHasActiveTeam,
659
+ now: () => Date.now(),
660
+ thresholdMs: defaultWedgeThresholdMs(),
661
+ };
662
+ }
663
+ /**
664
+ * Per-focus, per-tick evaluation of the planning-wedge condition. Does two
665
+ * things off ONE actionability classification:
666
+ *
667
+ * D3 (log): when an active, role-assigned focus surfaces zero actionable
668
+ * deliveries, name the rank-0 blocking delivery + its state in the daemon
669
+ * log -- so a wedge is visible in ~/.telora/daemon.log, not only the
670
+ * edge-function log. Dampened to once per focus per state change.
671
+ *
672
+ * D2 (escalate): when that focus is ALSO writable, the block is a WEDGE
673
+ * (planning/draft, not a human pause), NO team is running, and the wedge
674
+ * persists past the threshold, file a deduped wedged_focus escalation --
675
+ * defense-in-depth for wedge classes the rank-respecting release (D1) does
676
+ * not resolve (e.g. a 'draft' block, which D1 does not sweep).
677
+ *
678
+ * Runs AFTER the D1 release in the poll loop, so a focus D1 just unwedged is
679
+ * already surfacing actionable work here and neither logs nor escalates.
680
+ *
681
+ * Gating (escalation): status active + assigned_agent_role_id set + read_only
682
+ * false + wedge-held block + NO active team. The "no active team" check replaces
683
+ * the old (broken) isPostPlanning(stage) gate -- the stage column is stale and
684
+ * never reaches post-planning, so that gate never fired for the founding wedge
685
+ * (review finding, delivery 66c7d4d8). It is the same kickoff-window discriminator
686
+ * D1 uses: a running scoping team is shaping/releasing deliveries (don't escalate);
687
+ * no team means nothing can make progress (the rank-0 block stops the ready
688
+ * selector from spawning one) -- a true wedge. Zero-delivery focuses (planning
689
+ * teams) and all-paused focuses (human hold) are excluded by the classifier (no
690
+ * wedge-held blocking delivery).
691
+ */
692
+ export async function evaluateFocusWedge(focus, deps = defaultWedgeWatchdogDeps()) {
693
+ // Only active, role-assigned focuses can wedge an execution team. An
694
+ // unassigned or non-active focus has nothing to spawn -- not a wedge.
695
+ if (focus.status !== 'active' || !focus.assignedAgentRoleId) {
696
+ clearFocusWedgeState(focus.focusId);
697
+ return { kind: 'skipped', reason: 'not_active_or_unassigned' };
698
+ }
699
+ let deliveries;
700
+ try {
701
+ deliveries = await deps.getFocusDeliveries(focus.focusId);
702
+ }
703
+ catch (err) {
704
+ console.warn(`[focus-stage-lifecycle] Wedge eval: failed to fetch deliveries for ` +
705
+ `"${focus.focusName}": ${err.message}`);
706
+ return { kind: 'skipped', reason: 'delivery_fetch_failed' };
707
+ }
708
+ const actionability = classifyFocusActionability(deliveries);
709
+ // The focus surfaces actionable work (or has only terminal/zero deliveries):
710
+ // not zero-actionable-with-a-block -> clear any prior wedge state and return.
711
+ if (actionability.surfacesActionable || !actionability.blockingDelivery) {
712
+ clearFocusWedgeState(focus.focusId);
713
+ return actionability.surfacesActionable
714
+ ? { kind: 'surfaces_actionable' }
715
+ : { kind: 'skipped', reason: 'all_terminal_or_empty' };
716
+ }
717
+ const block = actionability.blockingDelivery;
718
+ const isWedgeHeld = WEDGE_HELD_STATUSES.has(block.status); // planning/draft vs paused
719
+ const teamActive = deps.hasActiveTeam(focus.focusId);
720
+ // ── D3: daemon-side zero-actionable log (dampened to state change) ──
721
+ // Characterization distinguishes THREE states (review finding, delivery
722
+ // bbe01d7d): a human pause (idle), a live kickoff/scoping window (team active,
723
+ // deliveries being shaped -- NOT a wedge), and a true wedge (held work, no team
724
+ // running). The old two-way split mislabeled a legitimate kickoff focus as
725
+ // "wedged"; the active-team signal separates them.
726
+ const characterization = !isWedgeHeld
727
+ ? 'idle (delivery paused by a human)'
728
+ : teamActive
729
+ ? 'scoping in progress (team active, deliveries being shaped -- not a wedge)'
730
+ : 'wedged (work held, no team running)';
731
+ // Fold team-active into the dampening signature so a kickoff->wedge transition
732
+ // (team exits while the block persists) re-logs with the updated characterization.
733
+ const logSig = `${block.id}:${block.status}:${teamActive ? 'team' : 'noteam'}`;
734
+ if (focusZeroActionableLogSig.get(focus.focusId) !== logSig) {
735
+ focusZeroActionableLogSig.set(focus.focusId, logSig);
736
+ console.log(`[focus-stage-lifecycle] Focus "${focus.focusName}" (stage=${focus.stage ?? 'unknown'}) ` +
737
+ `surfaced zero actionable deliveries: rank-${block.priorityRank} "${block.name}" in ` +
738
+ `"${block.status}" state -- ${characterization}.`);
739
+ }
740
+ // ── D2: wedged_focus escalation (writable + wedge-held + no active team) ──
741
+ // No isPostPlanning(stage) gate -- the stage column is stale (see header). The
742
+ // "no active team" check is the kickoff-window discriminator: a running scoping
743
+ // team means the focus is making progress, not wedged.
744
+ const escalationEligible = focus.readOnly === false &&
745
+ isWedgeHeld &&
746
+ !teamActive;
747
+ if (!escalationEligible) {
748
+ // Zero-actionable but not an escalation-worthy wedge (read-only audit, human
749
+ // pause, or a live scoping team). Logged above; clear the fallback timer.
750
+ focusWedgeFirstSeenAt.delete(focus.focusId);
751
+ return { kind: 'zero_actionable', escalated: false, wedged: false, blockingStatus: block.status };
752
+ }
753
+ // Threshold: escalate only once the wedge has persisted past the window --
754
+ // giving the D1 release time to fix it. Prefer the blocking delivery's
755
+ // updatedAt as a RESTART-DURABLE wedge-age proxy (how long the row has actually
756
+ // sat held; survives a daemon restart, fixing the process-memory reset --
757
+ // review finding, delivery 66c7d4d8). Fall back to the in-memory first-seen
758
+ // clock only when updatedAt is unavailable (older backends).
759
+ const now = deps.now();
760
+ const updatedAtMs = block.updatedAt ? Date.parse(block.updatedAt) : NaN;
761
+ let firstSeen;
762
+ if (Number.isFinite(updatedAtMs)) {
763
+ firstSeen = updatedAtMs;
764
+ focusWedgeFirstSeenAt.delete(focus.focusId); // DB-grounded; no in-memory clock needed
765
+ }
766
+ else {
767
+ firstSeen = focusWedgeFirstSeenAt.get(focus.focusId) ?? now;
768
+ if (!focusWedgeFirstSeenAt.has(focus.focusId)) {
769
+ focusWedgeFirstSeenAt.set(focus.focusId, now);
770
+ }
771
+ }
772
+ if (now - firstSeen < deps.thresholdMs) {
773
+ return { kind: 'zero_actionable', escalated: false, wedged: true, blockingStatus: block.status };
774
+ }
775
+ // Dedup: at most one open wedged_focus escalation per focus (survives restart).
776
+ try {
777
+ if (await deps.hasOpenWedgedFocusEscalation(focus.focusId)) {
778
+ return { kind: 'zero_actionable', escalated: false, wedged: true, blockingStatus: block.status };
779
+ }
780
+ }
781
+ catch (err) {
782
+ console.warn(`[focus-stage-lifecycle] Wedge eval: dedup check failed for ` +
783
+ `"${focus.focusName}" (skipping escalation this tick): ${err.message}`);
784
+ return { kind: 'zero_actionable', escalated: false, wedged: true, blockingStatus: block.status };
785
+ }
786
+ const wedgedMinutes = Math.round((now - firstSeen) / 60_000);
787
+ try {
788
+ await deps.createEscalation({
789
+ organizationId: focus.organizationId,
790
+ sessionId: '',
791
+ issueId: null,
792
+ reasonType: ESCALATION_REASONS.BLOCKED_BY_EXTERNAL,
793
+ disposition: ESCALATION_DISPOSITIONS.AGENT_RESOLVABLE,
794
+ anchor: { focusId: focus.focusId },
795
+ description: `Focus "${focus.focusName}" is wedged: it is active, role-assigned, ` +
796
+ `writable, and has no running team, but has zero actionable deliveries -- ` +
797
+ `the rank-${block.priorityRank} delivery "${block.name}" is stuck in ` +
798
+ `"${block.status}" state, blocking the focus, so no execution team ` +
799
+ `spawns. It has been wedged for ~${wedgedMinutes} minute(s). The ` +
800
+ `writable planning->queued release should normally clear a 'planning' ` +
801
+ `block; investigate why the delivery is not being released ` +
802
+ `(a 'draft' block is not swept by that release and needs attention).`,
803
+ // Local string const (mirrors ESCALATION_KINDS.WEDGED_FOCUS in
804
+ // daemon-core, the SSOT) so the write works against the currently-
805
+ // installed daemon-core before it is republished with the new enum value.
806
+ escalationKind: WEDGED_FOCUS_ESCALATION_KIND,
807
+ metadata: {
808
+ focusId: focus.focusId,
809
+ kind: WEDGED_FOCUS_ESCALATION_KIND,
810
+ blockingDeliveryId: block.id,
811
+ blockingDeliveryStatus: block.status,
812
+ wedgedMinutes,
813
+ },
814
+ });
815
+ console.warn(`[focus-stage-lifecycle] wedged_focus escalation filed for ` +
816
+ `"${focus.focusName}" (rank-${block.priorityRank} "${block.name}" in ` +
817
+ `"${block.status}", wedged ~${wedgedMinutes}m).`);
818
+ return { kind: 'zero_actionable', escalated: true, wedged: true, blockingStatus: block.status };
819
+ }
820
+ catch (err) {
821
+ console.warn(`[focus-stage-lifecycle] Failed to file wedged_focus escalation for ` +
822
+ `"${focus.focusName}": ${err.message}`);
823
+ return { kind: 'zero_actionable', escalated: false, wedged: true, blockingStatus: block.status };
824
+ }
825
+ }
371
826
  // ── Poll-loop entry point ─────────────────────────────────────────
372
827
  /**
373
828
  * Per-product per-focus tick for the new stage lifecycle transitions.
@@ -379,7 +834,12 @@ export async function runStageLifecycleTransitions(config, deps = {
379
834
  advanceVerifyToReview: (f) => advanceVerifyToReviewIfEnabled(f),
380
835
  advanceReviewToCloseLoop: (f) => advanceReviewToCloseLoopIfConverged(f),
381
836
  releaseRatifiedReadOnly: (f) => releaseRatifiedReadOnlyFocus(f),
837
+ releaseWritablePlanning: (f) => releaseWritableFocusPlanningDeliveries(f),
838
+ evaluateWedge: (f) => evaluateFocusWedge(f),
382
839
  }) {
840
+ // Every active focus seen this run, across all products -- used to prune
841
+ // per-focus wedge watchdog state for focuses that have gone terminal/away.
842
+ const seenFocusIds = new Set();
383
843
  for (const product of config.products) {
384
844
  const pc = configForProduct(config, product);
385
845
  let focuses;
@@ -396,6 +856,7 @@ export async function runStageLifecycleTransitions(config, deps = {
396
856
  // focuses make stage-lifecycle progress.
397
857
  if (focus.status !== 'active')
398
858
  continue;
859
+ seenFocusIds.add(focus.focus_id);
399
860
  const baseArgs = {
400
861
  focusId: focus.focus_id,
401
862
  focusName: focus.focus_name,
@@ -421,6 +882,52 @@ export async function runStageLifecycleTransitions(config, deps = {
421
882
  console.warn(`[focus-stage-lifecycle] Ratify-release tick failed for ` +
422
883
  `"${focus.focus_name}": ${err.message}`);
423
884
  }
885
+ // Writable-focus planning->queued release (planning-wedge prevention D1).
886
+ // The analogue of the ratify-release above for a NORMAL execute focus:
887
+ // when a writable (read_only=false) focus is past its kickoff window, sweep
888
+ // any born-'planning' deliveries to 'queued' so they cannot sit
889
+ // un-actionable and silently wedge the focus. Gate is stage-column-
890
+ // independent (derived phase + active team), NOT focus.stage -- the stage
891
+ // column is stale (see isWritableFocusPastKickoff). No-op for read-only
892
+ // audit focuses (handled by the ratify path) and for a live scoping window
893
+ // (active team). Runs AFTER the ratify-release so a focus that ratify just
894
+ // flipped writable is released on the same tick.
895
+ try {
896
+ await deps.releaseWritablePlanning({
897
+ focusId: focus.focus_id,
898
+ focusName: focus.focus_name,
899
+ organizationId: pc.organizationId,
900
+ readOnly: focus.read_only,
901
+ stage: baseArgs.stage, // display-only
902
+ reviewRequestedAt: focus.review_requested_at,
903
+ });
904
+ }
905
+ catch (err) {
906
+ console.warn(`[focus-stage-lifecycle] Writable-release tick failed for ` +
907
+ `"${focus.focus_name}": ${err.message}`);
908
+ }
909
+ // Planning-wedge watchdog + zero-actionable log (D2 + D3). Runs AFTER the
910
+ // releases so a focus just unwedged by D1 is already surfacing actionable
911
+ // work and neither logs nor escalates. Files a deduped wedged_focus
912
+ // escalation only for an active+assigned+writable focus with no running team
913
+ // whose zero-actionable state (a planning/draft block, not a human pause)
914
+ // persists past the threshold -- defense-in-depth for wedge classes D1 misses
915
+ // (e.g. a 'draft' block). Gate is stage-column-independent (see header).
916
+ try {
917
+ await deps.evaluateWedge({
918
+ focusId: focus.focus_id,
919
+ focusName: focus.focus_name,
920
+ organizationId: pc.organizationId,
921
+ status: focus.status,
922
+ assignedAgentRoleId: focus.assigned_agent_role_id,
923
+ readOnly: focus.read_only,
924
+ stage: baseArgs.stage, // display-only
925
+ });
926
+ }
927
+ catch (err) {
928
+ console.warn(`[focus-stage-lifecycle] Wedge watchdog tick failed for ` +
929
+ `"${focus.focus_name}": ${err.message}`);
930
+ }
424
931
  try {
425
932
  if (baseArgs.stage === FOCUS_STAGE.VERIFY) {
426
933
  await deps.advanceVerifyToReview(baseArgs);
@@ -435,5 +942,8 @@ export async function runStageLifecycleTransitions(config, deps = {
435
942
  }
436
943
  }
437
944
  }
945
+ // Evict wedge watchdog state for focuses no longer active anywhere, so the
946
+ // per-focus maps cannot leak across the daemon's lifetime.
947
+ pruneWedgeWatchdogState(seenFocusIds);
438
948
  }
439
949
  //# sourceMappingURL=focus-stage-lifecycle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focus-stage-lifecycle.js","sourceRoot":"","sources":["../src/focus-stage-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,IAAI,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,kBAAkB,IAAI,yBAAyB,EAC/C,6BAA6B,IAAI,oCAAoC,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sB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoIxD;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAGnC"}
1
+ {"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../src/listener.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,YAAY,CAAC;AAqC1D;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AA8BD;;GAEG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAwE5C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CA6JzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CA0GhE;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoIxD;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAGnC"}
package/dist/listener.js CHANGED
@@ -26,6 +26,7 @@ import { isDaemonShuttingDown } from './shutdown-state.js';
26
26
  import { configForProduct, findProduct } from './config.js';
27
27
  import { checkIncomingRequests } from './nexus-incoming.js';
28
28
  import { checkResolvedRequests } from './nexus-return.js';
29
+ import { checkEndpointClearance } from './nexus-endpoint-clearance.js';
29
30
  import { checkDirectives, seedLastProcessedStage, getPendingSpawnFocusIds } from './directive-executor.js';
30
31
  import { getActiveFocuses } from './queries/deliveries.js';
31
32
  import { isIntakeDraining } from './intake-control.js';
@@ -154,6 +155,9 @@ export function startDeliveryListener() {
154
155
  await checkIncomingRequests(pc);
155
156
  // Nexus: close the loop -- resolve done deliveries + notify blocked sources.
156
157
  await checkResolvedRequests(pc);
158
+ // Nexus: clear externally-owned obstacles whose endpoint-typed request has
159
+ // been fulfilled (registry-shape), advancing the consumer's frontier.
160
+ await checkEndpointClearance(pc);
157
161
  }
158
162
  // Endpoint discovery (D5): org-scoped, once per cycle. Best-effort -- the
159
163
  // daemon is the only LAN-reachable component, so it resolves the add-model