/**
 * 验证契约 — 问题十二 (Verification Contract)。
 *
 * 核心规则:
 * - VerificationPlan 只是计划，不是结果
 * - VerificationResult 必须来自真实执行或明确 not_executed
 * - 未验证不得 delivered
 * - delivery_readiness 不得触发 delivery_execution
 */
export type VerificationStatus = "pending" | "executing" | "passed" | "failed" | "not_executed" | "skipped";
export interface VerificationPlan {
    plan_id: string;
    task_id: string;
    commands: string[];
    acceptance_criteria: string[];
    created_at: string;
    status: "plan_only";
}
export interface VerificationEvidence {
    evidence_id: string;
    plan_id: string;
    task_id: string;
    command: string;
    exit_code: number | null;
    stdout_hash: string;
    stderr_hash: string;
    duration_ms: number;
    executed_at: string;
    redacted: boolean;
}
export interface VerificationResult {
    result_id: string;
    task_id: string;
    plan_id: string;
    status: VerificationStatus;
    total_commands: number;
    passed_commands: number;
    failed_commands: number;
    evidence_ids: string[];
    findings: VerificationFinding[];
    completed_at: string;
    /**
     * 来源标记 — 只有 "record_verification_execution" 的 passed 结果可被 delivery 消费。
     * "direct" 表示通过 createVerificationResult 直接构造，delivery 必须拒绝。
     */
    provenance: "record_verification_execution" | "direct";
    /** plan.commands 中已被 execution_records 覆盖的命令 */
    covered_commands?: string[];
    /** plan.commands 中缺少对应 execution_record 的命令 */
    missing_commands?: string[];
    /** 证据格式校验是否全部通过 */
    evidence_integrity_passed?: boolean;
}
export interface VerificationFinding {
    rule: string;
    severity: "hard_fail" | "warning" | "advisory";
    message_zh: string;
    diagnostic_code: string;
}
/**
 * 创建验证计划（不执行）。
 */
export declare function createVerificationPlan(taskId: string, commands: string[], acceptanceCriteria: string[]): VerificationPlan;
/**
 * 检查是否为 plan_only（无真实执行）。
 * VerificationPlan.status === "plan_only" 时不得视为 VerificationResult。
 */
export declare function isPlanOnly(plan: VerificationPlan): boolean;
/**
 * 创建验证结果（内部使用，provenance = "direct"）。
 * delivery_readiness 必须拒绝 provenance="direct" 的 passed 结果。
 * 唯一合法 passed 入口是 recordVerificationExecution。
 */
export declare function createVerificationResult(taskId: string, planId: string, evidenceIds: string[], commandResults: Array<{
    passed: boolean;
    diagnostic_code?: string;
}>): VerificationResult;
/**
 * 创建未执行的验证结果。
 */
export declare function createNotExecutedResult(taskId: string, planId: string, reason: string): VerificationResult;
/**
 * 真实执行记录 — recordVerificationExecution 的输入。
 * 每条记录必须包含完整的执行证据，缺字段则该条判定为失败。
 */
export interface ExecutionRecord {
    command: string;
    exit_code: number;
    stdout_hash: string;
    stderr_hash: string;
    started_at: string;
    finished_at: string;
    evidence_id: string;
}
/**
 * 校验执行记录: 证据格式、命令合法性、evidence_id 唯一性、时间合法性。
 * 返回校验失败的记录索引及对应的 diagnostic_code。
 */
export declare function validateExecutionRecords(plan: VerificationPlan, records: ExecutionRecord[]): Array<{
    index: number;
    diagnostic_code: string;
    message_zh: string;
}>;
/**
 * 计算命令覆盖率: plan.commands 中被 records 覆盖的比例。
 */
export declare function computeCommandCoverage(plan: VerificationPlan, records: ExecutionRecord[]): {
    covered_commands: string[];
    missing_commands: string[];
};
/**
 * 录入真实执行结果 — VerificationResult.status = "passed" 的唯一合法入口。
 *
 * 规则:
 * - plan 为 null → hard fail (SF-VERIFY-5002)
 * - records 为空 → not_executed
 * - 非计划命令 → 该条 failed (SF-VERIFY-5006)
 * - stdout/stderr hash 格式非法 → 该条 failed
 * - evidence_id 重复 → 该条 failed
 * - 时间倒挂 → 该条 failed
 * - plan.commands 未全覆盖 → failed (SF-VERIFY-5003)
 * - 所有 exit_code === 0 且全覆盖且无格式错误 → passed
 */
export declare function recordVerificationExecution(taskId: string, planId: string, records: ExecutionRecord[], plan: VerificationPlan | null): VerificationResult;
/**
 * 验证: VerificationPlan 不得当作 VerificationEvidence。
 */
export declare function validateVerificationSeparation(plan: VerificationPlan, result: VerificationResult | undefined): Array<{
    error: string;
    severity: "hard_fail" | "warning";
}>;
//# sourceMappingURL=verification_contract.d.ts.map