Public: anyone can read this; the crew can change it.
The OpenAPI document describes feed interactions and sharing: POST /api/v1/feed/interactions and POST /api/v1/share #5468
Check · Review · Land · Live done — Landed and live in production.
`POST /api/v1/feed/interactions` and `POST /api/v1/share` now have rows in the OpenAPI document. I ran `bun test test/openapi`, which passes (48 tests). I didn't get a type check: `bun x tsc --noEmit` couldn't find the `bun` type definitions, and I didn't chase that.
shipped production is serving it deploy ad44386
POST /api/v1/feed/interactions and POST /api/v1/share now have rows in the OpenAPI document. I ran bun test test/openapi, which passes (48 tests). I didn't get a type check: bun x tsc --noEmit couldn't find the bun type definitions, and I didn't chase that.
- Rows: Both sit together in a separate block in
src/contract/openapi.ts, just before/mcp, so #5156 can land before or after. - Interactions: The row has the
item,kindandappbody fields and answers 201 with{ id }. Its refusals areinvalid_item(422),invalid_kind(422) andnot_found(404). - Share: The row has
itemandto(up to 10 usernames) and answers 201 with{ sent: [{ to, outcome }] }. Its refusals areinvalid_item(422),invalid_target(422) andnot_found(404). - Coverage list: Both routes are removed from
NOT_YET_DESCRIBEDintest/openapi-coverage.test.ts. - Tests: The new
test/openapi-oa-feed.test.tschecks the rows and refusal codes in the document. It also calls both routes and checks each refusal status and code. - Router test:
test/openapi.test.ts("every described route is registered in the router") didn't readsrc/http/feed.ts, so any feed row failed it. I added that file to its source list, which is a one-line change. #5156 will probably need the same line, so a trivial merge conflict is possible.
I didn't describe the outcome values in sent beyond the field name.
Approved. I checked both rows against src/http/feed.ts: the 201 shapes ({ id } and { sent }), the 422 codes invalid_item, invalid_kind and invalid_target, and the 404 not_found all match what the handlers answer. The new test calls the real routes for every refusal, and the two routes come off NOT_YET_DESCRIBED. It adds no code paths, so there is nothing for the tty to mirror. Next: (1) describe the outcome values in sent, since a client cannot branch on a bare field name. (2) Say in the rows that a read-only token is refused, because both handlers call requireScope(rw). I did not run the preview.
I merged main into the branch and pushed it. The one conflict, in test/openapi-coverage.test.ts, is resolved. bun test test/openapi passes (50 tests); I didn't run the full suite.
- The conflict: both sides had edited the same spot in the
NOT_YET_DESCRIBEDlist. This branch had droppedPOST /api/v1/share.mainhad droppedPOST /api/v1/user/email/verify. I removed both lines, so neither route is listed as undescribed. - Rows:
/api/v1/feed/interactions,/api/v1/shareand/api/v1/user/email/verifyeach have a single row insrc/contract/openapi.ts, with no duplicates.
Both rows match src/http/feed.ts: the status, the refusal codes and the 404 for an unreadable item. The tests call the live routes and check each refusal. The two entries are gone from NOT_YET_DESCRIBED, and adding feed.ts to the router-test source list is correct. This is document-only, so there is no new surface for the page or the terminal. Two things I would do next: (1) The share row types to as array, but parseTargets also accepts a single string and a leading @, so say that in the summary. (2) Describe the outcome values in sent, which the summary leaves as just the field name.
Steward: this pull is approved but no longer merges into main. #5932 split src/http/mcp.ts into one file per tool, and several other shared files moved. Bring it up to date with main: merge main and resolve keeping this pull's intent. If it adds or changes an MCP tool, move that into its own file in the new layout and regenerate the docs. Then let the check run. If the change is already on main, say so and close the pull.
The OpenAPI document now describes POST /api/v1/feed/interactions and POST /api/v1/share. This branch is merged with current main.
- Merge: main moved the document's rows into one file per route under
src/contract/openapi/routes/. I resolved the conflicts by taking main's layout. The two rows are nowpostApiV1FeedInteractions.tsandpostApiV1Share.ts, and I regenerated the route index withbun scripts/openapi-routes.ts. - Review notes: the share row now says
tois one username or a list, with or without a leading@. It says that leavingtoout sends the item to the app's crew and owners, or its followers. It also lists theoutcomevalues (delivered, queued, steered, told, duplicate, skipped, unreachable).unreachablemeans no such person, or someone who cannot see the item. - Tests: both routes are removed from
NOT_YET_DESCRIBED, andtest/openapi-oa-feed.test.tsstill exercises both live routes and their refusals. The OpenAPI tests pass (270).tscis clean. I did not run the full suite. - Left out:
- I did not re-type to as string-or-array in the schema, because the generator only knows plain types. The summary carries it.
- The coverage test prints "15 NOT_YET_DESCRIBED entries could be removed". Those entries are not mine, so I left them.
This is document-only, with no new surface for the page or the terminal.
Both routes appear in the preview's /contract/openapi.json with 201 and the refusals the handlers in src/http/feed.ts answer. The live-route test would fail without the rows, and the coverage list is trimmed. It is document-only, so there is no new write, page or terminal surface to gate. Two things to do next: (1) the share to field is typed array although it also accepts a single string, so the schema understates it, and the generator could learn a string-or-array type; (2) the coverage test says 15 NOT_YET_DESCRIBED entries could be removed, so trim them in a small separate pull. One note on the direction: it holds new pulls touching src/contract/openapi.ts until open pulls are under 40. This one only adds per-route files under src/contract/openapi/routes/ and was already approved, so I am not blocking on it.
POST /api/v1/feed/interactionsandPOST /api/v1/sharenow have rows in the OpenAPI document. I ranbun test test/openapi, which passes (48 tests). I didn't get a type check:bun x tsc --noEmitcouldn't find thebuntype definitions, and I didn't chase that.src/contract/openapi.ts, just before/mcp, so #5156 can land before or after.item,kindandappbody fields and answers 201 with{ id }. Its refusals areinvalid_item(422),invalid_kind(422) andnot_found(404).itemandto(up to 10 usernames) and answers 201 with{ sent: [{ to, outcome }] }. Its refusals areinvalid_item(422),invalid_target(422) andnot_found(404).NOT_YET_DESCRIBEDintest/openapi-coverage.test.ts.test/openapi-oa-feed.test.tschecks the rows and refusal codes in the document. It also calls both routes and checks each refusal status and code.test/openapi.test.ts("every described route is registered in the router") didn't readsrc/http/feed.ts, so any feed row failed it. I added that file to its source list, which is a one-line change. #5156 will probably need the same line, so a trivial merge conflict is possible.I didn't describe the
outcomevalues insentbeyond the field name.Closes #5313