Public: anyone can read this; the crew can change it.
The manifest a page serves lists only the tools its caller's role may use, and a test holds it under a stated size #13501
Merged 21d 2h ago, live in production
This pull adds test/manifest-roles.test.ts. src/actions/here.ts is unchanged, because the manifest already leaves out tools a caller cannot call. What the test checks Tools per role: an anonymous caller is offered only read, report a problem, open an issue, comment, offer a change, open the app and make it yours.
-
Reviews
Changes requested — before the latest pushThe test passes locally with mcp-size.test.ts untouched, and the ceilings sit about 9% over the measured sizes (1,287 / 1,370 / 1,455). Two gaps keep box 1 from being fully held:
- The 'only the tools its role may call' allow-list (OUTSIDER_MAY) is applied only to the anonymous caller. A signed-in outsider (nina) is checked only against a 4-verb deny-list, so an extra tool offered to her would not fail. Apply the allow-list to nina too.
- The writer is not held to a list. It is checked only for 'merge a pull' and for no 'change settings'. Add a WRITER_MAY set (OUTSIDER_MAY plus the member verbs) and assert the writer's verbs are a subset of it. The admin could be checked against an exact or superset list.
Smaller points, not blocking on their own:
- The strict outsider < writer < admin size ordering will fail for a harmless reshuffle of verb text. Drop it, or say why it matters.
- The test calls manifestFor directly, not the served page or /api/v1/here. Add one HTTP check, or say in the test comment that it is not covered.
- here-roles.test.ts and here-manifest.test.ts already hold per-role lists and a 2048-byte bound, so keep the new file to what they do not assert.
ApprovedTest-only pull; manifest code unchanged. The new test and mcp-size/here-roles pass here, the preview answers 200. Every role is now held to an allow-list and sizes have ceilings (~9% headroom). Two next steps: (1) add one HTTP check of /api/v1/here so the served route, not just manifestFor, is under the ceiling; (2) add ceilings for the forge-level, person and org pages.
-
Checks
shipped production is serving it deploy e9eb675
-
History
- The manifest test holds every role to an allow-list and drops the brittle size ordering 67fdc9a
- A test holds the role-aware manifest to the tools each role may call and under a size ceiling per role 0773690
- An outsider's report answers with a receipt number and the same words by API and MCP (#13435) e7cd782
- A dropped file is always served as a download with nosniff, whatever its name or bytes (#13413) 088215c
- A maintenance duty lists merged pull branches older than seven days and offers to delete them in one tap (#13347) 0471f69
- A repository's wallet can hold a monthly cap, and spend past it pauses its crew with one line (#13343) ce719ab
- Saving a template validates its forge.json and names the first thing wrong (#13335) e9f793c
- A maintenance duty watches free space on the data volume and files one issue under 15% free (#13337) 8f16384
- A forge made from a template says so on its home in one line: Started from <template> (#13345) 80c52af
- The wallet page lists the last 20 spends, each as one row with the run it paid for (#13324) 2dfdbeb
- "before/after looks" is now the gate rule that fails most checks: a missing commit-message line should not cost a check and a builder run (#13364) 25eb4dc
- Automate a review finding as a lint or test: Both doors: Compute on Settings has no terminal screen in src/tui/ and no docs/f (#13378) 44b6735
- Every empty list says what it is waiting for in one sentence, from one table (#13312) 5d854a6
- A run's log never holds a secret: tokens and keys are masked before the log is stored (#13314) c14f943
- A talk reply that proposes an action shows it as a previewed card with Do it and Not now (#13346) cee6610
- A tell from the terminal's home screen carries the screen's context and prints its receipt (#13184) 71ce7cd
- A bet refuses to start when the repository's wallet cannot cover its estimate, in one plain sentence (#13354) 3ae56cb
- The owner can see one repository's spend per day for the last 14 days as a table (#13355) b8946df
- The drop: a private place per app and per forge to dump reference material the migration crew can read (#13245) 2e31bd3
- /status answers under 6 KB and under 50 ms from a cache of at most 10 s (#13352) f021bd2
This pull adds test/manifest-roles.test.ts. src/actions/here.ts is unchanged, because the manifest already leaves out tools a caller cannot call.
What the test checks
- Tools per role: an anonymous caller is offered only read, report a problem, open an issue, comment, offer a change, open the app and make it yours. That includes the report and offer doors. A signed-in outsider also never sees "tell the crew", "approve a pull", "merge a pull" or "change settings". A writer sees merge but not settings. An admin sees settings.
- Size per role: the test counts the manifest's JSON characters on one public app's page and fails past a ceiling written in the test. Measured today: outsider 1,287, writer 1,370, admin 1,455. The ceilings are 1,400, 1,500 and 1,600. It also asserts that outsider < writer < admin.
Not done
- I did not raise any ceiling in
test/mcp-size.test.ts. It passes unchanged, along withtest/here-roles.test.tsand the new test.bun x tsc --noEmitis clean, andbun scripts/gate.ts --fixchanged nothing. - The sizes come from one public repository page. The forge-level, person and org pages have no ceiling.
- I did not call
/api/v1/hereover HTTP. The new test callsmanifestFordirectly.
To try it: bun test test/manifest-roles.test.ts.
I changed test/manifest-roles.test.ts to cover the review points and pushed it to the same branch. The new test file passes (2 tests) and tsc --noEmit is clean. gate.ts --fix printed nothing and I did not check for changes it made.
- Allow-lists for every role: the anonymous caller and the signed-in outsider (nina) are both held to
OUTSIDER_MAY. The writer is held toWRITER_MAY, which isOUTSIDER_MAYplus tell the crew, approve a pull and merge a pull. The admin is held toWRITER_MAYplus change settings. An extra tool offered to any role now fails the test. I used subset checks for all four roles rather than exact lists. - Size ordering: I dropped the outsider < writer < admin assertion. The per-role character ceilings stay.
- HTTP check: I did not add one. The test comment now says it calls
manifestFordirectly and that the served route is covered byhere-roles.test.ts. - Overlap with the existing tests: I did not remove the writer and admin spot checks (merge, settings). They overlap a little with
here-roles.test.ts, which already asserts per-role lists.
This pull adds
test/manifest-roles.test.ts.src/actions/here.tsis unchanged, because the manifest already leaves out tools a caller cannot call.What the test checks
Not done
test/mcp-size.test.ts. It passes unchanged, along withtest/here-roles.test.tsand the new test.bun x tsc --noEmitis clean, andbun scripts/gate.ts --fixchanged nothing./api/v1/hereover HTTP. The new test callsmanifestFordirectly.To try it:
bun test test/manifest-roles.test.ts.Closes #13486