tarlatan
    Preparing search index...

    Function measuredIncrease

    • The increase in usedPercent, in points, of one provider window across a step, or Option.none() when the step is not measured in that window.

      The reading before is the latest one at or before the step's start; the reading after is the earliest one at or after its end. "Before" and "after" compare monotonic stamps from the step's boot, never the wall clock; ties are broken by ledger seq, the later-ingested reading winning.

      Both readings must be usable, read strictly (owner ruling 2026-11-16): the reading before at most freshnessMillis older than the start, the reading after at most freshnessMillis newer than the end, both bounds inclusive. Fewer steps are measured, so more fall back to initialEstimate. Both readings must also have a reset time, and the two must be equal (no reset in between).

      A fall in usage gives 0. A measured 0 stays 0 here; only the estimate is floored.

      Parameters

      • step: StepSpan
      • readings: readonly {
            observedAt: number;
            observedMono: Option<{ bootId: string & Brand<"BootId">; micros: number }>;
            provider: "claude" | "codex";
            resetsAt: Option<number>;
            seq: number & Brand<"LedgerSeq">;
            source:
                | "claudeRateLimitEvent"
                | "claudeStatusline"
                | "claudeUsagePrompt"
                | "codexAppServer";
            usedPercent: number;
            window: "fiveHour"
            | "weekly";
        }[]
      • provider: "claude" | "codex"
      • window: "fiveHour" | "weekly"
      • 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<number>