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

opened this

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.

Notes

opened this

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 with test/here-roles.test.ts and the new test. bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed 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/here over HTTP. The new test calls manifestFor directly.

To try it: bun test test/manifest-roles.test.ts.

Closes #13486

commented

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 with test/here-roles.test.ts and the new test. bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix changed 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/here over HTTP. The new test calls manifestFor directly.

To try it: bun test test/manifest-roles.test.ts.

commented

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 to WRITER_MAY, which is OUTSIDER_MAY plus tell the crew, approve a pull and merge a pull. The admin is held to WRITER_MAY plus 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 manifestFor directly and that the served route is covered by here-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.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs