/** A readable failure walking ancestors or diffing trees. Callers treat any * throw from this module as "fall back to a full capture", never as fatal. */ export declare class AncestorBaselineError extends Error { } /** How many first-parent ancestors of the requested commit the walk considers. */ export declare const DEFAULT_ANCESTOR_WALK_LIMIT = 50; /** First-parent ancestors of `sha`, nearest first, excluding `sha` itself, * bounded to `limit`. A shallow history simply yields fewer ancestors; a git * failure (unknown SHA, not a repository) throws {@link AncestorBaselineError}. */ export declare function listFirstParentAncestors(options: { sha: string; cwd: string; limit?: number; }): string[]; /** Paths changed between two commits' TREES (`git diff --name-only A B`). */ export declare function changedPathsBetween(options: { ancestorSha: string; sha: string; cwd: string; }): string[]; /** * The subset of `changedPaths` that is capture-relevant, conservatively: * the capture spec and anything in its directory (colocated harness files), * the Playwright capture config, any `styleproof.config.json`, any package * manifest/lockfile, and anything under a declared app source root. With NO * source roots declared — or a root that canonicalizes to the repo root — every * changed path is relevant, so reuse can never fire on an undeclared app * layout. Pure and fs-free. */ export declare function captureRelevantChangedPaths(options: { changedPaths: readonly string[]; spec: string; sourceRoots: readonly string[]; }): string[]; /** The verdict of {@link planAncestorBaselineReuse}: reuse names the ancestor * and carries the no-relevant-changes proof; capture names the reason. */ export type AncestorBaselineReusePlan = { decision: 'reuse'; ancestorSha: string; ancestorDepth: number; changedPathCount: number; } | { decision: 'capture'; reason: string; }; /** * Decide whether the nearest stored-ancestor bundle may serve as the requested * commit's baseline. FAIL-SAFE BY CONTRACT: any error in the walk or the diff * returns a `capture` verdict with the failure as its reason — this function * never throws and never returns a reuse verdict it could not prove. */ export declare function planAncestorBaselineReuse(options: { requestedSha: string; /** Commit SHAs that have a stored bundle (top-level dirs of the map store branch). */ availableShas: ReadonlySet; spec: string; sourceRoots: readonly string[]; cwd: string; limit?: number; }): AncestorBaselineReusePlan;