/** * Audit lineage reconstruction — SDK primitive. * * Promotes git-log + release-tag lineage reconstruction to a first-class * SDK verb. Git IS the immutable hash-chained ledger; this module mines it * to produce a structured {@link ReconstructResult} consumed by T1216 audit tasks. * * No `.jsonl` sidecar is emitted — git's DAG is the source of truth (per * FP peer note, T1322 council verdict 2026-04-24). * * Security: all git subprocess calls use `execFileSync` with strict `argv` * arrays — no shell interpolation or user-controlled string concatenation * in the command string. * * @task T1322 * @epic T1216 */ import type { ReconstructResult } from '@cleocode/contracts'; /** * Reconstruct the git-backed lineage for a task and its inferred children. * * This is the first-class SDK verb for audit lineage reconstruction (T1322). * It queries git directly and returns a fully-typed {@link ReconstructResult} * that T1216 audit tasks consume for their 4-outcome verdict. * * **Algorithm**: * 1. Find direct commits whose message references `taskId`. * 2. Infer child ID range from commit-message mining and numeric adjacency. * 3. Find child commits for each inferred child ID. * 4. Collect all release tags containing any direct or child commit. * 5. Compute first/last timestamps across the full commit set. * * @param taskId - The task ID to reconstruct (e.g. `"T991"`). * @param repoRoot - Absolute path to the git repository. Defaults to `process.cwd()`. * @returns A fully-typed {@link ReconstructResult} with all git-derived lineage data. * * @example * ```ts * import { reconstructLineage } from '@cleocode/core/audit/reconstruct.js'; * * const result = await reconstructLineage('T991'); * console.log(result.releaseTags.map(t => t.tag)); * // → ['v2026.4.98', 'v2026.4.99', ...] * ``` * * @task T1322 * @epic T1216 */ export declare function reconstructLineage(taskId: string, repoRoot?: string): Promise; //# sourceMappingURL=reconstruct.d.ts.map