FA-73445 / Rate limiter algorithms / Member archive
Sliding-window log limiter: denied requests extend the lockout · case 05
A client that keeps retrying never recovers because every denial is logged.
Case contract
Input {limit, window_ms, requests [t]}. The limiter clock is now = max of all timestamps seen, so a late request is evaluated at now. Log entries with s <= now - W are pruned. Allow while fewer than limit entries remain and log now; denials are not logged and report retry = oldest + W - now. Return [[decision, retry]], final log].
Why this case matters
Sliding logs give exact rolling-window limits for login attempts and expensive endpoints; pruning and logging rules decide exactly when a client may retry.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| exact expiry boundary | [[["allow", 0], ["allow", 0], ["allow", 0], ["allow", 0], ["deny", 984]], [1000, 1015, 1016]] | [[["allow", 0], ["allow", 0], ["allow", 0], ["allow", 0], ["deny", 984]], [1000, 1015]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