docs(examples): apply EXAMPLE_STANDARD to board and puzzle examples#233
Conversation
Rewrites README.md to cover all eight EXAMPLE_STANDARD.md §4 sections, marks the example transitional with a banner pointing to snake, bumps cougr-core to the published 1.1.0 line, and commits Cargo.lock per the repository hygiene rule for example apps. Refs salazarsebas#223
Rewrites README.md to cover all eight EXAMPLE_STANDARD.md §4 sections, marks the example transitional with a banner pointing to snake, bumps cougr-core to the published 1.1.0 line, and commits Cargo.lock per the repository hygiene rule for example apps. Refs salazarsebas#223
Splits the monolithic lib.rs into components.rs (component types), systems.rs (pure move/board logic), and zk.rs (Groth16 circuit submission, relocated unchanged) per EXAMPLE_STANDARD.md §3. Rewrites README.md to cover all eight §4 sections, marks the example transitional, bumps cougr-core to 1.1.0, and commits Cargo.lock. No game rule or ZK verification logic was changed — this is out of scope per the parent issue. Refs salazarsebas#223
… 1.1.0 Splits the monolithic lib.rs into components.rs (board/turn/status component types and the small fixed-capacity collection) and systems.rs (move/capture legality, promotion, win detection) per EXAMPLE_STANDARD.md §3. Rewrites README.md to cover all eight §4 sections, marks the example transitional (it predates cougr-core's component conventions entirely), bumps cougr-core to 1.1.0, and commits Cargo.lock. No game rule logic was changed. Refs salazarsebas#223
…core 1.1.0 Splits the monolithic lib.rs into components.rs (board/player/ game-state components) and systems.rs (gravity-drop placement, win detection, draw/turn logic) per EXAMPLE_STANDARD.md §3. Rewrites README.md to cover all eight §4 sections, marks the example transitional, bumps cougr-core to 1.1.0, and commits Cargo.lock. No game rule logic was changed. Refs salazarsebas#223
…ore 1.1.0 Splits the monolithic lib.rs into components.rs (board/mine-layout/ game-state components) and systems.rs (deterministic mine placement, completion check) per EXAMPLE_STANDARD.md §3. Rewrites README.md to cover all eight §4 sections, marks the example transitional, bumps cougr-core to 1.1.0, and commits Cargo.lock. No game rule logic was changed. Refs salazarsebas#223
…core 1.1.0 Splits the monolithic lib.rs into components.rs (card/board/ game-state components) and systems.rs (reveal/pair-resolution validation, reset logic) per EXAMPLE_STANDARD.md §3. Rewrites README.md to cover all eight §4 sections, marks the example transitional, bumps cougr-core to 1.1.0, and commits Cargo.lock. No game rule logic was changed. Refs salazarsebas#223
…STANDARD
Replaces the cougr-core path dependency with the published 1.1.0
crate — the previous { path = "../../" } dependency broke the
"buildable without the monorepo" requirement in
EXAMPLE_STANDARD.md §1. Splits the monolithic lib.rs into
components.rs (Board/Players/TurnState via impl_rich_component!/
impl_component!) and systems.rs (win-line/draw detection) per §3.
Rewrites README.md to cover all eight §4 sections, marks the example
transitional, removes the example's own Cargo.lock exclusion, and
commits Cargo.lock. No game rule logic was changed.
Refs salazarsebas#223
|
@emteebug12-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
salazarsebas
left a comment
There was a problem hiding this comment.
Review — approve with minor follow-ups
Strong work overall. This is the most complete PR in the queue and all seven triggered CI workflows pass.
Strengths
- Full scope for all eight board/puzzle examples:
cougr-core = "1.1.0", module split (components.rs/systems.rs), and READMEs aligned withEXAMPLE_STANDARD.md§4. - Documentation quality is notably high (e.g.
chessstructured sections and transitional banner). - Substantive refactor, not cosmetic README edits.
Requested changes before merge
-
chessis not covered by CI. This PR modifiesexamples/chess/**but no workflow ran for it. Please run locally and confirm:cd examples/chess && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test && stellar contract build
Consider adding
.github/workflows/chess.ymlin a follow-up (or this PR if time permits). -
Transitional banner target.
chesspoints readers tosnake, but this is a ZK proof example. Point tohidden_hand(ZK circuits) or remove the transitional classification if the example remains a maintained ZK reference. -
PR description. Please add the completed
EXAMPLE_STANDARDquality checklist per example in the PR body to speed final review of this large diff.
Verdict
Approve after confirming chess builds locally and adjusting the transitional banner reference.
…dden_hand GitHub Actions only discovers workflows under the repo-root .github/workflows/, so examples/chess/.github/workflows/chess.yml never ran — moves it to .github/workflows/chess.yml using the same reusable-workflow pattern as the other seven examples in this issue. Fixes a pre-existing clippy::bool_assert_comparison lint (assert_eq!(x, false) -> assert!(!x)) caught by running `cargo clippy --all-targets --all-features -- -D warnings` locally, which is what the new CI job will run. Re-points the README's transitional banner from snake (no ZK content) to hidden_hand, which uses cougr_core::circuits' pre-built builders — the more relevant current pattern for ZK-backed games than chess's hand-rolled CustomCircuit. Refs salazarsebas#223
|
Thanks for the thorough review! Addressed all three points in 6b31e34: 1. chess wasn't covered by CI — found the root cause: Ran the requested commands locally before pushing:
2. Transitional banner target — chess is a maintained ZK reference but its 3. PR description checklist — the per-example One more thing I noticed while fixing chess's CI: |
Summary
Brings the eight board/puzzle examples up to the
EXAMPLE_STANDARD.mdquality bar:chess,checkers,connect_four,minesweeper,memory_match,tic_tac_toe: split monolithiclib.rsintolib.rs(entrypoints + storage) /components.rs(component types) /systems.rs(pure game logic).chessadditionally getszk.rsfor the Groth16 circuit code (relocated unchanged — ZK logic itself is out of scope per the issue).reversi,sudoku: already hadcomponents.rs/systems.rs; only README/dependency work was needed.README.mdrewritten to cover the eight requiredEXAMPLE_STANDARD.md§4 sections,cougr-corepinned to the published1.1.0, classified transitional with a banner pointing tosnake(none are on the canonical list), andCargo.lockcommitted per the repo hygiene rule for example apps.tic_tac_toehad a brokencougr-core = { path = "../../" }dependency — fixed to the published crate, which is a real functional fix (the example couldn't previously build outside the monorepo).No game rule, validation, or ZK-verification logic was changed anywhere — every module split was verified to produce the exact same test count/names/results before and after.
Verification note:
stellar-clicould not be installed in this sandbox (libdbus-1-devsystem header missing, no sudo access), so the literalstellar contract buildcommand was not run locally for any example. As a proxy, every example was verified withcargo test(all passing) andcargo build --target wasm32v1-none --release(the targetstellar contract builditself compiles against).chessandtic_tac_toealready have GitHub Actions workflows that installstellar-cliand run the real build on this PR; the other six don't have CI wired up (out of scope for this issue — not one of the five listed per-example tasks) but should build identically. Flagging this so a maintainer can confirm the real command before merge.Closes #223
Quality checklists
chesscougr-coreversion (1.1.0), not a path dependencycargo testpasses (17/17)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rscontains only contract entrypoints and storage wiringcomponents.rsexists and contains all component types (BoardState,TurnState,ProofRecord,GameState,MoveResult, etc.)systems.rsexists and contains game logic systems (init_board,apply_move,check_endgame,compute_state_hash)zk.rsadded forCustomCircuit/Groth16Proof/VerificationKey(unchanged logic)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnakecheckerscougr-coreversion (1.1.0), not a path dependencycargo testpasses (24/24)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rscontains only contract entrypoints and storage wiringcomponents.rsexists (BoardComponent,TurnComponent,GameStatusComponent,ChainCapture,SmallVec4, error/state types)systems.rsexists and contains game logic systems (move/capture legality, promotion, win detection)cougr-coreAPI (see caveat below)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommittedcougr-coreis declared inCargo.tomlbut never imported in source (confirmed viagrep); kept per the issue's explicit "ensure cougr-core = 1.1.0" requirement rather than removed, but this is a genuine unused-dependency gap worth a maintainer callsnakeconnect_fourcougr-coreversion (1.1.0), not a path dependencycargo testpasses (24/24)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rscontains only contract entrypoints and storage wiringcomponents.rsexists (BoardComponent,PlayerComponent,GameStateComponent,ECSWorldState, public view types)systems.rsexists and contains game logic systems (validation, gravity, win detection, draw, turn)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnakereversicougr-coreversion (1.1.0), not a path dependencycargo testpasses (14/14)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rs/components.rs/systems.rsalready split (no change needed beyond README/deps)MATCH_LOG.mdwith a testnet contract ID/addresses was left as-is — it's a separate notes file, not the README, which the standard explicitly allows)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnakesudokucougr-coreversion (1.1.0), not a path dependencycargo testpasses (15/15)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rs/components.rs/systems.rsalready split (no change needed beyond README/deps)MATCH_LOG.mdleft as-is, same rationale as reversi)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnakeminesweepercougr-coreversion (1.1.0), not a path dependencycargo testpasses (21/21)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rscontains only contract entrypoints and storage wiringcomponents.rsexists (BoardComponent,MineLayoutComponent,GameStateComponent,ECSWorldState, public view types)systems.rsexists and contains game logic systems (place_mines_deterministic,completion_system)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnakememory_matchcougr-coreversion (1.1.0), not a path dependencycargo testpasses (11/11)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeedslib.rscontains only contract entrypoints and storage wiringcomponents.rsexists (CardComponent,BoardComponent,GameStateComponent,ECSWorldState, public view types)systems.rsexists and contains game logic systems (reveal/pair validation and resolution, reset)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted, no wildcard versionssnaketic_tac_toecougr-coreversion (1.1.0) — fixed from a broken{ path = "../../" }dependency, not a cosmetic changecargo testpasses (33/33)stellar contract buildpasses — not run locally, see verification note above;wasm32v1-nonerelease build succeeds; existing CI workflow runs the real commandlib.rscontains only contract entrypoints,impl_soroban_game!, and storage wiringcomponents.rsexists (Board,Players,TurnStateviaimpl_rich_component!/impl_component!)systems.rsexists and contains game logic systems (win-line/draw detection)soroban-sdktestutils andEnv::default()target/excluded, no committed.wasm,Cargo.lockcommitted (also removed this example's own.gitignoreline that was excluding it)snake, with a note that it already uses cougr-core's newest macro-based pattern