feat(KB-501): implement multi-project runtime architecture with HybridExecutor

- Add ProjectRuntime interface with InProcessRuntime and ChildProcessRuntime implementations
- Implement HybridExecutor for multi-project task orchestration
- Add IPC protocol for host-worker communication in child-process mode
- Implement health monitoring with automatic restart for child processes
- Add comprehensive tests for hybrid-executor and project-runtime
- Update AGENTS.md with multi-project runtime documentation
- Add changeset for hybrid-executor-runtime release
This commit is contained in:
gsxdsm
2026-03-31 20:17:25 -07:00
parent d6fe79a0b8
commit 24335d1176
8 changed files with 1391 additions and 0 deletions

View File

@@ -128,6 +128,53 @@ export interface ProjectRuntime extends EventEmitter<ProjectRuntimeEvents> {
getMetrics(): RuntimeMetrics;
}
/**
* Result of a task execution operation.
*/
export interface TaskExecutionResult {
/** Whether the task execution was successful */
success: boolean;
/** The task ID that was executed */
taskId: string;
/** Error message if execution failed */
error?: string;
/** Number of steps completed during execution */
stepsCompleted?: number;
/** ISO-8601 timestamp when execution started */
startedAt?: string;
/** ISO-8601 timestamp when execution completed */
completedAt?: string;
}
/**
* Health metrics for a ProjectRuntime instance.
* Used for detailed health monitoring and diagnostics.
*/
export interface RuntimeHealth {
/** Current status of the runtime */
status: RuntimeStatus;
/** Number of tasks currently in-progress */
activeTasks: number;
/** Memory usage in bytes */
memoryUsage: number;
/** ISO-8601 timestamp of the last activity */
lastActivityAt: string;
/** Number of errors encountered */
errorCount: number;
/** Optional last error message */
lastError?: string;
}
/**
* Runtime event types for event handlers.
*/
export type RuntimeEventType =
| "task:created"
| "task:completed"
| "task:failed"
| "health:changed"
| "error";
/**
* Global metrics aggregated across all project runtimes.
*/