/**
 * 用户项目知识合同。
 *
 * 内置 templates/** 解决 SoloForge 自带资产的同步与可见性；
 * 用户项目 .soloforge/knowledge/** 则需要独立承载: 允许用户沉淀项目特有规则，
 * 同时保证它们能被索引、选中、注入或审计，而不是静态文件。
 */
import type { ProjectConfig } from "../../types/index.js";
import type { DesignLifecycleStageId } from "./design_lifecycle_contract.js";
export type ProjectKnowledgeIdentity = "builtin_synced" | "user_authored" | "user_modified_builtin" | "deprecated_builtin" | "conflict";
export type ProjectKnowledgeConsumption = "hard_rule" | "injectable" | "index_only" | "audit_only" | "review_rule" | "acceptance_template" | "advisory";
export type ProjectKnowledgeSelectionStatus = "selected" | "not_selected" | "blocked";
export interface ProjectKnowledgeAsset {
    id: string;
    name: string;
    rel_path: string;
    abs_path: string;
    identity: ProjectKnowledgeIdentity;
    consumption: ProjectKnowledgeConsumption;
    routes: string[];
    primary_triggers: string[];
    tech_stack: string[];
    domains: string[];
    lifecycle_stages: DesignLifecycleStageId[];
    path_patterns: string[];
    business_domains: string[];
    traceability_ids: string[];
    verification_commands: string[];
    recovery_command?: string;
    conflict_group?: string;
    rule_value?: string;
    conflicts_with: string[];
    has_frontmatter: boolean;
    hard_rule: boolean;
    injectable: boolean;
    audit_only: boolean;
    evidence: {
        created_by: string;
        synced_by?: string;
        indexed_by: string;
        selected_by?: string;
        injected_by?: string;
        reviewed_by?: string;
        verified_by?: string;
        delivery_blocked_by?: string;
        last_consumed_task?: string;
        last_consumed_at?: string;
        last_consumption_action?: string;
        last_consumption_consumer?: string;
    };
    findings: Array<{
        severity: "hard_fail" | "warning" | "advisory";
        code: string;
        message_zh: string;
    }>;
}
export interface ProjectKnowledgeSelectionDecision {
    asset: ProjectKnowledgeAsset;
    status: ProjectKnowledgeSelectionStatus;
    selected: boolean;
    score: number;
    reason_zh: string;
    matched_signals: string[];
    excluded_reasons: string[];
    lifecycle_stage?: DesignLifecycleStageId;
    enforcement: "hard_rule" | "injectable" | "audit_only" | "index_only" | "advisory";
    user_visible: {
        must_fix: boolean;
        why_selected: string;
        how_to_fix?: string;
        verification_command?: string;
    };
}
export interface ProjectKnowledgeSelectionResult {
    selected: ProjectKnowledgeSelectionDecision[];
    decisions: ProjectKnowledgeSelectionDecision[];
    blocked: ProjectKnowledgeSelectionDecision[];
    not_selected: ProjectKnowledgeSelectionDecision[];
}
export interface ProjectKnowledgeAuditReport {
    project_path: string;
    total: number;
    user_authored: number;
    builtin_synced: number;
    user_modified_builtin: number;
    deprecated_builtin: number;
    conflict: number;
    hard_rule: number;
    injectable: number;
    index_only: number;
    unconsumed: number;
    hard_fail_count: number;
    warning_count: number;
    assets: ProjectKnowledgeAsset[];
    recommended_next_steps: string[];
    recent_consumption: Array<{
        asset_id: string;
        rel_path?: string;
        consumer: string;
        action?: string;
        lifecycle_stage?: string;
        task_id_or_route: string;
        consumed_at: string;
        decision?: string;
    }>;
}
export declare function auditProjectKnowledge(projectPath: string, config?: ProjectConfig): ProjectKnowledgeAuditReport;
/**
 * @deprecated 仅供旧测试和兼容调用使用。生产入口必须消费 selectProjectKnowledgeForTaskWithReasons
 * 或 evaluateLifecycleKnowledgeDecision 返回的 SelectionDecision。
 */
export declare function selectProjectKnowledgeForTask(report: ProjectKnowledgeAuditReport, input: {
    intent: string;
    route?: string;
    tech_stack?: string[];
    lifecycle_stage?: DesignLifecycleStageId;
    changed_files?: string[];
    business_domains?: string[];
    traceability_ids?: string[];
    limit?: number;
}): ProjectKnowledgeAsset[];
export declare function selectProjectKnowledgeForTaskWithReasons(report: ProjectKnowledgeAuditReport, input: {
    intent: string;
    route?: string;
    tech_stack?: string[];
    lifecycle_stage?: DesignLifecycleStageId;
    changed_files?: string[];
    business_domains?: string[];
    traceability_ids?: string[];
    limit?: number;
}): ProjectKnowledgeSelectionResult;
//# sourceMappingURL=project_knowledge_contract.d.ts.map