/**
 * 全模板资产权威合同注册表 — 214 资产单一权威元数据体系。
 *
 * 合同由显式资产注册表 (explicit_asset_registry.ts) 驱动，
 * 每个资产逐一注册，新增文件必须新增条目，否则 validate-release hard_fail。
 * DRAFT_CATEGORY_DEFAULTS 仅用于生成待审草稿/诊断建议，不作为发布态合同。
 */
export type TemplateAssetKind = "acceptance_template" | "checklist" | "domain" | "knowledge_rule" | "procedure" | "pipeline_procedure" | "review_rule" | "pattern_core" | "product_profile" | "knowledge_template" | "global_pattern" | "scaffold" | "adapter_workflow" | "pipeline_artifact" | "pipeline_rule" | "stage_gate" | "governance_rule";
export type TemplateAssetVisibility = "user_project" | "soloforge_internal" | "scaffold_only" | "global_pattern";
export type TemplateRuntimeVisibility = "injectable" | "index_only" | "internal_only" | "scaffold_only";
export type TemplateEvidenceRole = "template_guidance" | "project_source_file" | "classification";
export type TemplateLifecycleStatus = "active" | "deprecated" | "internal_only";
export type ConsumptionCategory = "mainline" | "audit_only" | "internal_runtime" | "scaffold_only" | "copy_only" | "copy_only_pipeline";
export type ContractDecision = "allowed" | "denied" | "unregistered";
/**
 * 可验证的消费证据 — 不依赖合同自报，由代码级真实消费链驱动。
 */
export interface ConsumptionEvidence {
    asset_kind: TemplateAssetKind;
    selected_by_entrypoint: string;
    selection_rule_or_matcher: string;
    production_consumer_file: string;
    production_consumer_export: string;
    validation_entrypoint: string;
    runtime_test_or_scenario_ref: string;
}
export interface TemplateAssetContract {
    asset_id: string;
    path: string;
    asset_kind: TemplateAssetKind;
    contract_version: string;
    owner_mechanism_id: string;
    asset_visibility: TemplateAssetVisibility;
    sync_to_user_project: boolean;
    sync_target: "project_knowledge" | "global_patterns" | "none";
    runtime_visibility: TemplateRuntimeVisibility;
    evidence_role: TemplateEvidenceRole;
    user_visible: boolean;
    applicable_routes: string[];
    applicable_tech_stack: string[];
    lifecycle_status: TemplateLifecycleStatus;
    consume_category: ConsumptionCategory;
    mainline_consumer: string;
    validation_entrypoint: string;
    /** review_rule 专用: 适用的编程语言（空=通用） */
    applicable_languages?: string[];
    /** review_rule 专用: 适用的框架（空=通用） */
    applicable_frameworks?: string[];
    /** review_rule 专用: 适用的文件 glob 模式（空=通用） */
    applicable_file_patterns?: string[];
    /** review_rule 专用: 排除的文件 glob 模式 */
    excluded_file_patterns?: string[];
    /** review_rule 专用: 验证策略 */
    verification_strategy?: "pattern_match" | "ast_parse" | "manual_review";
    /** review_rule 专用: 失败严重级别 */
    failure_severity?: "advisory" | "warning" | "hard_fail";
    /** scaffold 专用: 模板变量契约（必须提供的变量名） */
    required_template_vars?: string[];
}
interface DraftCategoryDefaults {
    asset_kind: TemplateAssetKind;
    owner_mechanism_id: string;
    asset_visibility: TemplateAssetVisibility;
    sync_to_user_project: boolean;
    sync_target: "project_knowledge" | "global_patterns" | "none";
    runtime_visibility: TemplateRuntimeVisibility;
    evidence_role: TemplateEvidenceRole;
    user_visible: boolean;
    applicable_routes: string[];
    applicable_tech_stack: string[];
    lifecycle_status: TemplateLifecycleStatus;
    consume_category: ConsumptionCategory;
    mainline_consumer: string;
    validation_entrypoint: string;
}
/**
 * 诊断用草稿默认值 — 用于为新资产生成待审合同建议，不作为发布态合同。
 * 新增模板文件应先通过此生成草稿，审阅后写入 explicit_asset_registry.ts。
 */
export declare const DRAFT_CATEGORY_DEFAULTS: Array<{
    prefix: string;
    defaults: DraftCategoryDefaults;
}>;
/**
 * 获取指定资产类型的真实消费证据。
 */
export declare function getConsumptionEvidence(assetKind: TemplateAssetKind): ConsumptionEvidence | undefined;
/**
 * 验证消费证据中声明的生产消费者文件是否真实存在于源码中。
 */
export declare function verifyConsumptionEvidence(rootDir: string): Array<{
    asset_kind: TemplateAssetKind;
    evidence: ConsumptionEvidence;
    consumer_exists: boolean;
    consumer_export_found: boolean;
    test_exists: boolean;
}>;
/**
 * 构建全模板资产权威合同列表 — 由显式注册表驱动。
 * 只为 EXPLICIT_ASSET_REGISTRY 中注册的资产生成合同，未注册文件不计入。
 */
export declare function buildTemplateAssetContracts(_rootDir: string): TemplateAssetContract[];
/**
 * 列出全模板资产权威合同（带缓存）。
 */
export declare function listTemplateAssetContracts(): TemplateAssetContract[];
/**
 * 清除缓存（测试用）。
 */
export declare function clearContractCache(): void;
/**
 * 按路径查询合同。
 */
export declare function getContractByPath(relPath: string): TemplateAssetContract | undefined;
/**
 * 合同决策 — 返回 allowed/denied/unregistered。
 * allowed: 注册且允许访问
 * denied: 注册但禁止（内部/脚手架资产）
 * unregistered: 未在显式注册表中注册 → fail-closed
 */
export declare function getContractDecision(relPath: string): {
    decision: ContractDecision;
    contract?: TemplateAssetContract;
};
/**
 * 按可见性筛选。
 */
export declare function getContractsByVisibility(visibility: TemplateAssetVisibility): TemplateAssetContract[];
/**
 * 获取应同步到用户项目的资产路径列表。
 */
export declare function getSyncableAssetPaths(): string[];
/**
 * 获取内部资产路径集合。
 */
export declare function getInternalAssetPaths(): Set<string>;
/**
 * 合同覆盖统计报告。
 */
export interface ContractCoverageReport {
    total_templates: number;
    total_contracts: number;
    contract_covered: number;
    uncovered: number;
    unregistered_files: string[];
    missing_from_registry: number;
    visibility_unknown: number;
    consumer_missing: number;
    validation_missing: number;
    owner_missing: number;
    internal_count: number;
    user_visible_count: number;
    consume_category_breakdown: Record<ConsumptionCategory, number>;
    consumption_evidence_verified: boolean;
    consumption_evidence_failures: string[];
}
/**
 * 生成合同覆盖统计，验证真实消费证据，检测未注册文件。
 */
export declare function auditContractCoverage(rootDir: string): ContractCoverageReport;
export {};
//# sourceMappingURL=template_asset_contract_registry.d.ts.map