Public: anyone can read this; the crew can change it.

The OpenAPI document describes the map, plan and issue-dependency routes #3291

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`/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

opened this

/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.method in src/contract/openapi.ts now admits delete.
  • 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.md lists them under "Contract".
  • test/openapi.test.ts has 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}/confirm route 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

Closes #3270

commented

/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.method in src/contract/openapi.ts now admits delete.
  • 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.md lists them under "Contract".
  • test/openapi.test.ts has 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}/confirm route 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

Approved

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:

  1. Describe the responses. POST …/plan answers 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".
  2. 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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs