/**
 * Plan / Proposal First Gate — 问题五十五核心机制。
 *
 * 任何写入、编码、构建、Docker、迁移、发布、外部副作用或交付动作前，
 * AI 必须先给出与任务风险匹配的计划或方案。
 *
 * 核心原则: 先说明计划，再执行动作。
 */
/** 计划门任务类型 */
export type PlanGateTaskType = "simple_answer" | "read_only_analysis" | "code_change" | "file_edit" | "test_or_review" | "architecture_design" | "existing_system_development" | "local_acceptance" | "batch_documentation_update" | "migration" | "delete_or_overwrite" | "high_risk_operation";
/** 计划等级 */
export type PlanGateLevel = "none_with_reason" | "brief_plan" | "execution_plan" | "option_proposal" | "human_confirmation_required";
/** 计划提案证据 */
export interface PlanProposalEvidence {
    evidence_id: string;
    task_id: string;
    plan_id: string;
    plan_level: PlanGateLevel;
    task_type: PlanGateTaskType;
    plan_summary_zh: string;
    proposed_steps: string[];
    verification_plan: string[];
    risks: string[];
    needs_user_confirmation: boolean;
    user_confirmation_ref?: string;
    evidence_refs: string[];
    created_at: string;
}
/** 用户确认引用 */
export interface UserConfirmationRef {
    confirmation_id: string;
    task_id: string;
    plan_id: string;
    confirmed_by: string;
    confirmed_at: string;
    scope: string[];
    caveats: string[];
}
/** 验证计划引用 */
export interface VerificationPlanRef {
    verification_id: string;
    task_id: string;
    plan_id: string;
    verification_type: "build" | "test" | "browser" | "manual" | "automated";
    commands: string[];
    expected_outcomes: string[];
    evidence_required: string[];
}
/** 计划前置门评估输入 */
export interface PlanProposalGateInput {
    task_id: string;
    task_type: PlanGateTaskType;
    user_intent: string;
    plan_level?: PlanGateLevel;
    plan_summary_zh?: string;
    proposed_steps?: string[];
    verification_plan?: string[];
    risks?: string[];
    needs_user_confirmation?: boolean;
    user_confirmation_ref?: string;
    evidence_refs?: string[];
    /** 是否为自动修复循环中的一步 */
    is_auto_repair_step?: boolean;
    /** 自动修复的原始计划 ID */
    auto_repair_origin_plan_id?: string;
    /** scope 是否扩大 */
    scope_expanded?: boolean;
    /** 风险是否升高 */
    risk_elevated?: boolean;
}
/** 计划前置门评估结果 */
export interface PlanProposalGateResult {
    passed: boolean;
    plan_gate_status: "passed" | "blocked" | "manual_required";
    required_level: PlanGateLevel;
    current_level?: PlanGateLevel;
    reason_zh: string;
    violations: PlanGateViolation[];
    diagnostic_code?: string;
    evidence_refs: string[];
    blocked_actions: string[];
}
/** 计划门违规 */
export interface PlanGateViolation {
    rule: string;
    severity: "warning" | "hard_fail";
    reason_zh: string;
    diagnostic_code: string;
}
/** 动作类型 */
export type PlanGatedAction = "write_file" | "code_change" | "build" | "docker" | "migrate" | "publish" | "external_side_effect" | "deliver" | "test_suite";
/**
 * 评估计划前置门 — 检查任务是否有足够等级的计划。
 */
export declare function evaluatePlanProposalGate(input: PlanProposalGateInput): PlanProposalGateResult;
/**
 * 在执行动作前检查 plan gate — 返回是否允许执行。
 */
export declare function requirePlanBeforeAction(gateResult: PlanProposalGateResult, action: PlanGatedAction): {
    allowed: boolean;
    reason_zh: string;
    diagnostic_code?: string;
};
/**
 * 验证动作是否在已确认计划范围内。
 */
export declare function validateActionWithinPlan(plannedScope: string[], actionTarget: string, planLevel: PlanGateLevel): {
    allowed: boolean;
    reason_zh: string;
};
/**
 * 创建计划提案证据。
 */
export declare function createPlanProposalEvidence(input: PlanProposalGateInput): PlanProposalEvidence;
/**
 * 推断任务类型 — 从用户意图文本映射到 PlanGateTaskType。
 */
export declare function inferPlanGateTaskType(intent: string, route?: string): PlanGateTaskType;
/**
 * 检查是否为 "只要求 review" 场景 — 如是，不得擅自修复。
 */
export declare function isReviewOnlyIntent(intent: string): boolean;
/**
 * 确认参数 — 计划确认后，旧确认只能覆盖原计划范围。
 */
export declare function validateConfirmationScope(originalConfirmation: UserConfirmationRef, newScope: string[]): {
    valid: boolean;
    reason_zh: string;
};
export declare const PLAN_GATE_DIAGNOSTIC_CODES: Record<string, string>;
//# sourceMappingURL=plan_proposal_gate.d.ts.map