/**
 * Append-only, content-addressed storage for run artifacts
 * (mmnto-ai/totem#2100). Layout: `<totemDir>/artifacts/runs/<hash>.json`,
 * where `<hash>` is the sha256 of the artifact's canonical serialization
 * EXCLUDING `createdAt` — identical runs dedup to one record regardless of
 * when they ran, and a rerun NEVER mutates a prior record (write-if-absent).
 *
 * The directory is machine-local state (gitignored alongside
 * `.totem/cache/`); growth is bounded per-run and pruning is a future verb,
 * deliberately not this slice.
 *
 * Reads go through `readJsonSafe` + `RunArtifactSchema` so a corrupted or
 * wrong-major artifact is a loud `TotemParseError`, never a silent partial
 * (Tenet 4). Version tolerance within the major + the migration-on-read
 * registry implement the F1 evolution policy from the #2100 design review.
 */
import type { RunArtifact } from './schema.js';
/** Absolute runs directory for a given absolute totem dir. */
export declare function runsDir(totemDirAbs: string): string;
/**
 * Content address of an artifact: deterministic hash over everything EXCEPT
 * `createdAt` (observability, not identity — see schema docstring).
 */
export declare function computeRunArtifactContentHash(artifact: RunArtifact): string;
export interface SaveRunArtifactResult {
    /** The content address (= filename stem). */
    hash: string;
    /** Absolute path of the stored artifact. */
    path: string;
    /** True when an identical logical run was already recorded (no write happened). */
    existed: boolean;
}
/**
 * Persist an artifact at its content address, write-if-absent. An existing
 * file is NEVER rewritten: same hash ⇒ same logical content by construction,
 * and the original record (including its `createdAt`) is the durable one —
 * append-only means the FIRST write wins forever.
 */
export declare function saveRunArtifact(totemDirAbs: string, artifact: RunArtifact): SaveRunArtifactResult;
/**
 * Load + validate an artifact by content address. Throws `TotemParseError`
 * on a missing file, corrupt JSON, or schema violation (including an unknown
 * major with no migration entry) — loud, never a silent partial.
 */
export declare function loadRunArtifact(totemDirAbs: string, hash: string): RunArtifact;
//# sourceMappingURL=storage.d.ts.map