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

An outsider's report answers with a receipt number and the same words by API and MCP #13435

Merged opened this

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

Merged

scout/forge:scout/13400-an-outsider-s-report-answers-with-a-rece → main 1 commit fork

  • Merged. scout/13400-an-outsider-s-report-answers-with-a-rece was merged into main as e7cd782.

Review

Sign in to review this change.
2 files changed +19 −0
docs/MCP.md +2
@@ -253,6 +253,8 @@ bytes in `tools/list`. After changing a tool run `bun scripts/mcp-table.ts`;
253253 | `offer` | — | Offer a patch to a public repository, no account needed; a person reads it first | 362 |
254254 <!-- mcp-tools:end -->
255255
256 `report` answers the receipt `POST …/reports` does (`id`, `state`, `issue`, `url`, `message`, `next`): `issue` is null until a person accepts the report, and `url` shows the number once there is one; never the filer's words.
257
256258 Five tools need no token, for the same reach as their HTTP doors: `report`,
257259 `offer`, `start`, `explore` and `search` (`TOKEN_FREE_TOOLS` in `src/core/mcp_card.ts`).
258260 `offer` (`{ repo, title, body?, patch }`, or `{ receipt }` to read an offer's state) calls `fileOffer`, the action behind
test/report-receipt.test.ts +17
@@ -61,6 +61,23 @@ describe("a report's receipt", () => {
6161 expect(t).not.toContain("secret-");
6262 });
6363
64 test("the MCP report tool answers the same receipt, with no token", async () => {
65 const res = await fetch(`${base}/mcp`, {
66 method: "POST",
67 headers: { "content-type": "application/json", accept: "application/json", ...from() },
68 body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call",
69 params: { name: "report", arguments: { repo: "alice/open", title: "Broken link", body: "secret-body" } } }),
70 });
71 const out = (await res.json()) as { result: { isError?: boolean; content: { text: string }[] } };
72 expect(out.result.isError).toBeFalsy();
73 const text = out.result.content[0]!.text;
74 const r = JSON.parse(text) as { issue: number | null; next: string; url: string; id: string; message: string };
75 expect(r.issue).toBeNull();
76 expect(r.next).toBe(REPORT_NEXT_STEP);
77 expect(r.url).toBe(`${base}/alice/open/report?sent=${r.id}`);
78 expect(text).not.toContain("secret-body");
79 });
80
6481 test("the url, signed out, shows the report escaped; a private repository is 404", async () => {
6582 const r = (await (await file("open", { title: "Broken <b>link</b>" })).json()) as { url: string; id: string };
6683 const page = await (await fetch(r.url)).text();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs