/**
 * Dual-layer mechanism definitions — release section.
 * Auto-extracted from the monolithic dual_layer_mechanism_registry.
 */
export const MECHANISM_CONTRACTS_RELEASE = [
    // ── 20. 现有系统分析 ──
    {
        mechanism_id: "mc-existing-system-analysis",
        mechanism_name: "现有系统差距分析",
        owner_issue_id: "问题五十",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/procedures/现有系统差距分析工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["read_only_analysis", "multi_stage_plan"],
            injected_workflows: ["existing_system_gap_analysis"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/existing_system_analysis.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["detectProjectContext", "checkAnalysisGate"],
            state_effects: ["analysis_gate → allow/block coding"],
            hard_fail_conditions: ["existing_system 未分析", "未知项目类型未 human gate"],
            degradation_behavior: "未分析时阻断编码",
        },
        evidence_layer: {
            outputs: ["ProjectContextDetection", "AnalysisGateResult"],
            reports: ["ExistingSystemAnalysisReport"],
            diagnostic_codes: ["analysis-not-done", "unknown-project-type"],
            task_context_facts: ["analysis_gate_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["analysis_gate_checked"],
            regression_cases: ["unanalyzed_blocks_coding", "unknown_type_requires_human"],
            drift_checks: ["analysis_matches_coding_readiness"],
        },
        status: "dual_layer_enforced",
    },
    // ── 21. 编码准备门 ──
    {
        mechanism_id: "mc-coding-readiness",
        mechanism_name: "编码准备门",
        owner_issue_id: "问题五十一",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/procedures/测试优先编码工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["code_execution"],
            injected_workflows: ["test_first_coding", "code_change"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/coding_readiness_gate.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["evaluateCodingReadiness", "createTestFirstPlan"],
            state_effects: ["coding_readiness → allow/block implementation"],
            hard_fail_conditions: ["缺少验证计划", "编码不是第一步但无准备"],
            degradation_behavior: "编码准备不足时阻断实现",
        },
        evidence_layer: {
            outputs: ["CodingReadinessContract", "CodingReadinessEvaluation"],
            reports: ["CodingReadinessReport"],
            diagnostic_codes: ["no-verification-plan", "coding-first-without-prep"],
            task_context_facts: ["coding_readiness_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["verification_plan_present"],
            regression_cases: ["no_plan_blocks_coding", "test_first_required"],
            drift_checks: ["readiness_matches_code_change"],
        },
        status: "dual_layer_enforced",
    },
    // ── 22. 本地浏览器验收 ──
    {
        mechanism_id: "mc-local-acceptance",
        mechanism_name: "本地浏览器验收",
        owner_issue_id: "问题五十二",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/procedures/本地浏览器验收工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["verification_only", "read_only_analysis"],
            injected_workflows: ["local_browser_acceptance"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/local_docker_acceptance.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["validateFinalAccess", "performBrowserAcceptance"],
            state_effects: ["final_access → allow/block delivery"],
            hard_fail_conditions: ["无本地 URL", "有可运行服务但只停在单测"],
            degradation_behavior: "无本地 URL 时阻断交付",
        },
        evidence_layer: {
            outputs: ["LocalDockerAcceptanceContract", "FinalAccessValidation"],
            reports: ["LocalAcceptanceReport"],
            diagnostic_codes: ["no-local-url", "unit-test-only"],
            task_context_facts: ["acceptance_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["final_urls_provided"],
            regression_cases: ["no_url_blocks_delivery", "docker_priority"],
            drift_checks: ["acceptance_matches_delivery"],
        },
        status: "dual_layer_enforced",
    },
    // ── 23. 演进回归门控 ──
    {
        mechanism_id: "mc-evolution-regression",
        mechanism_name: "演进回归门控",
        owner_issue_id: "问题五十四",
        priority: "P2",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/演进回归门控规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["operation"],
            injected_workflows: [],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/evolution_regression_gate.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["performEvolutionGate", "checkDuplicateIssue"],
            state_effects: ["evolution_gate → allow/block new issue"],
            hard_fail_conditions: ["重复问题未检测", "pending 状态通过"],
            degradation_behavior: "演进门控不通过时阻断",
        },
        evidence_layer: {
            outputs: ["EvolutionGateResult", "DuplicateCheckResult"],
            reports: ["EvolutionRegressionReport"],
            diagnostic_codes: ["duplicate-issue", "pending-gate"],
            task_context_facts: ["evolution_gate_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["evolution_gate_checked"],
            regression_cases: ["pending_blocks", "duplicate_detected"],
            drift_checks: ["evolution_gate_matches_issues"],
        },
        status: "dual_layer_enforced",
    },
    // ── 机制 ──
    // ── plan_proposal_gate (问题五十五) ──
    {
        mechanism_id: "mc-plan-proposal-gate",
        mechanism_name: "Plan / Proposal First Gate",
        owner_issue_id: "问题五十五",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/计划前置门规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["code_change", "operation", "analysis", "review"],
            injected_workflows: ["all"],
            target_hosts: ["claude_code", "codex", "trae"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/pipeline/plan_proposal_gate.ts"],
            registries: ["mechanism_contract_registry", "contract_registry"],
            entrypoints: ["evaluatePlanProposalGate", "requirePlanBeforeAction", "validateActionWithinPlan"],
            state_effects: ["plan_gate_status → passed/blocked/manual_required"],
            hard_fail_conditions: ["缺计划写入", "高风险无确认", "计划外动作", "review被升级为执行"],
            degradation_behavior: "Plan Gate 未通过时阻断所有写入动作",
        },
        evidence_layer: {
            outputs: ["PlanProposalGateResult", "PlanProposalEvidence", "UserConfirmationRef", "VerificationPlanRef"],
            reports: ["PlanProposalGateEvaluation"],
            diagnostic_codes: ["SF-PLAN-5001", "SF-PLAN-5002", "SF-PLAN-5003", "SF-PLAN-5010"],
            task_context_facts: ["plan_proposal_gate", "plan_proposal_evidence", "user_confirmation_ref", "verification_plan_ref"],
        },
        verification_layer: {
            tests: ["tests/engine/release_gate_scenario_matrix.test.ts"],
            runtime_checks: ["plan_gate_evaluated_before_write", "confirmation_required_for_high_risk"],
            regression_cases: ["code_change_no_plan_blocked", "high_risk_no_confirmation_blocked", "scope_expand_requires_reconfirm"],
            drift_checks: ["plan_gate_status_matches_actual"],
        },
        status: "dual_layer_enforced",
    },
    // ── core_experience_principle (问题五十六) ──
    {
        mechanism_id: "mc-core-experience-principle",
        mechanism_name: "Core Experience Principle",
        owner_issue_id: "问题五十六",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/核心体验原则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["all"],
            injected_workflows: ["all"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/audit/core_experience_principle.ts"],
            registries: ["mechanism_contract_registry", "contract_registry"],
            entrypoints: ["evaluateCoreExperiencePrinciple", "evaluateNoFalseCompletion", "evaluateMechanismFriction"],
            state_effects: ["evaluation → passed/blocked/manual_required"],
            hard_fail_conditions: ["机制未接主线", "用户路径过长", "硬规则降级为warning", "假完成"],
            degradation_behavior: "体验原则违反时阻断 Release Gate",
        },
        evidence_layer: {
            outputs: ["CoreExperiencePrincipleEvaluation", "UserPathFrictionReport", "RepairOrManualRequiredDecision"],
            reports: ["CoreExperiencePrincipleReport"],
            diagnostic_codes: ["SF-EXP-5601", "SF-EXP-5602", "SF-EXP-5603", "SF-EXP-5605", "SF-EXP-5607"],
            task_context_facts: ["core_experience_evaluation"],
        },
        verification_layer: {
            tests: ["tests/engine/release_gate_scenario_matrix.test.ts"],
            runtime_checks: ["all_new_mechanisms_evaluated", "no_fake_completion"],
            regression_cases: ["false_completion_blocked", "hard_fail_downgrade_blocked", "heavy_process_on_low_risk_blocked"],
            drift_checks: ["core_experience_vs_new_mechanisms"],
        },
        status: "dual_layer_enforced",
    },
    // ── knowledge_asset_governance (问题五十七) ──
    {
        mechanism_id: "mc-knowledge-asset-governance",
        mechanism_name: "Knowledge Asset Governance",
        owner_issue_id: "问题五十七",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/知识资产治理规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["knowledge_index_build", "intent_route", "intent_expand", "template_sync", "release_migration"],
            injected_workflows: ["knowledge_index_build", "intent_expand", "template_sync"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/knowledge/knowledge_asset_schema.ts"],
            registries: ["mechanism_contract_registry", "contract_registry", "consumable_asset_registry"],
            entrypoints: ["validateKnowledgeAssets", "buildKnowledgeAssetRegistry", "detectDuplicateAndConflicts", "resolveCanonicalAuthority"],
            state_effects: ["audit → passed/failed", "consumption_snapshot → indexed/injected/filtered/degraded/conflict_resolutions"],
            hard_fail_conditions: ["缺 frontmatter", "重复 canonical", "owner 缺失", "deprecated 被注入", "消费链路不可追踪"],
            degradation_behavior: "知识资产审计失败时阻断 prompt 注入",
        },
        evidence_layer: {
            outputs: ["KnowledgeAssetAuditReport", "KnowledgeConsumptionSnapshot", "MigrationDryRunResult"],
            reports: ["KnowledgeAssetAuditReport", "MigrationCompatibilityReport"],
            diagnostic_codes: ["SF-KA-5701", "SF-KA-5702", "SF-KA-5703", "SF-KA-5704", "SF-KA-5705", "SF-KA-5706", "SF-KA-5709"],
            task_context_facts: ["knowledge_audit_passed", "consumption_snapshot_verified"],
        },
        verification_layer: {
            tests: ["tests/engine/release_gate_scenario_matrix.test.ts"],
            runtime_checks: ["templates/knowledge 全量扫描", "消费链路可追踪"],
            regression_cases: ["missing_frontmatter_blocked", "duplicate_canonical_blocked", "deprecated_injection_blocked", "user_modified_protected"],
            drift_checks: ["knowledge_registry_vs_actual_assets"],
        },
        status: "dual_layer_enforced",
    },
    // ── 31. 意图扩展 ──
    {
        mechanism_id: "mc-intent-expander",
        mechanism_name: "意图扩展",
        owner_issue_id: "问题三",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/procedures/任务拆解流程.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["code_execution", "read_only_analysis", "single_artifact", "source_extraction"],
            injected_workflows: ["code_change", "planning"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/pipeline/intent_expander.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["expand"],
            state_effects: ["expansion → prompt/scope/acceptance_criteria", "matched_knowledge → template_injection"],
            hard_fail_conditions: ["expansion 无 route_decision", "required 模板缺失且未报错"],
            degradation_behavior: "confidence < 阈值时返回 clarification prompt 而非执行指令",
        },
        evidence_layer: {
            outputs: ["ExpandResult", "prompt", "scope", "acceptance_criteria"],
            reports: ["ExpansionReport"],
            diagnostic_codes: ["expansion-low-confidence", "expansion-missing-required-template"],
            task_context_facts: ["expansion", "prompt"],
        },
        verification_layer: {
            tests: ["tests/engine/intent_expander_integration.test.ts"],
            runtime_checks: ["expansion_requires_route_decision"],
            regression_cases: ["source_extraction_no_code_modification", "read_only_no_modification"],
            drift_checks: ["expander_routes_match_intent_router"],
        },
        status: "dual_layer_enforced",
    },
];
//# sourceMappingURL=mechanisms_release.js.map