/**
 * Dual-layer mechanism definitions — extension section.
 * Auto-extracted from the monolithic dual_layer_mechanism_registry.
 */
export const MECHANISM_CONTRACTS_EXTENSION = [
    // ══ 扩展平台双层机制 ══
    // ── 15. 决策主权 ──
    {
        mechanism_id: "mc-decision-sovereignty",
        mechanism_name: "技术决策主权",
        owner_issue_id: "问题十六",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/技术决策主权规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/架构设计工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "supporting" },
            ],
            injected_routes: ["code_execution", "multi_stage_plan"],
            injected_workflows: ["code_change", "architecture_design", "existing_system_gap_analysis"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/technology_decision.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["validateTechnologyDecision", "evaluateDecisionExecution"],
            state_effects: ["decision_status → allow/block"],
            hard_fail_conditions: ["architecture 决策无 human gate", "推荐状态允许执行"],
            degradation_behavior: "决策不合规时阻断执行",
        },
        evidence_layer: {
            outputs: ["TechnologyDecisionContract", "DecisionValidationResult"],
            reports: ["DecisionReview"],
            diagnostic_codes: ["no-human-gate", "executing-recommended"],
            task_context_facts: ["decision_scope", "decision_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["decision_human_gate_present"],
            regression_cases: ["architecture_requires_human_gate", "recommended_cannot_execute"],
            drift_checks: ["decision_status_matches_workflow"],
        },
        status: "dual_layer_enforced",
    },
    // ── 16. 脑暴与方案探索 ──
    {
        mechanism_id: "mc-brainstorm-contract",
        mechanism_name: "脑暴与方案探索",
        owner_issue_id: "问题四十二",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/脑暴与方案探索规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/架构设计工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "supporting" },
            ],
            injected_routes: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design", "existing_system_gap_analysis"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/brainstorm_contract.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["validateBrainstormSession", "canBrainstormAutoExecute"],
            state_effects: ["brainstorm_status → allow/block auto-execute"],
            hard_fail_conditions: ["脑暴无候选方案", "脑暴绕过决策主权"],
            degradation_behavior: "脑暴不完整时阻断",
        },
        evidence_layer: {
            outputs: ["BrainstormSession", "BrainstormValidationResult"],
            reports: ["BrainstormReview"],
            diagnostic_codes: ["empty-session", "auto-execute-blocked"],
            task_context_facts: ["brainstorm_trigger", "brainstorm_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["brainstorm_has_options"],
            regression_cases: ["cannot_auto_execute", "empty_session_invalid"],
            drift_checks: ["brainstorm_options_match_decision"],
        },
        status: "dual_layer_enforced",
    },
    // ── 17. 细节纪律 ──
    {
        mechanism_id: "mc-detail-discipline",
        mechanism_name: "细节纪律",
        owner_issue_id: "问题二十六",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/细节纪律规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/测试优先编码工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "supporting" },
            ],
            injected_routes: ["code_execution", "verification_only"],
            injected_workflows: ["code_change", "test_first_coding", "local_browser_acceptance"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/detail_discipline.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["performDetailCheck", "checkDetailGateIntegration"],
            state_effects: ["detail_check_status → allow/block delivery"],
            hard_fail_conditions: ["缺失关键维度", "blocking 检查未接入交付 gate"],
            degradation_behavior: "细节不足时阻断交付",
        },
        evidence_layer: {
            outputs: ["DetailDisciplineCheck", "DetailGateIntegrationResult"],
            reports: ["DetailDisciplineReport"],
            diagnostic_codes: ["missing-dimension", "gate-not-integrated"],
            task_context_facts: ["detail_check_status", "blocking"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["detail_dimensions_covered"],
            regression_cases: ["blocking_without_gate_fails", "missing_dimension_blocks"],
            drift_checks: ["detail_check_matches_workflow"],
        },
        status: "dual_layer_enforced",
    },
    // ── 18. 第一性原理 ──
    {
        mechanism_id: "mc-first-principles",
        mechanism_name: "第一性原理",
        owner_issue_id: "问题二十七",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/第一性原理推理规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/架构设计工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "supporting" },
            ],
            injected_routes: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design", "existing_system_gap_analysis"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/first_principles.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["performFirstPrinciplesCheck", "validateFirstPrinciplesForHighImpact"],
            state_effects: ["first_principles_status → allow/block"],
            hard_fail_conditions: ["缺少 fundamental_need", "高影响变更未推理"],
            degradation_behavior: "推理不完整时阻断",
        },
        evidence_layer: {
            outputs: ["FirstPrinciplesFrame", "FirstPrinciplesCheckResult"],
            reports: ["FirstPrinciplesReview"],
            diagnostic_codes: ["missing-fundamental-need", "high-impact-unframed"],
            task_context_facts: ["first_principles_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["fundamental_need_present"],
            regression_cases: ["missing_fundamental_need_fails", "high_impact_requires_frame"],
            drift_checks: ["principles_frame_matches_decision"],
        },
        status: "dual_layer_enforced",
    },
    // ── 19. 架构设计审查 ──
    {
        mechanism_id: "mc-architecture-design",
        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: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/architecture_design_contract.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["reviewArchitectureDesign", "validateOutputDirectoryDecision"],
            state_effects: ["architecture_review → allow/block delivery"],
            hard_fail_conditions: ["输出目录未确认", "Mermaid 不可渲染"],
            degradation_behavior: "设计不合规时阻断交付",
        },
        evidence_layer: {
            outputs: ["ArchitectureDesignContract", "ArchitectureReviewResult"],
            reports: ["ArchitectureDesignReview"],
            diagnostic_codes: ["directory-not-confirmed", "mermaid-render-failed"],
            task_context_facts: ["architecture_design_status"],
        },
        verification_layer: {
            tests: ["tests/engine/extension_scenario_matrix.test.ts"],
            runtime_checks: ["output_directory_confirmed"],
            regression_cases: ["unconfirmed_directory_blocks", "mermaid_render_check"],
            drift_checks: ["architecture_contract_matches_workflow"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 通用决策研讨机制（问题六十一） ──
    // 架构决策研讨作为内置子包保留，mc-architecture-decision-workshop 不代表整个问题六十一
    {
        mechanism_id: "mc-decision-workshop",
        mechanism_name: "通用决策研讨机制",
        owner_issue_id: "问题六十一",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/通用决策研讨规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design", "technology_selection", "data_migration", "security_policy", "deployment", "refactor"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/decision_workshop.ts", "src/server/tools/index.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["requiresDecisionWorkshop", "createDecisionWorkshop", "evaluateDecisionWorkshop", "applyDecisionWorkshopGate"],
            state_effects: ["decision_workshop → allow/block execution"],
            hard_fail_conditions: ["必须域未确认", "现有系统证据缺失", "用户确认引用缺失"],
            degradation_behavior: "返回待讨论域和待确认清单",
        },
        evidence_layer: {
            outputs: ["DecisionWorkshopContract", "DecisionWorkshopGateResult"],
            reports: ["DecisionRecord"],
            diagnostic_codes: ["SF-DECISION-WORKSHOP-REQUIRED"],
            task_context_facts: ["decision_workshop"],
        },
        verification_layer: {
            tests: ["tests/engine/decision_workshop.test.ts"],
            runtime_checks: ["all_required_domains_confirmed"],
            regression_cases: ["tech_selection_blocks_without_confirmation", "low_risk_skips_workshop"],
            drift_checks: ["workshop_matches_task_intent"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 架构决策研讨与确认门（问题六十一内置子包） ──
    {
        mechanism_id: "mc-architecture-decision-workshop",
        mechanism_name: "架构决策研讨与确认门",
        owner_issue_id: "问题六十一",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/架构决策研讨规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/架构决策研讨工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["multi_stage_plan"],
            injected_workflows: ["architecture_design"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/architecture_decision_workshop.ts", "src/server/tools/index.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["evaluateArchitectureDecisionWorkshop", "checkArchitectureDecisionWorkshopGate"],
            state_effects: ["architecture_decision_workshop → allow/block formal design generation"],
            hard_fail_conditions: ["六域决策未确认", "现有系统证据缺失", "输出范围未确认"],
            degradation_behavior: "返回待讨论域和待确认清单",
        },
        evidence_layer: {
            outputs: ["ArchitectureDecisionWorkshopContract", "ArchitectureWorkshopGateResult"],
            reports: ["ArchitectureDecisionRecord"],
            diagnostic_codes: ["SF-ARCH-WORKSHOP-REQUIRED"],
            task_context_facts: ["architecture_decision_workshop"],
        },
        verification_layer: {
            tests: ["tests/engine/architecture_decision_workshop.test.ts", "tests/adapters/architecture_design_workshop_mainpath.test.ts"],
            runtime_checks: ["six_domains_confirmed"],
            regression_cases: ["missing_confirmation_blocks_design", "low_risk_skips_workshop"],
            drift_checks: ["workshop_matches_architecture_output"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 标准资产覆盖机制（问题六十二） ──
    // mc-design-artifact-pack 仅作为首批 P0 子机制保留
    {
        mechanism_id: "mc-standard-asset-coverage",
        mechanism_name: "标准资产覆盖审计",
        owner_issue_id: "问题六十二",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/标准资产覆盖规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["validate", "multi_stage_plan"],
            injected_workflows: ["all"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/templates/standard_asset_coverage.ts"],
            registries: ["mechanism_contract_registry", "consumable_asset_registry"],
            entrypoints: ["auditStandardAssetCoverage"],
            state_effects: ["coverage_report → 覆盖完整性"],
            hard_fail_conditions: ["P0 资产缺少标准承载路径", "P0 资产未注册", "P0 资产缺少 owner"],
            degradation_behavior: "覆盖缺口时阻断发布",
        },
        evidence_layer: {
            outputs: ["StandardAssetCoverageReport", "StandardAssetCoverageEntry"],
            reports: [],
            diagnostic_codes: ["SF-COVERAGE-0001"],
            task_context_facts: ["standard_asset_coverage"],
        },
        verification_layer: {
            tests: ["tests/engine/standard_asset_coverage.test.ts"],
            runtime_checks: ["all_p0_types_covered"],
            regression_cases: ["missing_bearer_blocks", "unregistered_asset_blocks"],
            drift_checks: ["coverage_matches_registry"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 设计产物包与存量复验门（问题六十二子机制） ──
    {
        mechanism_id: "mc-design-artifact-pack",
        mechanism_name: "设计产物包与存量复验门",
        owner_issue_id: "问题六十二",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/设计产物包规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
                { path: "templates/procedures/设计产物生成与复验工作流.md", asset_kind: "pipeline_procedure", consumption_mode: "required" },
            ],
            injected_routes: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/design_artifact_pack.ts", "src/server/tools/index.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["verifyDesignArtifactPack"],
            state_effects: ["design_artifact_pack → implementation_ready/block delivery"],
            hard_fail_conditions: ["字段级 API 缺失", "SQL 无效", "跨产物冲突", "旧文档未复验"],
            degradation_behavior: "复验失败时阻断编码与交付并请求修复",
        },
        evidence_layer: {
            outputs: ["DesignArtifactPackContract", "DesignArtifactVerificationResult"],
            reports: ["DesignConsistencyReport"],
            diagnostic_codes: ["SF-DESIGN-PACK-VERIFY-FAILED", "SF-DESIGN-PACK-NOT-READY"],
            task_context_facts: ["design_artifact_pack"],
        },
        verification_layer: {
            tests: ["tests/engine/design_artifact_pack.test.ts", "tests/adapters/architecture_design_workshop_mainpath.test.ts"],
            runtime_checks: ["real_design_files_verified"],
            regression_cases: ["api_fields_required", "postgres_invalid_sql_blocks", "cross_document_conflict_blocks"],
            drift_checks: ["openapi_sql_markdown_consistency"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 标准资产契约化 ──
    {
        mechanism_id: "mc-standard-asset-contract",
        mechanism_name: "标准资产契约化",
        owner_issue_id: "问题六十三",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/验收模版输出契约规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["multi_stage_plan", "single_artifact"],
            injected_workflows: ["architecture_design"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/templates/standard_asset_contract.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["verifyStandardAssetContract"],
            state_effects: ["template_verified → 允许下游消费"],
            hard_fail_conditions: ["P0 模板缺契约字段", "验收失败未进入 repair_reverify"],
            degradation_behavior: "验收失败时阻断编码与交付并请求修复",
        },
        evidence_layer: {
            outputs: ["StandardAssetContract", "ContractVerificationResult"],
            reports: [],
            diagnostic_codes: ["SF-CONTRACT-0001", "SF-CONTRACT-0002", "SF-CONTRACT-0003"],
            task_context_facts: ["template_verified"],
        },
        verification_layer: {
            tests: ["tests/engine/standard_asset_contract.test.ts"],
            runtime_checks: ["contract_fields_complete"],
            regression_cases: ["api_field_table_missing_blocks", "draft_not_used_for_implementation"],
            drift_checks: ["contract_matches_template_content"],
        },
        status: "dual_layer_enforced",
    },
    // ── 发布问题: 模板资产可见性与注入边界 ──
    {
        mechanism_id: "mc-template-asset-visibility",
        mechanism_name: "模板资产可见性与注入边界",
        owner_issue_id: "问题六十四",
        priority: "P0",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/模版资产可见性规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["init", "sync-templates", "validate", "multi_stage_plan"],
            injected_workflows: ["all"],
            target_hosts: ["claude_code", "codex", "trae"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/templates/template_asset_visibility.ts"],
            registries: ["mechanism_contract_registry", "consumable_asset_registry"],
            entrypoints: ["filterAssetsForUserProject", "checkAssetVisibilityGate"],
            state_effects: ["internal 资产不同步到用户项目", "scaffold 不进入知识索引"],
            hard_fail_conditions: ["内部资产泄漏到用户项目", "可见性冲突未解决"],
            degradation_behavior: "冲突资产隔离并请求用户确认",
        },
        evidence_layer: {
            outputs: ["AssetVisibilityReport", "VisibilityConflictResult"],
            reports: [],
            diagnostic_codes: ["SF-ASSET-0001", "SF-ASSET-0002", "SF-ASSET-0003"],
            task_context_facts: ["asset_visibility"],
        },
        verification_layer: {
            tests: ["tests/engine/template_asset_visibility.test.ts"],
            runtime_checks: ["all_assets_have_visibility_metadata"],
            regression_cases: ["internal_not_synced", "scaffold_not_indexed", "fallback_respects_gate"],
            drift_checks: ["visibility_field_matches_content"],
        },
        status: "dual_layer_enforced",
    },
];
//# sourceMappingURL=mechanisms_extension.js.map