/** * Lemma API v2 — Evidence & EvidenceResolver contract (Lane 0) * * Truth behind the product (see plan §0): freshness is computed by hashing the * code a memory was recorded against. Local consumers hash the local filesystem * (LocalFsResolver), cloud consumers send their own hashes (SuppliedEvidenceResolver). * Both satisfy the same interface. The verifier only ever *compares* hashes — it * never hashes on the server's behalf, because the server has no client filesystem. */ /** Hash of a whole file: path (as the client refers to it) → sha256 hex. */ export type FileHashes = Record; /** Hash pair for one symbol: key is `::`. */ export type SymbolHashes = Record; /** * The complete evidence bundle a client attaches when storing a memory and * re-supplies when verifying. `files`/`symbols` are keyed by *relative* path as * the client refers to them; the `branch`/`commit` fields let a verifier reason * about cross-checkout freshness without re-reading disk. */ export interface Evidence { files: FileHashes; symbols: SymbolHashes; /** Symbols hashed after stripping comments/whitespace (semantic diff). */ symbolsNormalized: SymbolHashes; branch?: string; commit?: string; } /** * Resolves the current evidence for a path/symbol. * * This is the seam that decouples the Brain from the local filesystem: * - LocalFsResolver reads real files (MCP-local behaviour, byte for byte). * - SuppliedEvidenceResolver consults a client-supplied `currentEvidence` * mapping and FAILS CLOSED — a tracked path the client omitted resolves to * `null`, which the verifier maps to `unverified`, never `fresh`. * * Methods resolve to `null` when evidence cannot be obtained. `null` is the * fail-closed signal; callers must treat it as "cannot verify ⇒ not fresh". */ export interface EvidenceResolver { /** sha256 of a whole file, or `null` if the file cannot be read/verified. */ hashFile(path: string): string | null; /** Raw + normalized hash pair for a symbol, or `null` if it cannot be read. */ hashSymbol(path: string, symbolName: string): { raw: string; normalized: string; } | null; } //# sourceMappingURL=evidence.d.ts.map