import { type AuditRecord, type AuditSinkDef, type UnchainedAuditRecord } from '@moxxy/sdk'; import { type ChainVerdict } from './chain.js'; /** * The protected local floor: one hash-chained JSONL per day under * `~/.moxxy/audit/`. * * Daily files rather than per-session, because an auditor asks "what happened * on the 14th", not "what happened in session 01J…". It also means the chain * spans every session on that day, so deleting a whole session's records still * breaks the chain. * * A local file can be rewritten wholesale by whoever can write it, so this is * tamper-EVIDENT, not tamper-proof. It is the fallback for a machine with no * remote sink configured, and it says so rather than overclaiming. */ export declare function auditDir(): string; export declare function auditFileFor(ts: number): string; /** * Read one day's records. Malformed lines are SKIPPED rather than throwing, so * a truncated final line (the process died mid-write) still lets the rest * verify; the resulting seq gap is itself reported by {@link verifyChain}. */ export declare function readAuditDay(day: string): Promise; /** Every day that has an audit file, oldest first. */ export declare function listAuditDays(): Promise; /** Verify one day's chain. */ export declare function verifyAuditDay(day: string): Promise; /** * Drop audit files older than `retentionDays`. Returns the days removed. * Retention is a policy decision the operator makes; keeping everything forever * is its own compliance problem. */ export declare function pruneAuditDays(retentionDays: number, now?: number): Promise; /** Test seam: forget the cached chain head. */ export declare function resetAuditHeadForTests(): void; /** * Seal a record at the next chain position and append it, all under ONE lock * acquisition. Reserving the position and writing must be atomic: two writers * that both read `prevHash` before either appends would commit to the same * predecessor and fork the chain. */ export declare function appendAuditRecord(record: UnchainedAuditRecord): Promise; /** The floor sink: local, hash-chained, owner-only. */ export declare const jsonlAuditSink: AuditSinkDef; //# sourceMappingURL=jsonl-audit-sink.d.ts.map