@winspan/claude-forge 8.34.0 → 8.35.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.
Files changed (113) hide show
  1. package/README.md +10 -30
  2. package/dist/capability/index.d.ts +6 -5
  3. package/dist/capability/index.d.ts.map +1 -1
  4. package/dist/capability/index.js +6 -5
  5. package/dist/capability/index.js.map +1 -1
  6. package/dist/capability/types.d.ts +5 -74
  7. package/dist/capability/types.d.ts.map +1 -1
  8. package/dist/capability/types.js +4 -1
  9. package/dist/capability/types.js.map +1 -1
  10. package/dist/core/storage/rows.d.ts +0 -36
  11. package/dist/core/storage/rows.d.ts.map +1 -1
  12. package/dist/core/storage/schema.sql +1 -45
  13. package/dist/core/storage/sqlite.d.ts +2 -79
  14. package/dist/core/storage/sqlite.d.ts.map +1 -1
  15. package/dist/core/storage/sqlite.js +3 -362
  16. package/dist/core/storage/sqlite.js.map +1 -1
  17. package/dist/core/utils/token-tracker.d.ts +0 -1
  18. package/dist/core/utils/token-tracker.d.ts.map +1 -1
  19. package/dist/core/utils/token-tracker.js +0 -1
  20. package/dist/core/utils/token-tracker.js.map +1 -1
  21. package/dist/daemon/handlers/post-tool-use.d.ts +1 -9
  22. package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
  23. package/dist/daemon/handlers/post-tool-use.js +2 -99
  24. package/dist/daemon/handlers/post-tool-use.js.map +1 -1
  25. package/dist/daemon/handlers/stop.d.ts +1 -15
  26. package/dist/daemon/handlers/stop.d.ts.map +1 -1
  27. package/dist/daemon/handlers/stop.js +1 -95
  28. package/dist/daemon/handlers/stop.js.map +1 -1
  29. package/dist/daemon/handlers/user-prompt.d.ts +1 -5
  30. package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
  31. package/dist/daemon/handlers/user-prompt.js +4 -96
  32. package/dist/daemon/handlers/user-prompt.js.map +1 -1
  33. package/dist/daemon/index.d.ts.map +1 -1
  34. package/dist/daemon/index.js +3 -54
  35. package/dist/daemon/index.js.map +1 -1
  36. package/dist/skills/official-skills.d.ts.map +1 -1
  37. package/dist/skills/official-skills.js +218 -20
  38. package/dist/skills/official-skills.js.map +1 -1
  39. package/dist/web/routes/status.d.ts.map +1 -1
  40. package/dist/web/routes/status.js +8 -10
  41. package/dist/web/routes/status.js.map +1 -1
  42. package/dist/web/routes/token-usage.d.ts +1 -1
  43. package/dist/web/routes/token-usage.d.ts.map +1 -1
  44. package/dist/web/routes/token-usage.js +1 -16
  45. package/dist/web/routes/token-usage.js.map +1 -1
  46. package/dist/web/routes/types.d.ts +0 -6
  47. package/dist/web/routes/types.d.ts.map +1 -1
  48. package/dist/web/routes/types.js.map +1 -1
  49. package/dist/web/server.d.ts +0 -6
  50. package/dist/web/server.d.ts.map +1 -1
  51. package/dist/web/server.js +0 -5
  52. package/dist/web/server.js.map +1 -1
  53. package/package.json +2 -2
  54. package/dist/capability/execution-manager.d.ts +0 -96
  55. package/dist/capability/execution-manager.d.ts.map +0 -1
  56. package/dist/capability/execution-manager.js +0 -260
  57. package/dist/capability/execution-manager.js.map +0 -1
  58. package/dist/capability/executor/background-executor.d.ts +0 -58
  59. package/dist/capability/executor/background-executor.d.ts.map +0 -1
  60. package/dist/capability/executor/background-executor.js +0 -322
  61. package/dist/capability/executor/background-executor.js.map +0 -1
  62. package/dist/capability/executor/foreground-executor.d.ts +0 -26
  63. package/dist/capability/executor/foreground-executor.d.ts.map +0 -1
  64. package/dist/capability/executor/foreground-executor.js +0 -82
  65. package/dist/capability/executor/foreground-executor.js.map +0 -1
  66. package/dist/capability/executor/orchestrator.d.ts +0 -38
  67. package/dist/capability/executor/orchestrator.d.ts.map +0 -1
  68. package/dist/capability/executor/orchestrator.js +0 -158
  69. package/dist/capability/executor/orchestrator.js.map +0 -1
  70. package/dist/capability/executor/stream-parser.d.ts +0 -73
  71. package/dist/capability/executor/stream-parser.d.ts.map +0 -1
  72. package/dist/capability/executor/stream-parser.js +0 -56
  73. package/dist/capability/executor/stream-parser.js.map +0 -1
  74. package/dist/capability/executor/types.d.ts +0 -44
  75. package/dist/capability/executor/types.d.ts.map +0 -1
  76. package/dist/capability/executor/types.js +0 -9
  77. package/dist/capability/executor/types.js.map +0 -1
  78. package/dist/capability/executor/worker-auth-probe.d.ts +0 -30
  79. package/dist/capability/executor/worker-auth-probe.d.ts.map +0 -1
  80. package/dist/capability/executor/worker-auth-probe.js +0 -108
  81. package/dist/capability/executor/worker-auth-probe.js.map +0 -1
  82. package/dist/capability/methodologies/bmad.yaml +0 -81
  83. package/dist/capability/methodologies/code-quality-audit.yaml +0 -26
  84. package/dist/capability/methodologies/harness-engineering.yaml +0 -75
  85. package/dist/capability/methodologies/test-coverage-scan.yaml +0 -26
  86. package/dist/capability/methodology-planner.d.ts +0 -49
  87. package/dist/capability/methodology-planner.d.ts.map +0 -1
  88. package/dist/capability/methodology-planner.js +0 -306
  89. package/dist/capability/methodology-planner.js.map +0 -1
  90. package/dist/capability/methodology-registry.d.ts +0 -32
  91. package/dist/capability/methodology-registry.d.ts.map +0 -1
  92. package/dist/capability/methodology-registry.js +0 -113
  93. package/dist/capability/methodology-registry.js.map +0 -1
  94. package/dist/daemon/handlers/methodology-formatter.d.ts +0 -16
  95. package/dist/daemon/handlers/methodology-formatter.d.ts.map +0 -1
  96. package/dist/daemon/handlers/methodology-formatter.js +0 -119
  97. package/dist/daemon/handlers/methodology-formatter.js.map +0 -1
  98. package/dist/daemon/idle-detector.d.ts +0 -35
  99. package/dist/daemon/idle-detector.d.ts.map +0 -1
  100. package/dist/daemon/idle-detector.js +0 -56
  101. package/dist/daemon/idle-detector.js.map +0 -1
  102. package/dist/daemon/idle-trigger.d.ts +0 -53
  103. package/dist/daemon/idle-trigger.d.ts.map +0 -1
  104. package/dist/daemon/idle-trigger.js +0 -153
  105. package/dist/daemon/idle-trigger.js.map +0 -1
  106. package/dist/daemon/methodology-pending-queue.d.ts +0 -33
  107. package/dist/daemon/methodology-pending-queue.d.ts.map +0 -1
  108. package/dist/daemon/methodology-pending-queue.js +0 -120
  109. package/dist/daemon/methodology-pending-queue.js.map +0 -1
  110. package/dist/web/routes/methodology.d.ts +0 -12
  111. package/dist/web/routes/methodology.d.ts.map +0 -1
  112. package/dist/web/routes/methodology.js +0 -228
  113. package/dist/web/routes/methodology.js.map +0 -1
