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
Check · Review · Land · Live done — Landed and 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.
shipped production is serving it deploy 59903fa
1 earlier comment · 1 event
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.
The 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.
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.
Test-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.
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