import type { Logger } from '../../utils/logger.js'; /** * Validation result for increment completion */ export interface ValidationResult { isValid: boolean; errors: string[]; warnings?: string[]; /** Informational results (e.g. a PASSING verify). Never a problem report. */ info?: 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 done or skipped (ledger.jsonl fold, tasks.md checkbox fallback) * 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; reason?: string; }): Promise; /** * 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; /** * 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 acceptance criteria that are not met. * * Uses the same ledger-derived AC status as `specweave verify`: an AC is met * when ticked in spec.md or when every task covering it is done in the * ledger. State lives only in ledger.jsonl, so spec.md boxes are never ticked * for ledger-tracked work. When no task references any AC (the ledger can say * nothing about ACs), falls back to counting `- [ ] **AC-` lines in spec.md. * * @param incrementId - The increment ID * @returns Number of open ACs */ static countOpenACs(incrementId: string): Promise; /** * Count tasks that are neither done nor skipped. * * Uses the task board (ledger.jsonl fold, falling back to the tasks.md * checkbox / `**Status**` line for tasks without ledger events), so the * closure gate and `specweave task list` never disagree. * * @param incrementId - The increment ID * @returns Number of pending tasks */ static countPendingTasks(incrementId: string): Promise; } //# sourceMappingURL=completion-validator.d.ts.map