/**
 * Pipeline Stage Definitions and Transitions
 *
 * Defines the 9-stage RCASD-IVTR pipeline with stage metadata,
 * transition rules, and prerequisite mappings.
 *
 * Stages (in order):
 *   1. Research              - Information gathering and exploration
 *   2. Consensus             - Multi-agent decisions and validation
 *   3. Architecture Decision - Architecture Decision Records
 *   4. Specification         - Specification and documentation
 *   5. Decomposition         - Task breakdown and planning
 *   6. Implementation        - Code execution and building
 *   7. Validation            - Static analysis, type checking, quality gates
 *   8. Testing               - Test execution and coverage
 *   9. Release               - Version management and publishing
 *
 * @task T4800 - Implement Canonical SQLite Pipeline State Machine
 * @epic T4798 - Lifecycle persistence improvements
 * @audit T4799 - Unified stage names (replaces scattered definitions)
 *
 * NOTE: This file provides the canonical stage definitions. All other
 * stage definitions in the codebase should reference these.
 * Stage names MUST match the DB CHECK constraint in lifecycle_stages.stage_name.
 */
/**
 * Canonical pipeline stages in execution order.
 *
 * This is the single source of truth for stage names across CLEO.
 * All other stage arrays should be derived from this.
 * Names match the SQLite CHECK constraint on lifecycle_stages.stage_name.
 *
 * @task T4800
 * @audit T4799 - Consolidates: RCASD_STAGES, EXECUTION_STAGES, ENGINE_LIFECYCLE_STAGES
 */
import type { StageStatus } from '@cleocode/contracts';
export declare const PIPELINE_STAGES: readonly ["research", "consensus", "architecture_decision", "specification", "decomposition", "implementation", "validation", "testing", "release"];
/**
 * Cross-cutting contribution stage.
 * Not part of the pipeline execution order, but tracked in the schema
 * for attribution and provenance recording.
 *
 * @task T4800
 */
export declare const CONTRIBUTION_STAGE: "contribution";
/**
 * Stage type derived from canonical stage list.
 *
 * @task T4800
 */
export type Stage = (typeof PIPELINE_STAGES)[number];
/**
 * Stage status values.
 *
 * @task T4800
 * @audit T4799 - Unifies: StageStatus, EngineStageStatus
 */
export type { StageStatus };
/**
 * Stage category for grouping related stages.
 *
 * @task T4800
 */
export type StageCategory = 'planning' | 'decision' | 'execution' | 'validation' | 'delivery';
/**
 * Stage metadata with descriptive information.
 *
 * @task T4800
 */
export interface StageDefinition {
    /** Stage identifier */
    stage: Stage;
    /** Display name for the stage */
    name: string;
    /** Detailed description of what happens in this stage */
    description: string;
    /** Execution order (1-based) */
    order: number;
    /** Category for grouping */
    category: StageCategory;
    /** Whether this stage can be skipped */
    skippable: boolean;
    /** Default timeout in hours (null = no timeout) */
    defaultTimeoutHours: number | null;
    /** Required gate checks before completing this stage */
    requiredGates: string[];
    /** Expected artifacts produced by this stage */
    expectedArtifacts: string[];
}
/**
 * Canonical stage definitions with complete metadata.
 *
 * @task T4800
 * @audit T4799 - Replaces legacy STAGE_DEFINITIONS from index.ts
 */
export declare const STAGE_DEFINITIONS: Record<Stage, StageDefinition>;
/**
 * Stage order mapping for quick lookups.
 *
 * @task T4800
 */
export declare const STAGE_ORDER: Record<Stage, number>;
/**
 * Get the order/index of a stage (1-based).
 *
 * @param stage - The stage to look up
 * @returns The stage order (1-9)
 *
 * @task T4800
 */
export declare function getStageOrder(stage: Stage): number;
/**
 * Check if stage A comes before stage B in the pipeline.
 *
 * @param stageA - First stage to compare
 * @param stageB - Second stage to compare
 * @returns True if stageA comes before stageB
 *
 * @task T4800
 */
export declare function isStageBefore(stageA: Stage, stageB: Stage): boolean;
/**
 * Check if stage A comes after stage B in the pipeline.
 *
 * @param stageA - First stage to compare
 * @param stageB - Second stage to compare
 * @returns True if stageA comes after stageB
 *
 * @task T4800
 */
export declare function isStageAfter(stageA: Stage, stageB: Stage): boolean;
/**
 * Get the next stage in the pipeline.
 *
 * @param stage - Current stage
 * @returns The next stage, or null if at the end
 *
 * @task T4800
 */
