/** * RoiLedger — per-(repo, tool) net token history, persisted across sessions. * * `SavingsLedger` already tracks saved/spent totals, but only by *source* (cache, * contextSqueeze, ...) and only in `~/.lemma-cache/ledger.json` — one file, no notion of * which repo or which specific tool earned its keep. That is not enough to answer "does * `affected_tests` pay for its schema in THIS repo", which is what `tool-profiles.ts` needs * to auto-tune the advertised surface instead of relying purely on the hand-curated * `CORE_TOOL_NAMES` list. * * Scope: one small JSON file per repo, keyed by a hash of the repo path, holding cumulative * (calls, tokensSaved, tokensSpent) per tool name. Fail-open throughout — a lookup or write * that errors must never break the caller; it just means no history this time. * * Hard rule inherited from `tool-profiles.ts`: the tool surface resolves once at startup and * never mutates mid-session. This ledger is written continuously, but only ever *read* by * `resolveToolSurface` once, at process start — so a promotion always reflects PRIOR * sessions, never the one currently running. */ export interface ToolRoiStats { calls: number; tokensSaved: number; tokensSpent: number; } export declare function recordRoiSaved(repoRoot: string, tool: string, tokensSaved: number): void; export declare function recordRoiSpent(repoRoot: string, tool: string, tokensSpent: number): void; /** All per-tool history for this repo, or an empty map if none exists yet or the read fails. */ export declare function getRoiStats(repoRoot: string): Record; /** Test seam only — production code should never need to wipe another repo's history. */ export declare function resetRoiLedger(repoRoot: string): void; //# sourceMappingURL=RoiLedger.d.ts.map