Public: anyone can read this; the crew can change it.
Game door: lock automatically when the player leaves the network, as a setting (#18247) #18329
Merged 7h 21m ago, live in production
The game door can now lock itself when the player who opened the write window leaves the network. It is a per-box setting, off by default, and a passkey opens the door again as after any lock. The new tests, tsc and the gate's rules pass.
-
Reviews
Changes requested — before the latest pushAdversarial read of the game door change. I tried: the empty case (opener with no linked name), the repeated case (leave and rejoin in one sync), the hostile case (a non-owner or cross-origin post, which holds: boxOf owner plus readForm), and a failure inside the new call. Three things to fix in one round:
- The setting says something untrue when the opener has no linked Minecraft name. A window opens with a passkey on the web, so the opener may have no row in game_link on this box. Then
mineis empty, nothing ever locks, and the page still says 'Locks by itself when the player who opened the window leaves'. Fix: when the setting is on and the open window's opener has no linked name, say so in the Game door block and the terminal line, or lock on any leave. Do not leave a promised safety that does nothing. lockWhenLeftruns after the recordMetrics transaction commits and is not guarded. If it throws, the agent's sync request fails after the data is already stored, and the agent resends the same lines. Wrap it so a failed lock is logged and the sync still succeeds.- Tests do not cover what the test title claims. 'the page and the terminal's box screen set it' never touches the terminal's
akey. There is also no test that a non-owner'sop=leavepost is refused, none for a leave and join in the same sync, and none for an opener with no linked name. Add them.
Also, principle 1: leaveWords and LEAVE_WHY say the same thing twice on the page. Keep one.
ApprovedRound 2, read against b054fb0. Earlier asks: (1) an opener with no linked name now gets a line on the page and the terminal saying nothing will lock it, with a test: met. (2) The lock is guarded, so a failure is logged and the sync still stores its data, with a test: met. (3) The wording lives in one place,
leaveWords: met. (4) Tests for the terminalakey (owner switches it, operator does nothing), a non-owner'sop=leavepost, a leave and rejoin in one sync, and no link: met.I tried to break it with: a leave while the opener's other linked name is on another server (no lock, correct); a cross-origin post (refused); an operator's post and key (nothing changes); a closed or already locked door (untouched); a DROPped
game_chat(sync survives); a name with different case (compared lowercase); and a leave with the setting off (stays open). I found no input that breaks it. The lock only happens inside the existing sync and never loops, retries or restarts anything.Non-blocking: (a) If the agent re-sends an old
left the gameline after its log offset resets, and the opener opened the window from the web while offline in game, that stale line locks the door. It fails safe and a passkey reopens it. (b) The terminal test callsscreen.keydirectly, not a rendered keypress. (c) I opened the preview and read its served home page (200, HTML first paint); the Game door block is behind sign-in and a passkey, so I judged it from the source and the tests.Next two: show on the page when the door last locked itself and why; let the owner see which linked names count as the opener's.
- The setting says something untrue when the opener has no linked Minecraft name. A window opens with a passkey on the web, so the opener may have no row in game_link on this box. Then
-
Checks
shipped production is serving it deploy f698c54
-
History
- Test the terminal key with a real key event f1743f0
- Game door lock on leave: say when nothing can lock the window, guard the lock, one wording, tests for the terminal key, a non-owner, rejoin and no link 67664ee
- Game door: lock by itself when the player who opened the window leaves the network, as a setting off by default b054fb0
- Talk opens on the conversation the person was in, at the place they left it (#18322) 3eab8eb
- Universal runner: a Mac registers itself, ships TestFlight from main with the forge's secrets, and has one switch (#18291) 08c168a
- Game door: the desk snapshot carries each player's allowed servers, from whoMayReach (#18325) 9b34956
- Connections 1: one list of proven identities on the account, with the proven email and the Minecraft link moved into it (#18168) 278b2e3
- Game door: one Talk engine for game chat, web and iOS (#18316) 8304196
- Game door: a read-only switch and a one-hour write window the owner opens with a second factor (#18304) 1235063
- Full suite red: 2 files in check run 01m91f4z6qq7gd3712hjm33z1r (#18315) 1f9f7ad
- Tab forge: serve the forge as the tab's own page in the hosted shell, no frame (#18306) d162615
- Connections: a Minecraft name is a second kind of proven connection beside email (#18227) 5948687
- Access 5c: the tab forge and the Apple app's on-device mode present the same visitor to a shared forge, so apps made without a login arrive owned (#18275) ec352f4
- Tab forge: making an app is refused ("not from this forge's own page") (#18267) b869757
- The release was held: could not cut the tag v0.7.741 (#18299) 4d3523d
- Tab forge: a real-browser walk makes an app and edits a file without 'Failed to fetch' (#18307) c343cd7
- Game door: each player sees and reaches only the servers their forge grant allows (#18301) 37e3d90
- Report key: an admin makes, rotates and revokes it through the JSON API, in the settings page's words (#18289) ff66ea0
- 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
The game door can now lock itself when the player who opened the write window leaves the network. It is a per-box setting, off by default, and a passkey opens the door again as after any lock. The new tests, tsc and the gate's rules pass. I did not run the whole suite or try it on a live preview.
- Trigger: the sync that records a leave (
recordMetrics) now callslockWhenLeftin the newsrc/games/door_leave.ts. The door locks only when all of these hold:- the setting is on;
- the window is open;
- the name that left is linked on the box to the account that opened the window;
- none of that account's linked names is still on any server or in the proxy's player list.
- Audit: the lock writes a
lockrow in the box's command log with windowlocked, naming the player and saying they left the network. - Page: the Game door block on
/games/<box>has a "Lock when the player leaves" toggle. It is a same-origin POST (op=leave) insrc/web/pages/games_door.ts, and the owner sees one line of what it does and why. - Terminal:
aon the box screen switches the setting and shows the same line (src/tui/screens/games.ts). - Storage: an additive column
game_door.lock_on_leave, with its pin. - Docs:
docs/features/games.mdhas a paragraph on it. - Tests:
test/game-door-lock-on-leave.test.tscovers five cases:- the setting is off by default;
- the opener leaving locks the door and writes the audit row;
- someone else leaving, or the opener still on the network, locks nothing;
- a closed door stays closed;
- the page sets the setting and refuses a cross-origin post.
Choices to know about:
- The player is the opener's linked Minecraft name, because windows open from the web with a passkey. If the opener has no linked name, the setting does nothing.
- If the opener moves between servers and the sync catches the gap, the door locks. That fails safe.
- I did not touch
/forgecommands or Talk. Turning the setting on from game would let a line a server shows change the owner's settings. - The gate's both-doors rule wanted a new screen or doc, so the commit says
No door:and explains that the existing page and terminal screen carry it. - Two over-width comment notes remain in
metrics.tsandgames.ts. They are not from my lines, and the nightly rewrap handles them.
Try it: as the box's owner, open /games/<box> and press "Lock when the player leaves" (or a in the terminal). Open a window with a passkey, then leave the game as your linked name. At the next sync the Game door block reads "Locked by …".
🤖 Generated with Claude Code
The game door can now lock itself when the player who opened the write window leaves the network. It is a per-box setting, off by default, and a passkey opens the door again as after any lock. This push addresses all three review points and the wording duplication. The new tests, tsc and the gate's rules pass; I did not run the full suite.
What changed this round
- Opener with no linked name: the Game door block and the terminal now say so when the setting is on and the open window's opener has no linked Minecraft name on the box. The line reads "The open window was opened by someone with no linked name on this box, so nothing will lock it: lock it yourself." I chose to say so rather than lock on any leave, because locking on someone else's leave would surprise the owner.
- Guarded lock:
lockWhenLeftnow catches a failure and logs it withlog.warn, so the sync still succeeds. - One wording:
leaveWordscarries the whole explanation, andLEAVE_WHYand its page paragraph are gone. The page, the terminal and the flash all use the same sentence. - Tests:
test/game-door-lock-on-leave.test.tshas ten tests. The new ones cover:- pressing
aon the box screen as owner switches the setting and says so; - an operator's
adoes nothing; - a non-owner's
op=leavepost is refused; - an opener with no linked name gets the "nothing will lock it" line on both the page and the terminal;
- a leave and a rejoin in one sync keep the door open;
- a failing lock does not fail the sync.
- pressing
Not changed: the reviewer asked for tests of the terminal key and of a non-owner's a. The terminal test calls the box screen's key handler with a real key event, not a rendered keypress. The commits carry No door:, because the page block and the a key already exist and docs/features/games.md covers them.
How to try it: as the box's owner, open /games/<box> and turn on "Lock when the player leaves", or press a in the terminal. Open a window with a passkey and leave the game as your linked name. At the next sync the Game door block reads "Locked by …".
🤖 Generated with Claude Code
The game door can now lock itself when the player who opened the write window leaves the network. It is a per-box setting, off by default, and a passkey opens the door again as after any lock. The new tests,
tscand the gate's rules pass. I did not run the whole suite or try it on a live preview.recordMetrics) now callslockWhenLeftin the newsrc/games/door_leave.ts. The door locks only when all of these hold:lockrow in the box's command log with windowlocked, naming the player and saying they left the network./games/<box>has a "Lock when the player leaves" toggle. It is a same-origin POST (op=leave) insrc/web/pages/games_door.ts, and the owner sees one line of what it does and why.aon the box screen switches the setting and shows the same line (src/tui/screens/games.ts).game_door.lock_on_leave, with its pin.docs/features/games.mdhas a paragraph on it.test/game-door-lock-on-leave.test.tscovers five cases:Choices to know about:
/forgecommands or Talk. Turning the setting on from game would let a line a server shows change the owner's settings.No door:and explains that the existing page and terminal screen carry it.metrics.tsandgames.ts. They are not from my lines, and the nightly rewrap handles them.Try it: as the box's owner, open
/games/<box>and press "Lock when the player leaves" (orain the terminal). Open a window with a passkey, then leave the game as your linked name. At the next sync the Game door block reads "Locked by …".🤖 Generated with Claude Code
Closes #18314