export type SignatureAuditEventType = "provider_crash" | "provider_restart" | "provider_restart_exhausted" | "verify_failed" | "task_resign" | "resign_all"; export interface SignatureAuditEvent { event: SignatureAuditEventType; detail?: Record; } /** 单条验签失败状态(per-file per-hmac 指纹;resolved 后保留供回溯,重复失败复用条目只增长 count)。 */ export interface VerifyFailureStateEntry { /** 记录文件路径(相对 projectRoot,如 state/evidence/xxx.json) */ file: string; /** 失败时 record 携带的旧 hmac 指纹(前 12 字符)——重签留痕与回溯锚点 */ hmac_fingerprint: string; /** 累计失败次数(同文件同 hmac 重复验签失败只增长计数不新增条目) */ count: number; first_seen: string; last_seen: string; /** 恢复时间(验签再次通过时记录);null=未恢复 */ resolved_at: string | null; } /** 记录一次验签失败(状态化:同文件同 hmac 指纹只增长 count;fire-and-forget)。 */ export declare function recordVerifyFailure(projectRoot: string, input: { file: string; hmacFingerprint: string; }): Promise; /** 记录验签恢复(该文件再次验签通过且存在未解决失败状态时记 resolved_at;幂等、无状态时零开销)。 */ export declare function recordVerifyRecovery(projectRoot: string, file: string): Promise; /** 未解决的验签失败状态(供 doctor/full 收敛提示与 resign 通道计数)。优先内存缓存(debounce 窗口内一致)。 */ export declare function getUnresolvedVerifyFailures(projectRoot: string): Promise; /** 追加签名服务审计事件行。fire-and-forget(调用方 void,不阻塞热路径);失败仅 debug 不抛。 */ export declare function appendSignatureAudit(projectRoot: string, event: SignatureAuditEvent): Promise; /** 测试辅助:清空进程内状态缓存。 */ export declare function _clearSignatureAuditStateCache(): void; /** 测试辅助:立即落盘挂起的脏状态。 */ export declare function _flushSignatureAuditState(projectRoot: string): Promise;