/** A single @spec annotation extracted from source code. */
export interface SpecAnnotation {
    /** Spec ID referenced (e.g., "SPEC-120"). */
    specId: string;
    /** Acceptance criteria numbers (e.g., [1, 3, 5] from "AC-1,AC-3,AC-5"). */
    criteria: number[];
    /** Optional description after the dash. */
    description: string;
    /** File where the annotation was found. */
    file: string;
    /** Line number (1-based). */
    line: number;
    /** Raw annotation text as written in the source. */
    raw: string;
}
/** Result of parsing all @spec annotations from a set of files. */
export interface AnnotationParseResult {
    annotations: SpecAnnotation[];
    fileCount: number;
    annotatedFileCount: number;
}
/** Result of validating annotations against stored specs. */
export interface AnnotationValidationResult {
    valid: AnnotationValidationEntry[];
    invalid: AnnotationValidationEntry[];
    totalAnnotations: number;
    validCount: number;
    invalidCount: number;
}
/** A single annotation validation entry. */
export interface AnnotationValidationEntry {
    annotation: SpecAnnotation;
    reason: string;
}
/** Suggestion for annotating a file that lacks annotations. */
export interface AnnotationSuggestion {
    file: string;
    suggestedAnnotation: string;
    reason: string;
    confidence: 'high' | 'medium' | 'low';
}
/** SHA-256 hash snapshot of a file. */
export interface FileHashEntry {
    file: string;
    hash: string;
    /** Size in bytes. */
    size: number;
    /** ISO timestamp of last snapshot. */
    snapshotAt: string;
}
/** Exported function signature tracked for drift detection. */
export interface FunctionSignature {
    name: string;
    params: string;
    returnType: string;
    file: string;
    line: number;
}
/** A complete hash snapshot for a spec, including file hashes and function signatures. */
export interface SpecHashSnapshot {
    specId: string;
    createdAt: string;
    files: FileHashEntry[];
    signatures: FunctionSignature[];
}
/** Change classification for function signatures. */
export type SignatureChangeType = 'added' | 'modified' | 'removed';
/** A single signature change between two snapshots. */
export interface SignatureChange {
    name: string;
    file: string;
    changeType: SignatureChangeType;
    /** Previous signature string (empty for 'added'). */
    before: string;
    /** Current signature string (empty for 'removed'). */
    after: string;
}
/** File hash diff between two snapshots. */
export interface FileHashDiff {
    file: string;
    /** Previous hash (empty for new files). */
    previousHash: string;
    /** Current hash (empty for deleted files). */
    currentHash: string;
    /** Criteria linked to this file via annotations. */
    linkedCriteria: number[];
}
/** Report of hash and signature changes for a spec. */
export interface HashDiffReport {
    specId: string;
    changedFiles: FileHashDiff[];
    signatureChanges: SignatureChange[];
    unchangedFileCount: number;
    comparedAt: string;
}
/** Extended criterion status that includes annotation-based statuses. */
export type AnnotatedCriterionStatus = 'met' | 'pending' | 'drift' | 'regression' | 'untracked';
/** Extended drift report fields for annotation-based mode. */
export interface AnnotationDriftInfo {
    annotationCoverage: number;
    annotatedCriteria: number;
    totalCriteria: number;
    regressions: string[];
    untrackedCriteria: string[];
}
/** Entry in the auto-reconciliation log. */
export interface ReconcileLogEntry {
    timestamp: string;
    changeType: 'completion-update' | 'status-flip' | 'hash-update' | 'timestamp-update';
    specId: string;
    description: string;
    previousValue: string;
    newValue: string;
}
/** Classification of reconciliation changes. */
export type ReconcileChangeClass = 'safe' | 'unsafe';
/** Input for the validate_annotations tool. */
export interface ValidateAnnotationsInput {
    projectId: string;
    projectPath: string;
    specId?: string;
}
/** Input for the generate_annotations tool. */
export interface GenerateAnnotationsInput {
    projectId: string;
    projectPath: string;
    specId: string;
}
/** Input for the snapshot_spec_hashes tool. */
export interface SnapshotSpecHashesInput {
    projectId: string;
    specId: string;
}
/** Input for the auto_reconcile tool. */
export interface AutoReconcileInput {
    projectId: string;
    specId?: string;
    changedFiles?: string[];
}
/** Result of auto-reconciliation. */
export interface AutoReconcileResult {
    specId: string;
    appliedChanges: ReconcileLogEntry[];
    skippedUnsafe: string[];
    rateLimited: boolean;
    reconciledAt: string;
}
/** Options for creating a drift watcher. */
export interface DriftWatcherOptions {
    /** TTL in seconds for cached drift entries. Default 60. */
    ttlSeconds?: number;
    /** Glob patterns to exclude from watching. */
    excludePatterns?: string[];
    /** Project ID to watch. */
    projectId: string;
}
/** In-memory state of the drift watcher. */
export interface DriftWatcherState {
    /** Whether the watcher is currently running. */
    running: boolean;
    /** ISO timestamp when the watcher was started. */
    startedAt: string | null;
    /** Number of cached entries. */
    cacheSize: number;
    /** Project ID being watched. */
    projectId: string;
}
/** A single cached drift entry. */
export interface DriftCacheEntry {
    /** Spec ID this entry is for. */
    specId: string;
    /** Cached drift report data. */
    data: HashDiffReport;
    /** ISO timestamp when the entry was cached. */
    cachedAt: string;
    /** ISO timestamp when the entry expires. */
    expiresAt: string;
}
/** Drift watcher instance interface. */
export interface DriftWatcherInstance {
    start: () => void;
    stop: () => void;
    status: () => DriftWatcherState;
    invalidate: (specId?: string) => void;
    getCachedDrift: (specId: string) => DriftCacheEntry | null;
    setCachedDrift: (specId: string, data: HashDiffReport) => void;
}
/** Minimal spec shape needed for dashboard collection. */
export interface DashboardSpecInput {
    id: string;
    status: string;
    completion: number;
}
/** A single spec entry for the living dashboard. */
export interface DashboardSpecEntry {
    specId: string;
    status: string;
    completion: number;
    driftDetected: boolean;
    changedFileCount: number;
    signatureChangeCount: number;
    lastCheckedAt: string;
}
/** Summary statistics for the dashboard. */
export interface DashboardSummary {
    totalSpecs: number;
    specsWithDrift: number;
    averageCompletion: number;
    healthScore: number;
    generatedAt: string;
}
/** A single trend data point. */
export interface DashboardTrendPoint {
    timestamp: string;
    specsWithDrift: number;
    averageCompletion: number;
    healthScore: number;
}
/** A row in the spec diff table. */
export interface SpecDiffRow {
    specId: string;
    file: string;
    previousHash: string;
    currentHash: string;
    status: 'added' | 'modified' | 'removed';
}
/** Status of a criterion's test coverage. */
export type CriterionCoverageStatus = 'verified' | 'regression' | 'untested';
/** Coverage information for a group of annotations. */
export interface AnnotationCoverageGroup {
    specId: string;
    criterion: number;
    status: CriterionCoverageStatus;
    testCount: number;
    passCount: number;
    failCount: number;
    files: string[];
}
/** Full test coverage report correlated with specs (living-spec). */
export interface LivingSpecCoverageReport {
    projectId: string;
    groups: AnnotationCoverageGroup[];
    totalTests: number;
    passedTests: number;
    failedTests: number;
    coveragePercentage: number;
    generatedAt: string;
}
/** Minimal shape of a Vitest JSON test result. */
export interface VitestTestResult {
    name: string;
    status: 'passed' | 'failed' | 'skipped' | 'pending';
    duration?: number;
}
/** Minimal shape of a Vitest JSON test file. */
export interface VitestFileResult {
    filepath: string;
    tests: VitestTestResult[];
}
/** Minimal shape of the full Vitest JSON report. */
export interface VitestJsonReport {
    testResults: VitestFileResult[];
}
/** A single test case from JUnit XML. */
export interface JUnitTestCase {
    name: string;
    classname: string;
    file: string;
    passed: boolean;
}
/** A normalized test result for grouping. */
export interface NormalizedTestResult {
    name: string;
    file: string;
    passed: boolean;
}
/** Direction of synchronization. */
export type SyncDirection = 'spec-to-code' | 'code-to-spec';
/** Criterion info for TODO generation. */
export interface CriterionInfo {
    specId: string;
    criterion: number;
    description: string;
    status: string;
}
/** A TODO comment to be generated in code. */
export interface TodoComment {
    file: string;
    line: number;
    text: string;
    specId: string;
    criterion: number;
}
/** A progress update to apply to a spec. */
export interface ProgressUpdate {
    specId: string;
    criterion: number;
    previousStatus: string;
    newStatus: string;
    reason: string;
}
/** A conflict detected during sync. */
export interface SyncConflict {
    id: string;
    specId: string;
    criterion: number;
    direction: SyncDirection;
    description: string;
    codeState: string;
    specState: string;
    detectedAt: string;
    resolved: boolean;
    resolution?: string;
}
/** An entry in the sync log. */
export interface SyncLogEntry {
    timestamp: string;
    direction: SyncDirection;
    specId: string;
    action: string;
    details: string;
}
/** Result of a sync operation. */
export interface SyncResult {
    direction: SyncDirection;
    specId: string;
    todosGenerated: TodoComment[];
    progressUpdates: ProgressUpdate[];
    conflicts: SyncConflict[];
    logEntries: SyncLogEntry[];
    syncedAt: string;
}
/** Input for the living_spec_watch tool. */
export interface LivingSpecWatchInput {
    projectId: string;
    action: 'start' | 'stop' | 'status';
    ttlSeconds?: number;
    excludePatterns?: string[];
}
/** Input for the living_spec_status tool. */
export interface LivingSpecStatusInput {
    projectId: string;
    specId?: string;
}
/** Input for the spec_diff tool. */
export interface SpecDiffInput {
    projectId: string;
    specId?: string;
}
/** Input for the living_spec_coverage tool. */
export interface LivingSpecCoverageInput {
    projectId: string;
    coverageJsonPath?: string;
    junitXmlPath?: string;
}
/** Input for the sync_spec_to_code tool. */
export interface SyncSpecToCodeInput {
    projectId: string;
    specId: string;
    projectPath: string;
}
/** Input for the sync_code_to_spec tool. */
export interface SyncCodeToSpecInput {
    projectId: string;
    specId: string;
    projectPath: string;
}
/** Input for the resolve_sync_conflict tool. */
export interface ResolveSyncConflictInput {
    projectId: string;
    conflictId: string;
    resolution: 'accept-code' | 'accept-spec' | 'manual';
    manualResolution?: string;
}
/** Dashboard data persisted to disk. */
export interface LivingDashboardData {
    entries: DashboardSpecEntry[];
    summary: DashboardSummary;
    trends: DashboardTrendPoint[];
    updatedAt: string;
}
//# sourceMappingURL=living-spec.d.ts.map