export declare function getNextStage(stage: Stage): Stage | null;
/**
 * Get the previous stage in the pipeline.
 *
 * @param stage - Current stage
 * @returns The previous stage, or null if at the start
 *
 * @task T4800
 */
export declare function getPreviousStage(stage: Stage): Stage | null;
/**
 * Get all stages between two stages (inclusive).
 *
 * @param from - Starting stage
 * @param to - Ending stage
 * @returns Array of stages between from and to
 *
 * @task T4800
 */
export declare function getStagesBetween(from: Stage, to: Stage): Stage[];
/**
 * Prerequisites for each stage - which stages must be completed before entering.
 *
 * @task T4800
 * @audit T4799 - Canonical prerequisite map
 */
export declare const STAGE_PREREQUISITES: Record<Stage, Stage[]>;
/**
 * Get prerequisites for a stage.
 *
 * @param stage - The stage to get prerequisites for
 * @returns Array of prerequisite stages
 *
 * @task T4800
 */
export declare function getPrerequisites(stage: Stage): Stage[];
/**
 * Check if one stage is a prerequisite of another.
 *
 * @param potentialPrereq - Stage that might be a prerequisite
 * @param stage - Stage to check against
 * @returns True if potentialPrereq is required before stage
 *
 * @task T4800
 */
export declare function isPrerequisite(potentialPrereq: Stage, stage: Stage): boolean;
/**
 * Get all stages that depend on a given stage.
 *
 * @param stage - The stage to find dependents for
 * @returns Array of stages that require this stage
 *
 * @task T4800
 */
export declare function getDependents(stage: Stage): Stage[];
/**
 * Check if a stage name is valid.
 *
 * @param stage - Stage name to validate
 * @returns True if valid stage name
 *
 * @task T4800
 */
export declare function isValidStage(stage: string): stage is Stage;
/**
 * Validate a stage name and throw if invalid.
 *
 * @param stage - Stage name to validate
 * @throws {Error} If stage is invalid
 * @returns The validated Stage
 *
 * @task T4800
 */
export declare function validateStage(stage: string): Stage;
/**
 * Check if a stage status is valid.
 *
 * @param status - Status to validate
 * @returns True if valid status
 *
 * @task T4800
 */
export declare function isValidStageStatus(status: string): status is StageStatus;
/**
 * Get stages by category.
 *
 * @param category - Category to filter by
 * @returns Array of stages in that category
 *
 * @task T4800
 */
export declare function getStagesByCategory(category: StageCategory): Stage[];
/**
 * Get skippable stages.
 *
 * @returns Array of stages that can be skipped
 *
 * @task T4800
 */
export declare function getSkippableStages(): Stage[];
/**
 * Transition rule - defines if a transition is allowed.
 *
 * @task T4800
 */
export interface TransitionRule {
    from: Stage | 'any';
    to: Stage | 'any';
    allowed: boolean;
    requiresForce?: boolean;
    reason?: string;
}
/**
 * Allowed transitions between stages.
 *
 * By default, stages progress linearly. These rules define exceptions.
 *
 * @task T4800
 */
export declare const TRANSITION_RULES: TransitionRule[];
/**
 * Check if a transition is allowed.
 *
 * @param from - Source stage
 * @param to - Target stage
 * @param force - Whether to allow forced transitions
 * @returns Object with allowed flag and reason
 *
 * @task T4800
 */
export declare function checkTransition(from: Stage, to: Stage, force?: boolean): {
    allowed: boolean;
    requiresForce: boolean;
    reason?: string;
};
/**
 * Total number of stages in the pipeline.
 *
 * @task T4800
 */
export declare const STAGE_COUNT: 9;
/**
 * First stage in the pipeline.
 *
 * @task T4800
 */
export declare const FIRST_STAGE: Stage;
/**
 * Last stage in the pipeline.
 *
 * @task T4800
 */
export declare const LAST_STAGE: Stage;
/**
 * Planning stages.
 *
 * @task T4800
 */
export declare const PLANNING_STAGES: Stage[];
/**
 * Decision stages.
 *
 * @task T4800
 */
export declare const DECISION_STAGES: Stage[];
/**
 * Execution stages (canonical).
 *
 * @task T4800
 */
export declare const EXECUTION_STAGES: Stage[];
/**
 * Validation stages.
 *
 * @task T4800
 */
export declare const VALIDATION_STAGES: Stage[];
/**
 * Delivery stages.
 *
 * @task T4800
 */
export declare const DELIVERY_STAGES: Stage[];
//# sourceMappingURL=stages.d.ts.map