Implement a token-bucket rate limiter CLI tool located at /app/rate limiter.py . It must process a JSONL log…
Implement a token-bucket rate limiter CLI tool located at /app/rate limiter.py . It must process a JSONL log…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input contract: - Read from stdin (UTF-8 encoded). - Each line is a JSON object with keys: "time" (ISO…
The task
**Input contract:** - Read from stdin (UTF-8 encoded). - Each line is a JSON object with keys: `"time"` (ISO 8601 UTC timestamp, always ending in `Z`), `"user"` (string, non-empty), `"action"` (string, always exactly `"REFRESH"` or `"REFILL"`). - Lines are sorted by `"time"` ascending. - There may be duplicate lines…
Part of ai-and/termgrade-environments.