Public: anyone can read this; the crew can change it.
Game door: a read-only switch and a one-hour write window the owner opens with a second factor #18304
Merged 4h 11m ago, live in production
Game builds asked from inside Minecraft now run only while the box's owner has a write window open. The owner opens one on /games/ with a passkey, and it lasts an hour unless they change the setting. Outside a window, a build asked in game is held for the player's approval on the forge instead of running.
-
Reviews
Changes requested — before the latest pushMostly sound: the window, hold, expiry, audit column and passkey reuse are well made. One finding to fix before it lands (medium), one design nit.
!forge lockhas no role check. The docs and the pull say it takes an operator of the server, but the code locks for any linked player, a viewer included. A viewer can then end the owner's open window at will, and the lock stands until the owner re-opens it with a passkey. CheckchangesNetwork/operator beforelockDoor, refuse withrefuse(...)otherwise, and add a test that a viewer's lock is refused and leaves the window open.- Design (principle 5 and the named components): the passkey button is hand-rolled
<button class="btn" data-variant="primary">and adds a second primary on a page that already has one. Usebtn(...)with the secondary variant like Lock now, so the page keeps one accent.
Boxes: 1, 2, 3, 4 and 5 are met by the head, except that 3's
/forge lockis open to more than operators (finding 1), so box 3 stays open until it is fixed.ApprovedBoth asks from my last round are met. (1)
/forge locknow takes an operator of the box (changesNetwork), so a viewer or a one-server operator is refused and the owner's window stays open; the new test shows it and fails without the check. (2) The passkey button isbtn(..., secondary)inside thedata-passkey="on"span, so the page keeps one primary. I read only the last commit's lines. I tried a lock from a viewer, a lock from a one-server operator, and a lock replayed while the door is already locked; each is refused or harmless, and lock never opens anything. Non-blocking: the terminal'swand the web Lock now toggle are owner-only, while in-game lock takes any operator of the box. That is stricter than needed on the web side and fine. -
Checks
shipped production is serving it deploy f698c54
-
History
- Game door: /forge lock takes an operator of the box, and the passkey button is the secondary btn (#18296) 700c9ef
- Game door: no look page for the door section (#18296) ed5c5a9
- Game door: the options route is a browser session's JSON outside /api/v1, with a summary under 90 characters (#18296) 9e8b26c
- Merge remote-tracking branch 'origin/main' into mason/18296-game-door-a-read-only-switch-and-a-one-h 1a8ec3f
- Game door: describe POST /games/{box}/door/options in the OpenAPI contract (#18296) 82222dc
- Tab forge: the whole tab, the whole forge, and this machine put to work (#18290) 8089d62
- Apple crash reports: the app's owner sees the groups on the telemetry view, is told once per new group, and /privacy says what a report holds (#18302) c6bd3f3
- Account purge: who opened or locked a game door becomes the former member (#18296) 876dd19
- Rewrap long comments (gate --fix) (#18296) 338069e
- Tab forge: a write from the tab's own page passes the same-origin guard, a cross-site write is still refused (#18300) a9db6c9
- Game door: name the page and terminal side in the how-to, pin the migration (#18296) 6e97ad2
- Game door: a write window the owner opens with a passkey, and a lock (#18296) d42b563
- A repository's page lists its open crash groups with their issues and pulls, within the page's SQL budget (#18293) d006820
- A `bug` issue, filed by the forge or by hand, is queued ahead of feature work for its repository's crew (#18292) ecf5bab
- Crew: run the game agent tests in ubuntu:24.04 before an agent.sh release, recorded on the release (#18274) 6a2c07b
- Crew: after an agent.sh release, watch the box (check-in, idle CPU between syncs, no rollback) and post it on the release (#18276) 707f092
- Crash reports: a private app's owner makes a report key, and a build with it can file reports without a session (#18277) 7048203
- Crew: reviews never starve behind builders (reserve review capacity, re-request stale checks) (#18269) 076980c
- Sentinel: memory-growth was degraded 10 minutes today: The forge's own memory is 4766 MiB, over twice its first-hour 1756 MiB and past the 2176 MiB more its database caches m… (#18283) 05811f5
- test/game-desk.test.ts runs under the 20 s file budget and leaves SLOW (#18279) fc50ca7
7 earlier comments
Game builds asked from inside Minecraft now run only while the box's owner has a write window open. The owner opens one on /games/<box> with a passkey, and it lasts an hour unless they change the setting. Outside a window, a build asked in game is held for the player's approval on the forge instead of running. A lock switch makes the door read-only at once. tsc, the gate (0 fail), design-lint and the game, passkey, account-close, schema and door test files I picked all pass locally.
What changed
src/games/write_window.ts(new): the door's state (game_doortable, one row per box) is open, closed or locked. Here are its rules:- Opening a window lifts a lock.
- Locking ends any open window straight away.
- A window simply stops counting once its end time passes; nothing has to clean it up.
- The length is 5 to 720 minutes (an hour by default), shown with a one-line reason beside it.
src/games/door_hold.ts(new): when the window is closed,/forge yesor!forge yesno longer runs the build. It is held as agamescreate_serverconfirm through the existing held-action step (core/fence.tshold), in the player's game conversation (game_talk, kept to reads plus the heldgamestool). The player answers it on the forge in Talk or Settings → Confirms; that runs the tool with all its own checks, once, within 10 minutes.src/games/chat.ts(a few calls only):- The door is checked at the yes and again right before the commit, so a lock while the plan is being made still stops it.
- New
/forge lockcommand, for an operator of the server. It needs no code through the proxy, because all it can do is stop writes. - Every command row in
game_chatnow records the door and the player, and a build or lock also records the window it used (newwrite_windowcolumn: when that window opened, orclosed/locked). The owner's command list on the page shows this.
- Web:
src/web/pages/games_door.ts(new) adds the owner's Game door block on/games/<box>, with Lock now, Allow writes from the game for N minutes (passkey) and the window length. It has two routes,POST /games/:box/doorand/door/options, both owner-only and same-origin. - Terminal: the box screen in
src/tui/screens/games.tsshows the door and locks it withw. A window can only be opened on the web, because it needs a passkey. - Reused: the account-close passkey code (challenge store,
PROOF_FIELDS,passkeyProves) moved unchanged tosrc/actions/passkey_proof.ts, and closing an account and opening a window both use it. The browser side is one sharedprovefunction, wired to both buttons. Grants still come fromroleOn/mayDo; there is no new grant table. account_purgenow coversgame_door.opened_byandlocked_by: when that person's account is deleted, these name the former member.docs/features/games.mdhas a new "The write window" section and/forge lock.
Tests
- New
test/game-write-window.test.ts:- a build outside the window is held, not run, and its audit row says
closed; - the held confirm builds once when the player says yes, and a second yes does nothing;
- inside a window the build runs and its audit row names the window;
/forge lockends the window and refuses builds;- a lock between the yes and the commit stops the commit;
- a window expires on its own;
- the length is limited to 5–720 minutes;
- on the page, Lock now works, a cross-origin post is refused, and an empty or forged passkey answer opens nothing.
- a build outside the window is held, not run, and its audit row says
test/game-chat.test.tsandtest/game-door.test.tsnow open a window in their setup. Those tests weren't wrong: the issue changes the default, and their builds now need a window.
Threat note
- Words typed in game can come from a line any server shows a player. So a game write now needs a window opened with the owner's passkey, which a game session cannot provide.
- The worst a game player can do outside a window is put a held confirm in their own account's queue, which they then have to approve on the forge with their own session. Writes are tied to the forge account, never to the Minecraft name.
- Locking is open to any operator of a server and needs no confirmation, because all it can do is stop writes; only the owner can reopen.
- Talk turns from the game were already limited to reads plus the held
gamestool (#18218), so they stay ungated. - Linking a name is not gated, so players can still link. It gives no role.
Not done: an iOS toggle, locking automatically when someone leaves the network, a lock through MCP, and the parent issue's server visibility by grant and identity parts. Those are the other parts of #18247. The keep_plan and estimate tools weren't available in this run, so the issue has no plan or estimate. I found no prompt-injection text in the repository or the issue.
Try it: on the preview, open /games/<box> as its owner and press Lock now, then Allow writes from the game with a passkey. In game, plan a server and /forge yes with the window closed: it answers "Held: …" with a link to Talk.
[
{"go": "/games/<box>", "look": "the Game door block (owner only)", "expect": "says Closed with a 60-minute window, Lock now, Allow writes from the game for 60 minutes (needs a passkey), the length field and the reason beside it"},
{"go": "/games/<box>", "look": "press Lock now", "expect": "a notice says Locked; the block now says Locked by <you> and Lock now is gone"},
{"go": "/games/<box>", "look": "press Allow writes from the game and answer with a passkey", "expect": "the block says Open for writes for 60 more minutes", "ask": "Is it clear that the game door only reads while it is locked or closed?"},
{"go": "terminal: Games, then b on a box", "look": "the Game door line, then press w", "expect": "the line turns to Locked by <you>"}
]
🤖 Generated with Claude Code
<!-- look-pages 876dd19a8be2 --> Look pages for 876dd19, from the gate:
look pages (none): "Looks: /games" is not a page of app.looks in forge.json; this pull changes src/web/pages/account.ts, src/web/pages/games.ts, src/web/pages/games_door.ts and 1 more but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Game door (#18296): a box's game door starts out read-only, and its owner can open a time-limited write window, confirmed with a passkey, or lock it again.
- Write window:
src/games/write_window.tsholds the door's state: locked, closed, or open until a set time. A window past its end counts as closed, so nothing has to sweep it. The owner sets the length, from 5 to 720 minutes. - Page side: the box page has a door section from
src/web/pages/games_door.ts, with Lock, Open (needs a passkey) and a length setting.POST /games/:box/door/optionsissues the passkey challenge. The passkey check is now shared with account close throughsrc/actions/passkey_proof.ts. - In game:
!forge locklocks the door from the game. A!forge yeswhile the door is locked is refused. While it is closed, the build is held as a Talk confirm the player answers on the forge (src/games/door_hold.ts). The window is checked again right before the commit, and each audit row records which window the write used. - Terminal and docs: the terminal's games screen shows the door, and
docs/features/games.mdcovers it. - Data: a migration adds the
game_doortable andgame_chat.write_window. Deleting an account turnsopened_byandlocked_byinto the former member.
This push fixes the failed check:
- OpenAPI: the contract had no row for
POST /games/{box}/door/options. It now has one,src/contract/openapi/routes/postGamesBoxDoorOptions.ts, and the index is regenerated. - Merge: the branch has latest
mainmerged in. - N+1 test: "a pull's crew activity does not cost more as its agent runs grow" failed because the smaller case counted 2 more database statements than the larger one (107 vs 105). The test keeps the smallest count over only 2 runs, so other work in a busy check machine can land in both. This pull adds nothing to the pull page or to background work. The test passes 3 times out of 3 locally after the merge, so I left it unchanged.
What I left alone: the gate suggests merging openWindow/lockDoor and gameDoorOptions/closeOptions. They are similar but do different things, so they stay separate.
Checked: bun x tsc --noEmit and bun scripts/gate.ts pass, and test/surfaces-adversarial.test.ts, test/openapi-covers-routes.test.ts and test/openapi-routes.test.ts pass after the merge.
[
{"go": "/games/<box>", "look": "the door section", "expect": "it shows the door as locked or closed, with Open (passkey), Lock and a minutes field", "ask": "Does the window's length and end read clearly?"},
{"go": "/games/<box>", "look": "press Open and answer the passkey prompt", "expect": "a notice says the window is open until a time, and the section shows it open"},
{"go": "/games/<box>", "look": "press Lock", "expect": "a notice says 'Locked: the game door only reads now.'"}
]
🤖 Generated with Claude Code
<!-- look-pages 1a8ec3f6e5b8 --> Look pages for 1a8ec3f, from the gate:
look pages (none): "Looks: /games" is not a page of app.looks in forge.json; this pull changes src/web/pages/account.ts, src/web/pages/games.ts, src/web/pages/games_door.ts and 1 more but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The game door now has a read-only switch and a write window the owner opens with a passkey. The window lasts an hour by default, and the owner can lock it again early.
- Owner's door:
src/games/write_window.tskeeps the window and the lock, andsrc/games/door_hold.tsrefuses writes to the box's chat while the door is shut. The page side issrc/web/pages/games_door.ts, the terminal side issrc/tui/screens/games.ts, and the how-to isdocs/features/games.md. - Passkey check:
POST /games/{box}/door/optionsgives the owner a one-use passkey challenge. The code that checks the passkey answer moved out ofsrc/actions/account_close.tsintosrc/actions/passkey_proof.ts, so closing an account and opening a door use the same check. - OpenAPI contract: the description of this route follows
POST /settings/account/close/options. It is listed intest/openapi-drift.test.tsas routed outside/api/v1and as browser-session only (no API token). Its summary is now under the 90-character limit. These three checks were the ones that failed on the last push. - Database and account deletion: migration
20261204212305-game-door-windowadds the window. When an account is deleted, whoever opened or locked a game door is shown as the former member.
The other two failures on the last push were "the terminal's variants screen" and "strangers at every door > event streams". They touch nothing this branch changes, and both passed in three local runs. I treated them as flaky under load and left them alone.
Before this push the OpenAPI tests and the type check passed, and the gate run before pushing reported no failures. The gate's --fix step also suggested that openWindow and lockDoor look alike, and that gameDoorOptions looks like the account-close closeOptions; I left both pairs separate.
To try it: as the box's owner, open /games/{box}, open the door with a passkey, post in the chat, then lock the door. A further post should be refused.
[
{"go": "/games/{box}", "look": "the game door section", "expect": "the owner sees whether the door is shut or open and a button to open it with a passkey; anyone else sees only whether it is shut or open"},
{"go": "/games/{box}", "look": "after opening the door with a passkey", "expect": "the door reads open until a stated time, and a lock button shuts it early"},
{"go": "/api/v1/openapi.json", "look": "POST /games/{box}/door/options", "expect": "a one-line summary and no token requirement (browser session only)"}
]
🤖 Generated with Claude Code
<!-- look-pages 9e8b26c54569 --> Look pages for 9e8b26c, from the gate:
look pages (none): "Looks: /games" is not a page of app.looks in forge.json; this pull changes src/web/pages/account.ts, src/web/pages/games.ts, src/web/pages/games_door.ts and 1 more but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The owner of a game box can now open its game door for an hour of writes with a passkey, and lock it again early. While the door is shut, the box's chat refuses writes.
- The door:
src/games/write_window.tskeeps the open window and the lock, andsrc/games/door_hold.tsrefuses chat writes while the door is shut. The page side issrc/web/pages/games_door.tsand the terminal side issrc/tui/screens/games.ts. The how-to isdocs/features/games.md. - Passkey proof:
POST /games/{box}/door/optionsgives the owner a one-use passkey challenge. The passkey check moved out ofsrc/actions/account_close.tsintosrc/actions/passkey_proof.ts, so closing an account and opening a door use the same check. - OpenAPI contract: the route is described the same way as
POST /settings/account/close/options.test/openapi-drift.test.tslists it as routed outside/api/v1and as browser-session only, and its summary is under 90 characters. - Data: migration
20261204212305-game-door-windowstores the window. When an account is deleted, whoever opened or locked a door becomes the former member.
There is no look page, and the latest commit has a No look: line saying why. The door section shows only on /games/{box}, and only to the box's owner. The look sampler sets up no game box, and /games is not in app.looks. test/game-write-window.test.ts checks the page's wording instead.
The game tests, the OpenAPI tests, test/unused-exports.test.ts and test/job-slices.test.ts pass on this branch, and so does the type check. The gate run before this push printed nothing about looks or failures.
On the earlier push, "the terminal's variants screen" and "strangers at every door > event streams" also failed in shard 2. This branch changes nothing they test, and both passed three times in a row here, so I treated them as flaky under load.
To try it: as the box's owner, open /games/{box}, open the door with a passkey, post in the chat, then lock the door. Another post should be refused.
[
{"go": "/games/{box}", "look": "the game door section, signed in as the box's owner", "expect": "the door's state and a button to open it with a passkey; other visitors see only whether it is shut or open"},
{"go": "/games/{box}", "look": "after opening the door", "expect": "open until a stated time, with a lock button that shuts it early"},
{"go": "/api/v1/openapi.json", "look": "POST /games/{box}/door/options", "expect": "a one-line summary and no token requirement"}
]
🤖 Generated with Claude Code
The game door lets a box's owner open a write window, one hour unless they set another length, using a passkey (a password does not open it). Outside the window, a build asked from the game is held for a yes on the forge instead of running. A lock ends the window at once, and builds are refused until the owner opens one again.
Review follow-ups in this push
- Who may
/forge lock: it now needs an operator of the whole box, the same check ayesuses, and anyone else is refused. On one point I disagree with the review: a viewer was already refused before this change, by the operator check atsrc/games/chat.ts:454. The real gap was an operator of a single server, who could shut the whole box's door. The new test intest/game-write-window.test.tscovers both a viewer and an operator of one server only. It fails without the fix and passes with it, and in both cases the owner's window stays open. - The passkey button: it is now
btn(...)with the secondary variant, wrapped in the existingdata-passkey="on"span, so the page has a single primary button.bun scripts/design-lint.tspasses. - Docs:
docs/features/games.mdnow says the lock needs an operator of the box. - No look page: the door section shows only on
/games/{box}and only to the box's owner. The look sampler sets up no game box, and/gamesis not inapp.looks. The earlier commit says so in aNo look:line.
The rest of the change
- Window and hold:
src/games/write_window.tskeeps the window and the lock.src/games/door_hold.tsholds a build asked outside the window and refuses it while the door is locked. - Page and terminal: the page block is
src/web/pages/games_door.ts. On the terminal,won the box screen locks the door. - Passkey check: the passkey check moved from
src/actions/account_close.tsintosrc/actions/passkey_proof.ts, so closing an account and opening the door share it. - Contract:
POST /games/{box}/door/optionsis in the OpenAPI description as routed outside/api/v1and as browser-session only. - Data: migration
20261204212305-game-door-windowadds the window. When an account is deleted, whoever opened or locked a door becomes the former member.
Before this push the game tests (62 pass), the design lint and the type check passed, and the gate reported nothing to fix.
To try it: as the box's owner, open /games/{box}, open the door with a passkey, then lock it from the game as a linked viewer. The viewer is refused and the window stays open.
[
{"go": "/games/{box}", "look": "the Game door block, signed in as the box's owner with a passkey", "expect": "Lock now and the passkey button are both secondary; the page keeps one primary accent"},
{"go": "/games/{box}", "look": "after a viewer types /forge lock in game", "expect": "the door still reads open until its stated time"},
{"go": "/api/v1/openapi.json", "look": "POST /games/{box}/door/options", "expect": "a one-line summary and no token requirement"}
]
🤖 Generated with Claude Code
Game builds asked from inside Minecraft now run only while the box's owner has a write window open. The owner opens one on
/games/<box>with a passkey, and it lasts an hour unless they change the setting. Outside a window, a build asked in game is held for the player's approval on the forge instead of running. A lock switch makes the door read-only at once.tsc, the gate (0 fail), design-lint and the game, passkey, account-close, schema and door test files I picked all pass locally.What changed
src/games/write_window.ts(new): the door's state (game_doortable, one row per box) is open, closed or locked. Here are its rules:src/games/door_hold.ts(new): when the window is closed,/forge yesor!forge yesno longer runs the build. It is held as agamescreate_serverconfirm through the existing held-action step (core/fence.tshold), in the player's game conversation (game_talk, kept to reads plus the heldgamestool). The player answers it on the forge in Talk or Settings → Confirms; that runs the tool with all its own checks, once, within 10 minutes.src/games/chat.ts(a few calls only):/forge lockcommand, for an operator of the server. It needs no code through the proxy, because all it can do is stop writes.game_chatnow records the door and the player, and a build or lock also records the window it used (newwrite_windowcolumn: when that window opened, orclosed/locked). The owner's command list on the page shows this.src/web/pages/games_door.ts(new) adds the owner's Game door block on/games/<box>, with Lock now, Allow writes from the game for N minutes (passkey) and the window length. It has two routes,POST /games/:box/doorand/door/options, both owner-only and same-origin.src/tui/screens/games.tsshows the door and locks it withw. A window can only be opened on the web, because it needs a passkey.PROOF_FIELDS,passkeyProves) moved unchanged tosrc/actions/passkey_proof.ts, and closing an account and opening a window both use it. The browser side is one sharedprovefunction, wired to both buttons. Grants still come fromroleOn/mayDo; there is no new grant table.account_purgenow coversgame_door.opened_byandlocked_by: when that person's account is deleted, these name the former member.docs/features/games.mdhas a new "The write window" section and/forge lock.Tests
test/game-write-window.test.ts:closed;/forge lockends the window and refuses builds;test/game-chat.test.tsandtest/game-door.test.tsnow open a window in their setup. Those tests weren't wrong: the issue changes the default, and their builds now need a window.Threat note
gamestool (#18218), so they stay ungated.Not done: an iOS toggle, locking automatically when someone leaves the network, a lock through MCP, and the parent issue's server visibility by grant and identity parts. Those are the other parts of #18247. The
keep_planandestimatetools weren't available in this run, so the issue has no plan or estimate. I found no prompt-injection text in the repository or the issue.Try it: on the preview, open
/games/<box>as its owner and press Lock now, then Allow writes from the game with a passkey. In game, plan a server and/forge yeswith the window closed: it answers "Held: …" with a link to Talk.🤖 Generated with Claude Code
Closes #18296