/**
 * Evidence-based gate validation (ADR-051 / T832).
 *
 * Parses and validates evidence atoms for `cleo verify`. Each atom is checked
 * against the filesystem, git, vitest JSON output, or toolchain exit code.
 * Soft evidence (`url:`, `note:`) is accepted without validation.
 *
 * @task T832
 * @adr ADR-051
 */
import type { EvidenceAtom, GateEvidence, VerificationGate } from '@cleocode/contracts';
/**
 * Valid tool names recognised by the `tool:<name>` evidence atom.
 *
 * Tool invocation definitions live in {@link TOOL_COMMANDS}.
 *
 * @task T832
 */
export declare const VALID_TOOLS: readonly ["biome", "tsc", "eslint", "pnpm-build", "pnpm-test", "security-scan"];
/**
 * Type of a supported evidence tool.
 *
 * @task T832
 */
export type EvidenceTool = (typeof VALID_TOOLS)[number];
interface ToolCommand {
    cmd: string;
    args: string[];
}
/**
 * Tool name → shell command + args.  Each tool is executed with `cwd = project
 * root` and stdout/stderr captured. Exit 0 is required for acceptance.
 *
 * @task T832
 */
export declare const TOOL_COMMANDS: Record<EvidenceTool, ToolCommand>;
/**
 * Minimum evidence required for each verification gate.
 *
 * - A single atom kind means at least one atom of that kind MUST be present.
 * - A tuple of kinds means all listed kinds MUST be present.
 * - Alternatives are modeled as separate sets — if ANY set is satisfied the
 *   evidence is accepted.
 *
 * @task T832
 * @adr ADR-051 §2.3
 */
export declare const GATE_EVIDENCE_MINIMUMS: Record<VerificationGate, EvidenceAtom['kind'][][]>;
/**
 * Result of parsing a raw evidence string into structured atoms.
 *
 * @task T832
 */
export interface ParsedEvidence {
    atoms: ParsedAtom[];
}
/**
 * An atom that has been parsed from the CLI syntax but not yet validated
 * against filesystem / git / tools.
 *
 * @task T832
 */
export type ParsedAtom = {
    kind: 'commit';
    sha: string;
} | {
    kind: 'files';
    paths: string[];
} | {
    kind: 'test-run';
    path: string;
} | {
    kind: 'tool';
    tool: string;
} | {
    kind: 'url';
    url: string;
} | {
    kind: 'note';
    note: string;
};
/**
 * Parse the CLI `--evidence` string into structured atoms.
 *
 * Syntax:
 *   evidence-list := atom ';' atom ';' ...
 *   atom          := kind ':' payload
 *   payload for files: comma-separated paths
 *   payload for everything else: opaque string until next ';'
 *
 * @param raw - Raw CLI string from `--evidence`
 * @returns Parsed atoms ready for {@link validateEvidence}
 * @throws CleoError(VALIDATION_ERROR) for malformed input
 *
 * @example
 * ```ts
 * parseEvidence('commit:abc123;files:a.ts,b.ts;tool:biome');
 * // => { atoms: [{kind:'commit',sha:'abc123'}, ...] }
 * ```
 *
 * @task T832
 */
export declare function parseEvidence(raw: string): ParsedEvidence;
/**
 * Result of validating one atom — success carries the validated form
 * (with sha256 / exit codes populated), failure carries a human-readable
 * reason string.
 *
 * @task T832
 */
export type AtomValidation = {
    ok: true;
    atom: EvidenceAtom;
} | {
    ok: false;
    reason: string;
    codeName: string;
};
/**
 * Validate a single parsed atom against the filesystem / git / tools.
 *
 * @param parsed - Parsed atom from {@link parseEvidence}
 * @param projectRoot - Absolute path to project root (for resolving files, git)
 * @returns Validation outcome with canonicalised form on success
 *
 * @task T832
 * @adr ADR-051 §3
 */
export declare function validateAtom(parsed: ParsedAtom, projectRoot: string): Promise<AtomValidation>;
/**
 * Check whether a set of validated atoms satisfies the minimum evidence
 * required for a given gate.
 *
 * @param gate - The gate being verified
 * @param atoms - Validated atoms
 * @returns null when satisfied; otherwise the reason message
 *
 * @task T832
 * @adr ADR-051 §2.3
 */
export declare function checkGateEvidenceMinimum(gate: VerificationGate, atoms: EvidenceAtom[]): string | null;
/**
 * Compose a {@link GateEvidence} record from validated atoms.
 *
 * @param atoms - Validated evidence atoms
 * @param capturedBy - Agent identifier
 * @param override - True when CLEO_OWNER_OVERRIDE is set
 * @param overrideReason - Reason supplied with the override
 * @returns Canonical GateEvidence ready to persist
 *
 * @task T832
 */
export declare function composeGateEvidence(atoms: EvidenceAtom[], capturedBy: string, override?: boolean, overrideReason?: string): GateEvidence;
/**
 * Result of re-verifying stored evidence at complete time.
 *
 * @task T832
 */
export interface RevalidationResult {
    stillValid: boolean;
    failedAtoms: Array<{
        atom: EvidenceAtom;
        reason: string;
    }>;
}
/**
 * Re-validate stored evidence to detect tampering between verify and complete.
 *
 * Hard atoms (commit, files, test-run, tool) are re-executed. Soft atoms
 * (url, note, override) pass through unchanged.
 *
 * @param evidence - Previously-stored evidence
 * @param projectRoot - Absolute path to project root
 * @returns Revalidation outcome
 *
 * @task T832
 * @adr ADR-051 §5 / §8 (Decision 8)
 */
export declare function revalidateEvidence(evidence: GateEvidence, projectRoot: string): Promise<RevalidationResult>;
export {};
//# sourceMappingURL=evidence.d.ts.map