import type { Logger } from '../../utils/logger.js';
/**
 * Validation result for increment completion
 */
export interface ValidationResult {
    isValid: boolean;
    errors: string[];
    warnings?: string[];
}
/**
 * Validates that an increment is ready for completion
 * by checking that all ACs are completed and all tasks are done.
 *
 * This prevents false completion where status is marked "completed"
 * but work is still open.
 */
export declare class IncrementCompletionValidator {
    /**
     * Validate that an increment is ready for completion
     *
     * Checks:
     * 1. All acceptance criteria are checked (- [x] **AC-...)
     * 2. All tasks are completed (**Status**: [x] completed)
     * 3. Required files exist (spec.md, tasks.md)
     * 4. NEW (v0.23.0): AC coverage validation
     *    - All P0 ACs have at least one implementing task
     *    - No orphan tasks (all tasks reference valid ACs)
     * 5. NEW (v0.26.2): External tool drift detection
     *    - Warns if external tools (GitHub/JIRA/ADO) not synced in >24h
     *    - Blocks closure if drift >7 days (critical staleness)
     *    - Prevents "completed locally but external tools never updated" scenarios
     * 6. NEW (v1.0.105): Test coverage validation
     *    - Validates coverage meets target when coverageTarget > 0
     *    - Warns (non-blocking) if coverage is below target
     *    - Supports Istanbul, c8, Jest, lcov, Cobertura formats
     *
     * @param incrementId - The increment ID to validate
     * @param options - Validation options
     * @returns ValidationResult with isValid and errors array
     *
     * @example
     * ```typescript
     * const result = await IncrementCompletionValidator.validateCompletion('0043-spec-md-desync-fix');
     * if (!result.isValid) {
     *   console.error('Cannot complete increment:');
     *   result.errors.forEach(err => console.error(`  - ${err}`));
     * }
     * ```
     */
    static validateCompletion(incrementId: string, options?: {
        logger?: Logger;
        blockOnP0Orphans?: boolean;
    }): Promise<ValidationResult>;
    /**
     * Validate that quality gate reports exist and passed (NEW - v1.0.337)
     *
     * Checks for:
     * 1. grill-report.json - Required by default (config: grill.required)
     * 2. judge-llm-report.json - Optional (warns if missing, blocks on REJECTED)
     *
     * Skip conditions:
     * - grill.required === false in config.json
     * - auto.skipQualityGates === true in config.json
     * - metadata.type === 'hotfix' or 'experiment'
     *
     * @param incrementId - The increment ID
     * @param incrementPath - Path to increment directory
     * @param options - Validation options
     */
    private static validateQualityGateReports;
    /**
     * 0671 T-006: emit refinement signals from code-reviewer findings.
     *
     * Iterates the `findings[]` array from `code-review-report.json`, keeps
     * CRITICAL and HIGH severity entries, and delegates each to the shared
     * `emitRefinementIfAttributable` pipeline. Precision matters — a finding
     * that doesn't trace to a specific skill (direct slug or ≥6-word SKILL.md
     * phrase) produces no signal.
     *
     * Per AC-US1-03 the emitted severity is always `"high"` — the source
     * code-reviewer severity is the *finding* severity, but a refinement
     * signal with source="code-reviewer" is always treated as high-priority
     * advice for the target skill.
     *
     * Best-effort: all I/O errors are swallowed so closure validation is
     * never blocked by signal persistence issues.
     */
    static emitCodeReviewRefinementSignals(report: any, incrementId: string, projectRoot: string): Promise<void>;
    /**
     * Validate AC coverage (NEW - v0.23.0)
     *
     * Checks that all Acceptance Criteria have implementing tasks
     * and detects orphan tasks (tasks with no AC references).
     *
     * @param incrementId - The increment ID
     * @param specPath - Path to spec.md
     * @param tasksPath - Path to tasks.md
     * @param acManager - ACStatusManager instance
     * @returns Coverage validation result
     */
    private static validateACCoverage;
    /**
     * Parse all ACs from spec.md with priority detection
     *
     * @param specContent - Content of spec.md
     * @returns Array of ACs with their priorities
     */
    private static parseAllACsWithPriority;
    /**
     * Count open (unchecked) acceptance criteria in spec.md
     *
     * Searches for pattern: - [ ] **AC-
     *
     * @param incrementId - The increment ID
     * @returns Number of open ACs
     */
    static countOpenACs(incrementId: string): Promise<number>;
    /**
     * Count pending tasks in tasks.md
     *
     * Searches for pattern: **Status**: [ ] pending
     *
     * @param incrementId - The increment ID
     * @returns Number of pending tasks
     */
    static countPendingTasks(incrementId: string): Promise<number>;
}
//# sourceMappingURL=completion-validator.d.ts.map