/**
 * `~/.olam/upgrade.log` — JSONL append-only audit log for `olam upgrade`.
 *
 * Phase 2c — C1.
 *
 * Schema:
 *   {
 *     ts: ISO 8601,
 *     started_at: epoch ms,
 *     ended_at: epoch ms,
 *     sha_target: string (40-char SHA, captured-after-pull),
 *     sha_before: { hostCp, authService, devbox },
 *     sha_after:  { hostCp, authService, devbox },
 *     status: "success" | "failed" | "rolled_back",
 *     failed_step: string | null,
 *     durations_ms: { [step_label]: number }
 *   }
 *
 * Open-per-write semantics — open() + write() + close() per row so
 * external log-rotators can rename the file mid-run without us writing
 * to a now-unlinked fd. Best-effort; errors logged to stderr and
 * swallowed so the audit log never blocks an upgrade from completing.
 *
 * `failed_step` MUST hold a step LABEL only (e.g. "bash build-auth.sh"),
 * NEVER raw stdout/stderr — paths and credentials may leak. (Per audit
 * security finding A6-007.) The CLI's terminal already shows the full
 * stderr; the log row records the step name for queryability.
 */
/**
 * Resolve the upgrade-log path lazily so tests can override HOME via
 * process.env. Lazy resolution is also forward-compatible with operators
 * who set XDG_DATA_HOME or similar overrides at session start.
 */
export declare function getUpgradeLogPath(): string;
/** Convenience constant for callers who want the production path string. */
export declare const UPGRADE_LOG_PATH: string;
export interface UpgradeLogRow {
    readonly ts: string;
    readonly started_at: number;
    readonly ended_at: number;
    readonly sha_target: string;
    readonly sha_before?: {
        readonly hostCp?: string;
        readonly authService?: string;
        readonly devbox?: string;
    };
    readonly sha_after?: {
        readonly hostCp?: string;
        readonly authService?: string;
        readonly devbox?: string;
    };
    readonly status: 'success' | 'failed' | 'rolled_back';
    readonly failed_step: string | null;
    readonly durations_ms: Record<string, number>;
}
/**
 * Append a single row to ~/.olam/upgrade.log.
 *
 * Open-per-write to survive log rotation. Errors swallowed to stderr —
 * audit log failure must never block an upgrade.
 *
 * `logPath` parameter is a test seam; production callers omit it.
 */
export declare function appendUpgradeLog(row: UpgradeLogRow, logPath?: string): void;
/**
 * Read up to N most-recent rows from ~/.olam/upgrade.log.
 *
 * Returns an empty array on missing file (first-run UX).
 *
 * Per audit invariant: corrupt JSON lines (partial mid-write, manual
 * tampering) are SKIPPED with a stderr warning rather than crashing
 * `--history`.
 */
export declare function readUpgradeLog(limit?: number, logPath?: string): UpgradeLogRow[];
/** Format duration ms → "1.4s" / "12m04s" / "1h23m" for table display. */
export declare function formatDuration(ms: number): string;
/**
 * Format an array of upgrade-log rows as a 5-column ASCII table:
 *   timestamp | sha (8-char) | status | duration | failed_step
 *
 * Status column uses ✓/✗/↩ icons + plain text for grep-friendliness.
 */
export declare function formatHistoryTable(rows: ReadonlyArray<UpgradeLogRow>): string;
/** Format rows as one JSON object per line (JSONL passthrough — same as on-disk format). */
export declare function formatHistoryJson(rows: ReadonlyArray<UpgradeLogRow>): string;
//# sourceMappingURL=upgrade-log.d.ts.map