/** * Read-only staleness of a task's recorded gates (T14037): the checks * `cleo complete` applies, run where a reader looks, so `cleo show` and * `cleo done --plan` say a recorded pass no longer stands before complete * refuses it. * * Two rules, both the ones complete uses: * - re-validation of each recorded gate's hard atoms ({@link revalidateEvidence}: * a commit gone, a file or report whose bytes changed); * - for `testsPassed` / `qaPassed`, the superseded rules * ({@link testsPassedSupersededReason}, {@link qaPassedSupersededReason}): a * moved tree, or a scoped result that does not carry across the merge. * * Executes no tool and records nothing. A commit re-validation may refresh * its revalidation cache, as complete's does. * * @task T14037 */ import type { Task, VerificationGate } from '@cleocode/contracts'; import { type ChangeMergeState, type MergedVerdict } from './affected-scope.js'; /** One recorded gate whose evidence no longer stands. */ export interface GateStaleness { /** The gate recorded as passed. */ readonly gate: VerificationGate; /** Why it no longer stands, naming the atoms, files or commits involved. */ readonly reason: string; /** Which rule refused it: atom re-validation, or the superseded rule. */ readonly source: 'revalidate' | 'superseded'; } /** The lazy merge state and tree the superseded rules read. */ export interface GateStalenessProbe { /** Merge state of the task's change; resolved only when a rule needs it. */ readonly mergeState: () => Promise | ChangeMergeState | MergedVerdict; /** Current tree hash of the task's checkout. */ readonly currentTree: () => Promise | string | null; /** The task's checkout. */ readonly root: () => string; } /** * Every recorded passed gate of `task` whose evidence no longer stands. * * @param task - The task (its `verification` is read). * @param storeRoot - CLEO store root. * @param probe - Merge state, tree and root; defaults to the task's change-set root. * @param opts - `offline`: judge only the local rules (atom re-validation and a * moved tree); the merge state is never looked up (no `gh`), so a scoped * result is judged as before its merge. `cleo done --plan` gives the full verdict. * @returns The stale gates, in gate order; empty when every recorded pass stands. * @example * ```ts * for (const s of await gateStaleness(task, root)) console.warn(`${s.gate}: ${s.reason}`); * ``` * @task T14037 */ export declare function gateStaleness(task: Task, storeRoot: string, probe?: GateStalenessProbe, opts?: { offline?: boolean; }): Promise; //# sourceMappingURL=gate-staleness.d.ts.map