/** * Project Map — 文件位置表(domain 层模块)。 * * 职责边界: * - 负责:resolveFilePath 查表(override → 派生默认值 → missing)+ getProjectMapSnapshot 完整快照 * - 不负责:文件存在性检查(消费点用 glob_path 的 artifactPathExists/resolveArtifactsByGlob)、 * override 持久化(intent.yaml.project_map,由 resolver 透传)和 brownfield 路径探测 * * 被谁调用:消费点(verify_runner/executor/engine 等)切查表时 * 调用谁:ALL_CONTRACTS(派生默认值) * * 数据流:key + overrides(可选) → resolveFilePath → 该文件该在哪(相对路径,不检查存在) * 持久化:无(纯计算/内存态) * * 设计: * - 表是 override 层,默认值从 contract + deployment hardcode 派生 * - greenfield 空 overrides → 全走默认值,测试逐字验证路径契约 * - 不检查存在(查表=返回"该在哪";存在性消费点用 glob_path 的 artifactPathExists) * - 不依赖 context/config(overrides 由调用方从 config._intent.project_map.overrides 传入,避免 domain→context 依赖) * - 不依赖 gate(一致性校验放测试 E 组,避免 domain→gate 循环) * * key 格式:{kind}:{logical}(复合 key,路径变只改 value,key 稳定) * - artifact:{kind} — 产物主文件,默认值=contract.path_pattern(14 个 kind) * - companion:{artifact_kind}:{basename} — 附属文件,默认值=contract.companion_files * - reference:{artifact_kind}:{basename} — 引用文件,默认值=contract.references * - deployment:{logical}(docker_compose)— 仅真实执行链消费的逻辑文件 * - convention:{name}(knowledge_dir)— 默认值固定 * * 放 src/domain/ 而非 src/shared:派生默认值依赖 ALL_CONTRACTS(domain 同域);shared→domain 会与 domain→shared(engine_helpers 用 glob_path)成环。 */ /** 文件位置表 key({kind}:{logical} 复合格式) */ export type ProjectMapKey = string; /** override 值(单值或多候选) */ export type ProjectMapOverrideValue = string | string[]; /** 查表结果(不检查存在,返回"该在哪") */ export type FilePathResolution = { status: "found"; path: string; } | { status: "pattern"; pattern: string; } | { status: "candidates"; paths: string[]; } | { status: "missing"; key: string; }; /** * 派生默认值(只读 contract + deployment hardcode 两个源)。 * 纯函数,无 IO;从 project map snapshot 读取统一路径映射。 * * @param key 逻辑 key({kind}:{logical}) * @returns 默认路径(相对项目根),或 undefined(key 无效/无声明) */ export declare function deriveDefaultPath(key: ProjectMapKey): string | undefined; /** * 查文件位置表。 * * 解析顺序:override(intent.project_map.overrides)→ 派生默认值(contract + deployment hardcode)→ missing。 * greenfield 空 overrides → 全走默认值。 * * **不检查文件存在**(查表=返回"该在哪";存在性消费点用 glob_path 的 artifactPathExists/resolveArtifactsByGlob)。 * 消费点用法: * - found → `join(projectRoot, res.path)` + existsSync/readFileSync * - pattern → `resolveArtifactsByGlob(projectRoot, res.pattern)`(多端产物聚合) * - candidates → 遍历 `res.paths` * - missing → 该 key 无声明 * * @param key 逻辑 key({kind}:{logical}) * @param overrides 可选 override 映射(来自 config._intent.project_map.overrides 或 config.project_map?.overrides) * @returns 该文件该在哪(相对项目根) */ export declare function resolveFilePath(key: ProjectMapKey, overrides?: Record): FilePathResolution; /** * 完整快照(override + 派生默认值合并),只读视图。 * 遍历 ALL_CONTRACTS 生成所有 artifact/companion/reference key + deployment 常量 key。 * 用于“表是唯一真相源”的可审计性和多来源一致性校验。 * * @param overrides 可选 override 映射 * @returns key → FilePathResolution 完整映射 */ export declare function getProjectMapSnapshot(overrides?: Record): Record; /** * CVAT/gate 的模版名(如"切片计划模版")→ project_map artifact kind 映射。 * * CVAT 使用模板名,project_map 使用 kind;此映射统一两个维度。 * 本表是模版名→kind 的单一映射(替代 executors_artifact.REQUIRED_ARTIFACT_TO_KIND 去重 + CVAT 隐式映射)。 * 供跨产物验证与生命周期契约统一解析 project map override。 * * 多对一正常("架构设计模版"/"架构设计文档模版"/"架构设计" → design_doc),同名都保留(gate 配置可能用任一)。 */ export declare const TEMPLATE_NAME_TO_KIND: Record;