/**
 * Batch 3 共享契约骨架 — 9 个问题共用的类型定义和注册表。
 *
 * 骨架名称与问题正文定义的 interface/contract 名一致，不另起平行模型。
 * 继承 Batch 1+2 骨架（ContractRegistryEntry、DiagnosticCode 等），只扩展不重定义。
 */
/** 知识生命周期状态 — 使用 knowledge_lifecycle_status，不使用泛称 status */
export type KnowledgeLifecycleStatus = "draft" | "quarantine" | "active" | "pending_review" | "deprecated";
/** 知识主权 — 使用 sovereignty，normal / core */
export type KnowledgeSovereignty = "normal" | "core";
/** 知识写入阶段 — staged 从生命周期状态中拆出 */
export type KnowledgeWriteStage = "staged" | "committed";
/** 知识晋级状态 */
export type PromotionStatus = "pending" | "evidence_gathered" | "human_reviewed" | "approved" | "rejected";
/** 知识候选来源（问题十四） */
export type KnowledgeCandidateSource = "senior_practice" | "failure_analysis" | "drift_detection" | "repeated_success" | "user_instruction" | "ai_inference";
/** 知识证据（问题七 + 问题十四） */
export interface KnowledgeEvidence {
    id: string;
    source_type: "user_confirmed" | "test_passed" | "failure_reproduced" | "failure_fixed" | "review_approved" | "usage_success" | "drift_detected" | "external_reference";
    artifact_ref: string;
    confidence: number;
    collected_at: string;
    /** 关联知识条目的主权等级 */
    sovereignty: KnowledgeSovereignty;
    /** 阻断标记：证据是否导致晋级被阻断 */
    blocked?: boolean;
}
/** 知识健康检查发现（问题七） */
export interface KnowledgeHealthFinding {
    id: string;
    severity: "info" | "warning" | "error" | "critical";
    category: "format" | "lifecycle" | "consumption" | "conflict" | "staleness" | "evidence" | "injection_safety" | "sovereignty";
    entry_id: string;
    message: string;
    recommendation: string;
    auto_action?: "none" | "mark_pending_review" | "quarantine" | "deprecated_candidate";
    requires_human: boolean;
}
/** 知识晋级报告（问题十四） */
export interface KnowledgePromotionReport {
    entry_id: string;
    from_status: KnowledgeLifecycleStatus;
    to_status: KnowledgeLifecycleStatus;
    from_sovereignty: KnowledgeSovereignty;
    to_sovereignty: KnowledgeSovereignty;
    evidence_ids: string[];
    conflicts_checked: boolean;
    product_scope_checked: boolean;
    human_approved_by?: string;
    rollback_path: string;
    promotion_status: PromotionStatus;
}
/** 文档 eligibility 状态 */
export type DocEligibilityStatus = "draft" | "verified" | "formal" | "deprecated";
/** 文档制品策略 */
export interface DocumentationArtifactPolicy {
    artifact: "design_doc" | "memo" | "readme" | "contract_registry" | "capability_registry" | "knowledge_templates" | "issue_pr" | "ci_report";
    allowed_content: string[];
    forbidden_content: string[];
    source_of_truth_for: string[];
    update_trigger: string[];
}
/** 设计文档资格状态 — 使用 doc_eligibility_status，不用泛称 status */
export type DesignDocEligibilityStatus = "proposed" | "accepted_in_memo" | "implemented" | "verified" | "design_doc_eligible" | "superseded" | "rejected";
/** 设计文档资格（问题二十一） */
export interface DesignDocEligibility {
    decision_id: string;
    /** 准入资格状态 — 使用 doc_eligibility_status */
    doc_eligibility_status: DesignDocEligibilityStatus;
    evidence_refs: string[];
    target_doc_section?: string;
}
/** 模板同步状态 */
export type TemplateSyncStatus = "pending" | "dry_run_completed" | "conflicts_detected" | "user_confirmed" | "applied" | "rolled_back";
/** 模板资产差异状态 — 使用 template_asset_status，不用泛称 status */
export type TemplateAssetDiffStatus = "missing" | "up_to_date" | "outdated_unmodified" | "outdated_modified" | "deprecated" | "conflict" | "schema_migration_required";
/** 模板资产版本（问题二十五） */
export interface TemplateAssetVersion {
    asset_id: string;
    source_path: string;
    target_path: string;
    asset_kind: string;
    template_version: string;
    source_hash: string;
    installed_hash?: string;
    user_modified: boolean;
    /** 资产差异状态 — 使用 template_asset_status */
    template_asset_status: TemplateAssetDiffStatus;
}
/** 知识迁移报告（问题二十五） */
export interface KnowledgeMigrationReport {
    project_path: string;
    checked_at: string;
    added: string[];
    updated: string[];
    skipped_user_modified: string[];
    deprecated: string[];
    conflicts: string[];
    schema_migrations: string[];
    requires_human: boolean;
    rollback_path?: string;
}
/** 模板清单条目（问题二十五） */
export interface TemplateManifestEntry {
    asset_id: string;
    asset_kind: string;
    source_path: string;
    target_path: string;
    template_version: string;
    source_hash: string;
    installed_hash: string;
    installed_at: string;
    source_package_version?: string;
    knowledge_lifecycle_status?: KnowledgeLifecycleStatus;
    sovereignty?: KnowledgeSovereignty;
}
/** CLI 命令契约（问题三十） */
export interface CliCommandContract {
    command: string;
    capability_ids: string[];
    contract_ids: string[];
    default_mode: "read_only" | "dry_run" | "write" | "execute" | "delivery";
    reads: string[];
    writes: string[];
    side_effects: Array<"none" | "file_write" | "state_write" | "config_write" | "knowledge_write" | "command_execution" | "git_commit" | "git_push" | "pr_create" | "network" | "external_write">;
    requires_confirmation: boolean;
    dry_run_available: boolean;
    documented_in_readme: boolean;
}
/** 适配器合规状态 */
export type AdapterComplianceStatus = "compliant" | "missing_sections" | "forbidden_claims" | "outdated";
/** 适配器 Prompt 契约（问题三十一） */
export interface AdapterPromptContract {
    adapter_id: string;
    host_type: "claude_code" | "codex" | "cursor" | "trae" | "generic_mcp";
    prompt_path?: string;
    generated_from_contract_version: string;
    required_sections: Array<"when_to_use_soloforge" | "when_not_to_use_soloforge" | "tool_invocation_policy" | "read_only_bypass_policy" | "strict_controlled_tools" | "language_policy" | "status_feedback_policy" | "dangerous_action_policy" | "trace_policy" | "fallback_policy">;
    forbidden_claims: string[];
    sync_required: boolean;
    /** next_allowed_tools 约束 */
    next_allowed_tools: string[];
}
/** 适配器 Prompt 清单（问题三十一） */
export interface AdapterPromptManifest {
    adapter_id: string;
    host_type: string;
    generated_path: string;
    template_version: string;
    template_hash: string;
    generated_hash: string;
    generated_at: string;
    contract_ids: string[];
}
/** 发布兼容状态 */
export type ReleaseCompatibilityStatus = "compatible" | "migration_required" | "breaking_changes" | "incompatible";
/** 发布兼容契约（问题三十五） */
export interface ReleaseCompatibilityContract {
    package_version: string;
    contract_registry_version: string;
    supported_project_schema_versions: string[];
    migrations: MigrationStep[];
    breaking_changes: BreakingChange[];
    deprecated_features: DeprecatedFeature[];
    compatibility_policy: {
        read_old_state: boolean;
        auto_migrate_safe_changes: boolean;
        require_human_for_destructive_migration: boolean;
        rollback_supported: boolean;
    };
}
/** 迁移步骤 */
export interface MigrationStep {
    from_version: string;
    to_version: string;
    description_zh: string;
    auto_applicable: boolean;
    requires_human_confirm: boolean;
    affects_sovereignty: boolean;
    rollback_path: string;
}
/** 破坏性变更 */
export interface BreakingChange {
    id: string;
    description_zh: string;
    impact: "contract" | "schema" | "template" | "adapter" | "cli";
    migration_required: boolean;
}
/** 废弃特性 */
export interface DeprecatedFeature {
    id: string;
    description_zh: string;
    replacement?: string;
    removal_scheduled?: string;
}
/** 项目迁移计划（问题三十五） */
export interface ProjectMigrationPlan {
    project_path: string;
    from_version: string;
    to_version: string;
    required_migrations: string[];
    auto_applicable: string[];
    requires_human: string[];
    blocked: string[];
    backup_path?: string;
    rollback_path?: string;
}
/** 语言策略 — 使用 language_policy_status，不使用泛称 status/mode */
export type LanguagePolicyStatus = "zh_first" | "en_first" | "bilingual" | "source_preserving" | "project_override";
/** LanguagePolicy type — 问题十定义的值域 */
export type LanguagePolicy = "zh_first" | "source_preserving" | "en_allowed" | "code_native";
/** 语义污染检测状态 */
export type SemanticPollutionStatus = "clean" | "polluted" | "auto_remediated" | "manual_required";
export interface IssueDetailAcceptance {
    issue_id: string;
    contract_id: string;
    must_keep_details: string[];
    required_entrypoints: string[];
    required_contract_fields: string[];
    required_mechanism_hooks: string[];
    required_template_or_adapter_updates: string[];
    required_sync_or_migration_paths: string[];
    required_evidence_refs: string[];
    required_diagnostics: string[];
    regression_cases: string[];
    cross_scenario_coverage: string[];
    user_project_impact: string[];
    soloforge_self_impact: string[];
    owner_files: string[];
    mainline_consumption_check: string[];
    not_done_if_missing: string[];
}
export interface BatchScenarioCase {
    id: string;
    name: string;
    fixture: string;
    command_or_entry: string;
    expected_evidence: string[];
    pass_fail_rules: string[];
}
export declare const KNOWLEDGE_TEMPLATE_INVARIANTS: readonly ["core knowledge 不得被 AI inference 或自动机制修改", "draft / quarantine / pending_review 知识不得自动晋级 active/core", "知识晋级必须有人工签署或等效 evidence", "用户修改的模板不得被模板同步覆盖", "模板同步必须 dry-run 先行，apply 必须用户确认", "adapter prompt 不得包含超出宿主能力的 forbidden claim", "adapter prompt 必须包含 next_allowed_tools 约束", "README 命令必须映射到真实 CLI contract，漂移必须检测", "未 verified 的备忘录决策不得写入正式设计文档", "设计文档不得记录施工流水", "migrate 默认 dry-run，apply 必须用户确认", "升级后用户项目已有配置不得被覆盖", "英文项目可配置 en_first，中文项目不被英文模板污染", "知识主权使用 sovereignty（normal / core），不另起 knowledge_sovereignty_level", "知识生命周期状态使用 knowledge_lifecycle_status，不使用泛称 status", "语言策略使用 language_policy_status，不使用泛称 status"];
//# sourceMappingURL=knowledge_template_contracts.d.ts.map