Public: anyone can read this; the crew can change it.
Access 4b: the 'Who may do what' page, linked from settings, by person and by resource #18131
Merged 5h 55m ago, live in production
This adds Settings › Who may do what at /settings/who-can, with a row for it in the settings nav that everyone sees. A forge admin sees every grant on the forge, grouped by person or, with ?by=resource, by what it reaches. Anyone else sees their role first, then only the grants they hold themselves.
-
Reviews
Changes requested — before the latest pushThe nav row and the budget bump are right, and the terminal and the how-to are updated. One thing blocks: the dead-link fix is incomplete.
src/http/marks/settings.jsonmarks/settings/telemetry(line 20) and/settings/devices(line 72) asadmin, so a person who holds atelemetry_grantordevice_grantstill gets a row linking to a page that turns them away. The pull's own test asserts the telemetry link stays. Fix first: stop keeping a second hand-written list. Derive the admin-only paths from the marks, or move thehrefblanking to where the grant rows are built, so the list cannot drift. Then add/settings/telemetryand/settings/devicesto the test's wall list and flip the telemetry assertion. Smaller: a row with no link has no action, so on a phone the person reads 'an admin changes it' with no hint who that is. Consider naming the page, e.g. 'an admin changes it (People)'.ApprovedEarlier asks: (1) no dead links on admin-only pages in a person's own view: met.
reachableBynow asksisAdminRoutefrom the route marks, so telemetry and device rows lose their link too, and the row says "an admin changes it (Telemetry)" on the page and in the terminal. (2) First-view budget: met, 149 to 153 with a note. (3) Docs:docs/features/who-can.mdis updated and README is untouched. The test covers the web page, the terminal screen and the admin's link still present.The nav row is a link, the unlinked rows are plain rows, and nothing needs JavaScript. An admin's view is unchanged.
Two things I would do next:
- Non-blocking:
pageNamecapitalises the last path segment, so a future route like/settings/connected-agentswould read "Connected-agents". Take the name from the nav row table inorigins.tsinstead. - Non-blocking: the same "an admin changes it" string is built in
src/web/pages/who-can.tsandsrc/tui/screens/whocan.ts. Put it in one helper next toprovenance.
- Non-blocking:
-
Checks
shipped production is serving it deploy a338207
-
History
- Rewrap a comment the gate asked for (#18105) 2b09303
- Who may do what: read the admin-only pages from the route marks, and name the page (#18105) 4e116e1
- Merge main: keep the admin-only rows' wording and main's whoami_can grants (#18105) 0bc67c9
- Games: a proxy plugin update can wait until nobody has been on for 30 minutes (#18039) 9a5eb31
- Traces 5: compare two traces, and share one with secrets redacted (#18017) 7a17314
- AWS writes for mail setup are a named allowlist beside the read rule, and nothing else (#18142) 93c7c3d
- Traces 1c: GET /api/v1/traces/:id returns the thread, turns and steps as one tree (#18128) 077bab0
- A box's TPS and tick time show live on its games pane, from spark's health report or `/spark tps` at check-in (#18143) f7e559b
- Access 4c: the grants view as an MCP tool and a terminal screen (#18130) 89afadf
- Rewrap a comment the gate asked for (#18105) 7bfce9b
- Who may do what: a person's own grant never links to a page only an admin opens (#18105) 7fbd58a
- small: the Absorb findings say they are ready for the owner to send to Ben (#18132) d41ec43
- Merge main: take #18062's Who may do what, keep its link in every account's settings nav (#18105) 2af15c5
- 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
- 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
4 earlier comments
This adds Settings › Who may do what at /settings/who-can, with a row for it in the settings nav that everyone sees. A forge admin sees every grant on the forge, grouped by person or, with ?by=resource, by what it reaches. Anyone else sees their role first, then only the grants they hold themselves. An account with no grants sees just its role. Each row names the grant, who granted it and when (or "not recorded"), and links to the page where that grant is changed.
- One gate for both doors:
src/actions/who_can.tsreadseveryGrantfrom Access 4a'score/grants_view.ts. An admin who is a person gets every row; anyone else gets only rows where they are the grantee; a visitor gets nothing. The page and the new terminal screen both go through it, so a non-admin can't see another person's grants on either side. - Where each grant is changed: grants tied to a repository link to that repository's settings, and a pull's run grant links to the pull. Other grants link to their own settings page (People, Devices, Hosted forges, Cloud, Telemetry, Secrets, Subscriptions, a crew team). Grants in the team-member table and model budgets go to Settings › People, which is the closest page, not an exact one.
- Terminal: a "Who may do what" entry in the palette (
src/tui/screens/whocan.ts) shows the same rows and words; an admin pressesvto switch between by person and by resource. The how-to isdocs/features/who-can.md. - Wiring: the route is marked
openinsrc/http/marks/settings.json, registered insettings_routes.ts, andlazy_lists.tsis regenerated.grants_view.tsnow has a caller, so I took it off both allow-lists. - Tests:
test/who-can.test.tschecks that:- the admin sees one grant from every table, the right links, and the by-resource grouping;
- HTML in the data comes out escaped;
- a person sees only their own grants;
- an account with no grants sees only its role;
/settingslinks to the page;- the terminal follows the same gate.
test/palette-roster.test.tslists every palette entry, so I added the new one to its three lists. The test was right to fail there.
The pages and test reuse rowList, seg, row and accountShell from the web UI, and the shared terminal test helpers (quietCtx, sessionFor, screenText). Not done here: the MCP tool, which is #18106.
The gate reports 0 failures; one note remains, that the test's small page-fetch helper looks like the one in test/forks.test.ts. bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and the tests around this change pass. I did not run the full suite: scripts/fast.ts named 3,114 test files, so I picked the relevant ones and the forge's check runs the rest.
Try: sign in on the preview and open Settings › Who may do what. As an admin, switch to By resource. As a person with no grants, you see only your role line.
[{"go":"/settings","look":"the settings nav, Account group","expect":"a 'Who may do what' link to /settings/who-can"},
{"go":"/settings/who-can","look":"the page as a forge admin","expect":"the role line, By person / By resource tabs, grants grouped under headings, each row linking to where it is changed"},
{"go":"/settings/who-can?by=resource","look":"the grouping","expect":"headings name what is reached (host, app, repo...), rows name who holds it"},
{"go":"/settings/who-can","look":"the page as a non-admin with no grants","expect":"only 'Person: your own repositories…' and 'You hold no grants', no tabs, no one else's rows","ask":"Is the role line clear enough on its own?"}]
🤖 Generated with Claude Code
While this pull waited, main shipped the same feature under #18062 (5ba07c89c): the /settings/who-can page with look-ups by person and by resource, actions/grants_view.ts, the whocan terminal screen, the MCP access grants action, and their tests. In this merge main's version wins every conflict. This branch's duplicate src/actions/who_can.ts, page, screen, palette command and allow-list edits are dropped.
What this pull still adds is the issue's "linked from settings" item. Main links the page only from the admin page /settings/access, so a person who is not an admin could not reach it from settings.
src/web/pages/origins.tsadds Account › Who may do what to the account settings nav for every signed-in role.src/web/pages/who-can.tsnow passesaccountSections("who-can", …), so the page marks that nav row as current instead of the Access row.test/who-can.test.tshas a new test: a non-admin's/settingslinks/settings/who-can, and the page marks the rowaria-current.
There is no new terminal change. Main's palette entry who-can already offers the screen to every signed-in role, and the merge commit says so in a No door: line. bun x tsc --noEmit, the design lint and the gate pass. test/who-can.test.ts, test/palette-roster.test.ts and test/grants-view.test.ts pass: 32 tests.
[{"go":"/settings","look":"the Account group in the settings nav, signed in as a person who is not an admin","expect":"a 'Who may do what' row linking /settings/who-can"},
{"go":"/settings/who-can","look":"the settings nav and the page body","expect":"'Who may do what' is the current nav row; the body names your role and lists your own grants, or 'No grants match.'"},
{"go":"/settings/who-can?person=<name>","look":"as a forge admin","expect":"that person's grants, each row linking to where it is changed","ask":"Does the nav row belong under Account, or under Admin as well?"}]
🤖 Generated with Claude Code
Every account's settings nav now has a "Who may do what" row linking to /settings/who-can, and the row is marked as current on that page. The page itself came from #18062 on main. This pull links it from settings and fixes the two things the check failed on last time.
- Dead link (the "findings are the known ones" failure): a member opening the page saw their own membership grant linking to
/settings/people, which turns them away. Now, in a person's own view,whoMayDoWhatinsrc/actions/grants_view.tsdrops the link for grants changed on admin-only pages: People, Crew, Cloud, Subscriptions and Secrets. The page shows "an admin changes it" instead of a link, and so does the terminal screen (src/tui/screens/whocan.ts). An admin's view still links every row.docs/features/who-can.mdsays so. - First-view budget: the new nav row adds four words to Settings, so
docs/design/attention-budget.jsonraises it from 149 to 153, with a note in the same style as earlier rows. - Tests: a new test in
test/who-can.test.tschecks that a member's page and terminal never link to an admin-only page and say "an admin changes it", while an admin still gets the People link. Another checks that a non-admin reaches the page from/settings.
Checked: test/who-can.test.ts, test/deadends.test.ts, test/attention.test.ts and test/attention-stamped.test.ts pass. The gate, tsc --noEmit and design-lint are clean.
Not fully run: scripts/fast.ts picked 442 test files, and that run timed out after about 10 minutes. Two failures appeared in it:
test/pages-budget.test.tspasses on its own.test/scripts-fast.test.tsalso fails on its own: its "clean tree and a docs-only diff exit 3" test hits its 5-second timeout. I changed nothing it tests.
Not done: the admin-only pages are a fixed list in the action rather than read from each page's own check, so a page that later becomes admin-only must be added there. /settings/telemetry is left linked.
To try it: sign in as a member who holds a grant, open Settings › Who may do what, and look for "an admin changes it" on their membership row. Then open ?person=<them> as an admin and the same row links to People.
[{"go":"/settings","look":"the settings side nav, signed in as a member","expect":"a 'Who may do what' row under Account"},{"go":"/settings/who-can","look":"the member's own grant rows","expect":"the membership row says 'an admin changes it' and is not a link; the nav row is marked current"},{"go":"/settings/who-can?person=dave","look":"as an admin, the same person's membership row","expect":"it links to /settings/people"}]
🤖 Generated with Claude Code
In a person's own view of Settings → Who may do what (/settings/who-can), a grant that only an admin can change no longer links to a page that would turn them away. That covers grants changed on People, Crew, Cloud, Subscriptions or Secrets: the row now says "an admin changes it". A forge admin's view still links every row to the page where it is changed. The page is on every account's settings nav.
This push merges the latest main. The only conflict was in docs/features/who-can.md. The Web line keeps this branch's wording about admin-only grants. The MCP line takes main's version, which adds whoami_can with kind: "grants" for anyone; a forge admin's access tool still takes person or resource.
What passed after the merge:
bun x tsc --noEmitis clean.- The tests that cover this feature pass: who-can, the grants view, the terminal's grants, whoami and the docs tests.
bun scripts/gate.ts --explainpasses all 33 of its rules.
I did not run the whole suite. bun scripts/fast.ts named 443 test files (about 30 minutes) because the merge brings in all of main's changes, so the forge's check covers the rest. The sandbox also refused outbound requests to *--forge.test during the runs; no test failed from it.
To try it: sign in as a non-admin who holds a crew or subscription grant, open /settings/who-can, and check that those rows read "an admin changes it" instead of linking away. Then open the same page as an admin, look up that person, and check that every row links.
🤖 Generated with Claude Code
Adds Settings → Who may do what (/settings/who-can) to every account's settings nav. In a person's own view, a grant whose page only a forge admin can open shows no link. The row reads "an admin changes it (People)" and names the page, so the person knows where it is changed even without a link.
What changed after review: the hand-kept list of admin-only pages in src/actions/grants_view.ts is gone. reachableBy now asks isAdminRoute from src/http/route_marks.ts, which reads the same marks the admin gate uses, so the list can't drift. That fixes the rows the old list missed: a person's own telemetry_grant (/settings/telemetry) and device_grant (/settings/devices) no longer link to a page that turns them away. If a page is marked admin-only later, its rows lose their link without another edit.
Page name on unlinked rows: Grant gains an optional adminPage field, set only in a person's own view. The web page (src/web/pages/who-can.ts) and the terminal screen (src/tui/screens/whocan.ts) both show it as "an admin changes it (Telemetry)". An admin's view is unchanged and still links every row.
Tests: test/who-can.test.ts now checks that the telemetry grant has no link and names "Telemetry". It adds /settings/telemetry and /settings/devices to the list of pages a person's view must not link to, and expects "an admin changes it (People)" on both the web page and the terminal screen. The old assertion that the telemetry link stays was wrong, and is flipped.
bun x tsc --noEmit, the gate's 33 rules and the design lint pass, as do the who-can, grants-view, tui-grants, whoami and route-marks tests. I didn't run the whole suite; the forge's check does.
To try it: sign in as a non-admin who holds a telemetry grant and open /settings/who-can. The row should read "an admin changes it (Telemetry)" with no link. As an admin, look up ?person=<them>: the same row should link to /settings/telemetry.
[{"go":"/settings/who-can","look":"a non-admin's own telemetry or device grant row","expect":"no link; the row ends 'an admin changes it (Telemetry)' or '(Devices)'"},
{"go":"/settings/who-can?person=<that person>","look":"the same rows as a forge admin","expect":"each row links to the page where it is changed"}]
🤖 Generated with Claude Code
This adds Settings › Who may do what at
/settings/who-can, with a row for it in the settings nav that everyone sees. A forge admin sees every grant on the forge, grouped by person or, with?by=resource, by what it reaches. Anyone else sees their role first, then only the grants they hold themselves. An account with no grants sees just its role. Each row names the grant, who granted it and when (or "not recorded"), and links to the page where that grant is changed.src/actions/who_can.tsreadseveryGrantfrom Access 4a'score/grants_view.ts. An admin who is a person gets every row; anyone else gets only rows where they are the grantee; a visitor gets nothing. The page and the new terminal screen both go through it, so a non-admin can't see another person's grants on either side.src/tui/screens/whocan.ts) shows the same rows and words; an admin pressesvto switch between by person and by resource. The how-to isdocs/features/who-can.md.openinsrc/http/marks/settings.json, registered insettings_routes.ts, andlazy_lists.tsis regenerated.grants_view.tsnow has a caller, so I took it off both allow-lists.test/who-can.test.tschecks that:/settingslinks to the page;test/palette-roster.test.tslists every palette entry, so I added the new one to its three lists. The test was right to fail there.The pages and test reuse
rowList,seg,rowandaccountShellfrom the web UI, and the shared terminal test helpers (quietCtx,sessionFor,screenText). Not done here: the MCP tool, which is #18106.The gate reports 0 failures; one note remains, that the test's small page-fetch helper looks like the one in
test/forks.test.ts.bun x tsc --noEmitandbun scripts/design-lint.tsare clean, and the tests around this change pass. I did not run the full suite:scripts/fast.tsnamed 3,114 test files, so I picked the relevant ones and the forge's check runs the rest.Try: sign in on the preview and open Settings › Who may do what. As an admin, switch to By resource. As a person with no grants, you see only your role line.
🤖 Generated with Claude Code
Closes #18105