/** * Attribution Module v3 * * Computes line attributions by replaying edit deltas. * At commit time, replays all deltas to determine which lines * were written by AI vs human, and links to specific prompts. * * Algorithm: * 1. Start with empty attributions (or git blame for existing lines) * 2. For each delta in chronological order: * - Shift existing attributions based on insertions/deletions * - Remove attributions for deleted lines * - Add attributions for inserted lines * 3. Merge adjacent same-author ranges */ import type { EditDelta, LineAttribution, ComputedFileAttribution } from "./types"; /** * Apply a single delta to existing attributions * Returns updated attributions and new line count */ export declare function applyDelta(attributions: LineAttribution[], delta: EditDelta, lineCount: number): { attributions: LineAttribution[]; lineCount: number; }; /** * Merge adjacent attributions with the same author */ export declare function mergeAttributions(attrs: LineAttribution[]): LineAttribution[]; /** * Compute final attributions for a file by replaying all deltas */ export declare function computeFileAttributions(repoRoot: string, baseSha: string, filePath: string): Promise; /** * Compute attributions for multiple files */ export declare function computeAttributionsForFiles(repoRoot: string, baseSha: string, files: string[]): Promise>; /** * Count total AI lines from attributions */ export declare function countAILines(attribution: ComputedFileAttribution): number; /** * Count total human lines from attributions */ export declare function countHumanLines(attribution: ComputedFileAttribution): number; /** * Get attribution summary for a file */ export declare function getAttributionSummary(attribution: ComputedFileAttribution): { totalLines: number; aiLines: number; humanLines: number; aiPercent: number; sessionCount: number; };