/**
 * Dual-layer mechanism definitions — infra section.
 * Auto-extracted from the monolithic dual_layer_mechanism_registry.
 */
export const MECHANISM_CONTRACTS_INFRA = [
    // ── 11. 任务上下文生命周期（补齐） ──
    {
        mechanism_id: "mc-task-context-lifecycle",
        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/internal/patterns/任务上下文生命周期.md", asset_kind: "capability_knowledge_doc", consumption_mode: "supporting" },
            ],
            injected_routes: ["code_execution", "multi_stage_plan", "read_only_analysis"],
            injected_workflows: ["code_change", "verification", "delivery"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/pipeline/task_context.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["create", "updateStatus", "load"],
            state_effects: ["status transitions", "fact accumulation"],
            hard_fail_conditions: ["invalid status transition", "stdout/stderr in TaskContext"],
            degradation_behavior: "TaskContext 不可用时降级为无状态模式",
        },
        evidence_layer: {
            outputs: ["TaskContext"],
            reports: ["TaskContextSnapshot"],
            diagnostic_codes: ["invalid-transition", "forbidden-field"],
            task_context_facts: ["status", "verification_result", "injection_report"],
        },
        verification_layer: {
            tests: ["tests/engine/task_context.test.ts"],
            runtime_checks: ["status_transition_gate"],
            regression_cases: ["no_invalid_transition", "no_stdout_in_context"],
            drift_checks: ["context_fields_match_spec"],
        },
        status: "dual_layer_enforced",
    },
    // ── 12. 执行守卫评估（补齐） ──
    {
        mechanism_id: "mc-guard-evaluation",
        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: ["code_execution", "multi_stage_plan"],
            injected_workflows: ["code_change", "verification"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/release/verifier.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["generateVerifyCommands"],
            state_effects: ["guard_evaluation_executed"],
            hard_fail_conditions: ["guard_bypass"],
            degradation_behavior: "guard 评估集成在各契约内，无独立降级",
        },
        evidence_layer: {
            outputs: ["VerifyResult"],
            reports: ["GuardEvaluationReport"],
            diagnostic_codes: ["guard-failure"],
            task_context_facts: ["guard_status"],
        },
        verification_layer: {
            tests: ["tests/engine/verifier_phase25.test.ts"],
            runtime_checks: ["guard_evaluation_gate"],
            regression_cases: ["guard_blocks_execution"],
            drift_checks: ["guard_rules_match_verifier"],
        },
        status: "dual_layer_enforced",
    },
    // ── 13. 注册表基础设施（补齐） ──
    {
        mechanism_id: "mc-registry-infrastructure",
        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: ["init"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: [
                "src/engine/contracts/mechanism_contract_registry/index.ts",
                "src/engine/templates/consumable_asset_registry.ts",
            ],
            registries: ["mechanism_contract_registry", "consumable_asset_registry"],
            entrypoints: ["listMechanismContracts", "listBuiltinConsumableAssets"],
            state_effects: ["contract registration", "asset discovery"],
            hard_fail_conditions: ["registry entry missing lifecycle test"],
            degradation_behavior: "registry 不可用时整体降级",
        },
        evidence_layer: {
            outputs: ["MechanismContract[]", "ConsumableAssetRef[]"],
            reports: ["RegistryHealthReport"],
            diagnostic_codes: ["missing-lifecycle-test"],
            task_context_facts: [],
        },
        verification_layer: {
            tests: ["tests/engine/mechanism_contract_registry.test.ts", "tests/engine/consumable_asset_registry.test.ts"],
            runtime_checks: ["registry_health_check"],
            regression_cases: ["all_contracts_have_lifecycle_tests"],
            drift_checks: ["registry_entries_match_code_modules"],
        },
        status: "dual_layer_enforced",
    },
    // ── 14. 零配置初始化 ──
    {
        mechanism_id: "mc-zero-config-init",
        mechanism_name: "零配置初始化",
        owner_issue_id: "问题六",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/零配置初始化规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["operation"],
            injected_workflows: ["init"],
            target_hosts: ["claude_code", "codex", "trae"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/config/zero_config_init.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["detectFingerprint", "generateConfigDraft", "validateConfigDraft"],
            state_effects: ["config_initialized"],
            hard_fail_conditions: ["init without config validation"],
            degradation_behavior: "降级为手动配置",
        },
        evidence_layer: {
            outputs: ["ProjectConfig"],
            reports: ["InitReport"],
            diagnostic_codes: ["config-missing-field"],
            task_context_facts: ["init_status"],
        },
        verification_layer: {
            tests: ["tests/engine/zero_config_init.test.ts"],
            runtime_checks: ["init_config_valid"],
            regression_cases: ["init_without_interactive"],
            drift_checks: ["init_fields_match_config"],
        },
        status: "dual_layer_enforced",
    },
    // ── 15. 输入材料契约 ──
    {
        mechanism_id: "mc-input-material-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: ["code_execution", "read_only_analysis", "source_extraction"],
            injected_workflows: ["expand", "privacy_gate"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/pipeline/input_material_contract_registry.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["canSupportStrongConclusion", "isWriteAllowed"],
            state_effects: ["material_validated"],
            hard_fail_conditions: ["unregistered material source"],
            degradation_behavior: "降级为宽松模式",
        },
        evidence_layer: {
            outputs: ["InputMaterialContract[]"],
            reports: ["MaterialValidationReport"],
            diagnostic_codes: ["unregistered-material"],
            task_context_facts: ["material_status"],
        },
        verification_layer: {
            tests: ["tests/engine/input_material_contract_registry.test.ts"],
            runtime_checks: ["material_contract_valid"],
            regression_cases: ["unregistered_source_blocked"],
            drift_checks: ["material_types_match_registry"],
        },
        status: "dual_layer_enforced",
    },
    // ── 16. 用户反馈契约（/四十四） ──
    {
        mechanism_id: "mc-user-feedback",
        mechanism_name: "用户反馈契约",
        owner_issue_id: "问题二十九",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/用户反馈契约规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["code_execution"],
            injected_workflows: ["verify", "deliver"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/user_feedback_contract.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["createUserFeedbackMessage", "validateUserFeedbackContract", "getAllowedFeedbackKinds"],
            state_effects: ["feedback_generated"],
            hard_fail_conditions: ["forbidden wording in feedback", "verification_summary masking"],
            degradation_behavior: "降级为简单消息",
        },
        evidence_layer: {
            outputs: ["UserFeedbackMessage[]", "UserFeedbackGovernanceFinding[]"],
            reports: ["FeedbackValidationReport"],
            diagnostic_codes: ["forbidden-wording", "severity-mismatch"],
            task_context_facts: ["feedback_status"],
        },
        verification_layer: {
            tests: ["tests/engine/user_feedback_contract.test.ts"],
            runtime_checks: ["feedback_contract_valid"],
            regression_cases: ["blocked_kind_for_verify"],
            drift_checks: ["feedback_kinds_match_tools"],
        },
        status: "dual_layer_enforced",
    },
    // ── 17. 产物契约 ──
    {
        mechanism_id: "mc-artifact-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" },
            ],
            injected_routes: ["code_execution", "single_artifact"],
            injected_workflows: ["expand", "deliver"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/contracts/artifact_contract_registry.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["canTransition", "transitionRequiresVerification"],
            state_effects: ["artifact_created"],
            hard_fail_conditions: ["artifact without contract", "overwrite without policy"],
            degradation_behavior: "降级为手动产物管理",
        },
        evidence_layer: {
            outputs: ["ArtifactContract[]", "OutputArtifact"],
            reports: ["ArtifactValidationReport"],
            diagnostic_codes: ["missing-contract", "overwrite-violation"],
            task_context_facts: ["artifact_status"],
        },
        verification_layer: {
            tests: ["tests/engine/artifact_contract_registry.test.ts"],
            runtime_checks: ["artifact_contract_valid"],
            regression_cases: ["no_artifact_without_contract"],
            drift_checks: ["artifact_types_match_registry"],
        },
        status: "dual_layer_enforced",
    },
    // ── 18. 配置优先级契约 ──
    {
        mechanism_id: "mc-config-precedence",
        mechanism_name: "配置优先级契约",
        owner_issue_id: "问题三十七",
        priority: "P1",
        template_layer: {
            required: true,
            assets: [
                { path: "templates/internal/rules/配置优先级规则.md", asset_kind: "knowledge_rule", consumption_mode: "required" },
            ],
            injected_routes: ["operation"],
            injected_workflows: ["init", "config"],
            target_hosts: ["claude_code"],
            language_policy: "zh_first",
        },
        enforcement_layer: {
            required: true,
            enforcers: ["src/engine/config/config_precedence_contract.ts"],
            registries: ["mechanism_contract_registry"],
            entrypoints: ["listPrecedenceRules", "getPrecedenceRank"],
            state_effects: ["config_resolved"],
            hard_fail_conditions: ["invalid source override", "circular dependency"],
            degradation_behavior: "降级为默认配置",
        },
        evidence_layer: {
            outputs: ["ConfigPrecedenceResult"],
            reports: ["PrecedenceReport"],
            diagnostic_codes: ["invalid-override", "circular-dep"],
            task_context_facts: ["config_source"],
        },
        verification_layer: {
            tests: ["tests/engine/config_precedence_contract.test.ts"],
            runtime_checks: ["precedence_valid"],
            regression_cases: ["no_circular_deps"],
            drift_checks: ["precedence_rules_match_config"],
        },
        status: "dual_layer_enforced",
    },
];
//# sourceMappingURL=mechanisms_infra.js.map