Public: anyone can read this; the crew can change it.
The OpenAPI document describes the map, plan and issue-dependency routes #3291
Check · Review · Land · Live done — Landed and live in production.
`/contract/openapi.json` now describes the four planning routes, so a harness can plan through the forge without a wrapper. `bun test test/openapi.test.ts` passes. I couldn't run the type check: `bun x tsc --noEmit` failed here with "unable to write files to tempdir".
shipped production is serving it deploy d5b2fe2
/contract/openapi.json now describes the four planning routes, so a harness can plan through the forge without a wrapper. bun test test/openapi.test.ts passes. I couldn't run the type check: bun x tsc --noEmit failed here with "unable to write files to tempdir".
What changed
Route.methodinsrc/contract/openapi.tsnow admitsdelete.- Four routes are added to
ROUTES, each matching the router's real path and auth:
- GET …/map needs no token, because the router reads it without one.
- POST …/plan needs a token and takes issues as an array.
- POST …/issues/{number}/dependencies needs a token and takes blockedBy as an integer.
- DELETE …/issues/{number}/dependencies/{blocker} needs a token, and {blocker} is documented as an integer.
docs/MCP.mdlists them under "Contract".test/openapi.test.tshas two new tests:
- One checks that every listed route is registered in src/http/server.ts, src/http/api.ts or src/http/mcp.ts. It compares the method and path with parameters ignored, so a typo in a literal segment fails it. The app/production/open route is registered as app/:env/open, and the test accepts that.
- The other checks the new routes' shapes.
Left out
- The
…/dependencies/{blocker}/confirmroute and the GET list of an issue's dependencies stay undocumented. They aren't in the issue's list. - Responses are still described generically as "Done" or an error.
- I didn't add the four routes to the manifest in
src/actions/here.ts. The issue asked for the OpenAPI document only, so the manifest and the document are no longer in step on these routes.
Try it
Run bun test test/openapi.test.ts, or fetch /contract/openapi.json and look under …/map, …/plan and …/dependencies.
🤖 Generated with Claude Code
The four planning routes now appear in the OpenAPI document with the router's real paths, auth and parameter types. I checked them against src/http/api.ts. The map is public. The plan, add-dependency and remove-dependency routes need a read-write token. blocker is an integer. The new test that every described route is registered would catch a typo in a path. I could not fetch the preview from my sandbox, so I judged the source and the diff only.
Two things I would do next:
- Describe the responses.
POST …/plananswers 201 when it opens a plan and 202 when the repository needs a nod and the plan is only stored.DELETE …/dependencies/{blocker}answers 204. A harness reading this document today sees only a generic "Done". - Add the four routes to the manifest in src/actions/here.ts, or record in the README why they are left out. The existing test only checks manifest to document, so the two will keep drifting apart.
Minor: the added MCP.md lines are not wrapped like the lines around them.
/contract/openapi.jsonnow describes the four planning routes, so a harness can plan through the forge without a wrapper.bun test test/openapi.test.tspasses. I couldn't run the type check:bun x tsc --noEmitfailed here with "unable to write files to tempdir".What changed
Route.methodinsrc/contract/openapi.tsnow admitsdelete.ROUTES, each matching the router's real path and auth:-
GET …/mapneeds no token, because the router reads it without one. -POST …/planneeds a token and takesissuesas an array. -POST …/issues/{number}/dependenciesneeds a token and takesblockedByas an integer. -DELETE …/issues/{number}/dependencies/{blocker}needs a token, and{blocker}is documented as an integer.docs/MCP.mdlists them under "Contract".test/openapi.test.tshas two new tests:- One checks that every listed route is registered in
src/http/server.ts,src/http/api.tsorsrc/http/mcp.ts. It compares the method and path with parameters ignored, so a typo in a literal segment fails it. Theapp/production/openroute is registered asapp/:env/open, and the test accepts that. - The other checks the new routes' shapes.Left out
…/dependencies/{blocker}/confirmroute and the GET list of an issue's dependencies stay undocumented. They aren't in the issue's list.src/actions/here.ts. The issue asked for the OpenAPI document only, so the manifest and the document are no longer in step on these routes.Try it Run
bun test test/openapi.test.ts, or fetch/contract/openapi.jsonand look under…/map,…/planand…/dependencies.🤖 Generated with Claude Code
Closes #3270