/** * validator.attest — SDK tool wrapping the Validator's "attest" verdict path. * * Accepts a fully-formed {@link ValidatorAttestation} envelope (verdict='attest', * one finding per AC, all with status='pass') and writes one * `evidence_ac_bindings` row per AC with `binding_type='coverage'`. The write * is wrapped in a transaction so partial-bindings cannot leak when the AC * existence check fails mid-pass. * * Auth model — terminal: only an agent with `caller.role === 'validator'` may * invoke this tool. Returns `E_VALIDATOR_AUTH_ROLE` otherwise. * * Per council §3.1 ADR-D rejection: NO new tool registry — uses the existing * `defineSdkTool` factory. Tier scoping is enforced in the tool's `fn`. * * @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 ValidatorAttestation } from '@cleocode/contracts'; import type { RegisteredSdkTool } from '../task-tools/sdk-tool.js'; /** * Input envelope for the {@link validatorAttest} SDK tool. * * @task T10511 */ export interface ValidatorAttestInput { /** Absolute path to the project root. */ projectRoot: string; /** Caller identity — used for role-based auth. */ caller: { /** Canonical agent role; only `'validator'` may invoke. */ role: AgentRole; }; /** Fully-formed attestation envelope to persist. */ attestation: ValidatorAttestation; } /** * Output envelope for the {@link validatorAttest} SDK tool. * * Discriminated by `ok`. On success, contains the count of coverage bindings * written. On failure, contains a structured error code + message. * * @task T10511 */ export type ValidatorAttestOutput = { ok: true; /** Count of `evidence_ac_bindings` rows persisted (one per AC). */ bindingsWritten: number; /** UUIDs assigned to each binding row. */ bindingIds: string[]; /** ISO-8601 timestamp the attestation was processed. */ processedAt: string; } | { ok: false; /** Structured error code (E_VALIDATOR_*). */ code: string; /** Human-readable failure description. */ message: string; }; /** * Registered SDK tool: validator.attest. * * @example * ```typescript * const out = await validatorAttest.invoke({ * projectRoot: '/mnt/projects/cleocode', * caller: { role: 'validator' }, * attestation: { * verdict: 'attest', * taskId: 'T1234', * validatorId: 'validator-prime', * findings: [{ acId: 'uuid-1', status: 'pass', reasoning: 'ok', checkedAt: '...' }], * attestedAt: '2026-05-24T00:00:00Z', * schemaVersion: '1', * }, * }); * if (out.ok) console.log(`wrote ${out.bindingsWritten} coverage bindings`); * ``` * * @task T10511 */ export declare const validatorAttest: RegisteredSdkTool>; //# sourceMappingURL=validator-attest.d.ts.map