/**
 * 内置契约 — 核心基础设施契约 Part 2 (contracts 16–30)
 *
 * 指标、语言策略、任务上下文、技术决策、知识演化、诊断码、
 * 强制护栏、验证、交付就绪、失败报告、降级事件、工作区隔离、
 * 测试策略、机制族映射、语言策略入口
 */
export const BUILTIN_CONTRACTS_CORE_2 = [
    // ── 16. 指标契约 ──
    {
        contract_id: "metric_contract",
        kind: "metric",
        name: "指标契约",
        state: "enforced",
        owner_component: "engine/metric_governance",
        owner_files: ["src/engine/contracts/metric_governance.ts"],
        test_files: ["tests/engine/extension_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/extension_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有治理指标有采集和聚合测试"],
        demotion_conditions: ["指标采集影响性能"],
        evidence_requirements: ["metric governance 场景矩阵通过"],
    },
    // ── 17. 语言策略契约 ──
    {
        contract_id: "language_policy_contract",
        kind: "language_policy",
        name: "语言策略契约",
        state: "advisory",
        owner_component: "engine/core_engineering_principles",
        owner_files: ["src/engine/audit/core_engineering_principles.ts"],
        test_files: ["tests/engine/core_engineering_principles.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["中文语义优先覆盖所有用户可见路径"],
        demotion_conditions: ["语言策略产生误判阻断"],
        evidence_requirements: ["core engineering principles 测试通过"],
    },
    // ── 18. 任务上下文契约 ──
    {
        contract_id: "task_context_contract",
        kind: "task_context",
        name: "任务上下文契约",
        state: "enforced",
        owner_component: "engine/task_context",
        owner_files: ["src/engine/pipeline/task_context.ts"],
        test_files: ["tests/engine/task_context.test.ts"],
        lifecycle_test_files: ["tests/engine/task_context.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["workflow_contract", "main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["TaskContext 生命周期测试覆盖所有状态转移"],
        demotion_conditions: ["TaskContext 逃逸（绕过状态机）"],
        evidence_requirements: ["task_context 生命周期测试通过"],
        policy_id: "CAP-001",
        capability_ids: ["task_context_lifecycle"],
    },
    // ── 19. 技术决策契约 ──
    {
        contract_id: "technology_decision_contract",
        kind: "decision_sovereignty",
        name: "技术决策主权契约",
        state: "enforced",
        owner_component: "engine/technology_decision",
        owner_files: ["src/engine/contracts/technology_decision.ts"],
        test_files: ["tests/engine/extension_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/extension_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["技术决策 human gate 覆盖所有高影响范围"],
        demotion_conditions: ["技术决策误判阻断正常开发"],
        evidence_requirements: ["decision sovereignty 场景矩阵通过"],
    },
    // ── 20. 知识演化契约 ──
    {
        contract_id: "knowledge_evolution_contract",
        kind: "knowledge_evolution",
        name: "知识演化契约",
        state: "advisory",
        owner_component: "engine/knowledge_sovereignty",
        owner_files: ["src/engine/knowledge/knowledge_sovereignty.ts"],
        test_files: ["tests/engine/knowledge_sovereignty.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["knowledge_injection_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["知识演化生命周期有完整测试"],
        demotion_conditions: ["知识演化逻辑产生误判"],
        evidence_requirements: ["knowledge sovereignty 测试通过"],
    },
    // ── 21. 诊断码契约 ──
    {
        contract_id: "diagnostic_code_contract",
        kind: "guard",
        name: "诊断码契约",
        state: "enforced",
        owner_component: "engine/diagnostic_registry",
        owner_files: ["src/engine/audit/diagnostic_registry.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["contract_governance"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 blocking/critical 事件有诊断码"],
        demotion_conditions: ["诊断码检查产生大量误报"],
        evidence_requirements: ["diagnostic registry 测试通过"],
    },
    // ── 22. 强制护栏契约 ──
    {
        contract_id: "enforcement_guard_contract",
        kind: "guard",
        name: "强制护栏契约",
        state: "enforced",
        owner_component: "engine/enforcement_guard",
        owner_files: ["src/engine/contracts/enforcement_guard.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["diagnostic_code_contract", "command_execution_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["覆盖七类护栏且有 must-fail 测试"],
        demotion_conditions: ["护栏阻断产生大量误报"],
        evidence_requirements: ["enforcement guard 测试通过"],
    },
    // ── 23. 验证契约 ──
    {
        contract_id: "verification_contract",
        kind: "verification",
        name: "验证契约",
        state: "enforced",
        owner_component: "engine/verification_contract",
        owner_files: ["src/engine/contracts/verification_contract.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["main_path_integration_contract"],
        consumed_by: ["delivery_readiness_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["VerificationPlan 与 VerificationEvidence 分离有测试"],
        demotion_conditions: ["验证契约检查产生大量误报"],
        evidence_requirements: ["verification contract 测试通过"],
    },
    // ── 24. 交付就绪契约 ──
    {
        contract_id: "delivery_readiness_contract",
        kind: "delivery",
        name: "交付就绪契约",
        state: "enforced",
        owner_component: "engine/delivery_readiness",
        owner_files: ["src/engine/audit/delivery_readiness.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["verification_contract", "enforcement_guard_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["交付许可不触发交付执行有测试"],
        demotion_conditions: ["交付门控产生大量误报"],
        evidence_requirements: ["delivery readiness 测试通过"],
    },
    // ── 25. 失败报告契约 ──
    {
        contract_id: "failure_report_contract",
        kind: "failure",
        name: "失败报告契约",
        state: "enforced",
        owner_component: "engine/failure_report",
        owner_files: ["src/engine/audit/failure_report.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["diagnostic_code_contract", "failure_recovery_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 FailureClass 有恢复策略和测试"],
        demotion_conditions: ["失败分类产生大量误判"],
        evidence_requirements: ["failure report 测试通过"],
    },
    // ── 26. 降级事件契约 ──
    {
        contract_id: "degradation_event_contract",
        kind: "degradation",
        name: "降级事件契约",
        state: "enforced",
        owner_component: "engine/degradation",
        owner_files: ["src/engine/audit/degradation.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["diagnostic_code_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["降级事件用户可见有测试"],
        demotion_conditions: ["降级检查产生大量误报"],
        evidence_requirements: ["degradation 测试通过"],
    },
    // ── 27. 工作区隔离契约 ──
    {
        contract_id: "workspace_isolation_contract",
        kind: "guard",
        name: "工作区隔离契约",
        state: "enforced",
        owner_component: "engine/workspace_lease",
        owner_files: ["src/engine/pipeline/workspace_lease.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["diagnostic_code_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["并发冲突检测有测试"],
        demotion_conditions: ["lease 冲突检测产生大量误报"],
        evidence_requirements: ["workspace lease 测试通过"],
    },
    // ── 28. 测试策略契约 ──
    {
        contract_id: "test_strategy_contract",
        kind: "verification",
        name: "测试策略契约",
        state: "advisory",
        owner_component: "engine/test_strategy",
        owner_files: ["src/engine/audit/test_strategy.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["contract_governance"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["enforced contract lifecycle test 覆盖完整"],
        demotion_conditions: ["测试策略检查产生大量误报"],
        evidence_requirements: ["test strategy 测试通过"],
    },
    // ── 29. 机制族映射契约 ──
    {
        contract_id: "mechanism_family_contract",
        kind: "mechanism_family",
        name: "机制族映射契约",
        state: "deprecated",
        owner_component: "engine/contract_registry",
        owner_files: ["src/engine/contracts/contract_registry.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["contract_governance"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["所有设计机制族有 owner module 和测试"],
        demotion_conditions: ["机制族映射产生大量误报"],
        evidence_requirements: ["mechanism family registry 测试通过"],
        migration_note: "机制族映射已合并到 contract_registry 和 dual_layer_mechanism_registry",
    },
    // ── 30. 语言策略契约 ──
    {
        contract_id: "language_policy_contract_entry",
        kind: "language_policy",
        name: "语言策略契约",
        state: "advisory",
        owner_component: "engine/language_policy_contract",
        owner_files: ["src/engine/knowledge/language_policy_contract.ts"],
        test_files: ["tests/engine/verification_scenario_matrix.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["中文语义覆盖所有用户可见路径"],
        demotion_conditions: ["语言策略产生误判阻断"],
        evidence_requirements: ["language policy 测试通过"],
    },
];
//# sourceMappingURL=builtin_contracts_core_2.js.map