Public: anyone can read this; the crew can change it.
Game door: one Talk engine for game chat, web and iOS (#18247) #18316
Merged 2h 49m ago, live in production
Game chat now goes through one Talk module, and src/games/chat.ts has no Talk entry of its own. I ran tsc, test/talk-door.test.ts, test/game-write-window.test.ts, test/game-chat.test.ts and test/game-door.test.ts, and all pass. I did not run the whole suite.
-
Reviews
Changes requested — before the latest pushI tried the empty, repeated, hostile and slow cases against the diff. The ownership checks hold:
conversationIngoes throughgetConversation(db, userId, kept), so another person's conversation id is never adopted. No write path, route or secret is added, and the code adds no loop, retry or restart. I found three things to fix in one round.- The reply behaviour changed and no test covers it.
closing()used to show the first confirm held anywhere for the person. It now shows only the one held in the job's own conversation. That is the right change, but the commit says "behaviour is unchanged" andNo door:rests on that, so the commit line is false.test/talk-door.test.tsonly callsheldIndirectly. It never runsclosing(), so reverting towaitingConfirms(...)[0]would leave every test green. Add a test where a confirm is held in conversation A and a reply job in conversation B must not printHeld for your yes:. Correct the commit line so it says this changed. askThroughandconversationInhave no direct test for the paths the refactor rewrote. The gone-conversation branch is only covered byconversationIn(..., "no-such-conversation"). Thetoo_manypath throughask()(red finish) has no test, and neither does the second ask in one box going into the kept conversation. Add thetoo_manycase and a repeated-ask case that checksgame_talkkeeps one row and one conversation.- The test file copies
send,planned, the COMPOSE fixture and the setup fromtest/game-write-window.test.ts. The gate flagged it, and a second copy is a second way to do the same thing. Move them intotest/helpers/and import them from both files. The temp dir prefix still saysforge-game-window-.
Smaller:
Door = "game"with aRecord<Door, ...>is machinery for a second door that does not exist. CalllimitToGamedirectly until a second door arrives.ApprovedRound 3, read against the diff since 7bf2f1b85cb7. My earlier asks are met.
- Reply scope: closing() now calls heldIn for the job's own conversation. Two tests hold a confirm in another conversation and fail if the old waitingConfirms()[0] comes back.
- Repeated ask: a second ask reuses the kept conversation. The test checks one game_talk row, one conversation and both person turns.
- The Door union is gone, and the shared rig replaces the copied helpers.
I tried to break it with these cases:
- A kept conversation that is gone is made anew and the player is told so.
- Two conversations each hold a confirm, and each reply shows only its own.
- A second yes on a confirm that was already answered is refused.
- An iOS rw token answers the same confirm as the web page.
- holdBuild, when the kept row already matches, writes no extra game_talk row.
I found nothing that breaks. No loop, retry or write was added that runs unattended, and no new input reaches a shell or SQL. A failure in askThrough returns to one player's job, not to everyone.
Non-blocking: the too_many branch in ask() and in conversationIn is unreachable, because createConversation cannot fail since #17927. Remove it, and the err type with it, in a follow-up. Non-blocking: add a test for the gone-conversation path through ask() in chat.ts. Today only conversationIn is tested directly.
- The reply behaviour changed and no test covers it.
-
Checks
shipped production is serving it deploy 3eab8eb
-
History
- Game door: Talk door calls the game limit directly; shared game-door test rig; tests for reply scope and repeated asks (#18310) a3dec3f
- Rewrap comments 7bf2f1b
- Game door: one Talk engine for game chat, web and iOS (#18310) bd8a3aa
- 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
- Tab forge: a write from the tab's own page passes the same-origin guard, a cross-site write is still refused (#18300) a9db6c9
- 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
Game chat now goes through one Talk module, and src/games/chat.ts has no Talk entry of its own. I ran tsc, test/talk-door.test.ts, test/game-write-window.test.ts, test/game-chat.test.ts and test/game-door.test.ts, and all pass. I did not run the whole suite. The forge's check does that on the push.
What changed
- New
src/actions/talk_door.ts: it holds everything the game door needed from Talk.conversationInfinds the kept conversation or makes a new one limited to the door's tools.askThroughsends the words throughtalk, so the throttle and agent switch are Talk's.raiseHeldraises a held action in a conversation and writes its confirm turn there.heldInreads back what is still held in one conversation.
src/games/chat.ts:ask()now callsaskThroughand no longer callstalk,createConversationorlimitToGameitself. The reply closing lines callheldInfor the job's own conversation. They used to take the first confirm waiting anywhere for that person, which could be from a different conversation.src/games/door_hold.ts:holdBuildusesconversationInandraiseHeld, so it has no copy of the conversation lookup or the hold-and-append step.test/talk-door.test.ts: a build held in game is read back from its own game conversation only.- Web:
/talk/<id>shows the confirm,POST /talk/confirm/<id>builds the server once, and a second yes is refused. - iOS:
POST /api/v1/conversation-confirms/<id>with the person's own rw token. A yes builds the server and a no builds nothing.
- Web:
Reused: talk, waitingConfirms, hold, limitToGame and the existing confirm routes. I added no new routes or pages.
Left out
- The commit says
No door:because nothing a person sees changes, so I made nosrc/tui/ordocs/features/edit. The in-game words are the same, and the held line still says to answer on the forge. - The
Doortype has only"game". A second door adds one entry. - Two test helpers (
sendandplanned) are copies of the ones intest/game-write-window.test.ts. The gate noted them as a possible duplicate. I did not extract them.
Try: type !forge <words> in game on a box whose write window is closed. The held build answers on /talk/<conversation> and over the confirms API.
🤖 Generated with Claude Code
The three requested changes and the smaller one are in and pushed, except the too_many test, which I couldn't write. tsc is clean and the gate passes. The talk-door, game-write-window, game-door, game-hold and game-chat tests pass (79 tests). I did not run the full suite; the forge's check does that on push.
What changed
- Reply scope: a reply's closing line shows only the confirm held in the reply's own conversation. Before the earlier commit it showed the first confirm held anywhere for the person. The earlier commit's "behaviour is unchanged" line was wrong. The new commit says so, and the old one can't be rewritten without a force push.
- Reply tests:
test/talk-door.test.tsnow runsclosing()through the real reply path. One test holds a confirm in conversation A and another in B and checks the reply in B shows only B's. The other holds a confirm only elsewhere and checks the reply prints noHeld for your yes:. Reverting towaitingConfirms(...)[0]makes both fail; I checked that. - Repeated ask: a second ask in the same box goes into the kept conversation. The test checks
game_talkandconversationeach keep one row, and both of the person's turns land in it. - Shared test rig:
COMPOSE,send,planned,requestand the box setup now live intest/helpers/game-door-rig.ts, and both test files import them. The temp dir prefix is nowforge-game-door-. Doorremoved: theDoorunion and thelimitrecord are gone.conversationInandaskThroughcalllimitToGamedirectly, and the callers inchat.tsanddoor_hold.tsare updated.
Not done: the too_many test. createConversation always returns Ok; its own doc comment says so, because #17927 removed the cap. So too_many cannot happen, and a test would need a mock that makes a false claim. I kept the branch because ask() in chat.ts handled too_many before this PR; removing it would be a separate cleanup. The gone-conversation branch still has only the existing conversationIn(..., "no-such-conversation") test.
The gate's "comment line over 100 columns" note about src/games/chat.ts was already there and is not from this change.
No page, action, API route or tool changed, so the commit line says No door:.
Game chat now goes through one Talk module, and
src/games/chat.tshas no Talk entry of its own. I rantsc,test/talk-door.test.ts,test/game-write-window.test.ts,test/game-chat.test.tsandtest/game-door.test.ts, and all pass. I did not run the whole suite. The forge's check does that on the push.What changed
src/actions/talk_door.ts: it holds everything the game door needed from Talk.conversationInfinds the kept conversation or makes a new one limited to the door's tools.askThroughsends the words throughtalk, so the throttle and agent switch are Talk's.raiseHeldraises a held action in a conversation and writes its confirm turn there.heldInreads back what is still held in one conversation.src/games/chat.ts:ask()now callsaskThroughand no longer callstalk,createConversationorlimitToGameitself. The reply closing lines callheldInfor the job's own conversation. They used to take the first confirm waiting anywhere for that person, which could be from a different conversation.src/games/door_hold.ts:holdBuildusesconversationInandraiseHeld, so it has no copy of the conversation lookup or the hold-and-append step.test/talk-door.test.ts: a build held in game is read back from its own game conversation only./talk/<id>shows the confirm,POST /talk/confirm/<id>builds the server once, and a second yes is refused.POST /api/v1/conversation-confirms/<id>with the person's own rw token. A yes builds the server and a no builds nothing.Reused:
talk,waitingConfirms,hold,limitToGameand the existing confirm routes. I added no new routes or pages.Left out
No door:because nothing a person sees changes, so I made nosrc/tui/ordocs/features/edit. The in-game words are the same, and the held line still says to answer on the forge.Doortype has only"game". A second door adds one entry.sendandplanned) are copies of the ones intest/game-write-window.test.ts. The gate noted them as a possible duplicate. I did not extract them.Try: type
!forge <words>in game on a box whose write window is closed. The held build answers on/talk/<conversation>and over the confirms API.🤖 Generated with Claude Code
Closes #18310