import type { AuditArgs } from './args.mts'; import { type CoveragePolicy } from './classify.mts'; import type { ScanRules } from './types.mts'; export type PolicyContext = { settingsPath?: string; cwd: string; }; /** * What a repository injects. `loadPolicy` turns the settings location into the repository's * coverage answer (or `{ error }` when it cannot); `classifyFailure` and `limits` extend the scan; * `worktreeGlobs` names extra worktree layouts to scope transcripts to. */ export type AuditRules = ScanRules & { loadPolicy: (context: PolicyContext) => CoveragePolicy | { error: string; } | Promise; worktreeGlobs?: string[]; }; export type LoadRulesModule = (specifier: string) => Promise; export declare const importRulesModule: LoadRulesModule; /** * Imports a `--rules` module. The default export or a named `rules` export must be an object with * a `loadPolicy` function (or a function returning one); a relative path resolves against `cwd`. */ export declare function loadAuditRules(specifier: string, cwd: string, load?: LoadRulesModule): Promise; export type RunDeps = { cwd: string; load?: LoadRulesModule; }; /** * Scan, classify, report. A repository that cannot be resolved or a policy that cannot load yields * an `unavailable` report rather than an error, so a retrospective can still embed the output. */ export declare function runAudit(args: AuditArgs, deps: RunDeps): Promise;