import type { CheckPhase, Rule, Thresholds, Usage, Verdict } from "oh-my-plumb-schema"; import type { ToolCall } from "oh-my-plumb-schema"; import type { FileDiff } from "./git.js"; import { type CheckState, type ModelRule } from "./jev.js"; import { type ToolCallEntry } from "./session.js"; import { type PreconditionState } from "./precondition.js"; export type CheckRequest = { phase: CheckPhase; /** The change, one entry per touched file, paths repo-relative. */ fileDiffs: readonly FileDiff[]; task?: string; rules: readonly Rule[]; thresholds: Thresholds; timeoutMs: number; /** Transient gateway failures to retry. Hooks leave it at zero. */ retries?: number; }; export type ToolCallCheckRequest = { phase: CheckPhase; /** One recorded call: the tool's name plus its input. */ call: ToolCall; task?: string; rules: readonly Rule[]; thresholds: Thresholds; timeoutMs: number; retries?: number; /** * What the turn did, for a rule whose own precondition decides whether it is * judged at all. Absent means no precondition applies. */ turn?: PreconditionState; }; export type CheckOutcome = { verdicts: Verdict[]; modelRules: ModelRule[]; /** How many model calls the check took: one per distinct set of in-scope files; a tool-call check is one call. */ calls: number; usage: Usage; modelLatencyMs: number; }; /** Which pipeline judges a rule. A new target must be classified here or the build fails. */ export declare const judgesDiff: (rule: Rule) => boolean; /** Rules that are active, belong to this phase, and apply to at least one touched file. */ export declare const selectRules: (rules: readonly Rule[], phase: CheckPhase, files: readonly string[]) => Rule[]; /** Tool-call rules that are active, belong to this phase, and match the tool's name glob. */ export declare const selectToolCallRules: (rules: readonly Rule[], phase: CheckPhase, tool: string) => Rule[]; /** Rules grouped by the files each one applies to, so no rule ever sees a file outside its scope. */ export declare const groupByScope: (rules: readonly ModelRule[], fileDiffs: readonly FileDiff[]) => { rules: ModelRule[]; fileDiffs: FileDiff[]; }[]; /** One verdict per rule: the loudest. */ export declare const loudestVerdicts: (verdicts: readonly Verdict[]) => Verdict[]; export declare const mergeOutcomes: (outcomes: readonly CheckOutcome[]) => CheckOutcome; /** What the judge sees for a diff rule: the change, one file at a time on edit, the group on turn. */ export declare const stateFor: (request: CheckRequest, fileDiffs: readonly FileDiff[]) => CheckState; export declare const runCheck: (request: CheckRequest) => Promise; /** The call's input as JSON, cut to the same bound a diff gets so one call cannot flood the judge. */ export declare const renderToolInput: (call: ToolCall) => string; export type TurnToolCallCheckRequest = { /** The turn's tool-call log, in call order. */ log: readonly ToolCallEntry[]; logComplete?: boolean; /** Repo-relative files the turn changed: what a precondition's `changes` globs read. */ files?: readonly string[]; task?: string; rules: readonly Rule[]; thresholds: Thresholds; timeoutMs: number; retries?: number; }; /** * Turn-phase tool-call rules for this turn. A scoped rule runs when the turn * called a tool its scope names, or when the rule watches files this turn * changed: a rule demanding a call it never got has nothing in the log to * match, and dropping it there is how such a rule stays silent for ever. */ export declare const selectTurnToolCallRules: (rules: readonly Rule[], state: PreconditionState) => Rule[]; /** One model call judging the turn's whole tool-call log against every turn-phase tool-call rule it concerns. */ export declare const runTurnToolCallCheck: (request: TurnToolCallCheckRequest) => Promise; /** * One recorded call against the tool-call rules of a phase. On edit the judge * sees the call itself; on turn it sees a one-entry log, the shape turn rules read. */ export declare const runToolCallCheck: (request: ToolCallCheckRequest) => Promise; //# sourceMappingURL=checkRunner.d.ts.map