Add Optional CrapsSim Engine API (External Control + Full Test Parity)#79
Add Optional CrapsSim Engine API (External Control + Full Test Parity)#79nova-rey wants to merge 196 commits intoskent259:mainfrom
Conversation
…log (Session Lifecycle & Capabilities)
…dmap-and-changelog
…workflow; add minimal ruff/mypy config and report hygiene
…gauntlet-workflows
…t mypy) + stable tool config and report hygiene
…flow-and-tools
…add diagnostic workflow
…t-workflow-and-diagnostics
…re-diagnostics
…py, build, import smoke, examples smoke)
…artifacts, PYTHONPATH seed)
…tract-documentation
…eterminism-docs
…-state-and-metrics-design
…nd-metrics-endpoints
…crapssim-engine-api
…nd-import-guards
…tion-and-gauntlet-cleanup
…ity-for-3.103.13
|
Following up on your earlier notes and the recent v0.4.0 changes. The PR briefly disappeared from my view when I adjusted my fork’s default branch during some CI troubleshooting; once reverted, GitHub correctly reconnected me to this original PR. Nothing on your side was affected, but I wanted to mention it in case the activity log looked odd. Everything you flagged in your initial feedback has now been addressed: • Engine v0.4.0 updates • Python compatibility (3.10–3.13) • setup.cfg restoration • Maintenance model • Documentation and structure • Behavioral parity verification If anything needs clarification or refinement, I’m happy to adjust it. Thanks again for taking the time to look at this, I appreciate your willingness to include the API layer and I’m committed to maintaining it as the engine continues to evolve. |
This PR introduces a small, self-contained “CrapsSim Engine API” module that exposes the engine through a clean action-based interface. The goal is to support external orchestration layers (e.g., simulation runners, strategy controllers, or automated tests) without impacting the core engine or changing behavior for existing users.
A few important points up front:
The API is entirely optional.
Core users who want the standard library experience won’t notice anything new. No dependencies were added, and nothing in the engine imports the API.
It lives in its own directory (crapssim_api/) and can be installed independently if desired. If someone doesn’t need it, it stays out of the way.
No engine logic was touched.
All behavior remains defined by CrapsSim itself. The API simply exposes verbs that map cleanly to existing bet types and actions.
Full deterministic parity was validated.
The API was tested against the engine using a roll-by-roll scenario harness plus a larger surface test suite. All sequences matched: bankroll, bets, error codes, and resolution order. Parity reports are included.
The end result is an optional integration layer that allows higher-level tooling to interact with CrapsSim predictably, while keeping the engine itself pure, stable, and focused. If the API ever needs maintenance, I’m happy to keep it aligned with upstream changes so the core project doesn’t have to take on that burden.
If you’re open to including it, I think it gives CrapsSim a clean extension path without adding weight to the core package.