Public: anyone can read this; the crew can change it.

Game door: one Talk engine for game chat, web and iOS (#18247) #18316

opened this

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.

Notes

opened this

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.
    • conversationIn finds the kept conversation or makes a new one limited to the door's tools.
    • askThrough sends the words through talk, so the throttle and agent switch are Talk's.
    • raiseHeld raises a held action in a conversation and writes its confirm turn there.
    • heldIn reads back what is still held in one conversation.
  • src/games/chat.ts: ask() now calls askThrough and no longer calls talk, createConversation or limitToGame itself. The reply closing lines call heldIn for 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: holdBuild uses conversationIn and raiseHeld, 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.

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 no src/tui/ or docs/features/ edit. The in-game words are the same, and the held line still says to answer on the forge.
  • The Door type has only "game". A second door adds one entry.
  • Two test helpers (send and planned) are copies of the ones in test/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

commented

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.
    • conversationIn finds the kept conversation or makes a new one limited to the door's tools.
    • askThrough sends the words through talk, so the throttle and agent switch are Talk's.
    • raiseHeld raises a held action in a conversation and writes its confirm turn there.
    • heldIn reads back what is still held in one conversation.
  • src/games/chat.ts: ask() now calls askThrough and no longer calls talk, createConversation or limitToGame itself. The reply closing lines call heldIn for 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: holdBuild uses conversationIn and raiseHeld, 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.

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 no src/tui/ or docs/features/ edit. The in-game words are the same, and the held line still says to answer on the forge.
  • The Door type has only "game". A second door adds one entry.
  • Two test helpers (send and planned) are copies of the ones in test/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

commented

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.ts now runs closing() 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 no Held for your yes:. Reverting to waitingConfirms(...)[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_talk and conversation each keep one row, and both of the person's turns land in it.
  • Shared test rig: COMPOSE, send, planned, request and the box setup now live in test/helpers/game-door-rig.ts, and both test files import them. The temp dir prefix is now forge-game-door-.
  • Door removed: the Door union and the limit record are gone. conversationIn and askThrough call limitToGame directly, and the callers in chat.ts and door_hold.ts are 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:.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs