/** * validator.reject — SDK tool wrapping the Validator's "reject" verdict path. * * Accepts a fully-formed {@link ValidatorRejection} envelope (verdict='reject', * at least one finding with status='fail' or 'inconclusive'), validates it * against the Zod schema, and emits a structured rejection envelope. * * IMPORTANT: validator.reject does NOT write `evidence_ac_bindings` rows — * rejection is the ABSENCE of binding. The downstream AC-coverage gate * (T10509) sees no coverage rows for the rejected ACs and refuses * `cleo complete` accordingly. * * Auth model — terminal: only an agent with `caller.role === 'validator'` may * invoke this tool. Returns `E_VALIDATOR_AUTH_ROLE` otherwise. * * @arch SDK Tool (Category B) — harness-agnostic, contracts-typed * @task T10511 * @epic T10383 (E-VALIDATOR-ROLE) * @saga T10377 (SG-IVTR-AC-BINDING) */ import { type AgentRole, type ValidatorRejection } from '@cleocode/contracts'; import type { RegisteredSdkTool } from '../task-tools/sdk-tool.js'; /** * Input envelope for the {@link validatorReject} SDK tool. * * @task T10511 */ export interface ValidatorRejectInput { /** Absolute project root (kept for symmetry with attest; unused for reads). */ projectRoot: string; /** Caller identity — used for role-based auth. */ caller: { /** Canonical agent role; only `'validator'` may invoke. */ role: AgentRole; }; /** Fully-formed rejection envelope. */ rejection: ValidatorRejection; } /** * Output envelope for the {@link validatorReject} SDK tool. * * Discriminated by `ok`. On success, echoes the rejection envelope so * downstream callers can persist or surface it. On failure, contains a * structured error code + message. NO bindings are ever written. * * @task T10511 */ export type ValidatorRejectOutput = { ok: true; /** Echo of the validated rejection envelope. */ rejection: ValidatorRejection; /** Count of failing or inconclusive findings — for summary UIs. */ failingFindingCount: number; /** AC ids that did not pass — useful for downstream remediation routing. */ failingAcIds: string[]; /** ISO-8601 timestamp the rejection was processed. */ processedAt: string; } | { ok: false; /** Structured error code (E_VALIDATOR_*). */ code: string; /** Human-readable failure description. */ message: string; }; /** * Registered SDK tool: validator.reject. * * @example * ```typescript * const out = await validatorReject.invoke({ * projectRoot: '/mnt/projects/cleocode', * caller: { role: 'validator' }, * rejection: { * verdict: 'reject', * taskId: 'T1234', * validatorId: 'validator-prime', * findings: [ * { acId: 'uuid-1', status: 'fail', reasoning: 'no test', checkedAt: '...' }, * ], * summary: 'AC1 unsatisfied — test missing.', * rejectedAt: '2026-05-24T00:00:00Z', * schemaVersion: '1', * }, * }); * if (out.ok) console.log(`rejected ${out.failingFindingCount} ACs`); * ``` * * @task T10511 */ export declare const validatorReject: RegisteredSdkTool>; //# sourceMappingURL=validator-reject.d.ts.map