Public: anyone can read this; the crew can change it.
Access 3, terminal, games and infrastructure: the entries' own gates are deleted once may() has been asked beside them and agrees #18428
Merged 10h 49m ago, live in production
The /infra pages and the cloud API now decide access only through may(forge.administer). Their inline isAdmin checks are deleted, and every kind of caller gets the same status as before. This pull covers only the infrastructure part of #18425.
-
Reviews
ApprovedClean on security.
/infraandGET /api/v1/cloud/accountsnow decide bymay(forge.administer). TheisAdminchecks are gone and the gate rule reads both files. Signed-out callers are still sent to sign in or told to authenticate. Non-admins still get not found. An admin'srotoken still opens the pages and is refused a change (403), because the forms are still read with theadminscope. The tests pin those statuses. No new dependency, nothing added to README.md, and the 'not asked yet' list is unchanged. The terminal and games parts were split into #18426 and #18427, so their boxes stay open. -
Checks
shipped production is serving it deploy afe9e01
-
History
- Infrastructure access test: one request helper for reads and changes 2f4a004
- Access 3, infrastructure and clouds: may() alone decides the /infra pages and the cloud API e27b39f
- An imported session's page has a red Delete that asks for its title typed (#18423) 22c9252
- Access 3, terminal and games: SSH screens and game grants ask may() in shadow (#18412) fea5438
- A person deletes one of their imported sessions from its page, by typing its name (#18371) 3d2fa7b
- An imported session is deleted through the API by its owner who sends its exact title (#18390) 2c0a8b8
- Access 3, MCP: the scope floor is read from the disagreement count, then deleted (#18418) e374d6c
- A pull that adds a migration runs test/data-browser.test.ts in its fast tier (#18419) 105485a
- Access 3b, web pages: the remaining admin gates (a local user?.isAdmin, isAdmin !== true || agent) ask adminPage beside them (#18413) b9d6e88
- 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
The /infra pages and the cloud API now decide access only through may(forge.administer). Their inline isAdmin checks are deleted, and every kind of caller gets the same status as before. This pull covers only the infrastructure part of #18425. As the issue's risks allowed, the terminal and games parts are split into #18426 and #18427. #18425 and the umbrella #586 now both wait on them.
What changed
src/http/infra_routes.ts:guard()and the/infra/livecheck askmayof the account behind the request. A signed-out caller is sent to sign in, and an account that isn't the admin gets not found, as before. Every change still reads its form withreadForm(ctx, "admin"), so token scope is enforced where it was. An admin'srotoken still opens the pages and is still refused a change with 403.src/http/api/cloud.ts:GET /api/v1/cloud/accountsasksmaywith the credential sent.forge.writerefuses anrotoken (403), replacing thescopeAllows(…, "rw")check.forge.administerrefuses anyone who isn't the admin (404). The places catalog refreshes only whenforge.administeris granted, which gives the same answer asisAdmin && rwdid.- Gate rule from #18410:
src/design/door_checks.tsnow also readssrc/http/infra_routes.tsandsrc/http/api/cloud.ts.test/door-inline-checks.test.tschecks that both files are read. - Docs:
docs/features/may.mdhas a paragraph on the infrastructure and cloud doors. The "not asked yet" list is unchanged.
What to look at
test/infra-routes-may.test.ts checks the status for an admin, a non-admin person, an agent's rw and admin tokens, an admin's ro token (reads and a POST), and an anonymous caller. I also ran it against the old src/: every status matched, and the only failure was the shadow rows the old code wrote, which are now gone.
Not done here
- The terminal entries and
mayOnGameare in #18426 and #18427. PUT /api/v1/places/pinstill uses the sharedaccountAdminhelper fromapi/admin.ts, which is used by other admin routes, so I left it.- I could not read production's
access_disagreementtable: the sandbox denies the forge database. The rows for theinfra …doors are unchecked. The only parting the old shadow could record there was an admin'srotoken on a page, and this pull keeps that case's old answer.
Checks
bun x tsc --noEmitandbun scripts/gate.tspass.- I ran 179 test files covering infra, cloud, places, door, may, dead-code and duplicate-import: 1434 passed, 1 failed. The failure was
test/cloud-inventory.test.ts("the duty's own fetch carries redirect: error"). It passed alone, both on this branch and on the oldsrc/, so it looks like a timing flake under load. - The commit carries
No door:because nobody's access changed and the terminal has no infrastructure screen.
Try it: on the preview, open /infra as the admin (it loads) and as an everyday account (not found). curl -H "authorization: Bearer <ro token>" $PREVIEW/api/v1/cloud/accounts answers 403.
🤖 Generated with Claude Code
Left #18425 open: 3 unticked items remain (Terminal: src/tui/screens/entries.ts offers an entry by its asks through may; the entry's own gate function is removed for entries that name an action. The two expected partings in docs/features/may.md (signed out on account screens; an admin agent on a person's screens) are decided in the pull and the test pins the decision. Entries that name no action keep their gate and say why beside it.; Games: mayOnGame (src/games/game_may.ts) answers alone for the box, server and game-door checks; the grant tables stay the data behind game.view/game.operate/game.own (no new grant table). The ro-token-operates-a-server parting is decided and tested.; The gate rule from #18410 covers these files.).
The
/infrapages and the cloud API now decide access only throughmay(forge.administer). Their inlineisAdminchecks are deleted, and every kind of caller gets the same status as before. This pull covers only the infrastructure part of #18425. As the issue's risks allowed, the terminal and games parts are split into #18426 and #18427. #18425 and the umbrella #586 now both wait on them.What changed
src/http/infra_routes.ts:guard()and the/infra/livecheck askmayof the account behind the request. A signed-out caller is sent to sign in, and an account that isn't the admin gets not found, as before. Every change still reads its form withreadForm(ctx, "admin"), so token scope is enforced where it was. An admin'srotoken still opens the pages and is still refused a change with 403.src/http/api/cloud.ts:GET /api/v1/cloud/accountsasksmaywith the credential sent.forge.writerefuses anrotoken (403), replacing thescopeAllows(…, "rw")check.forge.administerrefuses anyone who isn't the admin (404). The places catalog refreshes only whenforge.administeris granted, which gives the same answer asisAdmin && rwdid.src/design/door_checks.tsnow also readssrc/http/infra_routes.tsandsrc/http/api/cloud.ts.test/door-inline-checks.test.tschecks that both files are read.docs/features/may.mdhas a paragraph on the infrastructure and cloud doors. The "not asked yet" list is unchanged.What to look at
test/infra-routes-may.test.tschecks the status for an admin, a non-admin person, an agent'srwandadmintokens, an admin'srotoken (reads and a POST), and an anonymous caller. I also ran it against the oldsrc/: every status matched, and the only failure was the shadow rows the old code wrote, which are now gone.Not done here
mayOnGameare in #18426 and #18427.PUT /api/v1/places/pinstill uses the sharedaccountAdminhelper fromapi/admin.ts, which is used by other admin routes, so I left it.access_disagreementtable: the sandbox denies the forge database. The rows for theinfra …doors are unchecked. The only parting the old shadow could record there was an admin'srotoken on a page, and this pull keeps that case's old answer.Checks
bun x tsc --noEmitandbun scripts/gate.tspass.test/cloud-inventory.test.ts("the duty's own fetch carries redirect: error"). It passed alone, both on this branch and on the oldsrc/, so it looks like a timing flake under load.No door:because nobody's access changed and the terminal has no infrastructure screen.Try it: on the preview, open
/infraas the admin (it loads) and as an everyday account (not found).curl -H "authorization: Bearer <ro token>" $PREVIEW/api/v1/cloud/accountsanswers 403.🤖 Generated with Claude Code
Closes #18425