@@ -18,7 +18,6 @@ import { registerSessionsRoutes } from './routes/sessions.js';
18
18
  import { registerRulesRoutes } from './routes/rules.js';
19
19
  import { registerRoutingRoutes } from './routes/routing.js';
20
20
  import { registerExperimentsRoutes } from './routes/experiments.js';
21
- import { registerMethodologyRoutes } from './routes/methodology.js';
22
21
  import { registerTokenUsageRoutes } from './routes/token-usage.js';
23
22
  import { registerExecutionTraceRoutes } from './routes/execution-trace.js';
24
23
  import { registerAIRoutes } from './routes/ai.js';
@@ -49,9 +48,6 @@ export class WebServer {
49
48
  router: this.options.router,
50
49
  agents: this.options.agents,
51
50
  skillRegistry: this.options.skillRegistry,
52
- executionManager: this.options.executionManager,
53
- methodologyRegistry: this.options.methodologyRegistry,
54
- methodologyPlanner: this.options.methodologyPlanner,
55
51
  };
56
52
  // 1. Auth bootstrap (must be available before everything else)
57
53
  registerAuthRoutes(this.app, ctx);
@@ -66,7 +62,6 @@ export class WebServer {
66
62
  registerRulesRoutes(this.app, ctx);
67
63
  registerRoutingRoutes(this.app, ctx);
68
64
  registerExperimentsRoutes(this.app, ctx);
69
- registerMethodologyRoutes(this.app, ctx);
70
65
  registerTokenUsageRoutes(this.app, ctx);
71
66
  registerExecutionTraceRoutes(this.app, ctx);
72
67
  registerAIRoutes(this.app, ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/web/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAS9B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,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CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;gBAC3C,CAAC;gBACD,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;gBAC3B,IAAI,CAAC,MAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winspan/claude-forge",
3
- "version": "8.34.0",
3
+ "version": "8.35.0",
4
4
  "description": "SDLC intelligent orchestration engine for Claude Code",
5
5
  "main": "dist/cli/index.js",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "scripts": {
28
28
  "prebuild": "rm -rf dist",
29
- "build": "tsc && mkdir -p dist/hooks && cp -r src/hooks/* dist/hooks/ && chmod +x dist/hooks/*.sh && cp src/core/storage/schema.sql dist/core/storage/schema.sql && mkdir -p dist/web/static && cp -r web/dist/* dist/web/static/ 2>/dev/null || cp src/web/static/index.html dist/web/static/ && cp -r src/web/static/vendor dist/web/static/ 2>/dev/null || true && mkdir -p dist/engine/conventions && cp src/engine/conventions/*.yaml dist/engine/conventions/ && mkdir -p dist/capability/methodologies && cp src/capability/methodologies/*.yaml dist/capability/methodologies/",
29
+ "build": "tsc && mkdir -p dist/hooks && cp -r src/hooks/* dist/hooks/ && chmod +x dist/hooks/*.sh && cp src/core/storage/schema.sql dist/core/storage/schema.sql && mkdir -p dist/web/static && cp -r web/dist/* dist/web/static/ 2>/dev/null || cp src/web/static/index.html dist/web/static/ && cp -r src/web/static/vendor dist/web/static/ 2>/dev/null || true && mkdir -p dist/engine/conventions && cp src/engine/conventions/*.yaml dist/engine/conventions/",
30
30
  "build:web": "cd web && npm run build",
31
31
  "build:all": "npm run build:web && npm run build",
32
32
  "prepublishOnly": "npm run build:all",
@@ -1,96 +0,0 @@
1
- /**
2
- * ExecutionManager — daemon 进程内单例,统筹所有 methodology_executions 的后台执行。
3
- *
4
- * 职责:
5
- * 1. 提供 `start({session_id, plan, mode})` 入口:为前台/后台两种模式分别使用合适的 executor
6
- * 2. 跟踪活跃的 orchestrator,让 cancel() 能真正 kill 子进程
7
- * 3. 在 daemon 启动时扫一遍 listRunningBackgroundExecutions() —— 对应 worker
8
- * 已不在了(孤儿 execution),标记为 failed("crashed")
9
- *
10
- * 不负责:路由决策 / planner / UI。
11
- */
12
- import type { SQLiteStorage } from '../core/storage/sqlite.js';
13
- import type { MethodologyRegistry } from './methodology-registry.js';
14
- import type { ExecutionPlan } from './types.js';
15
- import type { ExecutorEventListener } from './executor/types.js';
16
- import { type BackgroundExecutorOptions } from './executor/background-executor.js';
17
- export interface StartExecutionInput {
18
- session_id: string;
19
- methodology_id: string;
20
- plan: ExecutionPlan;
21
- mode: 'foreground' | 'background';
22
- trigger_type?: 'manual' | 'idle' | 'scheduled';
23
- }
24
- export interface ExecutionManagerOptions {
25
- background?: BackgroundExecutorOptions;
26
- /**
27
- * 判定 methodology_executions 进入 stale 的无推进阈值(ms)。
28
- * 默认 30 分钟:超过此时长没有任何推进就标 stale。
29
- */
30
- staleThresholdMs?: number;
31
- }
32
- export declare class ExecutionManager {
33
- private storage;
34
- private registry;
35
- private foregroundExecutor;
36
- private backgroundExecutor;
37
- private activeOrchestrators;
38
- private listeners;
39
- private reconcileTimer;
40
- private readonly staleThresholdMs;
41
- constructor(storage: SQLiteStorage, registry: MethodologyRegistry, options?: ExecutionManagerOptions);
42
- /**
43
- * Create the execution row + kick off orchestrator.
44
- * Returns the newly created execution id.
45
- */
46
- start(input: StartExecutionInput): number;
47
- cancel(execution_id: number): Promise<void>;
48
- /**
49
- * Subscribe to all executor events. Returns an unsubscribe function.
50
- */
51
- subscribe(listener: ExecutorEventListener): () => void;
52
- /**
53
- * At daemon startup: find background executions whose worker_pid is no longer
54
- * alive. Mark them failed so the UI shows a definitive state.
55
- */
56
- reconcileOrphansOnStartup(): void;
57
- /**
58
- * Cross-session residue sweep: find `mode='foreground' AND status='running'`
59
- * executions whose `started_at` is older than `maxAgeMs`, and mark them
60
- * `cancelled`. Foreground executions are driven by Claude Code sessions — if
61
- * the originating session ended without the Stop hook firing (crash, kill,
62
- * detach, pre-guard legacy data), the row can stay `running` forever and
63
- * blocks the session-level exclusivity check at UserPromptSubmit.
64
- *
65
- * Complements:
66
- * - `reconcileOrphansOnStartup()` handles background workers (pid-based).
67
- * - `sweepStaleMethodologies()` is the softer no-progress sweep (30min → `stale`).
68
- *
69
- * @param maxAgeMs absolute age since started_at. Default 4h.
70
- * @returns list of execution ids that were cancelled.
71
- */
72
- cancelStaleForegroundExecutions(maxAgeMs?: number): number[];
73
- private isPidAlive;
74
- /**
75
- * Sweep methodology_executions that are still `running` but haven't made any
76
- * progress for longer than `staleThresholdMs`. Mark them `stale` so the UI
77
- * (and downstream schedulers) stop treating them as active.
78
- *
79
- * 判定依据:`now - (last_progress_at || started_at) > staleThresholdMs`
80
- * 非 running 的 execution 一律忽略。
81
- *
82
- * 返回被标记为 stale 的 execution id 列表,便于测试 / 观测。
83
- */
84
- sweepStaleMethodologies(now?: number): number[];
85
- /**
86
- * Start a periodic reconcile loop — picks up workers killed while daemon
87
- * was running (e.g. user kill -9'd the pid). Safe to call once at startup.
88
- * Returns a stop function.
89
- *
90
- * @param intervalMs reconcile interval in milliseconds
91
- * @param idleTriggerCallback optional callback to trigger idle methodologies
92
- */
93
- startReconcileLoop(intervalMs?: number, idleTriggerCallback?: () => Promise<void>): () => void;
94
- stopReconcileLoop(): void;
95
- }
96
- //# sourceMappingURL=execution-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-manager.d.ts","sourceRoot":"","sources":["../../src/capability/execution-manager.ts"],"names":[],"m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IAAI;IAKtD;;;OAGG;IACH,yBAAyB,IAAI,IAAI;IAkBjC;;;;;;;;;;;;;;OAcG;IACH,+BAA+B,CAAC,QAAQ,GAAE,MAA2B,GAAG,MAAM,EAAE;IAyBhF,OAAO,CAAC,UAAU;IASlB;;;;;;;;;OASG;IACH,uBAAuB,CAAC,GAAG,GAAE,MAAmB,GAAG,MAAM,EAAE;IAkC3D;;;;;;;OAOG;IACH,kBAAkB,CAAC,UAAU,SAAS,EAAE,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI;IA4B9F,iBAAiB,IAAI,IAAI;CAI1B"}
@@ -1,260 +0,0 @@
1
- /**
2
- * ExecutionManager — daemon 进程内单例,统筹所有 methodology_executions 的后台执行。
3
- *
4
- * 职责:
5
- * 1. 提供 `start({session_id, plan, mode})` 入口:为前台/后台两种模式分别使用合适的 executor
6
- * 2. 跟踪活跃的 orchestrator,让 cancel() 能真正 kill 子进程
7
- * 3. 在 daemon 启动时扫一遍 listRunningBackgroundExecutions() —— 对应 worker
8
- * 已不在了(孤儿 execution),标记为 failed("crashed")
9
- *
10
- * 不负责:路由决策 / planner / UI。
11
- */
12
- import { ForegroundExecutor } from './executor/foreground-executor.js';
13
- import { BackgroundExecutor } from './executor/background-executor.js';
14
- import { Orchestrator } from './executor/orchestrator.js';
15
- import { probeWorkerAuth, WorkerAuthError } from './executor/worker-auth-probe.js';
16
- import { logger } from '../core/utils/logger.js';
17
- export class ExecutionManager {
18
- storage;
19
- registry;
20
- foregroundExecutor;
21
- backgroundExecutor;
22
- activeOrchestrators = new Map();
23
- listeners = new Set();
24
- reconcileTimer = null;
25
- staleThresholdMs;
26
- constructor(storage, registry, options = {}) {
27
- this.storage = storage;
28
- this.registry = registry;
29
- this.foregroundExecutor = new ForegroundExecutor(storage, registry);
30
- this.backgroundExecutor = new BackgroundExecutor(storage, registry, options.background);
31
- this.staleThresholdMs = options.staleThresholdMs ?? 30 * 60 * 1000;
32
- // Relay executor events to external subscribers (SSE, metrics, ...)
33
- const relay = (ev) => {
34
- for (const l of this.listeners) {
35
- try {
36
- l(ev);
37
- }
38
- catch (err) {
39
- logger.debug(`[ExecutionManager] relay failed: ${err}`);
40
- }
41
- }
42
- };
43
- this.foregroundExecutor.subscribe(relay);
44
- this.backgroundExecutor.subscribe(relay);
45
- }
46
- /**
47
- * Create the execution row + kick off orchestrator.
48
- * Returns the newly created execution id.
49
- */
50
- start(input) {
51
- // 后台模式:前置认证探测,给调用方明确错误而不是等 worker 起来后才报错
52
- if (input.mode === 'background') {
53
- const probe = probeWorkerAuth();
54
- if (!probe.available) {
55
- throw new WorkerAuthError(probe);
56
- }
57
- }
58
- const executionId = this.storage.createMethodologyExecution({
59
- session_id: input.session_id,
60
- methodology_id: input.methodology_id,
61
- plan_json: JSON.stringify(input.plan),
62
- mode: input.mode,
63
- trigger_type: input.trigger_type ?? 'manual',
64
- });
65
- // Seed the first phase_executions row so listings show immediately
66
- if (input.plan.phases[0]) {
67
- const p0 = input.plan.phases[0];
68
- this.storage.createPhaseExecution({
69
- methodology_execution_id: executionId,
70
- phase_id: p0.id,
71
- phase_index: 0,
72
- agent_name: p0.agent,
73
- prompt: p0.prompt,
74
- });
75
- }
76
- const executor = input.mode === 'background' ? this.backgroundExecutor : this.foregroundExecutor;
77
- const orch = new Orchestrator(this.storage, executor);
78
- this.activeOrchestrators.set(executionId, orch);
79
- // Fire-and-forget; errors are logged but don't crash the daemon.
80
- orch.run(executionId)
81
- .catch(err => {
82
- logger.warn(`[ExecutionManager] orchestrator for ${executionId} threw: ${err}`);
83
- try {
84
- this.storage.updateMethodologyExecution(executionId, {
85
- status: 'failed',
86
- completed_at: Date.now(),
87
- worker_pid: null,
88
- });
89
- }
90
- catch { /* swallow */ }
91
- })
92
- .finally(() => {
93
- this.activeOrchestrators.delete(executionId);
94
- });
95
- return executionId;
96
- }
97
- async cancel(execution_id) {
98
- const exec = this.storage.getMethodologyExecution(execution_id);
99
- if (!exec)
100
- throw new Error(`execution ${execution_id} not found`);
101
- const executor = exec.mode === 'background'
102
- ? this.backgroundExecutor
103
- : this.foregroundExecutor;
104
- await executor.cancel(execution_id);
105
- }
106
- /**
107
- * Subscribe to all executor events. Returns an unsubscribe function.
108
- */
109
- subscribe(listener) {
110
- this.listeners.add(listener);
111
- return () => { this.listeners.delete(listener); };
112
- }
113
- /**
114
- * At daemon startup: find background executions whose worker_pid is no longer
115
- * alive. Mark them failed so the UI shows a definitive state.
116
- */
117
- reconcileOrphansOnStartup() {
118
- const rows = this.storage.listRunningBackgroundExecutions();
119
- for (const row of rows) {
120
- const pid = row.worker_pid;
121
- const alive = pid ? this.isPidAlive(pid) : false;
122
- if (!alive) {
123
- logger.warn(`[ExecutionManager] execution=${row.id} has stale worker_pid=${pid}; marking failed`);
124
- this.storage.updateMethodologyExecution(row.id, {
125
- status: 'failed',
126
- completed_at: Date.now(),
127
- worker_pid: null,
128
- });
129
- }
130
- }
131
- }
132
- /**
133
- * Cross-session residue sweep: find `mode='foreground' AND status='running'`
134
- * executions whose `started_at` is older than `maxAgeMs`, and mark them
135
- * `cancelled`. Foreground executions are driven by Claude Code sessions — if
136
- * the originating session ended without the Stop hook firing (crash, kill,
137
- * detach, pre-guard legacy data), the row can stay `running` forever and
138
- * blocks the session-level exclusivity check at UserPromptSubmit.
139
- *
140
- * Complements:
141
- * - `reconcileOrphansOnStartup()` handles background workers (pid-based).
142
- * - `sweepStaleMethodologies()` is the softer no-progress sweep (30min → `stale`).
143
- *
144
- * @param maxAgeMs absolute age since started_at. Default 4h.
145
- * @returns list of execution ids that were cancelled.
146
- */
147
- cancelStaleForegroundExecutions(maxAgeMs = 4 * 60 * 60 * 1000) {
148
- const now = Date.now();
149
- const rows = this.storage.listRunningForegroundExecutions();
150
- const cancelled = [];
151
- for (const row of rows) {
152
- const startedAt = row.started_at ?? 0;
153
- const age = now - startedAt;
154
- if (age < maxAgeMs)
155
- continue;
156
- try {
157
- this.storage.updateMethodologyExecution(row.id, {
158
- status: 'cancelled',
159
- completed_at: now,
160
- });
161
- cancelled.push(row.id);
162
- logger.warn(`[ExecutionManager] execution=${row.id} session=${row.session_id} ` +
163
- `foreground residue age=${Math.round(age / 60000)}min > ${Math.round(maxAgeMs / 60000)}min — marked cancelled`);
164
- }
165
- catch (err) {
166
- logger.warn(`[ExecutionManager] cross-session cancel failed for execution=${row.id}: ${err}`);
167
- }
168
- }
169
- return cancelled;
170
- }
171
- isPidAlive(pid) {
172
- try {
173
- process.kill(pid, 0);
174
- return true;
175
- }
176
- catch {
177
- return false;
178
- }
179
- }
180
- /**
181
- * Sweep methodology_executions that are still `running` but haven't made any
182
- * progress for longer than `staleThresholdMs`. Mark them `stale` so the UI
183
- * (and downstream schedulers) stop treating them as active.
184
- *
185
- * 判定依据:`now - (last_progress_at || started_at) > staleThresholdMs`
186
- * 非 running 的 execution 一律忽略。
187
- *
188
- * 返回被标记为 stale 的 execution id 列表,便于测试 / 观测。
189
- */
190
- sweepStaleMethodologies(now = Date.now()) {
191
- const rows = this.storage.getDatabase().prepare(`SELECT id, status, started_at, last_progress_at
192
- FROM methodology_executions
193
- WHERE status = 'running'`).all();
194
- const marked = [];
195
- for (const row of rows) {
196
- const reference = row.last_progress_at ?? row.started_at;
197
- if (reference == null)
198
- continue;
199
- if (now - reference <= this.staleThresholdMs)
200
- continue;
201
- try {
202
- this.storage.updateMethodologyExecution(row.id, {
203
- status: 'stale',
204
- completed_at: now,
205
- });
206
- marked.push(row.id);
207
- logger.warn(`[ExecutionManager] execution=${row.id} marked stale (no progress for ${Math.round((now - reference) / 60_000)}min)`);
208
- }
209
- catch (err) {
210
- logger.warn(`[ExecutionManager] failed to mark execution=${row.id} stale: ${err}`);
211
- }
212
- }
213
- return marked;
214
- }
215
- /**
216
- * Start a periodic reconcile loop — picks up workers killed while daemon
217
- * was running (e.g. user kill -9'd the pid). Safe to call once at startup.
218
- * Returns a stop function.
219
- *
220
- * @param intervalMs reconcile interval in milliseconds
221
- * @param idleTriggerCallback optional callback to trigger idle methodologies
222
- */
223
- startReconcileLoop(intervalMs = 60_000, idleTriggerCallback) {
224
- if (this.reconcileTimer)
225
- clearInterval(this.reconcileTimer);
226
- this.reconcileTimer = setInterval(() => {
227
- try {
228
- this.reconcileOrphansOnStartup();
229
- }
230
- catch (err) {
231
- logger.debug(`[ExecutionManager] periodic reconcile failed: ${err}`);
232
- }
233
- try {
234
- this.sweepStaleMethodologies();
235
- }
236
- catch (err) {
237
- logger.debug(`[ExecutionManager] periodic stale sweep failed: ${err}`);
238
- }
239
- // Trigger idle methodologies if callback provided
240
- if (idleTriggerCallback) {
241
- idleTriggerCallback().catch(err => {
242
- logger.debug(`[ExecutionManager] idle trigger callback failed: ${err}`);
243
- });
244
- }
245
- }, intervalMs);
246
- // Don't keep the event loop alive just for this.
247
- this.reconcileTimer.unref?.();
248
- return () => {
249
- if (this.reconcileTimer)
250
- clearInterval(this.reconcileTimer);
251
- this.reconcileTimer = null;
252
- };
253
- }
254
- stopReconcileLoop() {
255
- if (this.reconcileTimer)
256
- clearInterval(this.reconcileTimer);
257
- this.reconcileTimer = null;
258
- }
259
- }
260
- //# sourceMappingURL=execution-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-manager.js","sourceRoot":"","sources":["../../src/capability/execution-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAkC,MAAM,mCAAmC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAmBjD,MAAM,OAAO,gBAAgB;IASjB;IACA;IATF,kBAAkB,CAAqB;IACvC,kBAAkB,CAAqB;IACvC,mBAAmB,GAAG,IAAI,GAAG,EAA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C5D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,cAAc;YAAE,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF"}
@@ -1,58 +0,0 @@
1
- /**
2
- * BackgroundExecutor —— spawn `claude -p` 子进程独立执行一个 phase。
3
- *
4
- * 与 ForegroundExecutor 的差异:
5
- * - 真正调用 CLI 并等待结束,所以 `executePhase` 返回的是最终 status
6
- * ('completed' | 'failed'), 不是 'injected'
7
- * - 不会改 pending queue —— 后台执行路径跟 Claude 主会话完全隔离
8
- * - 进度通过 subscribe() 的 ExecutorEvent 对外暴露(SSE 可订阅)
9
- */
10
- import type { MethodologyExecution, PlannedPhase } from '../types.js';
11
- import type { SQLiteStorage } from '../../core/storage/sqlite.js';
12
- import type { MethodologyRegistry } from '../methodology-registry.js';
13
- import type { ExecutorEventListener, PhaseExecutionResult, PhaseExecutor } from './types.js';
14
- export interface BackgroundExecutorOptions {
15
- /** claude CLI 可执行文件路径(默认走 PATH) */
16
- claudeBin?: string;
17
- /** 子进程 cwd;默认为当前项目目录 */
18
- cwd?: string;
19
- /** 项目根目录,作为 --add-dir 的参数;默认走 cwd */
20
- projectRoot?: string;
21
- /** 每个 phase 的最大预算美元(默认 2) */
22
- maxBudgetUsdPerPhase?: number;
23
- /** 权限模式(默认 bypassPermissions) */
24
- permissionMode?: 'acceptEdits' | 'bypassPermissions' | 'default' | 'dontAsk' | 'plan';
25
- /** 默认禁用的工具(逗号分隔) */
26
- disallowedTools?: string;
27
- /** phase 级 wall-clock 超时(ms),默认 30 分钟 */
28
- phaseTimeoutMs?: number;
29
- /** stream-json 日志根目录 */
30
- logDir?: string;
31
- /**
32
- * worker 专用 settings.json 路径。若未提供,会懒生成到
33
- * `$HOME/.claude-forge/worker-settings.json`,内容为 `{"hooks": {}}`。
34
- * 目的:让 worker 子进程跳过 daemon hooks,避免递归触发。
35
- */
36
- settingsPath?: string;
37
- }
38
- export declare class BackgroundExecutor implements PhaseExecutor {
39
- private storage;
40
- private registry;
41
- readonly mode: "background";
42
- private listeners;
43
- private running;
44
- private cancelRequested;
45
- private readonly opts;
46
- constructor(storage: SQLiteStorage, registry: MethodologyRegistry, options?: BackgroundExecutorOptions);
47
- executePhase(execution: MethodologyExecution, phase: PlannedPhase, phaseIndex: number): Promise<PhaseExecutionResult>;
48
- cancel(execution_id: number): Promise<void>;
49
- subscribe(listener: ExecutorEventListener): () => void;
50
- private emit;
51
- /**
52
- * @internal test-only: 构建 spawn 参数。生产代码请走 `executePhase`。
53
- */
54
- buildArgs(): string[];
55
- /** @internal test-only */
56
- getSettingsPath(): string;
57
- }
58
- //# sourceMappingURL=background-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"background-executor.d.ts","sourceRoot":"","sources":["../../../src/capability/executor/background-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACd,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iCAAiC;IACjC,cAAc,CAAC,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS,GAAG,SA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