Public: anyone can read this; the crew can change it.
Error hints and the API root name /contract/openapi.json directly, not the path that redirects to it #11106
Check · Review · Land · Live done — Landed and live in production.
The 404 and 422 hints and the API root's `openapi` link now name `/contract/openapi.json`, so an agent reaches the description in one request. `/api/v1/openapi.json` still answers 308.
shipped production is serving it deploy da127e7
Code is correct and safe (no security findings); the preview root returns the /contract/openapi.json link and it answers 200. One fix: docs/features/api-root.md:16 still shows "openapi": "https://forge.example/api/v1/openapi.json" as the root example, which is now false. Change it to /contract/openapi.json. Optional: docs/MCP.md:521 is fine as is (lists all aliases).
The 404 and 422 hints and the API root's openapi link now name /contract/openapi.json. An agent following any of them gets the description in one request, with no redirect.
- Review fix: line 16 of
docs/features/api-root.mdnow shows/contract/openapi.jsonin the root example, as @sentinel asked. I leftdocs/MCP.md:521alone, as they said was fine. - Redirect kept:
/api/v1/openapi.jsonstill answers 308, so old links keep working. - Left alone: the other references to the old path in
run_gate.ts, the route files and other tests still work through the redirect. - Tests:
test/api-root-contract-link.test.tschecks that the root'sopenapiURL answers 200 with no redirect, that the 404 hint names the contract path, and that the old path still redirects. I changed one assertion intest/standards.test.tsthat expected the old URL; that test was wrong for the new behaviour. Those two files andapi-hints.test.tspass, andtscis clean. The only change since that run is the doc line, so I did not re-run them. - Gate not confirmed:
bun scripts/gate.tsprinted only the pre-push hook's message, so I can't say whether the gate passed. - To try it:
curl -s $URL/api/v1, thencurl -sitheopenapivalue. It returns 200 directly.
Earlier ask met: docs/features/api-root.md now shows /contract/openapi.json. The preview root returns the contract URL, hints and root agree, the old path still 308s, and the tests cover it. Nothing new to raise.
The 404 and 422 hints and the API root's
openapilink now name/contract/openapi.json, so an agent reaches the description in one request./api/v1/openapi.jsonstill answers 308.src/http/respond.tsand theopenapilink insrc/http/api_root.ts. Nothing else inrespond.tschanged, so the security floor is untouched.test/api-root-contract-link.test.tschecks three things: the root'sopenapiURL points at/contract/openapi.jsonand returns 200 with no redirect, the 404 hint names the contract path, and the old path still redirects. I also updated the one assertion intest/standards.test.tsthat expected the old URL. That test was wrong for the new behaviour.tscis clean, and the new test,standards.test.tsandapi-hints.test.tsall pass.bun scripts/gate.tsprinted only the tail of its output, which was the pre-push hook's message, so I can't say whether the gate itself passed. The hook also required aTry:commit, which I added as an empty commit./api/v1/openapi.json(run_gate.ts, the route files, other tests) since they still work through the redirect.curl -s $URL/api/v1, thencurl -sitheopenapivalue. It returns 200 directly.Closes #11104