/** * recur-history-reader — reads the JSONL audit trail written by * `recurring-tick.ts` (appendHistory) and returns structured run records. * * The history file location is resolved in the same priority order that * recurring-tick.ts uses so the two stay in sync: * 1. LOG10X_RECUR_HISTORY_PATH env var (explicit override) * 2. /tmp/log10x-recur-history.jsonl (recurring-tick.ts default) * * One JSONL line per tick. Each line is a JSON object whose shape mirrors * the summary object emitted by `printRunSummary` in `bin/tenx-recur.ts` * PLUS the history-entry shape written by `appendHistory` in * `recurring-tick.ts`. The union of both is: * * { ts, status, projected_savings_pct, delta_patterns, delta_pp, message, * history_path? } * * `readHistorySince` is the primary consumer interface for the * `weekly-digest` mode of `commitment-report.ts`. */ /** * Resolve the history-file path using the same override ladder as * `recurring-tick.ts`: * LOG10X_RECUR_HISTORY_PATH → /tmp/log10x-recur-history.jsonl */ export declare function resolveHistoryPath(): string; /** * One tick run as parsed from the JSONL audit trail. */ export interface RecurRun { /** ISO-8601 timestamp of when the tick ran. */ ts: string; /** Epoch ms derived from `ts` for easier range comparisons. */ ts_ms: number; /** Tick outcome. */ status: 'no_change' | 'applied' | 'dry_run' | 'error'; /** Projected savings percentage at tick time. */ projected_savings_pct: number; /** Number of patterns whose action changed vs. prior state. */ delta_patterns: number; /** Change in savings percentage points vs. prior state. */ delta_pp: number; /** Human-readable message from the tick. */ message: string; /** Path to the history file (set when status==='applied'). */ history_path?: string; } /** * Read all tick runs since `sinceMs` (epoch ms, inclusive) from the JSONL * audit trail. * * @param sinceMs Epoch ms lower bound (inclusive). Pass `0` to read all. * @param histPath Override the file path (defaults to `resolveHistoryPath()`). * @returns Parsed runs in chronological order (oldest first). */ export declare function readHistorySince(sinceMs: number, histPath?: string): RecurRun[]; /** * Read the N most recent ticks regardless of age. * * @param limit Maximum number of runs to return (newest first when * `newestFirst=true`, oldest first otherwise). * @param histPath Override the file path. */ export declare function readRecentHistory(limit: number, histPath?: string): RecurRun[];