← story.propek
STORY MI-0.1
MI-0.1
Epic: Market Intel Macro v1
PENDING
ACCEPTANCE CRITERIA (11/11)
1. `lib/http-client.js` exports `fetchJSON(url, options)`, `fetchText(url, options)`, and `createLimiter(maxPerSecond)`
2. `fetchJSON` parses JSON response and throws typed errors: `HttpTimeoutError`, `HttpStatusError`, `HttpParseError`, `HttpNetworkError`
3. Retry logic retries on status codes 408, 429, 500, 502, 503, 504 with exponential backoff (1s, 2s, 4s default)
4. `fetchText` returns raw text response with same retry behavior
5. `createLimiter(maxPerSecond)` enforces minimum interval between requests via `.wait()` method
6. Single-hop redirect following (30x with Location header)
7. Default timeout is 15000ms, configurable via options
8. Max retries default is 3, configurable via options
9. Uses ONLY Node.js stdlib (`https`, `http`) -- zero npm dependencies
10. All 4 error classes are exported for consumer use
11. Works with both `https://` and `http://` URLs
TIMELINE
24/03/2026
feat: sessao 24/03 — DS v6, Market Intel, bot v5 sprints, content extractor [Story 6.1-sales-intelligence-bot]
c996eef