/** * Re-verify before training (ADR-503 ยง2.3). Opt-in: `.claude-flow/config.json` * `learningLoop.reverify: true`. Off by default because it runs project code. * * - The command comes only from a fixed allowlist built from the project's own * manifest (`package.json` scripts named test/typecheck/build/lint, or * `cargo test`/`cargo check` when `Cargo.toml` exists). A record's text is * never executed: it only selects, by its verifier *kind*, which allowlisted * check NOT to run. * - Checks rotate round-robin across ingests, preferring one the record did * not use, so no single check is the one that counts. * - The real runner works in a temporary detached `git worktree` at HEAD, * with a hard timeout; timeout, error or a non-zero exit downgrades the * record to `unknown`. */ import type { VerifierKind } from './verified-outcomes.js'; export interface ReverifyCheck { /** `npm:test`, `cargo:check`, ...: a stable name for the ledger. */ readonly name: string; readonly kind: VerifierKind; readonly argv: readonly string[]; } export interface ReverifyOutcome { readonly status: 'pass' | 'fail' | 'timeout' | 'error'; /** The commit the check ran at, when known. */ readonly commit: string | null; } /** Runs one allowlisted check for `root` at HEAD. Injectable so tests never start a process. */ export type ReverifyRunner = (root: string, check: ReverifyCheck, timeoutMs: number) => Promise; /** * The allowlist for a project. Only the script NAMES are read from the * manifest; the argv is fixed here (`npm run `, `cargo test`, ...). */ export declare function reverifyChecks(root: string): ReverifyCheck[]; /** * The check to run for a record decided by a `used` verifier: round-robin by * `cursor` over the checks of another kind, or over all of them when every * check is that kind. Null when the project has none. */ export declare function pickCheck(checks: readonly ReverifyCheck[], used: VerifierKind, cursor: number): ReverifyCheck | null; /** * The real runner: a detached `git worktree` at HEAD in a temp directory, the * root's `node_modules` linked in (a fresh worktree has none), the check run, * the worktree removed. Any failure along the way is `error`. */ export declare const gitWorktreeRunner: ReverifyRunner; /** One ingest's re-verification: picks per record, runs each distinct check at most once, never throws. */ export declare class ReverifySession { private readonly root; private readonly cursor; private readonly timeoutMs; private readonly runner; private readonly results; private readonly checks; ran: number; constructor(root: string, cursor: number, timeoutMs: number, runner: ReverifyRunner, checks?: ReverifyCheck[]); /** Re-verifies a success decided by a `used` verifier. The record's own command and task are never passed. */ verify(used: VerifierKind): Promise<{ check: string | null; outcome: ReverifyOutcome; }>; } //# sourceMappingURL=verified-reverify.d.ts.map