Encapsulate games under games/ with catalog session identities - #411
Open
bramcohen wants to merge 12 commits into
Open
Encapsulate games under games/ with catalog session identities#411bramcohen wants to merge 12 commits into
bramcohen wants to merge 12 commits into
Conversation
…sion model. Factory hashes stay on the WASM propose/notify boundary, and lastTerms is null until a hand is agreed so saves round-trip atomically.
The regression harness is a stub repo with only clsp/; GNU find exits 1 if a named search root does not exist.
Separate proposal composition, durable state, and play mounts so game UIs receive only accepted-hand data and host-owned lifecycle handling.
Give game packages one machine-owned state path and explicit directional contracts so live, restored, and frozen hands share the same authoritative model.
Keep queued candidates separate from canonical game state so delayed acceptance and rejection remain correct across protocol replay and browser restore.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0ea4cba. Configure here.
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.

Summary
games/<key>/{clsp,rust,ui}behind a portablegames/hostcontract andgames/registry.json.calpoker,spacepoker,krunk) in the JS session model and IndexedDB; factory hashes stay on the WASM propose/notify boundary.lastTermsnulluntil a hand is agreed so compose drafts and last terms persist independently and round-trip.Test plan
pnpm --filter chia-gaming-fe run test./ct.sh(or CI) for Rust/simulator coveragegameTypein the save and the game remountsNote
High Risk
Touches session persistence (envelope v15), proposal/identity mapping at the WASM boundary, and the entire game UI/lifecycle path. A mismatch in catalog vs protocol IDs or pending-candidate handling can break play and restore.
Overview
Turns games into self-contained packages under
games/<key>/{clsp,rust,ui}, registered only ingames/registry.json. Rust and frontend wiring, CLVM compile, presets, and tests are generated from that catalog. Core no longer special-cases Calpoker/Krunk/Space Poker when composing or reviewing.Identity split: JS saves and the session model keep catalog keys (
calpoker,spacepoker,krunk). The wire/WASMgame_typeis the first generated member’sinitial_validation_program_hash, filled by factory warmup on page load (protocolIdForCatalog/catalogGameTypeFromWire).Host contract: Packages implement
GamePackageviagames/host(HandProposal, factory-parameter codecs,durableState, onerender(view)mount). Gameplay RxJS events are gone; the machine applies five inputs (hand-started,opponent-moved,game-message,move-rejected,hand-ended) and games dispatchGameIntent. Queued local actions persist as pending candidates separate from canonicalhandStateuntil host-onlyLocalActionApplied.Persistence: Session envelope is now v15 (WASM schema 6). Compose drafts live under
drafts; last/retry/proposal-group terms becomeHandProposaland stay independent of the compose draft (null until a hand is agreed). Incompatible alpha records are still dropped, not migrated.Adds
GAME_WRITING_GUIDE.mdas the add-a-game checklist.Reviewed by Cursor Bugbot for commit 90e1615. Bugbot is set up for automated code reviews on this repo. Configure here.