/** * A gitignore-honoring file allowlist + a changed-since filter, for aih's scans. * * Algorithm and git argv adapted from @razroo/isolint (MIT, * https://github.com/razroo/isolint) — `dist/lint/scanner.js gitAllowlist` and * `dist/lint/git-diff.js changedFilesSince`. Reimplemented against aih's async * Runner seam (`gitRead`) instead of isolint's `execFileSync`, so the scanners * stay sync + pure and tests stay hermetic (no real process spawn). */ import type { PlanContext } from "./plan.js"; /** Repo-relative POSIX paths git considers tracked OR untracked-but-not-ignored. */ export interface Allowlist { files: ReadonlySet; } /** * The set of paths in `ctx.root`'s repo that are tracked OR * untracked-but-not-ignored, via the injected Runner. `undefined` when the root * isn't a git repo / git is absent — callers then fall back to a raw FS walk. * `-z` (NUL-delimited) keeps paths with spaces/newlines intact. */ export declare function gitTrackedSet(ctx: PlanContext): Promise; /** * Repo-relative POSIX paths git considers COMMITTED (tracked) — `git ls-files`. * Narrower than {@link gitTrackedSet}, which also counts untracked-not-ignored: * adopt's team-pollution guard treats ONLY committed content as "shared" (a * developer's uncommitted personal file must stay silent), so it needs the * tracked-only set. `undefined` when not a git repo / git absent / the set is * empty — callers then treat content as shared (can't prove it's personal), * mirroring {@link gitTrackedSet}'s empty→undefined fallback. */ export declare function gitCommittedSet(ctx: PlanContext): Promise | undefined>; /** * Paths changed since `ref` — committed (`ref...HEAD`), working tree, and * untracked-not-ignored — for fast PR CI (`--since`). `undefined` when the root * isn't a git repo. Returns the empty set (not undefined) for a valid ref with no * changes; callers treat `undefined` as "not a repo → full scan". */ export declare function changedSince(ctx: PlanContext, ref: string): Promise | undefined>; /** Predicate: keep `rel` only if the allowlist contains it (or there is no allowlist). */ export declare function acceptIn(allow: Allowlist | undefined): (rel: string) => boolean; /** Intersect an allowlist predicate with a changed-set (for `--since`). */ export declare function acceptChanged(allow: Allowlist | undefined, changed: ReadonlySet | undefined): (rel: string) => boolean;