import type { VerificationEvidence, EvidenceTombstone } from "./verification_evidence.js"; import { type SignatureProvider } from "../signature_provider.js"; /** 纯文件 CRUD + HMAC provenance,无业务逻辑。 */ export declare class VerificationEvidenceStore { private readonly projectRoot; private readonly provider; constructor(projectRoot: string, provider?: SignatureProvider); private filePath; private withEvidenceLock; /** 读取 + schema 校验 + HMAC 验签(fail-closed)。伪造/无 secret → null;损坏 schema throw。 */ private readAndValidate; get(evidenceId: string): Promise; /** 列出有效 evidence(HMAC valid + 未被 tombstone 失效;伪造/无 secret/已失效 排除)。V2 reader 默认用此。 */ list(): Promise; /** 列出全部 evidence(含已 tombstone 失效的,不过滤)。invalidate/审计用(找全部含已失效的)。 */ listAll(): Promise; /** 列出某 task 的所有 evidence。 */ listByTask(taskId: string): Promise; /** 列出某 task 指定产物(domain + artifact_kind)的 artifact_structure evidence(command 维度无 artifact,自动过滤)。 */ listByArtifact(taskId: string, domain: string, artifactKind: string): Promise; /** 跨 task 内容锚点查询(D1 消费侧):按 (domain, artifact_kind[, artifact_path]) 列全部 task 的 * artifact_structure evidence,不按 task_id 过滤。供消费端(deliver/advance/BLD-G01)在当前 task * 无记录时按 artifact_git_hash === 当前内容摘要 匹配继承——内容一致=验证结论对该版本内容成立。 * HMAC 验签/tombstone 过滤语义与 list() 一致。 * 验证复用路径(EvidenceWriter.read/FreshnessPolicy)不使用本函数——重跑决策不跨 task。 */ listByArtifactCrossTask(domain: string, artifactKind: string, artifactPath?: string): Promise; /** 持久化(schema 校验 + 重签 + 原子写)。不覆盖:已有 evidence_id 抛错(保留历史)。无 secret throw(fail-closed)。 */ save(evidence: VerificationEvidence): Promise; private tombstoneFilePath; private withTombstoneLock; /** 读 + schema 校验 + HMAC 验签 tombstone(fail-safe:无 secret/伪造 → 排除 tombstone → evidence 保持有效,防误失效)。 */ private readAndValidateTombstone; /** 列出全部有效 tombstone(HMAC valid;伪造/无 secret 排除 → 对应 evidence 保持有效)。 */ listTombstones(): Promise; /** 已失效 evidence_id 集合(list 过滤用)。 */ private listTombstonedEvidenceIds; /** 失效单个 evidence(写 tombstone,不删原文件)。幂等:同 evidence 重失效覆盖同 tombstone(确定性 id)。 */ invalidate(evidenceId: string, reason: string): Promise; /** 失效某 task+domain+artifact_kind(+可选 artifact_path)的全部 evidence(批量 tombstone)。 * apply_project_map 路径迁移/cleanup 用:旧路径 evidence 失效,V2 reader 不再读到(治孤儿积累)。 */ invalidateByArtifact(taskId: string, domain: string, artifactKind: string, artifactPath: string | undefined, reason: string): Promise; }