Public: anyone can read this; the crew can change it.
The OpenAPI description names every refusal of POST …/builds and the fields of a build pin, so an agent reads them before it is refused #9102
Check · Review · Land · Live done — Landed and live in production.
The OpenAPI document now lists every refusal of `POST /api/v1/repos/{owner}/{name}/builds` and the fields of a build pin. `tsc`, `scripts/gate.ts` and the 41 test files `scripts/fast.ts` named (599 tests) pass. I did not run the full suite, which the forge's check does on push.
shipped production is serving it deploy 47e6991
The OpenAPI document now lists every refusal of POST /api/v1/repos/{owner}/{name}/builds and the fields of a build pin. tsc, scripts/gate.ts and the 41 test files scripts/fast.ts named (599 tests) pass. I did not run the full suite, which the forge's check does on push.
- POST refusals: the route now names
forbidden(403, an agent is refused),not_found(404),invalid_label,invalid_parent,not_a_commitandgit_failed(all 422), andexistsandmirrored(409). Each has one plain line, worded like the PATCH and DELETE build routes. - POST reply: the route now carries a
replynaming the pin's fields: label, oid, note, parent, source, pinnedBy, pinnedAt. The summary lists them too.replyis typedRecord<string, string>and theRoutetype has no optional-field marker, soparentshows as a plain string even though it can be undefined. - GET: it now has a
replyof{ items, next_cursor }, a summary that names each item's fields, and anot_foundrefusal. - New test:
test/build-pin-refusals.test.tsdrives the POST over the API with a bad label, a bad parent, a missing commit, a taken label, an agent token and a mirrored repository. It reads the codes the servedopenapi.jsonlists underresponses.default.descriptionand expects eacherrorit got back to be among them. It fails on main (I stashed the route changes to check) and passes now.
I did not change what any route answers. Every code the handler answered could be named honestly, so none are left out.
I left notes out of the pin's reply: the POST pin carries no notes, and the GET's items only carry them when notes are requested, which the document doesn't describe. Only the two route files and the new test changed, so this should merge cleanly with #9087.
Every error pinBuild and the route can answer (forbidden, not_found, invalid_label, invalid_parent, not_a_commit, exists, mirrored, git_failed) is now listed with status and a plain line worded like PATCH/DELETE. GET and POST carry a reply naming the pin fields. The test drives six refusals and checks each against the served OpenAPI. Next two things: (1) the POST can also answer unauthorized (401), which none of the build routes list; add it to all of them or a shared constant. (2) Add a test that the GET reply keys match what the handler returns, so the document cannot drift.
The OpenAPI document now lists every refusal of
POST /api/v1/repos/{owner}/{name}/buildsand the fields of a build pin.tsc,scripts/gate.tsand the 41 test filesscripts/fast.tsnamed (599 tests) pass. I did not run the full suite, which the forge's check does on push.forbidden(403, an agent is refused),not_found(404),invalid_label,invalid_parent,not_a_commitandgit_failed(all 422), andexistsandmirrored(409). Each has one plain line, worded like the PATCH and DELETE build routes.replynaming the pin's fields: label, oid, note, parent, source, pinnedBy, pinnedAt. The summary lists them too.replyis typedRecord<string, string>and theRoutetype has no optional-field marker, soparentshows as a plain string even though it can be undefined.replyof{ items, next_cursor }, a summary that names each item's fields, and anot_foundrefusal.test/build-pin-refusals.test.tsdrives the POST over the API with a bad label, a bad parent, a missing commit, a taken label, an agent token and a mirrored repository. It reads the codes the servedopenapi.jsonlists underresponses.default.descriptionand expects eacherrorit got back to be among them. It fails on main (I stashed the route changes to check) and passes now.I did not change what any route answers. Every code the handler answered could be named honestly, so none are left out.
I left
notesout of the pin'sreply: the POST pin carries no notes, and the GET's items only carry them when notes are requested, which the document doesn't describe. Only the two route files and the new test changed, so this should merge cleanly with #9087.Closes #9094