import type { ParsedCommit, CommitSpecRef, OrphanDetectorResult, OrphanScanRange } from '../../types/index.js';
/**
 * Parse git log output into structured commit records.
 * Expected format per commit: sha FS subject FS body RS
 * where FS = ASCII unit-separator (0x1F) and RS = ASCII record-separator (0x1E).
 */
export declare function parseGitLogOutput(raw: string): ParsedCommit[];
/**
 * Fetch commits from git log for the given range.
 * Uses NUL as field separator to avoid escaping issues with special characters.
 */
export declare function fetchCommits(projectPath: string, range: OrphanScanRange): Promise<ParsedCommit[]>;
/**
 * Enumerate existing spec IDs from planu/specs/ directory entries.
 * Returns a Set of numeric IDs extracted from folder name prefixes (SPEC-NNN-*).
 */
export declare function enumerateExistingSpecIds(projectPath: string): Promise<Set<number>>;
/**
 * Extract the SPEC-NNN reference from a single commit subject.
 * Returns the numeric spec ID, or null if no reference is found.
 */
export declare function extractSpecId(subject: string): number | null;
/**
 * Pure detector function — cross-references parsed commits against known spec IDs.
 * Returns only commits that contain a SPEC-NNN reference (found or missing).
 *
 * @param commits - Commits to analyze
 * @param existingSpecIds - Set of numeric spec IDs that exist in planu/specs/
 */
export declare function detectOrphanRefs(commits: ParsedCommit[], existingSpecIds: Set<number>): CommitSpecRef[];
/**
 * Run the full orphan detection pipeline for a project.
 * Fetches commits, enumerates specs, and cross-references.
 */
export declare function runOrphanDetection(projectPath: string, range: OrphanScanRange): Promise<OrphanDetectorResult>;
//# sourceMappingURL=orphan-spec-refs.d.ts.map