/**
 * Pipeline stage binding for tasks (RCASD-IVTR+C).
 *
 * Implements auto-assignment of pipeline stages on task creation and
 * forward-only stage transition validation on task update.
 *
 * Stages (in order):
 *   1. research
 *   2. consensus
 *   3. architecture_decision
 *   4. specification
 *   5. decomposition
 *   6. implementation
 *   7. validation
 *   8. testing
 *   9. release
 *  10. contribution  (cross-cutting, treated as terminal)
 *
 * @task T060
 * @epic T056
 */
import type { TaskType } from '@cleocode/contracts';
/**
 * Minimal parent task shape needed for pipeline stage resolution.
 * @task T060
 */
export interface ResolvedParent {
    pipelineStage?: string | null;
    type?: TaskType | null;
}
/**
 * Ordered pipeline stages (RCASD-IVTR+C).
 * This matches lifecycle/stages.ts PIPELINE_STAGES but is kept local to avoid
 * a circular dependency — tasks/ must not import from lifecycle/.
 *
 * @task T060
 */
export declare const TASK_PIPELINE_STAGES: readonly ["research", "consensus", "architecture_decision", "specification", "decomposition", "implementation", "validation", "testing", "release", "contribution"];
/** Union type of all valid pipeline stage names. */
export type TaskPipelineStage = (typeof TASK_PIPELINE_STAGES)[number];
/**
 * Check whether a string is a valid pipeline stage name.
 *
 * @remarks
 * Uses a type-narrowing signature so callers can safely use the value
 * as {@link TaskPipelineStage} after a truthy check.
 *
 * @param stage - Raw string to test
 * @returns True if it is a valid stage name
 *
 * @example
 * ```ts
 * isValidPipelineStage('research');       // => true
 * isValidPipelineStage('not_a_stage');    // => false
 * ```
 *
 * @task T060
 */
export declare function isValidPipelineStage(stage: string): stage is TaskPipelineStage;
/**
 * Validate a pipeline stage name and throw a CleoError on failure.
 *
 * @remarks
 * Uses an assertion signature — after a successful call the compiler
 * narrows `stage` to {@link TaskPipelineStage}.
 *
 * @param stage - Stage name to validate
 * @returns void (assertion function — narrows type on success)
 * @throws CleoError(VALIDATION_ERROR) if invalid
 *
 * @example
 * ```ts
 * validatePipelineStage('implementation'); // passes
 * validatePipelineStage('invalid');        // throws CleoError
 * ```
 *
 * @task T060
 */
export declare function validatePipelineStage(stage: string): asserts stage is TaskPipelineStage;
/**
 * Determine the default pipeline stage for a new task.
 *
 * Rules (in priority order):
 * 1. If an explicit stage is provided and valid, use it.
 * 2. If the task has a parent, inherit the parent's pipelineStage.
 * 3. If the task type is 'epic', default to 'research'.
 * 4. Otherwise default to 'implementation'.
 *
 * @remarks
 * Priority order ensures explicit caller intent wins, then parent
 * inheritance, then type-based defaults. This avoids surprising
 * overrides when parent stages differ from the default.
 *
 * @param options - Resolution inputs
 * @param options.explicitStage - Stage explicitly provided by the caller
 * @param options.taskType      - Type of the task being created
 * @param options.parentTask    - Parent task (if any), for inheritance
 * @returns The resolved pipeline stage name
 *
 * @example
 * ```ts
 * resolveDefaultPipelineStage({ taskType: 'epic' });
 * // => 'research'
 *
 * resolveDefaultPipelineStage({ taskType: 'task' });
 * // => 'implementation'
 * ```
 *
 * @task T060
 */
export declare function resolveDefaultPipelineStage(options: {
    explicitStage?: string | null;
    taskType?: TaskType | null;
    parentTask?: ResolvedParent | null;
}): TaskPipelineStage;
/**
 * Get the numeric order of a pipeline stage (1-based).
 *
 * @remarks
 * Returns -1 for unrecognised stage names so callers can distinguish
 * "unknown" from a valid low-order stage.
 *
 * @param stage - Stage name (must be valid)
 * @returns Numeric order (1–10), or -1 if not found
 *
 * @example
 * ```ts
 * getPipelineStageOrder('research');       // => 1
 * getPipelineStageOrder('implementation'); // => 6
 * getPipelineStageOrder('unknown');        // => -1
 * ```
 *
 * @task T060
 */
export declare function getPipelineStageOrder(stage: string): number;
/**
 * Check whether transitioning from `currentStage` to `newStage` is forward-only.
 *
 * "Forward" means the new stage's order is greater than or equal to the current
 * stage's order (same stage is a no-op and is considered valid).
 *
 * @remarks
 * Unknown stages are treated as valid to avoid blocking tasks with
 * legacy or custom stage names that predate the standard set.
 *
 * @param currentStage - The task's current pipeline stage
 * @param newStage     - The requested new pipeline stage
 * @returns True if the transition is allowed (forward or same)
 *
 * @example
 * ```ts
 * isPipelineTransitionForward('research', 'implementation'); // => true
 * isPipelineTransitionForward('testing', 'research');        // => false
 * ```
 *
 * @task T060
 */
export declare function isPipelineTransitionForward(currentStage: string, newStage: string): boolean;
/**
 * Validate a pipeline stage transition and throw if it would move backward.
 *
 * @remarks
 * Validates the new stage name first via {@link validatePipelineStage},
 * then checks directionality. A null/undefined current stage accepts any
 * valid new stage (first assignment).
 *
 * @param currentStage - The task's current pipeline stage (may be null/undefined)
 * @param newStage     - The new stage being requested
 * @throws CleoError(VALIDATION_ERROR) if the transition is backward
 *
 * @example
 * ```ts
 * validatePipelineTransition(null, 'research');              // passes (first assignment)
 * validatePipelineTransition('research', 'implementation');   // passes (forward)
 * validatePipelineTransition('testing', 'research');          // throws (backward)
 * ```
 *
 * @task T060
 */
export declare function validatePipelineTransition(currentStage: string | null | undefined, newStage: string): void;
//# sourceMappingURL=pipeline-stage.d.ts.map