import type { SpawnSyncOptionsWithStringEncoding, SpawnSyncReturns } from "node:child_process"; import type { RepoManifest } from "../types.js"; import type { FileDisposition, FileDispositionStatus } from "audit-tools/shared"; /** * Explicit out-of-scope reason for files excluded because the repository's own * VCS ignore rules (.gitignore et al.) cover them. */ export declare const VCS_IGNORED_REASON = "vcs_ignored"; /** * Explicit out-of-scope reason for files that exist on disk but are absent * from the git index (`git ls-files`). Citation grounding already treats the * tracked set as the source of truth, so untracked scratch left in the audited * tree (worker batch files, generated helper scripts) must never enter the * auditable scope — a finding citing it could never be grounded. */ export declare const UNTRACKED_REASON = "untracked"; /** * Guard threshold shared by both scope rules: when a rule would exclude more * than this share of its candidate files, the rule is skipped (guard branch * `share_exceeded`) and only the existing targeted exclusions apply. A share * of exactly 1.0 fires the rule's root guard instead (`root_ignored` / * `root_untracked`). */ export declare const VCS_IGNORED_MAX_SHARE = 0.9; export type ScopeRuleGuardBranch = "root_ignored" | "share_exceeded" | "root_untracked"; /** * Outcome record for a scope rule (gitignore / untracked), persisted alongside * the per-file records so the scope pre-digest / intent checkpoint can surface * skipped-rule and guard decisions. */ export interface ScopeRuleSummary { /** True when the rule's exclusions were applied to the disposition. */ applied: boolean; /** Number of candidate files the rule matched. */ ignored_count: number; /** Why the rule was skipped (clean fallback or guard). */ skipped_reason?: string; /** Which guard branch fired when a guard skipped the rule. */ guard_branch?: ScopeRuleGuardBranch; } /** FileDisposition enriched with the per-rule outcome records. */ export interface FileDispositionWithScopeRules extends FileDisposition { vcs_ignore?: ScopeRuleSummary; untracked?: ScopeRuleSummary; } /** Injection seam for the batched git spawns (tests). */ export type GitSpawn = (command: string, args: readonly string[], options: SpawnSyncOptionsWithStringEncoding) => SpawnSyncReturns; export interface BuildFileDispositionOptions { /** * Audit root. When provided (and a git work tree), enables the batched * `git check-ignore --stdin` pass that classifies vcs-ignored files out of * scope, followed by the batched `git ls-files` pass that classifies * untracked files out of scope. Omit for the heuristics-only disposition. */ root?: string; /** Test seam: replacement for child_process.spawnSync on `git check-ignore`. */ spawn?: GitSpawn; /** Test seam: replacement for child_process.spawnSync on `git ls-files`. */ lsFilesSpawn?: GitSpawn; } /** * Applies shared path heuristics to mark files that should be excluded or * down-scoped before audit planning begins. When `options.root` is provided, * additionally classifies vcs-ignored files out of scope via one batched * `git check-ignore --stdin` pass, then untracked files via one batched * `git ls-files` pass — each with clean fallback to the disposition built so * far whenever git is unavailable or a safety guard fires. */ export declare function buildFileDisposition(repoManifest: RepoManifest, options?: BuildFileDispositionOptions): FileDispositionWithScopeRules; export declare function buildDispositionMap(disposition?: FileDisposition): Map; export declare function isAuditExcludedStatus(status: FileDispositionStatus): status is Exclude; //# sourceMappingURL=disposition.d.ts.map