/** * FR-D02: Spec Gap Detection. * * Detects code modules that cannot be traced back to any FR/AC in the spec. * Runs at implement stage completion and on pipeline creation (coverage pre-check). * * (spec §FR-D02, AC-D02.1 through AC-D02.7) */ import type { ArtifactRef } from '../types/index.js'; import type { SpecGapReport } from './types.js'; /** Minimal FR reference for alignment scanning. */ export interface FrReference { frId: string; summary: string; /** Keywords/patterns that indicate coverage. */ keywords: string[]; } /** Implementation module descriptor for alignment scanning. */ export interface ImplementationModule { /** File or directory path. */ path: string; /** Description of what this module does. */ description: string; /** Keywords/identifiers found in the module. */ keywords: string[]; } /** * SpecGapDetector — identifies code modules not traceable to spec FRs. * * AC-D02.1: Triggered automatically at implement completion. * AC-D02.2: Identifies untraceable modules, outputs structured report. * AC-D02.5: Advisory only, does not block pipeline. * AC-D02.7: Module-level granularity (file/directory/API endpoint). */ export declare class SpecGapDetector { /** * Run spec-code alignment scan. * * Compares implementation modules against FR references to find * modules that cannot be traced to any FR. * * AC-D02.2: Outputs structured SpecGapReport. * AC-D02.7: Module-level granularity. */ scan(pipelineId: string, frReferences: FrReference[], implementationModules: ImplementationModule[]): SpecGapReport; /** * Pre-check coverage for a new requirement description (AC-D02.4). * * Scans existing FR references to determine if the new requirement * involves capabilities not yet defined in the spec. */ preCheck(existingFrReferences: FrReference[], newRequirementDescription: string): { covered: boolean; suggestedAction: string; }; /** * Extract implementation modules from deploy artifacts. * Converts ArtifactRef[] to ImplementationModule[] for scanning. */ extractModulesFromArtifacts(artifacts: ArtifactRef[]): ImplementationModule[]; /** * Convert FR list (simple format) to FrReference format for scanning. */ frListToReferences(frList: Array<{ frId: string; summary: string; }>): FrReference[]; private isModuleCovered; private computeKeywordOverlap; private hasSemanticOverlap; private computeCoverageScore; private generateSuggestedFr; private extractKeywords; private extractKeywordsFromArtifact; } //# sourceMappingURL=spec-gap-detector.d.ts.map