@telora/daemon 0.21.83 → 0.21.134
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.
- package/build-info.json +10 -3
- package/dist/audit/audit-hooks.d.ts +106 -0
- package/dist/audit/audit-hooks.d.ts.map +1 -1
- package/dist/audit/audit-hooks.js +149 -17
- package/dist/audit/audit-hooks.js.map +1 -1
- package/dist/ci/ci-sensor-loop.d.ts +6 -0
- package/dist/ci/ci-sensor-loop.d.ts.map +1 -1
- package/dist/ci/ci-sensor-loop.js +50 -3
- package/dist/ci/ci-sensor-loop.js.map +1 -1
- package/dist/ci/ci-status.d.ts +63 -11
- package/dist/ci/ci-status.d.ts.map +1 -1
- package/dist/ci/ci-status.js +94 -27
- package/dist/ci/ci-status.js.map +1 -1
- package/dist/completion/coverage-drift-state.d.ts +29 -2
- package/dist/completion/coverage-drift-state.d.ts.map +1 -1
- package/dist/completion/coverage-drift-state.js +42 -2
- package/dist/completion/coverage-drift-state.js.map +1 -1
- package/dist/completion/coverage-stabilized.d.ts +58 -0
- package/dist/completion/coverage-stabilized.d.ts.map +1 -0
- package/dist/completion/coverage-stabilized.js +84 -0
- package/dist/completion/coverage-stabilized.js.map +1 -0
- package/dist/completion/delivery-advancement-guard.d.ts +21 -0
- package/dist/completion/delivery-advancement-guard.d.ts.map +1 -1
- package/dist/completion/delivery-advancement-guard.js +31 -3
- package/dist/completion/delivery-advancement-guard.js.map +1 -1
- package/dist/completion/event-escalations.d.ts +15 -0
- package/dist/completion/event-escalations.d.ts.map +1 -1
- package/dist/completion/event-escalations.js +42 -4
- package/dist/completion/event-escalations.js.map +1 -1
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +10 -5
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/machine-remediable-demotion.d.ts +74 -0
- package/dist/completion/machine-remediable-demotion.d.ts.map +1 -0
- package/dist/completion/machine-remediable-demotion.js +147 -0
- package/dist/completion/machine-remediable-demotion.js.map +1 -0
- package/dist/completion/review-exit-escalations.d.ts +36 -1
- package/dist/completion/review-exit-escalations.d.ts.map +1 -1
- package/dist/completion/review-exit-escalations.js +81 -0
- package/dist/completion/review-exit-escalations.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts +4 -2
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +49 -54
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/settle-injection-sweep.d.ts +55 -0
- package/dist/completion/settle-injection-sweep.d.ts.map +1 -0
- package/dist/completion/settle-injection-sweep.js +88 -0
- package/dist/completion/settle-injection-sweep.js.map +1 -0
- package/dist/completion/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade.js +41 -0
- package/dist/completion/state-cascade.js.map +1 -1
- package/dist/completion/status-advance-phase.d.ts.map +1 -1
- package/dist/completion/status-advance-phase.js +28 -30
- package/dist/completion/status-advance-phase.js.map +1 -1
- package/dist/completion/team-lifecycle.d.ts +42 -0
- package/dist/completion/team-lifecycle.d.ts.map +1 -1
- package/dist/completion/team-lifecycle.js +79 -2
- package/dist/completion/team-lifecycle.js.map +1 -1
- package/dist/delivery/delivery-lifecycle.d.ts +19 -33
- package/dist/delivery/delivery-lifecycle.d.ts.map +1 -1
- package/dist/delivery/delivery-lifecycle.js +26 -160
- package/dist/delivery/delivery-lifecycle.js.map +1 -1
- package/dist/delivery/delivery-merge-ops.d.ts +46 -0
- package/dist/delivery/delivery-merge-ops.d.ts.map +1 -0
- package/dist/delivery/delivery-merge-ops.js +154 -0
- package/dist/delivery/delivery-merge-ops.js.map +1 -0
- package/dist/delivery/delivery-reconciler-apply.d.ts +108 -66
- package/dist/delivery/delivery-reconciler-apply.d.ts.map +1 -1
- package/dist/delivery/delivery-reconciler-apply.js +87 -61
- package/dist/delivery/delivery-reconciler-apply.js.map +1 -1
- package/dist/delivery/delivery-reconciler.d.ts +7 -2
- package/dist/delivery/delivery-reconciler.d.ts.map +1 -1
- package/dist/delivery/delivery-reconciler.js +34 -5
- package/dist/delivery/delivery-reconciler.js.map +1 -1
- package/dist/delivery/external-hold-surface.d.ts +32 -0
- package/dist/delivery/external-hold-surface.d.ts.map +1 -0
- package/dist/delivery/external-hold-surface.js +67 -0
- package/dist/delivery/external-hold-surface.js.map +1 -0
- package/dist/delivery/external-hold.d.ts +38 -0
- package/dist/delivery/external-hold.d.ts.map +1 -1
- package/dist/delivery/external-hold.js +69 -6
- package/dist/delivery/external-hold.js.map +1 -1
- package/dist/delivery/operator-hold.d.ts +1 -2
- package/dist/delivery/operator-hold.d.ts.map +1 -1
- package/dist/delivery/operator-hold.js +1 -2
- package/dist/delivery/operator-hold.js.map +1 -1
- package/dist/delivery/paused-revival.d.ts +140 -0
- package/dist/delivery/paused-revival.d.ts.map +1 -0
- package/dist/delivery/paused-revival.js +229 -0
- package/dist/delivery/paused-revival.js.map +1 -0
- package/dist/delivery/wait-reachability.d.ts +149 -0
- package/dist/delivery/wait-reachability.d.ts.map +1 -0
- package/dist/delivery/wait-reachability.js +193 -0
- package/dist/delivery/wait-reachability.js.map +1 -0
- package/dist/directive/close-loop-dispatcher.d.ts +16 -263
- package/dist/directive/close-loop-dispatcher.d.ts.map +1 -1
- package/dist/directive/close-loop-dispatcher.js +21 -259
- package/dist/directive/close-loop-dispatcher.js.map +1 -1
- package/dist/directive/directive-dispatch.d.ts +19 -0
- package/dist/directive/directive-dispatch.d.ts.map +1 -1
- package/dist/directive/directive-dispatch.js +18 -0
- package/dist/directive/directive-dispatch.js.map +1 -1
- package/dist/directive/directive-executor.d.ts +1 -3
- package/dist/directive/directive-executor.d.ts.map +1 -1
- package/dist/directive/directive-executor.js +23 -21
- package/dist/directive/directive-executor.js.map +1 -1
- package/dist/directive/phase-sync.d.ts +28 -15
- package/dist/directive/phase-sync.d.ts.map +1 -1
- package/dist/directive/phase-sync.js +28 -36
- package/dist/directive/phase-sync.js.map +1 -1
- package/dist/directive/resolver-dispatch.d.ts +19 -92
- package/dist/directive/resolver-dispatch.d.ts.map +1 -1
- package/dist/directive/resolver-dispatch.js +19 -65
- package/dist/directive/resolver-dispatch.js.map +1 -1
- package/dist/focus/focus-engine.d.ts.map +1 -1
- package/dist/focus/focus-engine.js +26 -0
- package/dist/focus/focus-engine.js.map +1 -1
- package/dist/focus/focus-executor.d.ts.map +1 -1
- package/dist/focus/focus-executor.js +290 -256
- package/dist/focus/focus-executor.js.map +1 -1
- package/dist/focus/focus-loop-registry.d.ts.map +1 -1
- package/dist/focus/focus-loop-registry.js +43 -1
- package/dist/focus/focus-loop-registry.js.map +1 -1
- package/dist/focus/focus-respawn-guard.d.ts.map +1 -1
- package/dist/focus/focus-respawn-guard.js +11 -2
- package/dist/focus/focus-respawn-guard.js.map +1 -1
- package/dist/focus/focus-team-state.d.ts +11 -0
- package/dist/focus/focus-team-state.d.ts.map +1 -1
- package/dist/focus/focus-team-state.js +17 -0
- package/dist/focus/focus-team-state.js.map +1 -1
- package/dist/focus/listener-auto-advance.d.ts +13 -1
- package/dist/focus/listener-auto-advance.d.ts.map +1 -1
- package/dist/focus/listener-auto-advance.js +112 -76
- package/dist/focus/listener-auto-advance.js.map +1 -1
- package/dist/focus/listener.d.ts.map +1 -1
- package/dist/focus/listener.js +141 -75
- package/dist/focus/listener.js.map +1 -1
- package/dist/focus/tick-deadline.d.ts +55 -0
- package/dist/focus/tick-deadline.d.ts.map +1 -0
- package/dist/focus/tick-deadline.js +91 -0
- package/dist/focus/tick-deadline.js.map +1 -0
- package/dist/focus-stage-lifecycle/index.d.ts +18 -25
- package/dist/focus-stage-lifecycle/index.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle/index.js +26 -38
- package/dist/focus-stage-lifecycle/index.js.map +1 -1
- package/dist/focus-stage-lifecycle/wedge-cause-arbiter.d.ts +52 -0
- package/dist/focus-stage-lifecycle/wedge-cause-arbiter.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-cause-arbiter.js +94 -0
- package/dist/focus-stage-lifecycle/wedge-cause-arbiter.js.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +18 -1
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle/wedge-watchdog.js +57 -7
- package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
- package/dist/git/merge.d.ts.map +1 -1
- package/dist/git/merge.js +12 -3
- package/dist/git/merge.js.map +1 -1
- package/dist/guard/condition-evaluators.d.ts +9 -0
- package/dist/guard/condition-evaluators.d.ts.map +1 -1
- package/dist/guard/condition-evaluators.js +15 -0
- package/dist/guard/condition-evaluators.js.map +1 -1
- package/dist/guard/guard-evaluator.d.ts +17 -1
- package/dist/guard/guard-evaluator.d.ts.map +1 -1
- package/dist/guard/guard-evaluator.js +61 -2
- package/dist/guard/guard-evaluator.js.map +1 -1
- package/dist/guard/trigger-executor.d.ts +30 -18
- package/dist/guard/trigger-executor.d.ts.map +1 -1
- package/dist/guard/trigger-executor.js +55 -31
- package/dist/guard/trigger-executor.js.map +1 -1
- package/dist/prompt/team-prompt-base.d.ts +1 -1
- package/dist/prompt/team-prompt-base.d.ts.map +1 -1
- package/dist/prompt/team-prompt-base.js +1 -1
- package/dist/prompt/team-prompt-base.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +0 -32
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +19 -88
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/queries/deliveries.d.ts +33 -0
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +7 -0
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/focuses.d.ts +46 -0
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +60 -0
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/guards.d.ts +10 -0
- package/dist/queries/guards.d.ts.map +1 -1
- package/dist/queries/guards.js +14 -1
- package/dist/queries/guards.js.map +1 -1
- package/dist/queries/issues.d.ts +65 -1
- package/dist/queries/issues.d.ts.map +1 -1
- package/dist/queries/issues.js +135 -2
- package/dist/queries/issues.js.map +1 -1
- package/dist/queries/schemas.d.ts +53 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +38 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/verification.d.ts +5 -6
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +5 -6
- package/dist/queries/verification.js.map +1 -1
- package/dist/resolvers/loop-persona.d.ts +1 -11
- package/dist/resolvers/loop-persona.d.ts.map +1 -1
- package/dist/resolvers/loop-persona.js +2 -16
- package/dist/resolvers/loop-persona.js.map +1 -1
- package/dist/shell/heartbeat.d.ts +7 -0
- package/dist/shell/heartbeat.d.ts.map +1 -1
- package/dist/shell/heartbeat.js +1 -1
- package/dist/shell/heartbeat.js.map +1 -1
- package/dist/shell/unified-shell-provisioning.d.ts +40 -0
- package/dist/shell/unified-shell-provisioning.d.ts.map +1 -1
- package/dist/shell/unified-shell-provisioning.js +72 -0
- package/dist/shell/unified-shell-provisioning.js.map +1 -1
- package/dist/shell/unified-shell.d.ts.map +1 -1
- package/dist/shell/unified-shell.js +18 -1
- package/dist/shell/unified-shell.js.map +1 -1
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +6 -1
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +7 -0
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/respawn-cycle-escalation.d.ts +41 -0
- package/dist/spawn/respawn-cycle-escalation.d.ts.map +1 -0
- package/dist/spawn/respawn-cycle-escalation.js +83 -0
- package/dist/spawn/respawn-cycle-escalation.js.map +1 -0
- package/dist/spawn/spawn-cooldown.d.ts +119 -2
- package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
- package/dist/spawn/spawn-cooldown.js +120 -10
- package/dist/spawn/spawn-cooldown.js.map +1 -1
- package/dist/spawn/spawn-decision.d.ts.map +1 -1
- package/dist/spawn/spawn-decision.js +33 -1
- package/dist/spawn/spawn-decision.js.map +1 -1
- package/dist/testing/fixtures/index.d.ts +64 -0
- package/dist/testing/fixtures/index.d.ts.map +1 -0
- package/dist/testing/fixtures/index.js +220 -0
- package/dist/testing/fixtures/index.js.map +1 -0
- package/dist/update/build-info.d.ts +1 -0
- package/dist/update/build-info.d.ts.map +1 -1
- package/dist/update/build-info.js +1 -1
- package/dist/update/build-info.js.map +1 -1
- package/dist/verify/stall-detector-config.d.ts +8 -0
- package/dist/verify/stall-detector-config.d.ts.map +1 -1
- package/dist/verify/stall-detector-config.js +40 -0
- package/dist/verify/stall-detector-config.js.map +1 -1
- package/dist/verify/stall-detectors.d.ts +57 -14
- package/dist/verify/stall-detectors.d.ts.map +1 -1
- package/dist/verify/stall-detectors.js +72 -55
- package/dist/verify/stall-detectors.js.map +1 -1
- package/dist/verify/verification-feedback.d.ts +3 -4
- package/dist/verify/verification-feedback.d.ts.map +1 -1
- package/dist/verify/verification-feedback.js +3 -12
- package/dist/verify/verification-feedback.js.map +1 -1
- package/dist/workflow/gate-failure-policy.d.ts +48 -0
- package/dist/workflow/gate-failure-policy.d.ts.map +1 -0
- package/dist/workflow/gate-failure-policy.js +57 -0
- package/dist/workflow/gate-failure-policy.js.map +1 -0
- package/dist/workflow/pipeline-config.d.ts +2 -2
- package/dist/workflow/pipeline-config.js +2 -2
- package/package.json +3 -3
- package/dist/directive/close-loop-stage.d.ts +0 -50
- package/dist/directive/close-loop-stage.d.ts.map +0 -1
- package/dist/directive/close-loop-stage.js +0 -210
- package/dist/directive/close-loop-stage.js.map +0 -1
- package/dist/focus-stage-lifecycle/review-convergence.d.ts +0 -133
- package/dist/focus-stage-lifecycle/review-convergence.d.ts.map +0 -1
- package/dist/focus-stage-lifecycle/review-convergence.js +0 -237
- package/dist/focus-stage-lifecycle/review-convergence.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The legible record for a TERMINATED respawn cycle.
|
|
3
|
+
*
|
|
4
|
+
* When a focus's spawn/teardown cycle exhausts its terminating bounds
|
|
5
|
+
* (spawn-cooldown.ts isRespawnCycleExhausted), respawns halt -- but a halt with
|
|
6
|
+
* no record is a silent strand. This module files the one operator escalation
|
|
7
|
+
* that names why the daemon stopped respawning, so the terminated cycle is a
|
|
8
|
+
* declared state a human can see and clear rather than a focus that just went
|
|
9
|
+
* quiet.
|
|
10
|
+
*
|
|
11
|
+
* Kept OUT of spawn-cooldown.ts on purpose: that module is pure/DB-free so its
|
|
12
|
+
* bound predicate unit-tests without daemon-core. The DB write lives here,
|
|
13
|
+
* behind an injectable deps seam, and the listener calls it at the single
|
|
14
|
+
* terminal-skip site (processPendingSpawnFocuses). Idempotent + cause-keyed
|
|
15
|
+
* (one open row per focus), mirroring the review_window_stalled detector shape
|
|
16
|
+
* -- so filing on every poll while terminated yields exactly one open row.
|
|
17
|
+
*/
|
|
18
|
+
import { type FileEscalationIdempotentParams, type FileEscalationIdempotentResult } from '../queries/escalation-suppression.js';
|
|
19
|
+
/** escalation_kind for a terminated respawn cycle (DB CHECK is the real gate). */
|
|
20
|
+
export declare const RESPAWN_CYCLE_EXHAUSTED_KIND = "respawn_cycle_exhausted";
|
|
21
|
+
export interface RespawnCycleEscalationContext {
|
|
22
|
+
organizationId: string;
|
|
23
|
+
focusId: string;
|
|
24
|
+
focusName: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RespawnCycleEscalationDeps {
|
|
27
|
+
fileEscalation: (params: FileEscalationIdempotentParams) => Promise<FileEscalationIdempotentResult>;
|
|
28
|
+
/** Streak descriptor source; defaults to the live spawn-cooldown map. Injectable for tests. */
|
|
29
|
+
getStreak?: (focusId: string) => {
|
|
30
|
+
firstTime: number;
|
|
31
|
+
count: number;
|
|
32
|
+
} | null;
|
|
33
|
+
/** Current epoch ms; injectable for tests. */
|
|
34
|
+
now?: () => number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* File the one-per-focus respawn_cycle_exhausted escalation (needs_operator).
|
|
38
|
+
* Best-effort: never throws -- a failed file must not abort the poll loop.
|
|
39
|
+
*/
|
|
40
|
+
export declare function fileRespawnCycleExhaustedEscalation(ctx: RespawnCycleEscalationContext, deps?: RespawnCycleEscalationDeps): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=respawn-cycle-escalation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respawn-cycle-escalation.d.ts","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAEL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,sCAAsC,CAAC;AAO9C,kFAAkF;AAClF,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACpG,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAQD;;;GAGG;AACH,wBAAsB,mCAAmC,CACvD,GAAG,EAAE,6BAA6B,EAClC,IAAI,GAAE,0BAAwC,GAC7C,OAAO,CAAC,IAAI,CAAC,CA0Df"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The legible record for a TERMINATED respawn cycle.
|
|
3
|
+
*
|
|
4
|
+
* When a focus's spawn/teardown cycle exhausts its terminating bounds
|
|
5
|
+
* (spawn-cooldown.ts isRespawnCycleExhausted), respawns halt -- but a halt with
|
|
6
|
+
* no record is a silent strand. This module files the one operator escalation
|
|
7
|
+
* that names why the daemon stopped respawning, so the terminated cycle is a
|
|
8
|
+
* declared state a human can see and clear rather than a focus that just went
|
|
9
|
+
* quiet.
|
|
10
|
+
*
|
|
11
|
+
* Kept OUT of spawn-cooldown.ts on purpose: that module is pure/DB-free so its
|
|
12
|
+
* bound predicate unit-tests without daemon-core. The DB write lives here,
|
|
13
|
+
* behind an injectable deps seam, and the listener calls it at the single
|
|
14
|
+
* terminal-skip site (processPendingSpawnFocuses). Idempotent + cause-keyed
|
|
15
|
+
* (one open row per focus), mirroring the review_window_stalled detector shape
|
|
16
|
+
* -- so filing on every poll while terminated yields exactly one open row.
|
|
17
|
+
*/
|
|
18
|
+
import { ESCALATION_REASONS, ESCALATION_DISPOSITIONS, withRetry } from '@telora/daemon-core';
|
|
19
|
+
import { fileEscalationIdempotent as defaultFileEscalationIdempotent, } from '../queries/escalation-suppression.js';
|
|
20
|
+
import { focusBlockageCauseKey } from '../queries/cause-key.js';
|
|
21
|
+
import { getRespawnCycleStreak } from './spawn-cooldown.js';
|
|
22
|
+
import { createLogger } from '../shell/log.js';
|
|
23
|
+
const log = createLogger({ module: 'spawn-cooldown' });
|
|
24
|
+
/** escalation_kind for a terminated respawn cycle (DB CHECK is the real gate). */
|
|
25
|
+
export const RESPAWN_CYCLE_EXHAUSTED_KIND = 'respawn_cycle_exhausted';
|
|
26
|
+
const defaultDeps = {
|
|
27
|
+
fileEscalation: defaultFileEscalationIdempotent,
|
|
28
|
+
getStreak: getRespawnCycleStreak,
|
|
29
|
+
now: () => Date.now(),
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* File the one-per-focus respawn_cycle_exhausted escalation (needs_operator).
|
|
33
|
+
* Best-effort: never throws -- a failed file must not abort the poll loop.
|
|
34
|
+
*/
|
|
35
|
+
export async function fileRespawnCycleExhaustedEscalation(ctx, deps = defaultDeps) {
|
|
36
|
+
const getStreak = deps.getStreak ?? getRespawnCycleStreak;
|
|
37
|
+
const now = (deps.now ?? Date.now)();
|
|
38
|
+
const streak = getStreak(ctx.focusId);
|
|
39
|
+
const count = streak?.count ?? 0;
|
|
40
|
+
const elapsedMin = streak ? Math.floor((now - streak.firstTime) / 60_000) : 0;
|
|
41
|
+
const causeKey = focusBlockageCauseKey(RESPAWN_CYCLE_EXHAUSTED_KIND, ctx.focusId, 'respawn_cycle_exhausted');
|
|
42
|
+
try {
|
|
43
|
+
await withRetry(() => deps.fileEscalation({
|
|
44
|
+
causeKey,
|
|
45
|
+
organizationId: ctx.organizationId,
|
|
46
|
+
sessionId: '',
|
|
47
|
+
issueId: null,
|
|
48
|
+
reasonType: ESCALATION_REASONS.BLOCKED_BY_EXTERNAL,
|
|
49
|
+
disposition: ESCALATION_DISPOSITIONS.NEEDS_OPERATOR,
|
|
50
|
+
anchor: { focusId: ctx.focusId },
|
|
51
|
+
escalationKind: RESPAWN_CYCLE_EXHAUSTED_KIND,
|
|
52
|
+
description: `Focus "${ctx.focusName}" respawn cycle has been terminated: its teams have been ` +
|
|
53
|
+
`spawned and torn down ${count} time(s) over ~${elapsedMin} minute(s) without making ` +
|
|
54
|
+
`progress (no work left to do each time). The daemon has HALTED respawns for this focus ` +
|
|
55
|
+
`-- it is no longer being throttled to one team per ten minutes, it is stopped -- so the ` +
|
|
56
|
+
`self-perpetuating idle-respawn loop cannot keep burning cost while it waits to be noticed.\n\n` +
|
|
57
|
+
`**Focus:** ${ctx.focusName}\n` +
|
|
58
|
+
`**Focus ID:** ${ctx.focusId}\n` +
|
|
59
|
+
`**teardown_count:** ${count}\n` +
|
|
60
|
+
`**elapsed_minutes:** ${elapsedMin}\n\n` +
|
|
61
|
+
`Decide: close/descope the focus if its work is genuinely done, or fix the condition ` +
|
|
62
|
+
`that leaves each spawned team with nothing to do. Progress (a team that advances a ` +
|
|
63
|
+
`delivery) clears the halt automatically.`,
|
|
64
|
+
whatWasTried: `The focus was respawned ${count} time(s); each team found no actionable work and idle-exited. ` +
|
|
65
|
+
`The exponential spawn cooldown only rate-limited this (capped at 10 min/team), so the ` +
|
|
66
|
+
`cycle would otherwise run at that rate indefinitely.`,
|
|
67
|
+
helpNeeded: `Close/descope the focus, or resolve why each spawned team has no work. The respawn halt ` +
|
|
68
|
+
`clears itself once the focus makes genuine progress (clearSpawnCooldown).`,
|
|
69
|
+
metadata: {
|
|
70
|
+
cause: RESPAWN_CYCLE_EXHAUSTED_KIND,
|
|
71
|
+
focusName: ctx.focusName,
|
|
72
|
+
teardownCount: count,
|
|
73
|
+
elapsedMinutes: elapsedMin,
|
|
74
|
+
},
|
|
75
|
+
}), { maxAttempts: 3, label: `escalation-respawn-cycle-exhausted-${ctx.focusId}` });
|
|
76
|
+
log.info(`[spawn-cooldown] Filed respawn_cycle_exhausted escalation for focus "${ctx.focusName}" ` +
|
|
77
|
+
`(teardowns=${count}, elapsed~${elapsedMin}min)`);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
log.warn(`[spawn-cooldown] failed to file respawn_cycle_exhausted escalation for focus "${ctx.focusName}":`, err.message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=respawn-cycle-escalation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respawn-cycle-escalation.js","sourceRoot":"","sources":["../../src/spawn/respawn-cycle-escalation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,wBAAwB,IAAI,+BAA+B,GAG5D,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAy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-down focuses.
|
|
3
|
+
*
|
|
4
|
+
* When a focus is torn down, it enters a cooldown period before it can be
|
|
5
|
+
* respawned. Consecutive teardowns increase the cooldown exponentially
|
|
6
|
+
* (1min, 2min, 4min, 8min, capped at 10min).
|
|
7
|
+
*
|
|
8
|
+
* The exponential backoff bounds the RATE of respawns but not their TOTAL
|
|
9
|
+
* DURATION: a cycle that never becomes productive saturates at one team per ten
|
|
10
|
+
* minutes and then runs at that rate forever, waiting for a human to notice. So
|
|
11
|
+
* a SECOND, terminating bound sits on top of the rate limiter: once a focus's
|
|
12
|
+
* teardown streak exceeds a total elapsed duration OR a cumulative teardown
|
|
13
|
+
* count (isRespawnCycleExhausted), the entry is marked `exhausted` and
|
|
14
|
+
* isInSpawnCooldown returns true INDEFINITELY -- respawns stop entirely rather
|
|
15
|
+
* than merely slowing. The caller (listener.processPendingSpawnFocuses) files a
|
|
16
|
+
* legible respawn_cycle_exhausted escalation on that edge so the terminated
|
|
17
|
+
* cycle is never a silent strand. clearSpawnCooldown (genuine progress) resets
|
|
18
|
+
* the whole streak, so a focus that recovers starts fresh.
|
|
19
|
+
*
|
|
20
|
+
* DURABILITY: the teardown streak + `exhausted` latch are persisted to
|
|
21
|
+
* product_focuses (spawn_teardown_first_at / _last_at / _count /
|
|
22
|
+
* spawn_cooldown_exhausted) so they survive the auto-updater's routine daemon
|
|
23
|
+
* re-exec -- otherwise a deliberate halt silently re-opened and a spent
|
|
24
|
+
* terminating budget restarted from zero on every restart. The map here is the
|
|
25
|
+
* hot write-through cache: recordFocusTeardown / clearSpawnCooldown mutate it
|
|
26
|
+
* synchronously AND fire a best-effort DB write through the registered persister;
|
|
27
|
+
* on boot, hydrateSpawnCooldownEntry restores the map from the persisted columns
|
|
28
|
+
* the first time each focus is seen. In-memory wins during a run (hydrate never
|
|
29
|
+
* clobbers a live entry); the DB is the restart-proof backing.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Per-focus teardown tracking.
|
|
33
|
+
* - firstTime: epoch ms of the FIRST teardown of the current streak. Preserved
|
|
34
|
+
* across subsequent teardowns so the total-duration bound measures the whole
|
|
35
|
+
* cycle, not just the latest teardown. Reset by clearSpawnCooldown.
|
|
36
|
+
* - time: epoch ms of the LATEST teardown (drives the exponential rate limit).
|
|
37
|
+
* - count: cumulative teardown count for the streak (drives both the
|
|
38
|
+
* exponential backoff and the cumulative-count terminating bound).
|
|
39
|
+
* - exhausted: true once a terminating bound crossed. Latches the focus into a
|
|
40
|
+
* permanent skip until clearSpawnCooldown.
|
|
41
|
+
*/
|
|
42
|
+
interface TeardownEntry {
|
|
43
|
+
firstTime: number;
|
|
44
|
+
time: number;
|
|
45
|
+
count: number;
|
|
46
|
+
exhausted: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The durable spawn-cooldown state persisted per focus (mirrors the
|
|
50
|
+
* product_focuses.spawn_teardown_* / spawn_cooldown_exhausted columns).
|
|
51
|
+
* firstAt/lastAt are ISO timestamps; null (with count 0, exhausted false) is the
|
|
52
|
+
* cleared state written by clearSpawnCooldown.
|
|
53
|
+
*/
|
|
54
|
+
export interface DurableSpawnCooldown {
|
|
55
|
+
firstAt: string | null;
|
|
56
|
+
lastAt: string | null;
|
|
57
|
+
count: number;
|
|
58
|
+
exhausted: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Write-through seam: persists a focus's spawn-cooldown state to durable storage.
|
|
62
|
+
* Registered once at daemon boot (setSpawnCooldownPersister) and called
|
|
63
|
+
* best-effort (fire-and-forget) on every teardown/clear. Unset in tests, where
|
|
64
|
+
* the module stays pure in-memory -- so no test registers a persister and none
|
|
65
|
+
* touches the DB.
|
|
66
|
+
*/
|
|
67
|
+
export type SpawnCooldownPersister = (focusId: string, state: DurableSpawnCooldown) => void;
|
|
68
|
+
/** Register (or clear, with null) the durable write-through persister at boot. */
|
|
69
|
+
export declare function setSpawnCooldownPersister(fn: SpawnCooldownPersister | null): void;
|
|
70
|
+
/**
|
|
71
|
+
* Restore a focus's teardown streak + `exhausted` latch from its persisted
|
|
72
|
+
* columns, the FIRST time the daemon sees the focus after a (re-)start. Idempotent
|
|
73
|
+
* and non-clobbering: an entry already tracked in memory this run always wins
|
|
74
|
+
* (hydrate never overwrites a live increment), and a focus with no persisted
|
|
75
|
+
* streak (count 0, not exhausted) is left untracked. This is what makes a halt
|
|
76
|
+
* stay halted and a spent budget stay spent across a daemon re-exec.
|
|
77
|
+
*/
|
|
78
|
+
export declare function hydrateSpawnCooldownEntry(focusId: string, state: DurableSpawnCooldown): void;
|
|
79
|
+
/** Bounds for the respawn-cycle terminating condition. */
|
|
80
|
+
export interface RespawnCycleBounds {
|
|
81
|
+
/** Max total elapsed ms since the streak's first teardown before terminating. */
|
|
82
|
+
maxTotalMs: number;
|
|
83
|
+
/** Max cumulative teardown count for the streak before terminating. */
|
|
84
|
+
maxCount: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Pure decision: has this teardown streak exhausted its terminating bounds?
|
|
88
|
+
*
|
|
89
|
+
* True when the streak has run for at least `maxTotalMs` since its FIRST
|
|
90
|
+
* teardown, OR has accumulated at least `maxCount` teardowns. Either bound alone
|
|
91
|
+
* terminates the cycle -- duration catches a slow saturated loop; count catches a
|
|
92
|
+
* fast one. Exported for direct unit testing (no clock, no daemon-core).
|
|
93
|
+
*/
|
|
94
|
+
export declare function isRespawnCycleExhausted(entry: Pick<TeardownEntry, 'firstTime' | 'count'>, nowMs: number, bounds: RespawnCycleBounds): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Record a focus teardown for spawn cooldown tracking.
|
|
97
|
+
*
|
|
98
|
+
* Preserves the streak's firstTime, increments count, and -- when a terminating
|
|
99
|
+
* bound crosses -- latches `exhausted`. Returns the updated entry so the caller
|
|
100
|
+
* can detect the exhaustion edge and file the terminating escalation.
|
|
101
|
+
*/
|
|
102
|
+
export declare function recordFocusTeardown(focusId: string): TeardownEntry;
|
|
103
|
+
/**
|
|
104
|
+
* True once a focus's respawn cycle has crossed its terminating bounds. Distinct
|
|
105
|
+
* from isInSpawnCooldown (which is also true during ordinary rate-limit cooldown):
|
|
106
|
+
* this is the TERMINAL signal the caller uses to file the one-per-focus
|
|
107
|
+
* respawn_cycle_exhausted escalation before skipping the spawn. Read-only.
|
|
108
|
+
*/
|
|
109
|
+
export declare function isRespawnCycleTerminated(focusId: string): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Read a focus's current teardown-streak descriptor (firstTime + count), or null
|
|
112
|
+
* when no streak is tracked. Used by the respawn_cycle_exhausted escalation to
|
|
113
|
+
* report the elapsed duration and teardown count in its body. Read-only.
|
|
114
|
+
*/
|
|
115
|
+
export declare function getRespawnCycleStreak(focusId: string): {
|
|
116
|
+
firstTime: number;
|
|
117
|
+
count: number;
|
|
118
|
+
} | null;
|
|
3
119
|
/** Check if a focus is in spawn cooldown. */
|
|
4
120
|
export declare function isInSpawnCooldown(focusId: string): boolean;
|
|
5
121
|
/** Clear cooldown for a focus (e.g. after successful long-running session). */
|
|
6
122
|
export declare function clearSpawnCooldown(focusId: string): void;
|
|
123
|
+
export {};
|
|
7
124
|
//# sourceMappingURL=spawn-cooldown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-cooldown.d.ts","sourceRoot":"","sources":["../../src/spawn/spawn-cooldown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spawn-cooldown.d.ts","sourceRoot":"","sources":["../../src/spawn/spawn-cooldown.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;;;GAUG;AACH,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,G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CAMxD"}
|
|
@@ -1,38 +1,140 @@
|
|
|
1
1
|
import { createLogger } from '../shell/log.js';
|
|
2
|
+
import { resolveRespawnCycleMaxHours, resolveRespawnCycleMaxCount, } from '../verify/stall-detector-config.js';
|
|
2
3
|
const log = createLogger({ module: 'spawn-cooldown' });
|
|
3
|
-
/**
|
|
4
|
-
* Spawn cooldown: prevents crash loops by tracking recently-torn-down focuses.
|
|
5
|
-
*
|
|
6
|
-
* When a focus is torn down, it enters a cooldown period before it can be
|
|
7
|
-
* respawned. Consecutive teardowns increase the cooldown exponentially
|
|
8
|
-
* (1min, 2min, 4min, 8min, capped at 10min).
|
|
9
|
-
*/
|
|
10
4
|
const teardownTimestamps = new Map();
|
|
11
5
|
const SPAWN_COOLDOWN_BASE_MS = 60_000; // 1 minute base cooldown
|
|
12
6
|
const SPAWN_COOLDOWN_MAX_MS = 10 * 60_000; // 10 minute max cooldown
|
|
7
|
+
let persister = null;
|
|
8
|
+
/** Register (or clear, with null) the durable write-through persister at boot. */
|
|
9
|
+
export function setSpawnCooldownPersister(fn) {
|
|
10
|
+
persister = fn;
|
|
11
|
+
}
|
|
12
|
+
/** Map a live in-memory entry to its durable shape for the persister. */
|
|
13
|
+
function toDurable(entry) {
|
|
14
|
+
return {
|
|
15
|
+
firstAt: new Date(entry.firstTime).toISOString(),
|
|
16
|
+
lastAt: new Date(entry.time).toISOString(),
|
|
17
|
+
count: entry.count,
|
|
18
|
+
exhausted: entry.exhausted,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** The durable state written on clearSpawnCooldown: the streak fully reset. */
|
|
22
|
+
const CLEARED_DURABLE = { firstAt: null, lastAt: null, count: 0, exhausted: false };
|
|
23
|
+
/**
|
|
24
|
+
* Restore a focus's teardown streak + `exhausted` latch from its persisted
|
|
25
|
+
* columns, the FIRST time the daemon sees the focus after a (re-)start. Idempotent
|
|
26
|
+
* and non-clobbering: an entry already tracked in memory this run always wins
|
|
27
|
+
* (hydrate never overwrites a live increment), and a focus with no persisted
|
|
28
|
+
* streak (count 0, not exhausted) is left untracked. This is what makes a halt
|
|
29
|
+
* stay halted and a spent budget stay spent across a daemon re-exec.
|
|
30
|
+
*/
|
|
31
|
+
export function hydrateSpawnCooldownEntry(focusId, state) {
|
|
32
|
+
if (teardownTimestamps.has(focusId))
|
|
33
|
+
return; // in-memory wins during a run
|
|
34
|
+
if (state.count <= 0 && !state.exhausted)
|
|
35
|
+
return; // no streak to restore
|
|
36
|
+
const now = Date.now();
|
|
37
|
+
const parsedFirst = state.firstAt ? Date.parse(state.firstAt) : now;
|
|
38
|
+
const parsedLast = state.lastAt ? Date.parse(state.lastAt) : now;
|
|
39
|
+
teardownTimestamps.set(focusId, {
|
|
40
|
+
firstTime: Number.isNaN(parsedFirst) ? now : parsedFirst,
|
|
41
|
+
time: Number.isNaN(parsedLast) ? now : parsedLast,
|
|
42
|
+
// An exhausted latch with a lost count still counts as at least one teardown
|
|
43
|
+
// so isInSpawnCooldown/backoff math stays well-defined.
|
|
44
|
+
count: Math.max(state.count, state.exhausted ? 1 : 0),
|
|
45
|
+
exhausted: state.exhausted,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
13
48
|
// Entries older than 2x the max cooldown window are definitely expired
|
|
14
49
|
const COOLDOWN_CLEANUP_THRESHOLD_MS = 2 * SPAWN_COOLDOWN_MAX_MS;
|
|
50
|
+
/** Resolve the terminating bounds from env-config (hours -> ms). */
|
|
51
|
+
function resolveRespawnCycleBounds() {
|
|
52
|
+
return {
|
|
53
|
+
maxTotalMs: resolveRespawnCycleMaxHours() * 3_600_000,
|
|
54
|
+
maxCount: resolveRespawnCycleMaxCount(),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Pure decision: has this teardown streak exhausted its terminating bounds?
|
|
59
|
+
*
|
|
60
|
+
* True when the streak has run for at least `maxTotalMs` since its FIRST
|
|
61
|
+
* teardown, OR has accumulated at least `maxCount` teardowns. Either bound alone
|
|
62
|
+
* terminates the cycle -- duration catches a slow saturated loop; count catches a
|
|
63
|
+
* fast one. Exported for direct unit testing (no clock, no daemon-core).
|
|
64
|
+
*/
|
|
65
|
+
export function isRespawnCycleExhausted(entry, nowMs, bounds) {
|
|
66
|
+
if (entry.count >= bounds.maxCount)
|
|
67
|
+
return true;
|
|
68
|
+
return nowMs - entry.firstTime >= bounds.maxTotalMs;
|
|
69
|
+
}
|
|
15
70
|
/**
|
|
16
71
|
* Remove stale entries from the teardown map to prevent unbounded growth.
|
|
17
72
|
* Entries older than 2 * SPAWN_COOLDOWN_MAX_MS are guaranteed to be past
|
|
18
73
|
* their cooldown window regardless of count.
|
|
74
|
+
*
|
|
75
|
+
* An `exhausted` entry is NEVER cleaned up by age: it latches the terminated
|
|
76
|
+
* cycle into a permanent skip and must survive until clearSpawnCooldown (genuine
|
|
77
|
+
* progress) or a daemon restart, so age-based cleanup would silently re-open the
|
|
78
|
+
* respawn cycle it exists to stop.
|
|
19
79
|
*/
|
|
20
80
|
function cleanupStaleEntries() {
|
|
21
81
|
const now = Date.now();
|
|
22
82
|
for (const [focusId, entry] of teardownTimestamps) {
|
|
83
|
+
if (entry.exhausted)
|
|
84
|
+
continue;
|
|
23
85
|
if (now - entry.time > COOLDOWN_CLEANUP_THRESHOLD_MS) {
|
|
24
86
|
teardownTimestamps.delete(focusId);
|
|
25
87
|
}
|
|
26
88
|
}
|
|
27
89
|
}
|
|
28
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Record a focus teardown for spawn cooldown tracking.
|
|
92
|
+
*
|
|
93
|
+
* Preserves the streak's firstTime, increments count, and -- when a terminating
|
|
94
|
+
* bound crosses -- latches `exhausted`. Returns the updated entry so the caller
|
|
95
|
+
* can detect the exhaustion edge and file the terminating escalation.
|
|
96
|
+
*/
|
|
29
97
|
export function recordFocusTeardown(focusId) {
|
|
30
98
|
cleanupStaleEntries();
|
|
99
|
+
const now = Date.now();
|
|
31
100
|
const existing = teardownTimestamps.get(focusId);
|
|
32
101
|
const count = existing ? existing.count + 1 : 1;
|
|
33
|
-
|
|
102
|
+
const firstTime = existing?.firstTime ?? now;
|
|
103
|
+
const wasExhausted = existing?.exhausted ?? false;
|
|
104
|
+
const exhausted = wasExhausted || isRespawnCycleExhausted({ firstTime, count }, now, resolveRespawnCycleBounds());
|
|
105
|
+
const entry = { firstTime, time: now, count, exhausted };
|
|
106
|
+
teardownTimestamps.set(focusId, entry);
|
|
107
|
+
// Write-through so the streak + latch survive a daemon re-exec (best-effort).
|
|
108
|
+
persister?.(focusId, toDurable(entry));
|
|
34
109
|
const cooldownMs = Math.min(SPAWN_COOLDOWN_BASE_MS * Math.pow(2, count - 1), SPAWN_COOLDOWN_MAX_MS);
|
|
35
|
-
|
|
110
|
+
if (exhausted && !wasExhausted) {
|
|
111
|
+
log.warn(`Focus ${focusId} respawn cycle EXHAUSTED (count=${count}, ` +
|
|
112
|
+
`elapsed=${Math.round((now - firstTime) / 1000)}s): respawns halted pending operator resolution.`);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
log.info(`Focus ${focusId} torn down (count=${count}, cooldown=${Math.round(cooldownMs / 1000)}s)`);
|
|
116
|
+
}
|
|
117
|
+
return entry;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* True once a focus's respawn cycle has crossed its terminating bounds. Distinct
|
|
121
|
+
* from isInSpawnCooldown (which is also true during ordinary rate-limit cooldown):
|
|
122
|
+
* this is the TERMINAL signal the caller uses to file the one-per-focus
|
|
123
|
+
* respawn_cycle_exhausted escalation before skipping the spawn. Read-only.
|
|
124
|
+
*/
|
|
125
|
+
export function isRespawnCycleTerminated(focusId) {
|
|
126
|
+
return teardownTimestamps.get(focusId)?.exhausted ?? false;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Read a focus's current teardown-streak descriptor (firstTime + count), or null
|
|
130
|
+
* when no streak is tracked. Used by the respawn_cycle_exhausted escalation to
|
|
131
|
+
* report the elapsed duration and teardown count in its body. Read-only.
|
|
132
|
+
*/
|
|
133
|
+
export function getRespawnCycleStreak(focusId) {
|
|
134
|
+
const entry = teardownTimestamps.get(focusId);
|
|
135
|
+
if (!entry)
|
|
136
|
+
return null;
|
|
137
|
+
return { firstTime: entry.firstTime, count: entry.count };
|
|
36
138
|
}
|
|
37
139
|
/** Check if a focus is in spawn cooldown. */
|
|
38
140
|
export function isInSpawnCooldown(focusId) {
|
|
@@ -40,6 +142,10 @@ export function isInSpawnCooldown(focusId) {
|
|
|
40
142
|
const entry = teardownTimestamps.get(focusId);
|
|
41
143
|
if (!entry)
|
|
42
144
|
return false;
|
|
145
|
+
// An exhausted streak is a permanent skip: the rate-limit window no longer
|
|
146
|
+
// applies -- the cycle is terminated, not merely throttled.
|
|
147
|
+
if (entry.exhausted)
|
|
148
|
+
return true;
|
|
43
149
|
const cooldownMs = Math.min(SPAWN_COOLDOWN_BASE_MS * Math.pow(2, entry.count - 1), SPAWN_COOLDOWN_MAX_MS);
|
|
44
150
|
if (Date.now() - entry.time > cooldownMs) {
|
|
45
151
|
return false;
|
|
@@ -49,5 +155,9 @@ export function isInSpawnCooldown(focusId) {
|
|
|
49
155
|
/** Clear cooldown for a focus (e.g. after successful long-running session). */
|
|
50
156
|
export function clearSpawnCooldown(focusId) {
|
|
51
157
|
teardownTimestamps.delete(focusId);
|
|
158
|
+
// Write-through the cleared state so genuine progress un-halts the focus
|
|
159
|
+
// durably: without this a persisted `exhausted` latch would be re-hydrated on
|
|
160
|
+
// the next restart and re-halt a focus that had already recovered.
|
|
161
|
+
persister?.(focusId, CLEARED_DURABLE);
|
|
52
162
|
}
|
|
53
163
|
//# sourceMappingURL=spawn-cooldown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-cooldown.js","sourceRoot":"","sources":["../../src/spawn/spawn-cooldown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn-cooldown.js","s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M,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACjD,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;IACnD,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA+J/B"}
|
|
@@ -20,8 +20,9 @@ import { resolveAnsweredEscalations } from '../resolvers/escalation-answers.js';
|
|
|
20
20
|
import { resolveLineageSpec, resolveResumeId } from '../session/session-lineage.js';
|
|
21
21
|
import { resolveScopingSpawnResume } from './prompt-assembly.js';
|
|
22
22
|
import { resolveFocusMilestoneContext } from '../prd/index.js';
|
|
23
|
-
import { isStatusAgentActionable, isStatusBlocking } from '../workflow/stage-classifier.js';
|
|
23
|
+
import { isStatusAgentActionable, isStatusBlocking, isStatusTerminal } from '../workflow/stage-classifier.js';
|
|
24
24
|
import { createLogger } from '../shell/log.js';
|
|
25
|
+
import { scanForContradictions, formatContradictions } from '../prompt/prompt-contradictions.js';
|
|
25
26
|
const log = createLogger({ module: 'focus-executor' });
|
|
26
27
|
/**
|
|
27
28
|
* Default loop-context assembly recipe for a focus-team spawn.
|
|
@@ -218,6 +219,22 @@ export function resolveActionableDeliveries(args) {
|
|
|
218
219
|
teamState.lastConsumedDirectiveHash = pendingDirective.contentHash;
|
|
219
220
|
teamState.sessionType = pendingDirective.sessionType;
|
|
220
221
|
}
|
|
222
|
+
// TEL (delivery 5): a focus whose deliveries are ALL terminal (done/cancelled)
|
|
223
|
+
// has nothing to act on -- no coding work, no review to run (a review focus
|
|
224
|
+
// sits in verify, which is NOT terminal). Even a pending directive must not
|
|
225
|
+
// spawn a team here: this is the no-actionable-work floor the pendingDirective
|
|
226
|
+
// branch below otherwise bypasses (it does NOT return 'skip'), so a terminal
|
|
227
|
+
// focus that acquired an inject directive spawns a full team with nothing to
|
|
228
|
+
// do -- once per daemon restart. The forceSpawn escalation-answer path is
|
|
229
|
+
// EXEMPT (it deliberately spawns an exited/all-terminal focus to consume a
|
|
230
|
+
// pending answer via the escalation.answers resolver), so it is guarded out
|
|
231
|
+
// below. A directive we just consumed is discarded with the skip; the terminal
|
|
232
|
+
// focus produces no work next tick either, so nothing is stranded.
|
|
233
|
+
if (!forceSpawn && deliveries.length > 0 && deliveries.every(d => isStatusTerminal(d.executionStatus ?? ''))) {
|
|
234
|
+
log.info(`[focus-executor] Focus "${focusName}" has only terminal deliveries -- skipping spawn ` +
|
|
235
|
+
`(no actionable work; a terminal focus stays quiet)`);
|
|
236
|
+
return { kind: 'skip' };
|
|
237
|
+
}
|
|
221
238
|
// Pre-spawn guard: enforce rank-ordered execution.
|
|
222
239
|
// Skip when a pending spawn directive exists -- the directive has its own intent.
|
|
223
240
|
let actionableDeliveries = [];
|
|
@@ -434,6 +451,21 @@ export async function resolveDirectiveOrFallback(args) {
|
|
|
434
451
|
useLegacyFullPrompt = true;
|
|
435
452
|
}
|
|
436
453
|
}
|
|
454
|
+
// Mechanical scan of the DB-seeded directive body actually reaching this spawn
|
|
455
|
+
// (delivery 6 TEL-5): prompt-contradictions was previously tests-only, so a
|
|
456
|
+
// contradictory seeded stage directive (an action-suffixed telora_* tool name,
|
|
457
|
+
// a team-facing stage-advancement mandate, or a "database trigger" mechanism
|
|
458
|
+
// claim) reached a live team UNSCANNED. Surface each contradiction as a warning
|
|
459
|
+
// -- NOT a hard fail: blocking the spawn would wedge the focus, the exact
|
|
460
|
+
// absorbing state this focus exists to remove. The seeded-directive defect is
|
|
461
|
+
// now visible and fixable at its source (the migration) instead of silently
|
|
462
|
+
// mis-steering the team.
|
|
463
|
+
if (directiveBody) {
|
|
464
|
+
const contradictions = scanForContradictions(directiveBody);
|
|
465
|
+
if (contradictions.length > 0) {
|
|
466
|
+
log.warn(formatContradictions(`stage directive for "${focusName}"`, contradictions));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
437
469
|
return { directiveBody, directiveModel, directiveEngine, directiveLocalModel, pendingFocusOverrideModel, spawnStageName, spawnDirectiveDeclared, useLegacyFullPrompt };
|
|
438
470
|
}
|
|
439
471
|
//# sourceMappingURL=spawn-decision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-decision.js","sourceRoot":"","sources":["../../src/spawn/spawn-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mCAAmC,EACnC,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,oCAAoC,EACpC,cAAc,EACd,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iCAAiC,EAAoD,MAAM,iCAAiC,CAAC;AACtI,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAI5F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAGvD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAa;IACnD,cAAc;IACd,kBAAkB;IAClB,wBAAwB;CACzB,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA0D,EAC1D,SAAiB;IAEjB,IAAI,UA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