/** * Process-local memoization for the high-frequency Hook path. * * Each PreToolUse Hook invocation is a fresh Node process, but within that * single process the same project-rooted reads are repeated several times: * `inspectCometHook` resolves the workflow owner (reads config + current * selection + enumerates active changes), then delegates to a Guard that * re-enumerates the same active changes and re-resolves the current change * (spawning `git` again). These reads are immutable for the lifetime of one * Hook decision, so memoizing them per projectRoot eliminates the redundant * IO and `git` forks without any cross-invocation consistency risk — the * cache dies with the process. * * The cache is opt-in: only the Hook entry point activates it, and only the * Hook-path read functions consult it. CLI commands, writes, and Native * receipt/hash verification never go through this cache. This module lives * in `platform/` so every domain can share it without creating import * cycles (no domain dependency on a higher layer). */ /** * Run `work` with a per-invocation read cache active. Reads issued through * `memoizedHookRead` during `work` are cached by their argument key for the * duration of the call. The cache is dropped as soon as `work` settles, so it * never leaks across Hook invocations or into CLI command paths. */ export declare function runWithHookReadCache(work: () => Promise): Promise; /** * Memoize an async factory for the duration of the active Hook read cache. * * When no cache is active (CLI paths, tests that bypass the Hook entry), the * factory runs unchanged on every call — preserving exact current behavior. * When a cache is active, the first call with a given argument tuple stores * the in-flight promise; concurrent and repeat callers within the same Hook * decision share that single result. Rejections are not cached, so a * transient failure still retries on the next call. */ export declare function memoizedHookRead(factoryName: string, factory: (...args: TArgs) => Promise): (...args: TArgs) => Promise; /** * Memoize a synchronous factory for the duration of the active Hook read * cache. Mirrors {@link memoizedHookRead} for non-async reads such as the * `git rev-parse` branch probe, which is the single most expensive sync call * on the Hook path. */ export declare function memoizedHookReadSync(factoryName: string, factory: (...args: TArgs) => TResult): (...args: TArgs) => TResult; //# sourceMappingURL=hook-read-cache.d.ts.map