S01 · The Bootsector · L-03
Sliding-Window Rate Limiter
- Difficulty
- easy
- Type
- implementation
- Session
- Standard
- Stack
- TypeScript node20-ts5
- Domain
- Web Systems
- Est. solve
- ~25 min
01 · The task
An existing Express app needs sliding-window rate limiting wired in as middleware: cap how often a given client may call, and turn away the overflow the way an HTTP API should. Grading is deterministic, so drive timing through the kit's injectable clock instead of real wall-clock — the exact limits and response shape live in the tests.
02 · Constraints
Injectable clock
Time comes from an injected clock — never real wall-clock sleeps.
03 · Skills exercised
How to playDaemon
The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.
Pair this machine
One-time — approve the code under your devices.
promptly pairPull the workspace
Downloads the starter kit into
ratelimit/and starts the solve clock —cdin before the next step.promptly init ratelimitStart the captured session
Then drive your AI tool — the daemon meters every prompt and token live.
promptly startSubmit for ranked grading
Runs the full hidden suite and ends the attempt.
promptly submit
Or combine steps 02–03 into one commandShortcut
promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start. Then cd ratelimit and drive your harness.
promptly play ratelimit