/** * Pure per-snapshot helpers of the QuotaRegistry, split to a smaller owner * (complexity ratchet): durable-journal v3.2.0 rollback shaping, snapshot * keying, freshness aging, and expired scoped-cooldown pruning. No registry * state lives here. */ import { type CredentialRoute, type HarnessEvent, type QuotaConstraint, type QuotaSnapshot, type QuotaSource } from "@claudexor/schema"; /** The reactive vendor-limit cooldown snapshot for a harness event: the * existing subject's constraints minus the superseded/expired cooldown, plus * the new bounded cooldown window. Pure: the registry finds `existing`. */ export declare function reactiveCooldownSnapshot(input: { harness: string; credentialRoute: CredentialRoute; event: HarnessEvent; source: QuotaSource; existing: QuotaSnapshot | undefined; }, now: Date): QuotaSnapshot; export declare const QUOTA_FRESHNESS_TTL_MS: number; /** Same quota EVIDENCE: everything but the observation time (a freshness flip * is evidence). A poll that only re-observed unchanged evidence keeps the fresh * `observed_at` in memory without a journal frame. */ export declare function sameQuotaEvidence(a: QuotaSnapshot, b: QuotaSnapshot): boolean; export declare function snapshotKey(snapshot: QuotaSnapshot): string; /** Exact durable payload accepted by the strict v3.2.0 quota schemas. Keep an * explicit allowlist at every nested level so a future additive field cannot * silently make updater rollback boot-incompatible again. */ export declare function legacyV320Snapshot(snapshot: QuotaSnapshot): QuotaSnapshot; export declare function staleAt(snapshot: QuotaSnapshot, now: number): QuotaSnapshot; /** The instant at which a fresh snapshot stops satisfying primary demand: its * TTL expiry or its earliest reset boundary, whichever comes first. A stale or * unreadable observation is already due (-Infinity). One owner for "when is * this evidence due" — the demand horizon check and the lane renewal cap both * read it, so they can never disagree by a tick. */ export declare function quotaSnapshotDueAt(snapshot: QuotaSnapshot): number; /** Whether primary evidence will be due by a future demand horizon. Unlike * `staleAt`, the TTL comparison includes equality so the last existing poll * before expiry requests renewal instead of waiting for the following tick. */ export declare function quotaSnapshotDueBefore(snapshot: QuotaSnapshot, deadline: number): boolean; export declare function isExpiredScopedCooldown(source: QuotaSnapshot["source"], constraint: QuotaConstraint, now: number): boolean; export declare function withoutExpiredScopedCooldowns(snapshot: QuotaSnapshot, now: number): QuotaSnapshot | null; //# sourceMappingURL=quota-registry-support.d.ts.map