/** * Verification-gate policy — the single resolver for WHICH verification gates * a task must have set to `true`, and whether that requirement is enforced. * * `cleo complete` and `cleo release plan` both consume this so the two can * never disagree about what "verified" means. Before T12359 the release plan * checked only that evidence atoms were PRESENT, and shipped fifteen tasks * whose `implemented` gate was `false`. * * @task T12359 */ import type { Task, VerificationGate } from '@cleocode/contracts'; export { GATE_PROFILE_LABEL_PREFIX, GATE_PROFILES, type GateProfile, gateProfileLabelProblem, gateProfileOf, implementedCodeEvidence, isDocumentArtifact, isDocumentEvidencePath, } from './gate-notes.js'; /** * Type guard: `true` when `value` names a canonical {@link VerificationGate}. * * @param value - Candidate gate name (typically from project config). * @returns Whether `value` is a known verification gate. */ export declare function isVerificationGate(value: string): value is VerificationGate; /** * Resolved verification-gate policy for a project. * * @task T12359 */ export interface VerificationGatePolicy { /** * Whether verification gates are enforced. Mirrors `verification.enabled` * from the project config; under VITEST it defaults to `false` when the * project config does not set it explicitly. */ enabled: boolean; /** Gates that must be `true` before a task counts as verified, in config order. */ requiredGates: VerificationGate[]; /** * Gates required per evidence kind (T14001); read through * {@link requiredGatesFor} with the kind `taskEvidenceKind` gives (code * whenever the work touched code). `code` is `requiredGates` and the * non-code kinds `requiredGates` without `testsPassed`/`qaPassed`, unless * the project overrides them. */ requiredGatesByKind: Readonly>; } /** The evidence kinds `classifyEvidenceTask` sorts tasks into. */ export type EvidenceTaskKind = 'code' | 'documentation' | 'research'; /** * The gates a task of `kind` must have set before it counts as verified: the * one rule `cleo verify`, `cleo done --plan`, `cleo complete` and * `cleo release plan` share (T14001). * * @param policy - The resolved policy. * @param kind - The task's evidence kind (`classifyEvidenceTask`). * @returns The required gates, in config order. */ export declare function requiredGatesFor(policy: Pick, kind: EvidenceTaskKind): VerificationGate[]; /** * Resolve the project's verification-gate policy — the same policy * `cleo complete` enforces. * * @param cwd - Project root (defaults to the resolved project root). * @returns The enforcement flag and the required gate list. * * @task T12359 */ export declare function loadVerificationGatePolicy(cwd?: string): Promise; /** * Return the required gates that are not `true` on a verification record. * * @param gates - The task's `verification.gates` map (may be absent). * @param requiredGates - Gates the policy requires. * @returns Required gates whose value is anything other than `true`. * * @task T12359 */ export declare function missingRequiredGates(gates: Partial> | null | undefined, requiredGates: readonly VerificationGate[]): VerificationGate[]; /** * The evidence kind a task's own record decides before any change set is * read, or `null` when its change set decides (T14048, T14065): research and * spike kinds are research; declared files decide next (all documents: * documentation, any code file: code); a bug, or acceptance criteria naming * a code path, is code. A task declaring a gate profile ({@link gateProfileOf}, * T13474) is then research for its gates. A task with none of these is * undecided. * * @param task - The task's kind, declared files, acceptance criteria and labels. * @returns The decided kind, or `null`. * @task T14048 * @task T13474 */ export declare function declaredEvidenceKind(task: Pick & Partial>): EvidenceTaskKind | null; /** * Classify a task for evidence purposes: `research` (research/spike kind), * `documentation` or `code`. * * {@link declaredEvidenceKind} decides first. An undecided task is read from * what it changed (T14048): an inspected change set (`changedPaths`, a * `pr:`/`commit:` atom's diff) of documents only makes it documentation, one * with any code path keeps it code. Failing a change set, acceptance criteria * that name documents (and, being undecided, no code) or a docs label make it * documentation (T14065). A docs label therefore never hides code. * * Exported so the read-only `cleo done --plan` planner chooses the same * documentary path the validators accept — one classification, not two. It * also picks the gates a task needs ({@link requiredGatesFor}, T14001). * * @param context - Task context; only `task` and `changedPaths` are read. * @returns The evidence classification. * @task T12624 * @task T14048 * @task T14065 */ export declare function classifyEvidenceTask(context: { readonly task: Pick; /** The change set inspected for this evidence, when there is one (T14048). */ readonly changedPaths?: readonly string[]; }): EvidenceTaskKind; //# sourceMappingURL=verification-policy.d.ts.map