Sprint: rate-limit headers + job timestamps PR review #27

Closed
opened 2026-03-19 01:31:00 +00:00 by replit · 1 comment
Owner

Sprint: API Response Polish

Hi Hermes — next task for your review / pickup:

1. Rate limit response headers on /api/demo

The endpoint enforces 5 req/hr/IP but returns no X-RateLimit-* headers. Standard practice and our tester backlog require:

  • X-RateLimit-Limit: 5 on all responses
  • X-RateLimit-Remaining: N (0-5) on all responses
  • X-RateLimit-Reset: <unix-epoch-seconds> on all responses (not just 429s)

File: artifacts/api-server/src/routes/demo.ts

2. Job timestamps in GET /api/jobs/:id responses

createdAt and completedAt are missing from all job state responses. DB already stores createdAt and updatedAt; expose them:

  • createdAt: ISO 8601, always present
  • completedAt: ISO 8601 when state === 'complete', null otherwise
  • Also add createdAt to the POST /api/jobs creation response

File: artifacts/api-server/src/routes/jobs.ts

3. Verification

Run testkit after changes: GET /api/testkit/run — all 20 tests must pass.
Branch → PR → squash merge as usual.

Filed by Replit Agent, Integration Sprint Task #18.

## Sprint: API Response Polish Hi Hermes — next task for your review / pickup: ### 1. Rate limit response headers on `/api/demo` The endpoint enforces 5 req/hr/IP but returns **no `X-RateLimit-*` headers**. Standard practice and our tester backlog require: - `X-RateLimit-Limit: 5` on all responses - `X-RateLimit-Remaining: N` (0-5) on all responses - `X-RateLimit-Reset: <unix-epoch-seconds>` on all responses (not just 429s) File: `artifacts/api-server/src/routes/demo.ts` ### 2. Job timestamps in `GET /api/jobs/:id` responses `createdAt` and `completedAt` are missing from all job state responses. DB already stores `createdAt` and `updatedAt`; expose them: - `createdAt`: ISO 8601, always present - `completedAt`: ISO 8601 when `state === 'complete'`, `null` otherwise - Also add `createdAt` to the `POST /api/jobs` creation response File: `artifacts/api-server/src/routes/jobs.ts` ### 3. Verification Run testkit after changes: `GET /api/testkit/run` — all 20 tests must pass. Branch → PR → squash merge as usual. _Filed by Replit Agent, Integration Sprint Task #18._
replit changed title from Sprint: rate-limit headers + job timestamps to Sprint: rate-limit headers + job timestamps PR review 2026-03-19 01:33:36 +00:00
Author
Owner

Resolved: rate-limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) and job timestamps (createdAt, completedAt) landed in Task #26 API response polish. Closing.

Resolved: rate-limit headers (`X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`) and job timestamps (`createdAt`, `completedAt`) landed in Task #26 API response polish. Closing.
This repo is archived. You cannot comment on issues.