/** True when `root` is inside a git working tree. */ export declare function isGitRepo(root: string): boolean; /** * True when `ref` resolves to a commit in `root`. Lets callers distinguish a * mistyped/unknown `--since` ref (fall back to a full audit) from a valid ref * with no changes (`changedFiles` returns `[]` in both cases otherwise). */ export declare function gitRefExists(root: string, ref: string): boolean; /** * The current HEAD commit SHA, or `null` when `root` is not a git repo / the * command fails. Cheap (one `rev-parse`) relative to a full history mine — the * git-history artifact is a pure function of the commit graph reachable from * HEAD, so an unchanged HEAD means an unchanged mine, letting the structure * executor skip the expensive `git log` walk. Never throws. */ export declare function headCommit(root: string): string | null; /** * Files differing between `since` (a ref/SHA) and the current working tree — * committed, staged, and unstaged. Backs the auditor's `--since` delta mode. */ export declare function changedFiles(root: string, since: string): string[]; /** The set of commit SHAs that have touched `path`, newest first. */ export declare function fileCommits(root: string, path: string): Set; /** A pair of files that changed together, with the number of shared commits. */ export interface CoChangePair { a: string; b: string; commits: number; } /** Per-file change frequency (number of commits that touched the file). */ export interface ChurnEntry { path: string; commits: number; } /** Per-file authorship breadth (number of distinct authors that touched it). */ export interface AuthorshipEntry { path: string; authors: number; } /** Deterministic git-history aggregates mined from the commit log. */ export interface GitHistory { co_change: CoChangePair[]; churn: ChurnEntry[]; authorship: AuthorshipEntry[]; /** * Count of in-window commits whose file count exceeded * `maxCoChangeFilesPerCommit` and were therefore SKIPPED for co-change pair * expansion (churn/authorship still counted them — only pairing was * skipped). Optional so existing `GitHistory` literals built by other * callers (e.g. the audit extractor's in-scope filter, the no-root * fallback) remain valid without updating — this field is additive. * Absent/`undefined` means "no commit was skipped" (equivalent to `0`). */ skipped_cochange_commits?: number; } export interface MineGitHistoryOptions { /** Cap on commits scanned, newest first (bounds cost on large repos). */ maxCommits?: number; /** Minimum shared-commit count for a co-change pair to be reported. */ minCoChangeCommits?: number; /** * Cap on files touched by a single commit before it is skipped for * co-change pair expansion (bounds the O(files^2) blow-up a single wide * commit — a vendor/format/rename sweep — would otherwise cause). A commit * touching more files than this carries almost no per-pair signal anyway * (any two files it "explains" are also very likely explained by other, * narrower commits), so skipping it loses little while capping cost. */ maxCoChangeFilesPerCommit?: number; } /** * Mine deterministic git-history signals from `root`'s commit log: * - **co_change**: file pairs that changed in the same commit, counted across * history (a temporal-coupling signal), filtered by `minCoChangeCommits`. * A commit touching more than `maxCoChangeFilesPerCommit` files is SKIPPED * for pair expansion entirely (churn/authorship still see it) — bounds the * per-commit O(files^2) cost; `skipped_cochange_commits` on the result * counts how many commits this affected. * - **churn**: per-file commit-touch frequency. * - **authorship**: per-file distinct-author count (a bus-factor signal). * * Fully deterministic: every list is sorted by a total order (counts descending, * then lexicographic ids) so identical history yields byte-identical output. * Degrades to empty (`{co_change:[],churn:[],authorship:[]}`) when `root` is not * a git repo or the log command fails — never throws. */ export declare function mineGitHistory(root: string, options?: MineGitHistoryOptions): GitHistory; /** Working-tree changes vs HEAD plus untracked (non-ignored) files. */ export declare function stagedAndUntracked(root: string): string[]; //# sourceMappingURL=git.d.ts.map