/** * Executable-anchor grounding for behavior claims (S7 tier-2). * * Tier-1 (quoteGrounding) proves a finding *cites code that exists*. It cannot * prove a *behavior* claim — "there is a cycle", "this symbol is unused", "this * throws". Those are exactly the claims that shipped as **not real** in the * 452-self-audit (a hallucinated cycle, two const-compare mistakes), caught only * by deterministically re-running `madge`/`grep`. Tier-2 attaches a read-only * command to such a claim, the tool runs it, and the confirmed bit is the tool's * run — never the model's word. A refuting run quarantines the finding. * * SAFETY. The command is model-authored, so it runs only when both its * executable AND its arguments pass the shared **default-deny allowlist** * (`isAllowedAnchorCommand` — CRIT ARC-a06a3945: validates args, not just the * executable, so `rg --pre`, `ast-grep --rewrite`, non-read-only git, etc. are * refused). It runs under a timeout, with the host-signalling env stripped, and * never via a shell — all owned by the shared `runAllowlistedReadOnlyCommand` * runner. Anything off the allowlist is *skipped* (recorded, not run) and the * finding falls back to tier-1 grounding. The whole pass can be disabled with * `AUDIT_CODE_DISABLE_ANCHORS=1`; the per-anchor timeout (60s default) can be * raised with `AUDIT_CODE_ANCHOR_TIMEOUT_MS` for slow checks on large repos. */ import { ANCHOR_ALLOWLIST, GIT_READONLY_SUBCOMMANDS, isAllowedAnchorCommand } from "audit-tools/shared"; import type { AllowlistedExecRunner, Finding, FindingGrounding } from "audit-tools/shared"; export { isAllowedAnchorCommand, ANCHOR_ALLOWLIST, GIT_READONLY_SUBCOMMANDS }; /** Default per-anchor wall-clock budget; a slower command is killed and inconclusive. */ export declare const ANCHOR_TIMEOUT_MS = 60000; /** * The effective per-anchor timeout. The 60s default suits the common anchors * (madge/grep/rg/git) but a legitimately slow check on a large repo would be * silently killed → `inconclusive`; `AUDIT_CODE_ANCHOR_TIMEOUT_MS` (a positive * integer in ms) lets an operator raise it per run without code changes. Read * per-call to mirror `AUDIT_CODE_DISABLE_ANCHORS` (no import-time capture). */ export declare function resolveAnchorTimeoutMs(env?: NodeJS.ProcessEnv): number; export type AnchorRunner = AllowlistedExecRunner; /** Verdict of an anchor run, folded into the finding's grounding by the caller. */ export interface AnchorResult { status: "confirmed" | "refuted" | "inconclusive" | "skipped"; summary: string; /** Last lines of the command output, for display. */ evidence?: string[]; } /** * Run a finding's executable anchor (if any) and return the verdict. Pure of any * finding mutation — the caller folds the result into `grounding` via * {@link combineGroundingWithAnchor}. Returns `undefined` when the finding has * no anchor (nothing to run). */ export declare function verifyFindingAnchor(repoRoot: string, finding: Finding, run?: AnchorRunner): Promise; /** * Fold an anchor verdict into the quote-and-verify (tier-1) grounding. A * confirming run grounds the finding (a verified behavior claim outranks a * missing quote); a refuting run quarantines it (the cited code may exist, but * the behavior claim is false); an inconclusive/skipped/absent anchor leaves the * tier-1 verdict in place. */ export declare function combineGroundingWithAnchor(tier1: FindingGrounding, anchor: AnchorResult | undefined): FindingGrounding; //# sourceMappingURL=anchorGrounding.d.ts.map