feat(battleship): frontend on SDK v2 + vs-bot via gameKit#110
Merged
daniellam258 merged 19 commits intoJun 29, 2026
Conversation
…ntend-v2 # Conflicts: # frontend/src/agent/gameKit.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two stacked changes to Battleship's frontend, both on the SDK
battleship.v2protocol. Base isfeat/battleship-commit-reveal(the SDK v2 / PR #106) — merge that first, then this can be rebased ontodev-raid.Part 1 — Migrate frontend/agent/bench off
battleship.v1(Merkle) → SDKbattleship.v2The SDK now owns the canonical commit-reveal Battleship (single board-hash commit + terminal legal-fleet
reveal_board). The frontend still ran its ownv1(Merkle root + per-cell-salt per-shot proofs), so the legal-fleet fix wasn't live and the bench measured v1. This repoints every consumer to the SDK, keeping the existing game design (bot/pvp modes, many games per tunnel with a fresh fleet each game, manual placement, smart bot, resume).kind):commit{commitment}(rawUint8Array),shoot{cell},answer{isHit, next?}, terminalreveal_board{board, salt}. Notype:/merkle/proveCell/per-cell-salt anywhere.FleetSecret { board, salt, commitment }; salts fromcrypto.getRandomValues(16).engine/selfPlay.ts,protocol/multiGameBattleship.ts(battleship.multi.v2),agent/games/battleship/kit.ts(battleship.v2),engine/pvpDriver.ts,battleshipResumeAdapter.ts,view.ts+engine/bot.ts(type repoint),useBattleship.ts,useBattleshipPvp.ts.protocol/battleship.ts(v1) +engine/merkle.ts(+ tests). loadbench Dockerfile drops the SDK-backed protocol COPY.Part 2 — Route vs-bot through the gameKit (kit = single bot-move source)
Battleship was the only arena game whose solo/vs-bot UI did not route through its gameKit (every other game does; PvP is bespoke in all of them, incl. blackjack v1 on
dev). This unifies it, mirroring Quantum Poker'spokerSelfPlay.ts.kit.BattleshipBot.planis now the single source of commit/answer/reveal_board/shoot for vs-bot + bench. Newgames/battleship/battleshipSelfPlay.ts(makeSeatBot/stepBattleshipAuto/stepBattleshipWithHuman/applyHumanShot/isHumanShootTurn/runBattleshipSelfPlayToEnd) is a thin wrapper.pipelineflag on the kit bot (defaulttrue): the human seat A is builtpipeline:false(bare answers → the human fires its own shot); the bot seat B + bench arepipeline:true(folds the return shot for TPS).useBattleship.tsdrives via two kit bots (rebuilt each game with the fresh fleet); the human's shot goes throughapplyHumanShot. Deleted the duplicateengine/selfPlay.ts#nextMove/playToCompletion/DrivenMove.useBattleshipPvp.ts/engine/pvpDriver.tshave zero production diff) — matches every game's bespoke-PvP convention.Tests
tsc --noEmitgreen; battleship + gameKit suite passes (38/38 after Part 1; 43/43 after Part 2).Out of scope (follow-ups)