/** * Local provenance extractor (spec-18) — "who last changed this, in which PR". * * Reads the local `.git` history (and, only if present and authenticated, the * local `gh` CLI) to produce per-file provenance. The deliberate constraint: * **everything is local, nothing is uploaded.** This is the no-OAuth alternative * to cloud connectors — the git-only path needs no network at all; `gh` is an * optional enrichment that degrades gracefully when absent. * * Mirrors the parser→projector split used by IaC and decisions: this module is * the parser (raw git → normalized records); project.ts maps records to typed * `authored_by` / `changed_in_pr` graph edges. */ export declare const PROVENANCE_MAX_COMMITS = 1000; export declare const PROVENANCE_TOP_AUTHORS = 5; export declare const PROVENANCE_MAX_PRS = 5; export interface Author { name: string; email: string; } export interface PullRequest { number: number; /** Title — only populated when `gh` enrichment succeeds. */ title?: string; /** open | closed | merged — only populated when `gh` enrichment succeeds. */ state?: string; } /** Per-file provenance — derived, regenerable, repo-relative POSIX path. */ export interface FileProvenance { filePath: string; lastAuthor: Author; lastDate: string; lastCommit: string; lastSubject: string; /** Distinct authors, most-recent-first, capped — includes lastAuthor. */ recentAuthors: Author[]; /** Distinct PRs that touched the file, most-recent-first, capped. */ prs: PullRequest[]; } export interface ProvenanceOptions { maxCommits?: number; topAuthors?: number; maxPrs?: number; /** Attempt `gh` enrichment for PR titles/state. Auto-skips if gh is absent. */ useGh?: boolean; } /** Extract the PR number a commit subject references (squash "(#123)" or merge). */ export declare function parsePrNumber(subject: string): number | undefined; /** * Extract per-file provenance for `files` (repo-relative POSIX paths). * * - Authors come from non-merge commits (real contributors, not the merger). * - PR numbers come from squash subjects `(#N)` and merge commits * (`--first-parent`, which attributes a PR's full diff to its files). * - Returns `[]` for a non-git or empty repo — never throws, never blocks analyze. */ export declare function extractProvenance(rootPath: string, files: string[], opts?: ProvenanceOptions): Promise; /** * Enrich PR numbers with title/state via the local `gh` CLI — one bounded call. * Returns an empty map when `gh` is absent, unauthenticated, or the repo has no * GitHub remote. Never throws; the git-only path is unaffected. */ export declare function enrichWithGh(rootPath: string): Promise>; //# sourceMappingURL=git-provenance.d.ts.map