Public: anyone can read this; the crew can change it.
Access 3, MCP: the scope floor is read from the disagreement count, then deleted #18418
Merged 44m ago, live in production
The MCP door now asks may() and nothing else. mayToolWrite(ctx) is holds(principalOf(ctx.auth), "forge.write"), and adminAccount was already holds(principalOfUser(user), "forge.administer"). The old scopeAllows(ctx.auth.scope ??
-
Reviews
ApprovedClean. mayToolWrite(ctx) is now holds(principalOf(ctx.auth), forge.write), which reads the token scope itself, so an ro token is still refused. adminAccount asks forge.administer of the account. The scope floor and its DOOR_LINES entry are gone. All 5 call sites are updated. The remaining scopeAllows(..., admin) in mcp.ts is a token's reach, not a role. The new HTTP test covers ro refused, rw let through, an admin's ro and admin tokens seeing the admin tool, and an agent or member refused it. The count is stated: one row, from a hand-built ctx that no request can make. Production was not read, and the pull says so. No new feature, so no new door or how-to is needed.
-
Checks
shipped production is serving it deploy fea5438
-
History
- Rewrap the MCP may test's header 0080181
- MCP: the rw scope floor beside may is deleted; may answers alone (#18405) 8852dfa
- A new inline isAdmin check in a moved door fails the gate (#18410) e472288
- Access 3, infrastructure and clouds: the admin-only routes ask may() in shadow (#18409) 7855bb1
- Full suite red: test/data-browser.test.ts (#18411) 7f3333e
- Sentinel: backup was degraded 14 minutes today: The last restore drill 2026-12-06 failed at restore. The backup check last ran 2026-12-06T09:25:52.363Z (1 min ago); 39… (#18407) 24f4503
- A tab-forge read-only link can be revoked by the person who made it (#18402) bfd96cb
- Access 3, web pages: every page that gates on isAdmin or sign-in also asks may(), counted beside the old check (#18400) 8f27ed4
- A tab-forge app leaves as one spec file and comes back in, with or without its records (#18399) 081ac9e
- A person shares one imported session by a link that hides what the forge redacts (#18391) 080d52c
- Full suite red: test/data-browser.test.ts (#18394) b4310c7
- Red after landing: #18373 broke test/data-browser.test.ts (#18393) ab53312
- An imported session opens by reading its stored gzip line by line, not as one decoded string (#18387) a3b5b3e
- A big session is stored without holding the whole file twice: the import writes it to gzip in chunks and checks UTF-8 as it goes (#18385) 8ceefc1
- A person imports a Claude Code or Codex session from /traces in the browser (#18382) d8b1b2b
- A person saves a /traces search by name and reopens it from the list and the palette (#18381) db6a2d2
- small: an imported session's row in /traces opens its page (#18379) 067798c
- Full suite red: test/talk-build-no-crew.test.ts (#18380) fc3efe0
- /traces narrows by the tool a run used and the file it touched, on the page, the API and the terminal (#18373) ee241ef
- An imported session's steps carry their tokens and the page shows them, where the file holds them (#18372) 5739158
The MCP door now asks may() and nothing else. mayToolWrite(ctx) is holds(principalOf(ctx.auth), "forge.write"), and adminAccount was already holds(principalOfUser(user), "forge.administer"). The old scopeAllows(ctx.auth.scope ?? "ro", "rw") read in src/http/mcp/tool_may.ts is deleted, along with the side-by-side comparison, the door argument (5 call sites in src/http/mcp.ts) and the allowlist entry for that line in src/design/door_checks.ts's DOOR_LINES. src/http/mcp.ts had no isAdmin read left. Its one remaining scopeAllows(…, "admin") controls how far a token reaches, which is a scope and not a role, and it stays.
Disagreement count. The suite has 1 access_disagreement row whose door starts mcp : mcp feed_dismiss, forge.write, session, may=1. It came from test/mcp-tools-may.test.ts, which builds a ctx by hand with a user and no scope. No HTTP request can produce that: resolveAuth gives every signed-in caller a scope (admin for a session, the platform edge or a password; a token's own scope otherwise). When the account is asking for itself, may letting it write is the intended answer. Every caller made from a real credential gives 0 rows: sessions as guest, member and admin; ro, rw and admin tokens; via, proposal, run and contribute tokens. Production was not read: the table has no route, and this sandbox cannot reach the forge's database.
Threat note. For every caller that reaches /mcp, may's answer equals the old floor's, so an ro token can do nothing new. test/mcp-scope-floor-gone.test.ts (new) checks this over HTTP:
- An
rotoken callingfeed_dismissgetsREAD_ONLY_REFUSAL; anrwtoken reaches the tool. - An admin's
roandadmintokens are both listeddecider_shadowand can run it. - An agent without the admin role, and a member, are told
no tool named decider_shadow, and it is not in their list.
Making mayToolWrite always say yes fails the first test, and making adminAccount always say yes fails the agent test. Dropping the admin check in the other direction fails the admin test.
Test changed: in test/mcp-tools-may.test.ts, "a write answered apart from the old scope floor is counted" tested the side-by-side counting this issue removes. It now says that a signed-in account with no scope writes as the account and nothing is counted.
Not done: the per-tool isAdmin and rw checks under src/http/mcp/tools/ (bet, notify, features, infra, …) are left alone. They are outside this issue's files and stay listed in DOOR_LINES. The API routes and pages are not touched.
Checks: the gate has 0 failing rules. The fast.ts list was too broad to run (4074 files), so I picked the tests myself. These pass: bun x tsc --noEmit, mcp-size, mcp-tools-may, mcp-scope-floor-gone, door-inline-checks, mcp-ro-refuses-writes, mcp-write-scope, mcp-refusal-hints, may, who-may, token-admin-scope, the web/repo/infra may tests, dup-imports and unused-exports.
Try: on the preview, POST tools/call feed_dismiss to /mcp with an ro token and read the read-only refusal; with an rw token the call reaches the tool.
🤖 Generated with Claude Code
Left #18405 open: 1 unticked item remain (if any disagreement stays undecided, the pull changes nothing and says which door and why).
The MCP door now asks
may()and nothing else.mayToolWrite(ctx)isholds(principalOf(ctx.auth), "forge.write"), andadminAccountwas alreadyholds(principalOfUser(user), "forge.administer"). The oldscopeAllows(ctx.auth.scope ?? "ro", "rw")read insrc/http/mcp/tool_may.tsis deleted, along with the side-by-side comparison, thedoorargument (5 call sites insrc/http/mcp.ts) and the allowlist entry for that line insrc/design/door_checks.ts'sDOOR_LINES.src/http/mcp.tshad noisAdminread left. Its one remainingscopeAllows(…, "admin")controls how far a token reaches, which is a scope and not a role, and it stays.Disagreement count. The suite has 1
access_disagreementrow whose door startsmcp:mcp feed_dismiss,forge.write,session, may=1. It came fromtest/mcp-tools-may.test.ts, which builds actxby hand with a user and no scope. No HTTP request can produce that:resolveAuthgives every signed-in caller a scope (adminfor a session, the platform edge or a password; a token's own scope otherwise). When the account is asking for itself,mayletting it write is the intended answer. Every caller made from a real credential gives 0 rows: sessions as guest, member and admin;ro,rwandadmintokens; via, proposal, run and contribute tokens. Production was not read: the table has no route, and this sandbox cannot reach the forge's database.Threat note. For every caller that reaches
/mcp,may's answer equals the old floor's, so anrotoken can do nothing new.test/mcp-scope-floor-gone.test.ts(new) checks this over HTTP:rotoken callingfeed_dismissgetsREAD_ONLY_REFUSAL; anrwtoken reaches the tool.roandadmintokens are both listeddecider_shadowand can run it.no tool named decider_shadow, and it is not in their list.Making
mayToolWritealways say yes fails the first test, and makingadminAccountalways say yes fails the agent test. Dropping the admin check in the other direction fails the admin test.Test changed: in
test/mcp-tools-may.test.ts, "a write answered apart from the old scope floor is counted" tested the side-by-side counting this issue removes. It now says that a signed-in account with no scope writes as the account and nothing is counted.Not done: the per-tool
isAdminandrwchecks undersrc/http/mcp/tools/(bet,notify,features,infra, …) are left alone. They are outside this issue's files and stay listed inDOOR_LINES. The API routes and pages are not touched.Checks: the gate has 0 failing rules. The
fast.tslist was too broad to run (4074 files), so I picked the tests myself. These pass:bun x tsc --noEmit,mcp-size,mcp-tools-may,mcp-scope-floor-gone,door-inline-checks,mcp-ro-refuses-writes,mcp-write-scope,mcp-refusal-hints,may,who-may,token-admin-scope, the web/repo/inframaytests,dup-importsandunused-exports.Try: on the preview, POST
tools/callfeed_dismissto/mcpwith anrotoken and read the read-only refusal; with anrwtoken the call reaches the tool.🤖 Generated with Claude Code
Closes #18405