/** * Provenance tracking for ingested documents. * * Records where each piece of knowledge came from: * source file, section, page, line range, and ingestion timestamp. */ import type { ChunkResult, DatabaseLike, ProvenanceRecord } from "./types"; /** * Compute a SHA-256 hash of a file for deduplication. */ export declare function computeFileHash(filePath: string): string; /** * Check if a file has already been ingested (by hash). * Returns the existing job ID if found, null otherwise. */ export declare function checkAlreadyIngested(db: DatabaseLike, fileHash: string): string | null; /** * Build a provenance record for a chunk. */ export declare function buildProvenance(chunk: ChunkResult, filePath: string, sourceType: string, fileHash: string): ProvenanceRecord; /** * Get file metadata for tracking. */ export declare function getFileMetadata(filePath: string): { size: number; modified: string; }; export interface IngestionJobRow { id: string; source_path: string; source_type: string; file_hash: string; status: string; chunks_total: number; chunks_processed: number; memories_created: number; started_at: string; completed_at: string | null; error: string | null; } /** * Create an ingestion job record in the database. */ export declare function createIngestionJob(db: DatabaseLike, jobId: string, sourcePath: string, sourceType: string, fileHash: string): void; /** * Update an ingestion job's progress. */ export declare function updateIngestionJob(db: DatabaseLike, jobId: string, updates: { status?: string; chunksTotal?: number; chunksProcessed?: number; memoriesCreated?: number; error?: string; }): void; //# sourceMappingURL=provenance.d.ts.map