@lumenflow/core 1.0.0
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/LICENSE +190 -0
- package/README.md +119 -0
- package/dist/active-wu-detector.d.ts +33 -0
- package/dist/active-wu-detector.js +106 -0
- package/dist/adapters/filesystem-metrics.adapter.d.ts +108 -0
- package/dist/adapters/filesystem-metrics.adapter.js +519 -0
- package/dist/adapters/terminal-renderer.adapter.d.ts +106 -0
- package/dist/adapters/terminal-renderer.adapter.js +337 -0
- package/dist/arg-parser.d.ts +63 -0
- package/dist/arg-parser.js +560 -0
- package/dist/backlog-editor.d.ts +98 -0
- package/dist/backlog-editor.js +179 -0
- package/dist/backlog-generator.d.ts +111 -0
- package/dist/backlog-generator.js +381 -0
- package/dist/backlog-parser.d.ts +45 -0
- package/dist/backlog-parser.js +102 -0
- package/dist/backlog-sync-validator.d.ts +78 -0
- package/dist/backlog-sync-validator.js +294 -0
- package/dist/branch-drift.d.ts +34 -0
- package/dist/branch-drift.js +51 -0
- package/dist/cleanup-install-config.d.ts +33 -0
- package/dist/cleanup-install-config.js +37 -0
- package/dist/cleanup-lock.d.ts +139 -0
- package/dist/cleanup-lock.js +313 -0
- package/dist/code-path-validator.d.ts +146 -0
- package/dist/code-path-validator.js +537 -0
- package/dist/code-paths-overlap.d.ts +55 -0
- package/dist/code-paths-overlap.js +245 -0
- package/dist/commands-logger.d.ts +77 -0
- package/dist/commands-logger.js +254 -0
- package/dist/commit-message-utils.d.ts +25 -0
- package/dist/commit-message-utils.js +41 -0
- package/dist/compliance-parser.d.ts +150 -0
- package/dist/compliance-parser.js +507 -0
- package/dist/constants/backlog-patterns.d.ts +20 -0
- package/dist/constants/backlog-patterns.js +23 -0
- package/dist/constants/dora-constants.d.ts +49 -0
- package/dist/constants/dora-constants.js +53 -0
- package/dist/constants/gate-constants.d.ts +15 -0
- package/dist/constants/gate-constants.js +15 -0
- package/dist/constants/linter-constants.d.ts +16 -0
- package/dist/constants/linter-constants.js +16 -0
- package/dist/constants/tokenizer-constants.d.ts +15 -0
- package/dist/constants/tokenizer-constants.js +15 -0
- package/dist/core/scope-checker.d.ts +97 -0
- package/dist/core/scope-checker.js +163 -0
- package/dist/core/tool-runner.d.ts +161 -0
- package/dist/core/tool-runner.js +393 -0
- package/dist/core/tool.constants.d.ts +105 -0
- package/dist/core/tool.constants.js +101 -0
- package/dist/core/tool.schemas.d.ts +226 -0
- package/dist/core/tool.schemas.js +226 -0
- package/dist/core/worktree-guard.d.ts +130 -0
- package/dist/core/worktree-guard.js +242 -0
- package/dist/coverage-gate.d.ts +108 -0
- package/dist/coverage-gate.js +196 -0
- package/dist/date-utils.d.ts +75 -0
- package/dist/date-utils.js +140 -0
- package/dist/dependency-graph.d.ts +142 -0
- package/dist/dependency-graph.js +550 -0
- package/dist/dependency-guard.d.ts +54 -0
- package/dist/dependency-guard.js +142 -0
- package/dist/dependency-validator.d.ts +105 -0
- package/dist/dependency-validator.js +154 -0
- package/dist/docs-path-validator.d.ts +36 -0
- package/dist/docs-path-validator.js +95 -0
- package/dist/domain/orchestration.constants.d.ts +99 -0
- package/dist/domain/orchestration.constants.js +97 -0
- package/dist/domain/orchestration.schemas.d.ts +280 -0
- package/dist/domain/orchestration.schemas.js +211 -0
- package/dist/domain/orchestration.types.d.ts +133 -0
- package/dist/domain/orchestration.types.js +12 -0
- package/dist/error-handler.d.ts +116 -0
- package/dist/error-handler.js +136 -0
- package/dist/file-classifiers.d.ts +62 -0
- package/dist/file-classifiers.js +108 -0
- package/dist/gates-agent-mode.d.ts +81 -0
- package/dist/gates-agent-mode.js +94 -0
- package/dist/generate-traceability.d.ts +107 -0
- package/dist/generate-traceability.js +411 -0
- package/dist/git-adapter.d.ts +395 -0
- package/dist/git-adapter.js +649 -0
- package/dist/git-staged-validator.d.ts +32 -0
- package/dist/git-staged-validator.js +48 -0
- package/dist/hardcoded-strings.d.ts +61 -0
- package/dist/hardcoded-strings.js +270 -0
- package/dist/incremental-lint.d.ts +78 -0
- package/dist/incremental-lint.js +129 -0
- package/dist/incremental-test.d.ts +39 -0
- package/dist/incremental-test.js +61 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +61 -0
- package/dist/invariants/check-automated-tests.d.ts +50 -0
- package/dist/invariants/check-automated-tests.js +166 -0
- package/dist/invariants-runner.d.ts +103 -0
- package/dist/invariants-runner.js +527 -0
- package/dist/lane-checker.d.ts +50 -0
- package/dist/lane-checker.js +319 -0
- package/dist/lane-inference.d.ts +39 -0
- package/dist/lane-inference.js +195 -0
- package/dist/lane-lock.d.ts +211 -0
- package/dist/lane-lock.js +474 -0
- package/dist/lane-validator.d.ts +48 -0
- package/dist/lane-validator.js +114 -0
- package/dist/logs-lib.d.ts +104 -0
- package/dist/logs-lib.js +207 -0
- package/dist/lumenflow-config-schema.d.ts +272 -0
- package/dist/lumenflow-config-schema.js +207 -0
- package/dist/lumenflow-config.d.ts +95 -0
- package/dist/lumenflow-config.js +236 -0
- package/dist/manual-test-validator.d.ts +80 -0
- package/dist/manual-test-validator.js +200 -0
- package/dist/merge-lock.d.ts +115 -0
- package/dist/merge-lock.js +251 -0
- package/dist/micro-worktree.d.ts +159 -0
- package/dist/micro-worktree.js +427 -0
- package/dist/migration-deployer.d.ts +69 -0
- package/dist/migration-deployer.js +151 -0
- package/dist/orchestration-advisory-loader.d.ts +28 -0
- package/dist/orchestration-advisory-loader.js +87 -0
- package/dist/orchestration-advisory.d.ts +58 -0
- package/dist/orchestration-advisory.js +94 -0
- package/dist/orchestration-di.d.ts +48 -0
- package/dist/orchestration-di.js +57 -0
- package/dist/orchestration-rules.d.ts +57 -0
- package/dist/orchestration-rules.js +201 -0
- package/dist/orphan-detector.d.ts +131 -0
- package/dist/orphan-detector.js +226 -0
- package/dist/path-classifiers.d.ts +57 -0
- package/dist/path-classifiers.js +93 -0
- package/dist/piped-command-detector.d.ts +34 -0
- package/dist/piped-command-detector.js +64 -0
- package/dist/ports/dashboard-renderer.port.d.ts +112 -0
- package/dist/ports/dashboard-renderer.port.js +25 -0
- package/dist/ports/metrics-collector.port.d.ts +132 -0
- package/dist/ports/metrics-collector.port.js +26 -0
- package/dist/process-detector.d.ts +84 -0
- package/dist/process-detector.js +172 -0
- package/dist/prompt-linter.d.ts +72 -0
- package/dist/prompt-linter.js +312 -0
- package/dist/prompt-monitor.d.ts +15 -0
- package/dist/prompt-monitor.js +205 -0
- package/dist/rebase-artifact-cleanup.d.ts +145 -0
- package/dist/rebase-artifact-cleanup.js +433 -0
- package/dist/retry-strategy.d.ts +189 -0
- package/dist/retry-strategy.js +283 -0
- package/dist/risk-detector.d.ts +108 -0
- package/dist/risk-detector.js +252 -0
- package/dist/rollback-utils.d.ts +76 -0
- package/dist/rollback-utils.js +104 -0
- package/dist/section-headings.d.ts +43 -0
- package/dist/section-headings.js +49 -0
- package/dist/spawn-escalation.d.ts +90 -0
- package/dist/spawn-escalation.js +253 -0
- package/dist/spawn-monitor.d.ts +229 -0
- package/dist/spawn-monitor.js +672 -0
- package/dist/spawn-recovery.d.ts +82 -0
- package/dist/spawn-recovery.js +298 -0
- package/dist/spawn-registry-schema.d.ts +98 -0
- package/dist/spawn-registry-schema.js +108 -0
- package/dist/spawn-registry-store.d.ts +146 -0
- package/dist/spawn-registry-store.js +273 -0
- package/dist/spawn-tree.d.ts +121 -0
- package/dist/spawn-tree.js +285 -0
- package/dist/stamp-status-validator.d.ts +84 -0
- package/dist/stamp-status-validator.js +134 -0
- package/dist/stamp-utils.d.ts +100 -0
- package/dist/stamp-utils.js +229 -0
- package/dist/state-machine.d.ts +26 -0
- package/dist/state-machine.js +83 -0
- package/dist/system-map-validator.d.ts +80 -0
- package/dist/system-map-validator.js +272 -0
- package/dist/telemetry.d.ts +80 -0
- package/dist/telemetry.js +213 -0
- package/dist/token-counter.d.ts +51 -0
- package/dist/token-counter.js +145 -0
- package/dist/usecases/get-dashboard-data.usecase.d.ts +52 -0
- package/dist/usecases/get-dashboard-data.usecase.js +61 -0
- package/dist/usecases/get-suggestions.usecase.d.ts +100 -0
- package/dist/usecases/get-suggestions.usecase.js +153 -0
- package/dist/user-normalizer.d.ts +41 -0
- package/dist/user-normalizer.js +141 -0
- package/dist/validators/phi-constants.d.ts +97 -0
- package/dist/validators/phi-constants.js +152 -0
- package/dist/validators/phi-scanner.d.ts +58 -0
- package/dist/validators/phi-scanner.js +215 -0
- package/dist/worktree-ownership.d.ts +50 -0
- package/dist/worktree-ownership.js +74 -0
- package/dist/worktree-scanner.d.ts +103 -0
- package/dist/worktree-scanner.js +168 -0
- package/dist/worktree-symlink.d.ts +99 -0
- package/dist/worktree-symlink.js +359 -0
- package/dist/wu-backlog-updater.d.ts +17 -0
- package/dist/wu-backlog-updater.js +37 -0
- package/dist/wu-checkpoint.d.ts +124 -0
- package/dist/wu-checkpoint.js +233 -0
- package/dist/wu-claim-helpers.d.ts +26 -0
- package/dist/wu-claim-helpers.js +63 -0
- package/dist/wu-claim-resume.d.ts +106 -0
- package/dist/wu-claim-resume.js +276 -0
- package/dist/wu-consistency-checker.d.ts +95 -0
- package/dist/wu-consistency-checker.js +567 -0
- package/dist/wu-constants.d.ts +1275 -0
- package/dist/wu-constants.js +1382 -0
- package/dist/wu-create-validators.d.ts +42 -0
- package/dist/wu-create-validators.js +93 -0
- package/dist/wu-done-branch-only.d.ts +63 -0
- package/dist/wu-done-branch-only.js +191 -0
- package/dist/wu-done-messages.d.ts +119 -0
- package/dist/wu-done-messages.js +185 -0
- package/dist/wu-done-pr.d.ts +72 -0
- package/dist/wu-done-pr.js +174 -0
- package/dist/wu-done-retry-helpers.d.ts +85 -0
- package/dist/wu-done-retry-helpers.js +172 -0
- package/dist/wu-done-ui.d.ts +37 -0
- package/dist/wu-done-ui.js +69 -0
- package/dist/wu-done-validators.d.ts +411 -0
- package/dist/wu-done-validators.js +1229 -0
- package/dist/wu-done-worktree.d.ts +182 -0
- package/dist/wu-done-worktree.js +1097 -0
- package/dist/wu-helpers.d.ts +128 -0
- package/dist/wu-helpers.js +248 -0
- package/dist/wu-lint.d.ts +70 -0
- package/dist/wu-lint.js +234 -0
- package/dist/wu-paths.d.ts +171 -0
- package/dist/wu-paths.js +178 -0
- package/dist/wu-preflight-validators.d.ts +86 -0
- package/dist/wu-preflight-validators.js +251 -0
- package/dist/wu-recovery.d.ts +138 -0
- package/dist/wu-recovery.js +341 -0
- package/dist/wu-repair-core.d.ts +131 -0
- package/dist/wu-repair-core.js +669 -0
- package/dist/wu-schema-normalization.d.ts +17 -0
- package/dist/wu-schema-normalization.js +82 -0
- package/dist/wu-schema.d.ts +793 -0
- package/dist/wu-schema.js +881 -0
- package/dist/wu-spawn-helpers.d.ts +121 -0
- package/dist/wu-spawn-helpers.js +271 -0
- package/dist/wu-spawn.d.ts +158 -0
- package/dist/wu-spawn.js +1306 -0
- package/dist/wu-state-schema.d.ts +213 -0
- package/dist/wu-state-schema.js +156 -0
- package/dist/wu-state-store.d.ts +264 -0
- package/dist/wu-state-store.js +691 -0
- package/dist/wu-status-transition.d.ts +63 -0
- package/dist/wu-status-transition.js +382 -0
- package/dist/wu-status-updater.d.ts +25 -0
- package/dist/wu-status-updater.js +116 -0
- package/dist/wu-transaction-collectors.d.ts +116 -0
- package/dist/wu-transaction-collectors.js +272 -0
- package/dist/wu-transaction.d.ts +170 -0
- package/dist/wu-transaction.js +273 -0
- package/dist/wu-validation-constants.d.ts +60 -0
- package/dist/wu-validation-constants.js +66 -0
- package/dist/wu-validation.d.ts +118 -0
- package/dist/wu-validation.js +243 -0
- package/dist/wu-validator.d.ts +62 -0
- package/dist/wu-validator.js +325 -0
- package/dist/wu-yaml-fixer.d.ts +97 -0
- package/dist/wu-yaml-fixer.js +264 -0
- package/dist/wu-yaml.d.ts +86 -0
- package/dist/wu-yaml.js +222 -0
- package/package.json +114 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spawn Monitor Library (WU-1948, WU-1968)
|
|
3
|
+
*
|
|
4
|
+
* Core monitoring logic for detecting stuck spawns and zombie locks.
|
|
5
|
+
* Used by orchestrate:monitor CLI command.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Analyzes spawn registry for status counts
|
|
9
|
+
* - Detects pending spawns older than threshold (stuck)
|
|
10
|
+
* - Checks lane locks for zombie PIDs
|
|
11
|
+
* - Generates recovery suggestions
|
|
12
|
+
* - WU-1968: Processes spawn_failure signals from memory bus
|
|
13
|
+
*
|
|
14
|
+
* Library-First Note: This is project-specific monitoring code for
|
|
15
|
+
* PatientPath's spawn-registry.jsonl and lane-lock files. No external
|
|
16
|
+
* library exists for this custom format.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link tools/__tests__/orchestrate-monitor.test.mjs} - Tests
|
|
19
|
+
* @see {@link tools/lib/__tests__/spawn-monitor.test.mjs} - Signal handler tests
|
|
20
|
+
* @see {@link tools/orchestrate-monitor.mjs} - CLI entry point
|
|
21
|
+
* @see {@link tools/lib/spawn-registry-store.mjs} - Registry storage
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Default threshold for stuck spawn detection (in minutes)
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_THRESHOLD_MINUTES = 30;
|
|
27
|
+
/**
|
|
28
|
+
* Log prefix for spawn-monitor messages
|
|
29
|
+
*/
|
|
30
|
+
export declare const LOG_PREFIX = "[spawn-monitor]";
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {Object} SpawnAnalysis
|
|
33
|
+
* @property {number} pending - Count of pending spawns
|
|
34
|
+
* @property {number} completed - Count of completed spawns
|
|
35
|
+
* @property {number} timeout - Count of timed out spawns
|
|
36
|
+
* @property {number} crashed - Count of crashed spawns
|
|
37
|
+
* @property {number} total - Total spawn count
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {Object} StuckSpawnInfo
|
|
41
|
+
* @property {import('./spawn-registry-schema.js').SpawnEvent} spawn - The stuck spawn event
|
|
42
|
+
* @property {number} ageMinutes - Age of spawn in minutes
|
|
43
|
+
* @property {string|null} lastCheckpoint - Last checkpoint timestamp (if available from memory layer)
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} ZombieLockInfo
|
|
47
|
+
* @property {string} wuId - WU ID that holds the zombie lock
|
|
48
|
+
* @property {string} lane - Lane name
|
|
49
|
+
* @property {number} pid - Process ID (no longer running)
|
|
50
|
+
* @property {string} timestamp - When lock was acquired
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* @typedef {Object} Suggestion
|
|
54
|
+
* @property {string} command - Suggested command to run
|
|
55
|
+
* @property {string} reason - Explanation of why this is suggested
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {Object} MonitorResult
|
|
59
|
+
* @property {SpawnAnalysis} analysis - Spawn status counts
|
|
60
|
+
* @property {StuckSpawnInfo[]} stuckSpawns - List of stuck spawns
|
|
61
|
+
* @property {ZombieLockInfo[]} zombieLocks - List of zombie locks
|
|
62
|
+
* @property {Suggestion[]} suggestions - Recovery suggestions
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* @typedef {Object} RecoveryResultInfo
|
|
66
|
+
* @property {string} spawnId - ID of the spawn that was processed
|
|
67
|
+
* @property {string} targetWuId - Target WU ID for the spawn
|
|
68
|
+
* @property {string} action - Recovery action taken (from RecoveryAction)
|
|
69
|
+
* @property {boolean} recovered - Whether auto-recovery was successful
|
|
70
|
+
* @property {string} reason - Human-readable explanation
|
|
71
|
+
* @property {Object} [escalation] - Escalation info if action is ESCALATED_STUCK
|
|
72
|
+
* @property {string} [escalation.bugWuId] - Bug WU ID created for escalation
|
|
73
|
+
* @property {string} [escalation.title] - Bug WU title
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Analyzes spawn events and returns status counts.
|
|
77
|
+
*
|
|
78
|
+
* @param {import('./spawn-registry-schema.js').SpawnEvent[]} spawns - Array of spawn events
|
|
79
|
+
* @returns {SpawnAnalysis} Status counts
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* const analysis = analyzeSpawns(spawns);
|
|
83
|
+
* console.log(`Pending: ${analysis.pending}, Completed: ${analysis.completed}`);
|
|
84
|
+
*/
|
|
85
|
+
export declare function analyzeSpawns(spawns: any): {
|
|
86
|
+
pending: number;
|
|
87
|
+
completed: number;
|
|
88
|
+
timeout: number;
|
|
89
|
+
crashed: number;
|
|
90
|
+
total: any;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Detects pending spawns that have been running longer than the threshold.
|
|
94
|
+
*
|
|
95
|
+
* @param {import('./spawn-registry-schema.js').SpawnEvent[]} spawns - Array of spawn events
|
|
96
|
+
* @param {number} [thresholdMinutes=DEFAULT_THRESHOLD_MINUTES] - Threshold in minutes
|
|
97
|
+
* @returns {StuckSpawnInfo[]} Array of stuck spawn info
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const stuck = detectStuckSpawns(spawns, 30);
|
|
101
|
+
* for (const info of stuck) {
|
|
102
|
+
* console.log(`${info.spawn.targetWuId} stuck for ${info.ageMinutes} minutes`);
|
|
103
|
+
* }
|
|
104
|
+
*/
|
|
105
|
+
export declare function detectStuckSpawns(spawns: any, thresholdMinutes?: number): any[];
|
|
106
|
+
/**
|
|
107
|
+
* Checks lane lock files for zombie locks (dead PIDs).
|
|
108
|
+
*
|
|
109
|
+
* @param {SpawnMonitorBaseDirOptions} [options] - Options
|
|
110
|
+
* @returns {Promise<ZombieLockInfo[]>} Array of zombie lock info
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* const zombies = await checkZombieLocks();
|
|
114
|
+
* for (const lock of zombies) {
|
|
115
|
+
* console.log(`Zombie lock: ${lock.lane} (PID ${lock.pid})`);
|
|
116
|
+
* }
|
|
117
|
+
*/
|
|
118
|
+
interface SpawnMonitorBaseDirOptions {
|
|
119
|
+
/** Base directory (defaults to process.cwd()) */
|
|
120
|
+
baseDir?: string;
|
|
121
|
+
}
|
|
122
|
+
export declare function checkZombieLocks(options?: SpawnMonitorBaseDirOptions): Promise<any[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Generates recovery suggestions for stuck spawns and zombie locks.
|
|
125
|
+
*
|
|
126
|
+
* @param {StuckSpawnInfo[]} stuckSpawns - Array of stuck spawn info
|
|
127
|
+
* @param {ZombieLockInfo[]} zombieLocks - Array of zombie lock info
|
|
128
|
+
* @returns {Suggestion[]} Array of suggestions
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* const suggestions = generateSuggestions(stuckSpawns, zombieLocks);
|
|
132
|
+
* for (const s of suggestions) {
|
|
133
|
+
* console.log(`${s.reason}\n ${s.command}`);
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
export declare function generateSuggestions(stuckSpawns: any, zombieLocks: any): any[];
|
|
137
|
+
/**
|
|
138
|
+
* Formats monitor output for display.
|
|
139
|
+
*
|
|
140
|
+
* @param {MonitorResult} result - Monitor result to format
|
|
141
|
+
* @returns {string} Formatted output string
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* const output = formatMonitorOutput(result);
|
|
145
|
+
* console.log(output);
|
|
146
|
+
*/
|
|
147
|
+
export declare function formatMonitorOutput(result: any): string;
|
|
148
|
+
/**
|
|
149
|
+
* Runs recovery for stuck spawns by calling recoverStuckSpawn for each.
|
|
150
|
+
* When a spawn is escalated (action=ESCALATED_STUCK), chains to escalateStuckSpawn.
|
|
151
|
+
*
|
|
152
|
+
* @param {StuckSpawnInfo[]} stuckSpawns - Array of stuck spawn info
|
|
153
|
+
* @param {RunRecoveryOptions} [options] - Options
|
|
154
|
+
* @returns {Promise<RecoveryResultInfo[]>} Array of recovery results
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* const results = await runRecovery(stuckSpawns, { baseDir: '/path/to/project' });
|
|
158
|
+
* for (const result of results) {
|
|
159
|
+
* console.log(`${result.spawnId}: ${result.action}`);
|
|
160
|
+
* }
|
|
161
|
+
*/
|
|
162
|
+
interface RunRecoveryOptions extends SpawnMonitorBaseDirOptions {
|
|
163
|
+
/** If true, escalations return spec only */
|
|
164
|
+
dryRun?: boolean;
|
|
165
|
+
}
|
|
166
|
+
export declare function runRecovery(stuckSpawns: any, options?: RunRecoveryOptions): Promise<any[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Formats recovery results for display.
|
|
169
|
+
*
|
|
170
|
+
* @param {RecoveryResultInfo[]} results - Array of recovery results
|
|
171
|
+
* @returns {string} Formatted output string
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* const output = formatRecoveryResults(results);
|
|
175
|
+
* console.log(output);
|
|
176
|
+
*/
|
|
177
|
+
export declare function formatRecoveryResults(results: any): string;
|
|
178
|
+
/**
|
|
179
|
+
* Log prefix for signal handler messages
|
|
180
|
+
*/
|
|
181
|
+
export declare const SIGNAL_HANDLER_LOG_PREFIX = "[spawn-signal-handler]";
|
|
182
|
+
/**
|
|
183
|
+
* Response actions for spawn failure signals
|
|
184
|
+
*/
|
|
185
|
+
export declare const SignalResponseAction: Readonly<{
|
|
186
|
+
RETRY: "retry";
|
|
187
|
+
BLOCK: "block";
|
|
188
|
+
BUG_WU: "bug_wu";
|
|
189
|
+
NONE: "none";
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* Processes spawn_failure signals from the memory bus.
|
|
193
|
+
*
|
|
194
|
+
* WU-1968: Orchestrator signal handler for spawn_failure signals.
|
|
195
|
+
*
|
|
196
|
+
* Response logic:
|
|
197
|
+
* - First failure (suggested_action=retry): logs warning, suggests retry
|
|
198
|
+
* - Second failure (suggested_action=block): marks WU blocked with reason
|
|
199
|
+
* - Third+ failure (suggested_action=human_escalate): creates Bug WU
|
|
200
|
+
*
|
|
201
|
+
* @param {RunRecoveryOptions} options - Options
|
|
202
|
+
* @returns {Promise<SignalProcessingResult>} Processing result
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* const result = await processSpawnFailureSignals({ baseDir: '/path/to/project' });
|
|
206
|
+
* console.log(`Processed ${result.signalCount} signals`);
|
|
207
|
+
* for (const response of result.processed) {
|
|
208
|
+
* console.log(`${response.targetWuId}: ${response.action}`);
|
|
209
|
+
* }
|
|
210
|
+
*/
|
|
211
|
+
export declare function processSpawnFailureSignals(options?: RunRecoveryOptions): Promise<{
|
|
212
|
+
processed: any[];
|
|
213
|
+
signalCount: number;
|
|
214
|
+
retryCount: number;
|
|
215
|
+
blockCount: number;
|
|
216
|
+
bugWuCount: number;
|
|
217
|
+
}>;
|
|
218
|
+
/**
|
|
219
|
+
* Formats signal handler output for display.
|
|
220
|
+
*
|
|
221
|
+
* @param {SignalProcessingResult} result - Processing result
|
|
222
|
+
* @returns {string} Formatted output string
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* const output = formatSignalHandlerOutput(result);
|
|
226
|
+
* console.log(output);
|
|
227
|
+
*/
|
|
228
|
+
export declare function formatSignalHandlerOutput(result: any): string;
|
|
229
|
+
export {};
|