/** * Report storage abstraction. * Default implementation: local file system. * Can be replaced with database, S3, etc. */ import type { EvaluationJob, EvaluationReport, JobStore, ReportDocument, ReportIndexCard, ReportStore } from '../types/index.js'; /** * Create a file-system-based report store. */ export declare function createFileStore(dir: string): ReportStore; /** * 项目盖全局的 overlay 报告存储。reports 默认落项目 `.omk/reports`(绑用例集,construct validity), * 全局 `~/.oh-my-knowledge/reports` 作存量兜底。两类语义刻意不同: * - 浏览(list / findByVariant):记录优先 —— 项目有报告只看项目(studio 不混进跨项目全局堆), * 项目空才回退全局(空项目不白屏)。同 resolveManagedDir / phase-1 口径。 * - 寻址(get / exists / findByArtifactHash):项目→全局兜底 —— 拿具体 id / 内容哈找文件时两处都查, * resume / gold-compare / baseline 复用不因「写默认翻项目」而落空;复用查找继续覆盖全局,报告数字零变化。 * 写(save / update / remove):落项目(写默认目标);update / remove 找不到再落/试全局(改删 studio 当前所见那份)。 * 两个底层 createFileStore 各自带 list 指纹缓存,overlay 一次构建即可、无需每请求重建(cwd 进程内不变, * 内容变化由 createFileStore 的 mtime 指纹自动失效)。 */ export declare function createOverlayReportStore(projectDir: string, globalDir: string): ReportStore; export interface JobQuery { status?: string; reportId?: string; project?: string; owner?: string; tag?: string; limit?: number; } export declare function queryJobList(jobStore: JobStore, query?: JobQuery): Promise; export declare function queryJob(jobStore: JobStore, id: string): Promise; export type RunListItem = Omit; export interface TrendPoint { reportId: string; timestamp: string; avgCompositeScore: number | null; avgNumTurns: number | null; avgCostPerSample: number | null; artifactHash: string | null; gitCommitShort: string | null; gitBranch: string | null; } export interface TrendQueryResult { variant: string; points: TrendPoint[]; runs: EvaluationReport[]; } export declare function queryRunList(reportStore: ReportStore): Promise; export declare function queryRun(reportStore: ReportStore, id: string): Promise; export declare function queryTrend(reportStore: ReportStore, variantName: string): Promise;