/**
 * 施工指令契约 (Instruction Contract)
 *
 * 问题五十八：确保 AI 任务目标、范围、真实消费者、失败闭环和验收证据受机制约束。
 * 任何实现/编码/写文件操作前，必须存在包含完整字段的施工指令。
 */
export type InstructionStatus = "draft" | "confirmed" | "executing" | "completed" | "blocked";
export interface InstructionContract {
    instruction_id: string;
    task_id: string;
    /** 目标：本次施工要达成什么 */
    goal: string;
    /** 范围：涉及哪些文件/模块/功能 */
    scope: string[];
    /** 非目标：明确不做什么 */
    non_goals: string[];
    /** 落点：产出物放在哪里 */
    output_location: string;
    /** 验收标准：怎样算完成 */
    acceptance_criteria: string[];
    /** 禁止绕过项：不可跳过的检查 */
    bypass_prohibited: string[];
    /** 确认证据：用户确认引用 */
    confirmation_ref?: string;
    status: InstructionStatus;
    created_at: string;
    /** 高影响标记 */
    high_impact?: boolean;
    /** 风险等级 */
    risk?: "low" | "medium" | "high";
    /** 不确定性标记 */
    uncertainty?: boolean;
    /** 证据驱动字段（问题六十） */
    required_evidence_sources?: string[];
    retrieval_plan?: Record<string, unknown>;
    evidence_matrix?: Record<string, unknown>;
    unsupported_claim_policy?: "block" | "warn" | "allow_with_confirmation";
    uncertainty_policy?: "require_confirmation" | "allow_with_flag" | "block";
    conflict_resolution_policy?: "user_decides" | "prefer_fresh" | "prefer_authoritative" | "block";
}
export interface InstructionValidationResult {
    valid: boolean;
    missing_fields: string[];
    reason: string;
}
export interface InstructionCompletenessResult {
    complete: boolean;
    missing: string[];
    severity: "hard_fail" | "advisory";
    reason_zh: string;
}
export interface InstructionIssueCandidate {
    task_id: string;
    description: string;
    source: "user_prompt" | "plan_output" | "clarification" | "auto_detected";
    suggested_fields: Partial<InstructionContract>;
}
export interface InstructionEnforcementResult {
    allowed: boolean;
    reason_zh: string;
    missing_evidence: string[];
    diagnostic_code: string;
}
/**
 * 校验施工指令完整性：必须包含目标、范围、非目标、落点、验收、禁止绕过项。
 */
export declare function validateInstructionContract(contract: Partial<InstructionContract>): InstructionValidationResult;
/**
 * 检查施工指令完整性（用于 gate 检查）。
 */
export declare function checkInstructionCompleteness(contract: Partial<InstructionContract> | undefined | null): InstructionCompletenessResult;
/**
 * 登记施工指令候选项（用于从用户输入或计划输出中提取指令雏形）。
 */
export declare function registerInstructionIssueCandidate(candidate: InstructionIssueCandidate): InstructionContract;
/**
 * 在实现/编码前强制执行施工指令检查。
 * 无完整指令时返回 blocked，不能假通过。
 */
export declare function enforceInstructionBeforeImplementation(contract: Partial<InstructionContract> | undefined | null, action: string, taskRisk?: "low" | "medium" | "high" | "critical"): Promise<InstructionEnforcementResult>;
//# sourceMappingURL=instruction_contract.d.ts.map