/** * What the dispatcher knows about the checkout it tried to run a hook from. */ export interface HookRuntimeFacts { readonly depsInstalled: boolean; } /** * Probe `repoDir` for the one fact the policy turns on. Takes an injected * `exists` so the decision table can be exercised without a filesystem. */ export declare function hookRuntimeFacts(repoDir: string, exists?: (filepath: string) => boolean): HookRuntimeFacts; /** * A hook whose runtime failed to load, and the context needed to say why. */ export interface HookRuntimeFailure { /** * Short cause — an error CODE or missing specifier, never a stack. */ readonly cause: string; readonly hookName: string; /** * Checkout the runtime was resolved from, named in the message. */ readonly repoDir: string; /** * Command that restores enforcement, quoted in the fail-open message. */ readonly repairCommand?: string | undefined; readonly runtime: HookRuntimeFacts; } export interface HookRuntimeVerdict { readonly block: boolean; readonly message: string; } /** * Decide whether a hook whose runtime could not load blocks the action. * * Blocks only when the failure is plausibly a purge window: an enforcing hook * whose checkout HAS an install, where retrying runs the real check. An * enforcing hook whose checkout has no install fails OPEN and says so — the * message states plainly that enforcement is off and names the command that * turns it back on. A block here would also block the repair, leaving the * reader nothing to act on. */ export declare function hookRuntimeVerdict(config: HookRuntimeFailure): HookRuntimeVerdict; /** * Whether `hookName` enforces a rule. Only an enforcing hook has a reason to * fail closed; advisory hooks — reminders, nudges, sweepers — never do, because * an advisory that cannot speak has nothing to withhold. */ export declare function isEnforcingHook(hookName: string): boolean;