/**
 * 内置契约 — 核心基础设施契约 Part 1 (contracts 1–15)
 *
 * 工作流、工具调用、机制、产物、输入物料、命令执行、隐私、配置、
 * 用户反馈、主链路接入、路由决策、契约治理、知识注入、失败恢复、
 * 降级
 */
export const BUILTIN_CONTRACTS_CORE_1 = [
    // ── 1. 工作流契约 ──
    {
        contract_id: "workflow_contract",
        kind: "workflow",
        name: "工作流契约",
        state: "enforced",
        owner_component: "engine/workflow_contract_registry",
        owner_files: ["src/engine/workflow/workflow_contract_registry.ts"],
        test_files: ["tests/engine/workflow_contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/workflow_contract_registry.test.ts"],
        knowledge_refs: ["templates/internal/rules/工作流契约规则.md"],
        prompt_refs: [],
        depends_on: ["route_decision_contract"],
        consumed_by: ["tool_invocation_contract", "main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 workflow 有集成测试"],
        demotion_conditions: ["workflow regression check 漏检"],
        evidence_requirements: ["validateWorkflowContracts 无 hard_fail"],
        policy_id: "CAP-021",
        capability_ids: ["workflow_contract"],
    },
    // ── 2. 工具调用契约 ──
    {
        contract_id: "tool_invocation_contract",
        kind: "guard",
        name: "工具调用契约",
        state: "enforced",
        owner_component: "engine/tool_invocation_contract_registry",
        owner_files: ["src/engine/contracts/tool_invocation_contract_registry.ts"],
        test_files: ["tests/engine/tool_invocation_contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/tool_invocation_contract_registry.test.ts"],
        knowledge_refs: ["templates/internal/rules/工具调用规则.md"],
        prompt_refs: [],
        depends_on: ["workflow_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 MCP tool 有 invocation test"],
        demotion_conditions: ["tool invocation regression 漏检"],
        evidence_requirements: ["validateToolInvocation 无 hard_fail"],
        policy_id: "CAP-022",
        capability_ids: ["tool_invocation_contract"],
    },
    // ── 3. 机制契约 ──
    {
        contract_id: "mechanism_contract",
        kind: "mechanism_family",
        name: "机制契约",
        state: "enforced",
        owner_component: "engine/mechanism_contract_registry",
        owner_files: ["src/engine/contracts/mechanism_contract_registry.ts"],
        test_files: ["tests/engine/mechanism_contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/mechanism_contract_registry.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["workflow_contract", "tool_invocation_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 P0 机制有 lifecycle test"],
        demotion_conditions: ["机制 regression check 漏检"],
        evidence_requirements: ["validateMechanismContracts 无 hard_fail"],
    },
    // ── 4. 产物契约 ──
    {
        contract_id: "artifact_contract",
        kind: "delivery",
        name: "产物契约",
        state: "enforced",
        owner_component: "engine/artifact_contract_registry",
        owner_files: ["src/engine/contracts/artifact_contract_registry.ts"],
        test_files: ["tests/engine/artifact_contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/artifact_contract_registry.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["workflow_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 artifact kind 有测试"],
        demotion_conditions: ["artifact regression 漏检"],
        evidence_requirements: ["validateArtifactContracts 无 hard_fail"],
    },
    // ── 5. 输入物料契约 ──
    {
        contract_id: "input_material_contract",
        kind: "verification",
        name: "输入物料契约",
        state: "enforced",
        owner_component: "engine/input_material_contract_registry",
        owner_files: ["src/engine/pipeline/input_material_contract_registry.ts"],
        test_files: ["tests/engine/input_material_contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/input_material_contract_registry.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["privacy_secret_contract"],
        consumed_by: ["workflow_contract", "main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 material kind 有测试"],
        demotion_conditions: ["material regression 漏检"],
        evidence_requirements: ["input material contract 验证通过"],
    },
    // ── 6. 命令执行契约 ──
    {
        contract_id: "command_execution_contract",
        kind: "guard",
        name: "命令执行契约",
        state: "enforced",
        owner_component: "engine/command_execution_contract",
        owner_files: ["src/engine/contracts/command_execution_contract.ts"],
        test_files: ["tests/engine/command_execution_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/command_execution_contract.test.ts"],
        knowledge_refs: ["templates/internal/rules/命令执行规则.md"],
        prompt_refs: [],
        depends_on: ["tool_invocation_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["覆盖所有 destructive 命令模式"],
        demotion_conditions: ["destructive 命令漏检"],
        evidence_requirements: ["命令分级测试通过"],
        policy_id: "CAP-025",
        capability_ids: ["command_execution"],
    },
    // ── 7. 隐私/敏感信息契约 ──
    {
        contract_id: "privacy_secret_contract",
        kind: "guard",
        name: "隐私/敏感信息契约",
        state: "enforced",
        owner_component: "engine/privacy_secret_contract",
        owner_files: ["src/engine/audit/privacy_secret_contract.ts"],
        test_files: ["tests/engine/privacy_secret_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/privacy_secret_contract.test.ts"],
        knowledge_refs: ["templates/internal/rules/敏感信息处理规则.md"],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["input_material_contract", "main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["覆盖所有 PII 类型"],
        demotion_conditions: ["secret scanner 产生大量误报"],
        evidence_requirements: ["RedactionRecord 测试通过"],
        policy_id: "CAP-024",
        capability_ids: ["privacy_secret"],
    },
    // ── 8. 配置优先级契约 ──
    {
        contract_id: "config_precedence_contract",
        kind: "guard",
        name: "配置优先级契约",
        state: "enforced",
        owner_component: "engine/config_precedence_contract",
        owner_files: ["src/engine/config/config_precedence_contract.ts"],
        test_files: ["tests/engine/config_precedence_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/config_precedence_contract.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有优先级冲突有测试"],
        demotion_conditions: ["优先级回归漏检"],
        evidence_requirements: ["validateConfigPrecedence 无 hard_fail"],
    },
    // ── 9. 用户反馈契约 ──
    {
        contract_id: "user_feedback_contract",
        kind: "delivery",
        name: "用户反馈契约",
        state: "enforced",
        owner_component: "engine/user_feedback_contract",
        owner_files: ["src/engine/contracts/user_feedback_contract.ts"],
        test_files: ["tests/engine/user_feedback_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/user_feedback_contract.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有反馈类型有测试"],
        demotion_conditions: ["反馈回归漏检"],
        evidence_requirements: ["用户反馈契约验证通过"],
    },
    // ── 10. 主链路接入契约 ──
    {
        contract_id: "main_path_integration_contract",
        kind: "verification",
        name: "主链路接入防孤岛契约",
        state: "enforced",
        owner_component: "engine/main_path_integration_contract",
        owner_files: ["src/engine/audit/main_path_integration_contract.ts"],
        test_files: ["tests/engine/main_path_integration_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/main_path_integration_contract.test.ts"],
        knowledge_refs: ["templates/internal/rules/防孤岛实现规则.md"],
        prompt_refs: [],
        depends_on: [
            "workflow_contract",
            "tool_invocation_contract",
            "mechanism_contract",
            "artifact_contract",
        ],
        consumed_by: ["contract_governance"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有 enforced 模块有 entry trace"],
        demotion_conditions: ["orphan scan 产生大量误报"],
        evidence_requirements: ["validateMainPathIntegration 无 hard_fail"],
        policy_id: "CAP-023",
        capability_ids: ["main_path_integration"],
    },
    // ── 11. 路由决策契约 ──
    {
        contract_id: "route_decision_contract",
        kind: "workflow",
        name: "路由决策契约",
        state: "enforced",
        owner_component: "engine/route_decision_contract_verifier",
        owner_files: ["src/engine/contracts/route_decision_contract_verifier.ts"],
        test_files: ["tests/engine/route_decision_contract.test.ts"],
        lifecycle_test_files: ["tests/engine/route_decision_contract.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [],
        consumed_by: ["workflow_contract"],
        hard_fail_allowed: true,
        promotion_conditions: ["所有路由决策有测试"],
        demotion_conditions: ["路由决策回归漏检"],
        evidence_requirements: ["verifyRouteDecisionContract 无 hard_fail"],
    },
    // ── 12. 契约治理契约（问题二十自治理） ──
    {
        contract_id: "contract_governance",
        kind: "verification",
        name: "契约治理契约",
        state: "enforced",
        owner_component: "engine/contract_registry",
        owner_files: ["src/engine/contracts/contract_registry.ts"],
        test_files: ["tests/engine/contract_registry.test.ts"],
        lifecycle_test_files: ["tests/engine/contract_registry.test.ts"],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: [
            "main_path_integration_contract",
            "workflow_contract",
            "tool_invocation_contract",
        ],
        consumed_by: [],
        hard_fail_allowed: true,
        promotion_conditions: ["所有核心契约已在 Unified Contract Registry 登记"],
        demotion_conditions: ["契约治理检查产生大量误报"],
        evidence_requirements: [
            "validateContractRegistry 无 hard_fail",
            "所有核心 contract 已登记",
            "policy_id 到 contract_id 映射完整",
        ],
    },
    // ── 13. 知识注入契约 ──
    {
        contract_id: "knowledge_injection_contract",
        kind: "knowledge_injection",
        name: "知识注入契约",
        state: "advisory",
        owner_component: "engine/knowledge_injection_boundary",
        owner_files: ["src/engine/knowledge/knowledge_injection_boundary.ts"],
        test_files: ["tests/engine/knowledge_injection_boundary.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["workflow_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["知识注入边界有完整集成测试"],
        demotion_conditions: ["知识注入产生安全逃逸"],
        evidence_requirements: ["knowledge injection boundary 测试通过"],
    },
    // ── 14. 失败/恢复契约 ──
    {
        contract_id: "failure_recovery_contract",
        kind: "failure",
        name: "失败/恢复契约",
        state: "advisory",
        owner_component: "engine/failure_classifier",
        owner_files: ["src/engine/audit/failure_classifier.ts"],
        test_files: ["tests/engine/failure_classifier.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["workflow_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["所有失败分类有恢复策略测试"],
        demotion_conditions: ["失败恢复逻辑产生误判"],
        evidence_requirements: ["failure classifier 测试通过"],
    },
    // ── 15. 降级契约 ──
    {
        contract_id: "degradation_contract",
        kind: "degradation",
        name: "降级契约",
        state: "advisory",
        owner_component: "engine/runtime_safety",
        owner_files: ["src/engine/audit/runtime_safety.ts"],
        test_files: ["tests/engine/runtime_safety.test.ts"],
        lifecycle_test_files: [],
        knowledge_refs: [],
        prompt_refs: [],
        depends_on: ["failure_recovery_contract"],
        consumed_by: ["main_path_integration_contract"],
        hard_fail_allowed: false,
        promotion_conditions: ["降级事件用户可见测试通过"],
        demotion_conditions: ["降级逻辑产生误判"],
        evidence_requirements: ["runtime safety 测试通过"],
    },
];
//# sourceMappingURL=builtin_contracts_core.js.map