tarlatan
    Preparing search index...

    Function activeSpendDown

    • The spend-down active on provider's window: the latest one written for the window's current period, not canceled, and (if it loosens) with the period's reset time still ahead. None without a current period.

      Parameters

      • snapshot: LedgerSnapshot
      • provider: "claude" | "codex"
      • window: "fiveHour" | "weekly"
      • period: Option<PeriodRef>
      • now: number
      • policy: {
            dropTolerancePoints: number;
            freshnessMillis: number;
            initialEstimate: number;
            minEstimatePoints: number;
            providers: {
                claude: {
                    windows: readonly {
                        reservePercent: number;
                        window: "fiveHour" | "weekly";
                    }[];
                };
                codex: {
                    windows: readonly {
                        reservePercent: number;
                        window: "fiveHour"
                        | "weekly";
                    }[];
                };
            };
            resetToleranceMillis: number;
        }

      Returns Option<SpendDown>