/** * Precondition validators for each workflow turn. * Pure functions — no side effects, no I/O. * * Returns `{ valid: true }` if the guard passes, * `{ valid: false, errors: [...] }` if not. * * @module config-workflow/workflow-guards */ import type { ConfigWorkflowState } from "./workflow-types.js"; type GuardPass = { valid: true; }; type GuardFail = { valid: false; errors: string[]; }; type GuardResult = GuardPass | GuardFail; /** * Validate that a turn can be executed given the current workflow state. * * Turn-specific guards: * - Turn 0 (Discovery): Always valid — no prerequisites * - Turn 1 (Investigate): Requires `targetPrimitives.length > 0` * - Turn 2 (Collect): Requires Turn 1 output exists * - Turn 3 (Proposal): Requires Turn 2 output with collected fields * - Turn 4 (Validate): Requires Turn 3 output with assembled spec * - Turn 5 (Compile): Requires Turn 4 output with validation pass * - Turn 6 (Test): Requires Turn 5 output with written file path * - Turn 7 (Save): Requires Turn 6 output with test results * * @param state - Current workflow state. * @param turn - Turn index to validate (0-7). * @returns Guard result indicating pass or fail with descriptive errors. */ export declare function validateTurnPrecondition(state: ConfigWorkflowState, turn: number): GuardResult; /** * Check if a workflow has the minimum data needed to start Turn 2 (Collect). * Requires at least one target primitive defined. * * @param state - Current workflow state. * @returns `true` if at least one target primitive exists. */ export declare function hasCollectedPrerequisites(state: ConfigWorkflowState): boolean; /** * Check if a workflow has data needed for Turn 5 (Compile). * Requires at least Turn 2 (Collect) output with a spec. * * @param state - Current workflow state. * @returns `true` if Turn 2 has output data. */ export declare function hasCompilePrerequisites(state: ConfigWorkflowState): boolean; export {}; //# sourceMappingURL=workflow-guards.d.ts.map