Update to pkcore 0.0.54#6
Merged
Merged
Conversation
Contributor
folkengine
commented
May 2, 2026
- Features: bind PokerSession (constructors, hand lifecycle, set_blinds/forced_at_hand_start, getters, session-wide ops) — src/session.rs (+212)
- Features: bind TableNoCell with nlh_from_seats + heads_up factories — src/table_no_cell.rs (+232)
- Features: bind SeatsNoCell construction and inspection helpers
- Features: bind PlayerAction enum with TableAction-style accessors
- Features: bind SessionStep enum (read-only, returned by next_step)
- Features: add PyO3 scaffolding modules (bot.rs, hand_history.rs, stats.rs) under pkcore 0.0.52
- Fixes: clippy cleanup across new bindings
- Fixes: make TableNoCell::heads_up public so session.rs can call it cross-module
- Refactors: pub struct Winnings(PkWinnings) → pub(crate) PkWinnings so session.rs can construct it
- Config: bump pkpy and pkcore 0.0.39 → 0.0.52, then 0.0.52 → 0.0.54
- Config: ignore .claude/ and remove tracked .claude/settings.local.json
- Docs: add CHANGELOG.md starting at 0.0.54 with inherited short-stack-BB fix notes
- Docs: design spec + plan for pkpy 0.0.52 upgrade (docs/superpowers/{specs,plans}/2026-04-28-*)
- Docs: design spec + plan for PokerSession + TableNoCell bindings on pkcore 0.0.53 (docs/superpowers/{specs,plans}/2026-04-29-*)
- Docs: register new classes in python/pkpy/init.py (PokerSession, TableNoCell, SeatsNoCell, PlayerAction, SessionStep)
- Tests: add tests/test_session.py (+157) covering PokerSession lifecycle and 0.0.53 regression ports
- Tests: add tests/test_table_no_cell.py (+140) covering no-cell table construction and inspection
- Cargo.toml: bump pkpy and pkcore from 0.0.39 → 0.0.52 Refactors - src/lib.rs: promote to_py_err to pub(crate) for sibling-module use - src/lib.rs: add five mod declarations (bot, hand_history, session, stats, table_no_cell) and call their register functions in #[pymodule] Features - src/lib.rs: surface ChipAuditFailed and ResetTable as explicit TableAction.kind() strings instead of "Other", with two new Rust unit tests in a Scaffolding (no behavior yet) - src/bot.rs, src/hand_history.rs, src/session.rs, src/stats.rs, src/table_no_cell.rs: empty domain modules with no-op register functions, ready to host Phase 3+ bindings Docs - docs/superpowers/specs/2026-04-28-pkpy-0.0.52-upgrade-design.md: design spec for the upgrade - docs/superpowers/plans/2026-04-28-pkpy-0.0.52-upgrade.md: 26-task implementation plan
bindings on pkcore 0.0.53
What changed: - src/table_no_cell.rs:3 — added use pkcore::casino::table_no_cell::SeatNoCell as PkSeatNoCell; - src/table_no_cell.rs:64-105 — new SeatNoCell pyclass with 7 state predicates and __repr__ - src/table_no_cell.rs:107-111 — register now adds SeatNoCell - python/pkpy/__init__.py — SeatNoCell added to import block and __all__ (next to SeatEquity) - tests/test_table_no_cell.py — added TestSeatNoCell class (3 tests); the test_default_state_predicates assertion was relaxed to match pkcore's actual semantics (a fresh funded seat reports is_in_hand=True because that flag means "eligible," not "hand in progress")
heads_up factories
- src/lib.rs:2646 — pub struct Winnings(PkWinnings); → pub struct Winnings(pub(crate) PkWinnings); (so session.rs can construct via Winnings(pk_winnings)) - src/session.rs — added crate-internal uses (TableNoCell, to_py_err, ForcedBets, Winnings, PkPokerSession); appended the PokerSession pyclass with new/heads_up constructors, the 0.0.53 set_blinds/forced_at_hand_start methods, hand lifecycle (start_hand, end_hand, is_hand_in_progress, is_hand_complete, next_actor, next_step, apply_action), session-wide ops (count_funded, eliminate_busted), and #[getter] accessors for hand_number and shuffled_deck_str; added m.add_class::<PokerSession>()? to register - src/table_no_cell.rs — added pub to TableNoCell::heads_up so session.rs's heads-up factory can call it (private-by-default #[pymethods] would have blocked the cross-module call) - python/pkpy/__init__.py — PokerSession added to import block and __all__ after Pluribus - tests/test_session.py — TestPokerSession class with 10 tests; all green on first run, no semantic surprises Two compile-time corrections from the plan: 1. hand_number is u32 in pkcore, not u64 (plan was off — caught by the compiler). 2. TableNoCell::heads_up needed pub to be reachable from session.rs (Python-visible doesn't mean Rust-visible across modules).
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.