/** * Workflow interpreter — the live body of the (currently dormant) WorkflowEngine * invoke() seam. * * Reproduces the TS pipeline's plan → sprint-loop orchestration as PURE * computation: it produces a {@link WorkflowRunResult} and writes nothing. * `RunResultFlusher.flush()` commits the result afterward (the sole clock/commit * source). Plan / contract-derivation / sprint-cycle are injected * ({@link WorkflowDeps}) so the interpreter is hermetically testable; the real * agent wiring (default deps) and the invoke() rewire + eligibility flip land in * Sprint 5. * * Resume: contracts whose `sprintNumber` is in `args.resumeCursor.completed- * SprintNumbers` are filtered out BEFORE dispatch, so the result only contains * newly-run sprints — the flusher then appends only their history (no * double-write on re-run). */ import type { WorkflowArgs, WorkflowRunResult } from "./types.js"; import type { PlanSpec } from "../../contracts/spec.js"; import type { SprintContract } from "../../contracts/sprint-contract.js"; import { Scheduler } from "./scheduler.js"; import type { SprintInput, SprintOutcome } from "./pure-sprint.js"; export interface PlanResult { spec: PlanSpec; needsClarification: boolean; } export interface WorkflowDeps { /** Produce or load the plan spec for the run. */ plan: (args: WorkflowArgs, projectRoot: string) => Promise; /** Derive sprint contracts from a spec (used when preloadedContracts is empty). */ buildContracts: (spec: PlanSpec, args: WorkflowArgs) => SprintContract[]; /** Run one sprint's pure (side-effect-free) generate→evaluate cycle. */ runSprint: (input: SprintInput) => Promise; } export interface RunWorkflowOptions { /** * Scheduler used to run the sprint loop. Defaults to a sequential scheduler * (maxConcurrent 1) for TS-pipeline parity. Sprint 5 raises the cap and adds * dependsOn-aware ordering for true cross-sprint parallelism. */ scheduler?: Scheduler; } /** * Run the workflow: plan → derive contracts → (skip completed) → sprint loop → * aggregate into a {@link WorkflowRunResult}. Writes nothing. */ export declare function runWorkflow(args: WorkflowArgs, projectRoot: string, deps: WorkflowDeps, opts?: RunWorkflowOptions): Promise; //# sourceMappingURL=interpreter.d.ts.map