/**
 * 标准资产契约 — 为每类标准资产定义机器可读契约字段。
 *
 * 覆盖模板、规则、流程、检查清单、审查规则、patterns、脚手架
 * 和 adapter workflow 的契约 schema、验证和修复闭环。
 */
import type { ArtifactSchema } from "../contracts/artifact_schema_registry.js";
export type AssetContractKind = "acceptance_template" | "rule" | "procedure" | "checklist" | "review_rule" | "pattern" | "scaffold" | "adapter_workflow";
export type ContractLevel = "required" | "supporting" | "advisory";
export interface StandardAssetContract {
    contract_version: string;
    asset_id: string;
    asset_kind: AssetContractKind;
    owner_mechanism_id: string;
    contract_level: ContractLevel;
    applicable_routes: string[];
    applicable_task_types: string[];
    applicable_output_paths: string[];
    applicable_tech_stacks: string[];
    trigger_conditions: string[];
    required_inputs: string[];
    required_outputs: string[];
    failure_severity: "hard_fail" | "advisory";
    verification_strategy: string[];
    /** per-kind 额外字段存储 */
    kind_specific: Record<string, unknown>;
}
export interface ContractVerificationResult {
    passed: boolean;
    contract: StandardAssetContract;
    missing_fields: string[];
    messages: string[];
}
export interface RepairReverifyDirective {
    phase_directive: "回退";
    asset_id: string;
    contract_id: string;
    missing_fields: string[];
    messages: string[];
    repair_suggestion: string;
}
export declare const P0_TEMPLATE_CONTRACTS: StandardAssetContract[];
export declare function getStandardAssetContractSchema(kind: AssetContractKind): string[];
export declare function verifyStandardAssetContract(contract: StandardAssetContract): ContractVerificationResult;
/**
 * 模板匹配 — 综合输出产物类型、工作流意图、路由决策、文件路径和用户要求，
 * 不只用文件名判断。
 */
export declare function matchTemplateContract(params: {
    output_artifact_kind?: string;
    workflow_intent?: string;
    route_decision?: string;
    file_path?: string;
    user_requirement?: string;
}): StandardAssetContract | null;
/**
 * 验证真实产物文件是否满足契约要求。
 */
export declare function verifyOutputAgainstContract(contract: StandardAssetContract, content: string, rootDir: string): ContractVerificationResult;
/**
 * 生成修复重验指令。
 */
export declare function createRepairReverifyDirective(contract: StandardAssetContract, result: ContractVerificationResult): RepairReverifyDirective;
/**
 * 检查是否为低风险任务（不应触发模板契约）。
 */
export declare function isLowRiskTask(params: {
    route_decision?: string;
    workflow_intent?: string;
    changed_files?: string[];
}): boolean;
/**
 * 检查草稿标记 — 草稿文档不应进入编码消费。
 */
export declare function isDraftDocument(content: string): boolean;
/**
 * 基于 Schema Registry 的产物验证。
 *
 * 与 verifyOutputAgainstContract() 不同，此函数直接使用
 * artifact_schema_registry 中的 Schema 定义，覆盖全部 19 种产物类型。
 *
 * @param kind 产物类型
 * @param content 文件内容
 * @param rootDir 项目根目录（用于检查附属产物文件）
 * @returns 验证结果
 */
export declare function verifyOutputAgainstSchema(kind: string, content: string, rootDir: string): ContractVerificationResult;
/**
 * 通过产物类型查找对应的 Schema。
 * 用于 matchTemplateContract 的补充查询。
 */
export declare function findSchemaByArtifactKind(kind: string): ArtifactSchema | undefined;
/**
 * 增强版模板匹配 — 先查 P0 契约，再查 Schema Registry。
 *
 * 优先返回 P0 契约（向后兼容），无匹配时回退到 Registry 查找。
 */
export declare function matchTemplateContractEnhanced(params: {
    output_artifact_kind?: string;
    workflow_intent?: string;
    route_decision?: string;
    file_path?: string;
    user_requirement?: string;
}): StandardAssetContract | null;
//# sourceMappingURL=standard_asset_contract.d.ts.map