Public: anyone can read this; the crew can change it.
Access 4c: the grants view as an MCP tool and a terminal screen #18130
Merged 5h 24m ago, live in production
The grants view from #18104 can now be read by agents, through MCP whoamican with kind: "grants", and in the terminal, through a new Who may do what entry in the ctrl-k palette. A forge admin who is a person sees every grant. Everyone else sees only grants held by their own account.
-
Reviews
ApprovedClean. whoami_can kind:"grants" reuses the page's action (whoMayDoWhat): an admin person sees everything, everyone else, agents included, only their own rows; no new gate, no new input. Test covers admin vs member, docs updated in who-can.md, terminal door is the existing whocan screen. Not blocking: the agent-with-admin-account case is untested here.
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Rewrap a comment (#18106) ea7a774
- who-may test: the MCP door only; the terminal is test/who-can.test.ts's (#18106) 6fcbf58
- Merge main: whoami_can's kind: "grants" reads #18062's whoMayDoWhat; its duplicate action and terminal screen go (#18106) 29873cd
- small: the Absorb findings say they are ready for the owner to send to Ben (#18132) d41ec43
- whoami_can: a shorter description keeps the Talk list under its 18,500-byte ceiling after the merge (#18106) 8746edf
- Games survival step 2a: BlueMap behind login at /games/<box>/<server>/map, no published box port (#18100) 1132c91
- A Mac can take a repository's checks and report them on the pull (#17915) 4c72a1d
- Access 4: one view of every grant, and a page that says who may do what (#18062) 5ba07c8
- Merge main: whoami_can's doc names both actions and kind grants (#18106) 9f27e1e
- Access 2: one `may(principal, action, resource)`, with the repository checks behind it first (#18065) 7d48ce1
- Apps without a login 2: a tiny model in the browser fills the app's spec, and the compiler catches every failure (#18117) 4147a37
- Games: a new pin for the forge's proxy plugin replaces the old jar, in PLUGINS and on disk, and the page says which one loaded (#18111) da9e15f
- Healer: a server still starting, its log moving, is not started again (#18053) d918642
- Game box: refuse a wake or a mod install the box has no memory for (#18057) 7fe508f
- Games survival step 1: a survival performance set (lithium, scalablelux, noisium, chunky) planned as one locked install (#18099) b838dce
- Games survival step 2b: read FabricExporter Prometheus metrics at check-in so TPS and tick time show on the games page (#18116) 0d92810
- Full suite red: 2 files in check run 01m8zwjzbrpcdryvgey8kqdeak (#18124) 643723c
- Palette roster: Who may do what is offered to every signed-in account (#18106) 93ddc2a
- Who may do what: the test builds a real MCP context, read-only scope (#18106) e01a972
- Access 4c: who may do what, as MCP whoami_can kind grants and a terminal screen (#18106) cb310a1
2 earlier comments · 1 event
The grants view from #18104 can now be read by agents, through MCP whoami_can with kind: "grants", and in the terminal, through a new Who may do what entry in the ctrl-k palette. A forge admin who is a person sees every grant. Everyone else sees only grants held by their own account. That includes every agent, even one whose account is an admin, so a token never shows more than its own account holds.
- One gate, one set of words: the tool and the screen both go through the new
src/actions/who_may.ts.whoMay(app, user)picks every grant or only the caller's own (passed toeveryGrant(db, account)).grantWords(g)turns each grant into one line, e.g.user <id> may member on forge · by <id> · 2026-12-04 · member, andwhoMayHeadingwrites the sentence above the list. The tool answers{ scope, says, grants }, and each grant carries itsline. - No new tool: this is a third
kindon the existingwhoami_cantool, which also keeps the MCP tool list small. Its description gained one clause; the tool-list size test passes. - Terminal:
src/tui/screens/who_may.tsis read-only,j/kmove, and the palette offers it to every signed-in account. - Cleanup:
src/core/grants_view.tsnow has callers, so it is off both "nothing calls this yet" allow lists and its header comment says who reads it. - Docs:
docs/features/who-may.mdcovers both the tool and the terminal screen.
Test: test/who-may.test.ts calls the tool with a read-only token. As admin, the answer includes both members' rows. As plain member bob, every row is bob's own. The terminal shows bob the same sentence and lines, never carol's id, and shows the admin every grant. Without the gate, bob would see carol's row and the test would fail.
Changed an existing test: test/palette-roster.test.ts pins the full palette list for each kind of account, so it was right to fail. I added the new entry to its three lists.
Not done:
- The "Who may do what" web page (#18105) isn't built yet. These words live in
who_may.tsso the page can use the same ones. - The screen shows account ids, not usernames, because the view returns ids.
- No filtering or paging.
Checks run: bun x tsc --noEmit and bun scripts/gate.ts --explain are clean apart from one note. The note says whoMayScreen resembles forgeUsageScreen and the test's terminal helper resembles one in tui-machines.test.ts; I kept them separate. scripts/fast.ts named about 1,000 test files, too many to run here. I ran these instead, and they pass:
who-may,grants-view,mcp-size,tui-can,delete-tiermodule-state,unreached,unused-exports,mcp-doc-*palette-entries,palette-roster,doorless,feature-doors,hollow,talk-whoami
Try it on the preview: call MCP whoami_can with {"kind":"grants"} as an admin and as a member, or SSH in and pick Who may do what from ctrl-k.
🤖 Generated with Claude Code
This pull lets an MCP client ask whoami_can with kind: "grants" for who may do what. A forge admin sees every grant; anyone else sees only their own, each grant with a line of text. A terminal screen shows the same list.
This update merges main. Both sides had rewritten the doc string of src/http/mcp/tools/whoami_can.ts. The merged doc keeps main's new actions field (what you may do across the forge, by the names GET /api/v1/may takes) and this branch's kind: "grants".
With both changes in, the Talk tool list was 18,503 bytes, 3 over the 18,500 limit test/mcp-talk-tools.test.ts holds it to. The test says not to raise that limit in a feature pull, so the tool's description became "What you may do: your role, each action yes or no." It had been "What you can do: your role and each action, yes or no." The test was right and was not changed.
All 1,325 tests in test/mcp*.test.ts pass, and so do the who-may and whoami tests; bun x tsc --noEmit is clean. The full set scripts/fast.ts named was too large to run here (about 76 minutes), so the forge's check on this push covers the rest. The gate's only notes flag code that looks similar to other code, as before the merge.
To try it, call the whoami_can MCP tool with {"kind":"grants"}, once as a forge admin and once as an ordinary account. The admin should see every grant and the ordinary account only its own.
🤖 Generated with Claude Code
MCP whoami_can now takes kind: "grants", so anyone signed in can ask who may do what. A forge admin who is a person gets every grant, and anyone else, any agent included, gets only their own. The answer is { scope, standing, grants }.
This merges main, which had since landed Access 4 (#18062): the shared action whoMayDoWhat in src/actions/grants_view.ts, the terminal screen "Who may do what" (src/tui/screens/whocan.ts), and an admin-only MCP door (access with action: "grants"). The only conflict was a doc comment in src/core/grants_view.ts, and main's version is kept.
To avoid two copies of the same feature, whoami_can now calls main's action with no filter. This branch's own copies are deleted: src/actions/who_may.ts, src/tui/screens/who_may.ts, its who-may palette entry and docs/features/who-may.md. That changes this tool's answer from what earlier commits on the branch returned: scope is now all or self (it was everyone or yours), and the says sentence and each row's line are gone.
- Terminal side: main's
whocanscreen. - Docs:
docs/features/who-can.mdnow nameswhoami_canas the MCP door for everyone, andaccessas the admin's door withpersonandresourcefilters. - Tests:
test/who-may.test.tsnow covers only the MCP door: an admin sees everyone's grants, a member sees only their own. I dropped its terminal half because the gate flagged its helper as a near-copy of another test's, andtest/who-can.test.tsfrom main already checks the screen.
Type check, the gate, and test/who-may, who-can, grants-view, palette-roster, mcp-talk-tools (the Talk list size limit) and talk-page all pass.
To try it: call MCP whoami_can {"kind":"grants"} as a member, then as an admin, and compare with Settings → Who may do what (/settings/who-can).
🤖 Generated with Claude Code
The grants view from #18104 can now be read by agents, through MCP
whoami_canwithkind: "grants", and in the terminal, through a new Who may do what entry in thectrl-kpalette. A forge admin who is a person sees every grant. Everyone else sees only grants held by their own account. That includes every agent, even one whose account is an admin, so a token never shows more than its own account holds.src/actions/who_may.ts.whoMay(app, user)picks every grant or only the caller's own (passed toeveryGrant(db, account)).grantWords(g)turns each grant into one line, e.g.user <id> may member on forge · by <id> · 2026-12-04 · member, andwhoMayHeadingwrites the sentence above the list. The tool answers{ scope, says, grants }, and each grant carries itsline.kindon the existingwhoami_cantool, which also keeps the MCP tool list small. Its description gained one clause; the tool-list size test passes.src/tui/screens/who_may.tsis read-only,j/kmove, and the palette offers it to every signed-in account.src/core/grants_view.tsnow has callers, so it is off both "nothing calls this yet" allow lists and its header comment says who reads it.docs/features/who-may.mdcovers both the tool and the terminal screen.Test:
test/who-may.test.tscalls the tool with a read-only token. As admin, the answer includes both members' rows. As plain memberbob, every row isbob's own. The terminal showsbobthe same sentence and lines, nevercarol's id, and shows the admin every grant. Without the gate,bobwould seecarol's row and the test would fail.Changed an existing test:
test/palette-roster.test.tspins the full palette list for each kind of account, so it was right to fail. I added the new entry to its three lists.Not done:
who_may.tsso the page can use the same ones.Checks run:
bun x tsc --noEmitandbun scripts/gate.ts --explainare clean apart from one note. The note sayswhoMayScreenresemblesforgeUsageScreenand the test's terminal helper resembles one intui-machines.test.ts; I kept them separate.scripts/fast.tsnamed about 1,000 test files, too many to run here. I ran these instead, and they pass:who-may,grants-view,mcp-size,tui-can,delete-tiermodule-state,unreached,unused-exports,mcp-doc-*palette-entries,palette-roster,doorless,feature-doors,hollow,talk-whoamiTry it on the preview: call MCP
whoami_canwith{"kind":"grants"}as an admin and as a member, or SSH in and pick Who may do what fromctrl-k.🤖 Generated with Claude Code
Closes #18106