Intent: a harness that re-reads the 145 KB OpenAPI document on every start pays for it once per release.
Seen: GET /contract/openapi.json answers 200 public, max-age=300 with no ETag (src/http/mcp.ts:335), so every read rebuilds it (13 ms) and sends it whole.
Done:
[ ] the answer carries an ETag derived from the running version and origin, using src/http/etag.ts
[ ] If-None-Match with it answers 304 with no body
[ ] the document is built once per origin and version, not per request
[ ] a test: second request with the ETag is 304; a different version gives a different ETag
Files: src/http/mcp.ts (the route), src/contract/openapi.ts if a cache lives there, one test.
Risk: none; this route is touched by nothing else open.
Intent: a harness that re-reads the 145 KB OpenAPI document on every start pays for it once per release.
Seen:
GET /contract/openapi.jsonanswers 200public, max-age=300with no ETag (src/http/mcp.ts:335), so every read rebuilds it (13 ms) and sends it whole.Done:
If-None-Matchwith it answers 304 with no bodyFiles: src/http/mcp.ts (the route), src/contract/openapi.ts if a cache lives there, one test. Risk: none; this route is touched by nothing else open.