/** * Pipeline Engine — core orchestrator. * * Responsibilities: * - Create pipelines from RoutingResult * - Advance stages via advance() * - Persist state (write-tmp + rename, §8.5) * - Append events (events.jsonl, append-only) * - Handle parallel branches (delegate to parallel-branch) */ import type { StageId, StageResult, StageTransition, PipelineState, RoutingResult } from '../types/index.js'; import { type ClarificationCoordinator } from '../clarification/index.js'; export interface PipelineEngineOptions { clarificationCoordinator?: ClarificationCoordinator; } export declare class PipelineEngine { private readonly basePath; private readonly clarificationCoordinator?; constructor(basePath: string, options?: PipelineEngineOptions); /** Create a new pipeline from a routing result. */ create(routing: RoutingResult): PipelineState; /** Load pipeline state from disk. */ load(pipelineId: string): PipelineState; /** * Advance a pipeline: mark current stage result, then activate next eligible stages. * This is the primary API for driving the pipeline forward. */ advance(pipelineId: string, stageResult: StageResult): StageTransition; /** * Activate a specific stage (e.g. for retry from failed/blocked). */ activate(pipelineId: string, stageId: StageId): void; resolveClarification(pipelineId: string, clarificationId: string): StageTransition; /** * Check if the pipeline is fully complete (all required stages terminal). */ isComplete(pipelineId: string): boolean; private registerArtifacts; private handleFailedStage; private handlePassedStage; private settleClarificationArtifacts; private tryUnblockClarification; /** * Scan for pending stages whose prerequisites are met, activate them. * Handles parallel branches and the implement-blocked-by-test-case rule. */ private activateNext; /** * If implement should be blocked (ADR-004), transition pending→active→blocked. * Returns true if the stage was blocked (caller should skip normal activation). */ private tryBlockImplement; /** Activate a single stage record: pending → active. */ private activateStageRecord; /** Check if any blocked stages can now be unblocked. */ private tryUnblockStages; /** Persist state if any activations occurred. */ private persistIfChanged; private scanClarifications; private buildClarificationSummary; private toClarificationArtifactRef; private emitEvent; } //# sourceMappingURL=pipeline-engine.d.ts.map