/** * Stage Validation Service * * Validates stage outputs to determine if the pipeline should stop early * due to insufficient or invalid input data. */ import type { ExecutedToolCall } from './validators/types.js'; import './validators/built-in/index.js'; /** * Validation result from stage output check */ export interface StageValidationResult { /** Whether the stage output is valid and pipeline should continue */ isValid: boolean; /** Reasons why validation failed */ reasons: string[]; /** Whether this is a critical failure that should stop the pipeline */ shouldStopPipeline: boolean; /** Summary message for display */ summary?: string; } export declare class StageValidationService { private readonly color; private readonly console; private readonly renderer; /** * Stage patterns mapped to their validation handlers */ private readonly stageValidators; /** * Check if a stage requires validation */ requiresValidation(stageName: string): boolean; /** * Validate stage outputs and determine if pipeline should continue. * Registry validators (Track-Two) run first; if they fail the result is * returned immediately without running the legacy built-in validators. */ validate(stageName: string, outputs: Record, executedToolCalls?: ExecutedToolCall[]): StageValidationResult; /** * Validate load-specifications stage outputs */ private validateLoadSpecifications; /** * Check if ready_for_prd is explicitly false */ private checkPrdReadiness; /** * Check completeness score threshold */ private checkCompletenessScore; /** * Check specifications for missing critical sections */ private checkSpecifications; /** * Check for validation errors in output */ private checkValidationErrors; /** * Check for blockers */ private checkBlockers; /** * Validate analyze-requirements stage outputs */ private validateAnalyzeRequirements; /** * Validate the requirement_analysis field */ private validateRequirementAnalysis; /** * Check for critical gaps in analysis */ private validateCriticalGaps; /** * Validate complexity estimate for blockers */ private validateComplexityEstimate; /** * Check for blocking risks */ private validateBlockingRisks; /** * Validate confidence level */ private validateConfidence; /** * Check for explicit validation failures */ private validateExplicitFailures; /** * Check for missing critical fields in specifications * Accepts multiple key variations for robustness against LLM output variations */ private checkMissingCriticalFields; /** * Find field value using multiple key variations */ private findFieldValue; /** * Check if a value is empty/missing */ private isEmptyValue; /** * Check if analysis object is empty or contains only placeholders */ private isEmptyOrPlaceholder; /** * Build summary message for specifications validation failure */ private buildSpecificationsSummary; /** * Build summary message for requirements analysis validation failure */ private buildRequirementsSummary; /** * Display validation failure summary */ displayValidationFailure(result: StageValidationResult): void; } /** * Get the singleton stage validation service instance */ export declare function getStageValidationService(): StageValidationService; //# sourceMappingURL=stage-validation.service.d.ts.map