import type { Rule, Verdict } from "oh-my-plumb-schema"; import type { ToolCallEntry } from "./session.js"; /** * The deterministic half of a model rule: what a turn did, read off the turn's * own state instead of asked of a judge. * * On a turn check the judge sees this turn's diff and log, so "did this turn * change a file in scope" looks answerable. It is not: a judge reads its own * priors and the session before it, so once a session has edited in scope the * question answers `true` on every later turn, even one that touched nothing, * and no turn can ever clear it. These two tests read one thing each — the * files this turn changed, and the calls this turn made — and nothing else. */ export type PreconditionState = { /** Repo-relative paths this turn changed. */ files: readonly string[]; /** The turn's tool-call log. */ log: readonly ToolCallEntry[]; logComplete?: boolean; }; /** * What this turn settles without a judge, as the verdict a judge would have * given — or nothing, when the rule still needs one. * * `changes` decides whether the rule is in play at all: a turn that changed * nothing the rule watches has nothing to answer for, on any turn of any * session. `ran` is the rule's own requirement, so it settles both ways: the * call is there and the rule is met, or it is absent and the rule is broken. * Neither answer is a judgement, and asking a model either one is how a rule * ends up firing on every turn of a session or on none. */ export declare const settlePrecondition: (rule: Rule, state: PreconditionState) => Verdict | undefined; /** * Splits the rules the way the turn will judge them: those it settles itself, * with the verdict it settles them at, and those that still need a judge. A * cleared rule is recorded rather than dropped, so `report` shows a rule that * was never in play apart from a rule that was asked and passed. */ export declare const settlePreconditions: (rules: readonly Rule[], state: PreconditionState) => { settled: Verdict[]; judgeable: Rule[]; }; /** * Whether this turn is one the rule concerns at all. * * A turn-phase call rule is normally selected by the tools its scope names — * which means a rule demanding a call it never got is invisible, since the * call it wanted is exactly what the log is missing. A precondition's * `changes` globs are the other way in: the turn changed a file the rule * watches, so the rule is in play whatever tools the log happens to hold. */ export declare const concernsTurn: (rule: Rule, state: PreconditionState) => boolean; //# sourceMappingURL=precondition.d.ts.map