/** * Typed-gate PREVIEW — run a task's `AcceptanceGate[]` and report the results * without recording anything. * * ## Why this exists (T12308) * * Typed gates had exactly one way to execute: as a side effect of * `cleo verify --gate --evidence `. Every typed gate on the * task ran, implicitly, during a call whose stated purpose was to ATTEST a * different gate — and the only way to discover whether they would pass was to * make that attestation. * * The explicit driver had been documented since T768 and is still emitted into * every validation-stage spawn prompt ("Run `cleo verify --run` and * capture output"), but the flag was dropped from the command, so an agent * following CLEO's own instruction got `Unknown flag` and had no supported way * to ask the question. Restoring it as a read-only operation is what makes the * two surfaces agree: `--run` observes, `--evidence` attests. * * Nothing here persists. No verification record, no receipt, no gate state — * which is also why it does not need the criterion bindings `runTaskGates` * builds: a result that is never stored cannot be mistaken for evidence later. * The one write is the ADR-061 result cache (T12621): a PASS is cached by gate * hash + HEAD + dirty-tree fingerprint, so the attesting write that follows * reuses it instead of executing the gate a second time. The cached observation * is re-bound to the task by that write; it is never itself a record. * * @task T12308 * @task T12621 */ import type { AcceptanceGateResult, ValidateGateParams } from '@cleocode/contracts'; /** Outcome of a typed-gate preview run. */ export interface TaskGatePreview { /** Task whose gates were run. */ taskId: string; /** Number of typed gates found on the task's acceptance array. */ gateCount: number; /** One result per typed gate, in acceptance-array order. */ results: AcceptanceGateResult[]; /** * True when no gate returned `fail` or `error`. * * `warn` (a failed advisory gate) and `skipped` (a manual gate) do not * withhold it — they carry their own meaning in `results`. */ passed: boolean; /** * Always `false`, and present on purpose. * * The caller is reading gate outcomes outside the attestation path, and the * response has to say so in its own data rather than relying on the reader * knowing which verb they used. It is about VERIFICATION only: a pass is * still cached for the attesting write — see {@link TaskGatePreview.cache}. */ persisted: false; /** * Whether each result was cached for a later `--no-run` or attesting write * (T13512), and why not when it was not. A cached pass is keyed on `head`, * the dirty-tree fingerprint, the cwd and the gate's inputs, so a write after * any of those changes misses it. */ cache?: { /** HEAD the passes were cached under, or null outside a git checkout. */ head: string | null; /** One entry per result, in `results` order. */ entries: Array<{ index: number; req?: string; cached: boolean; reason?: string; }>; }; /** Present when the task carries no typed gates, explaining the empty result. */ note?: string; } /** * Run every typed gate on a task and return the results, persisting nothing. * * Signature follows ADR-057: `(projectRoot, params)`, uniform with every other * core function behind a dispatch operation. * * @param projectRoot - Absolute CLEO store root. * @param params - Dispatch params; `taskId` selects the task, `agent` attributes the results. * @returns Per-gate results plus an aggregate verdict. * @throws When the task does not exist, or the project has no stable identity. * * @example * ```ts * const preview = await previewTaskGates(projectRoot, { taskId: 'T489' }); * if (!preview.passed) console.error(preview.results); * ``` * * @task T12308 */ export declare function previewTaskGates(projectRoot: string, params: ValidateGateParams): Promise; //# sourceMappingURL=gate-preview.d.ts.map