|
65 | 65 | CALIBRATION.md Frozen triplicate + reciprocal-check protocol. |
66 | 66 | ``` |
67 | 67 |
|
| 68 | +## Current executable contracts |
| 69 | + |
| 70 | +Engine entry points are exported from `ahbg/engine/__init__.py`: |
| 71 | + |
| 72 | +- `new_game(seed, tiles, units)` bootstraps a declared plane and writes the |
| 73 | + first `plane.init` event. |
| 74 | +- `TurnEngine.begin_turn()`, `TurnEngine.resolve(plans)`, and |
| 75 | + `TurnEngine.end_turn()` provide the current turn envelope. |
| 76 | +- `legal_observation(plane)` returns the tiles, units, and turn visible to an |
| 77 | + agent; seed, RNG streams, event log, and DM state stay internal. |
| 78 | +- `save_plane()`, `load_plane()`, and `replay()` bind persistence to event-log |
| 79 | + replay equivalence and the event hash chain. |
| 80 | + |
| 81 | +The only resolving action is: |
| 82 | + |
| 83 | +```json |
| 84 | +{"kind": "move", "data": {"unit_id": "A0", "to_tile_id": "ne"}} |
| 85 | +``` |
| 86 | + |
| 87 | +It means one axial step onto an empty adjacent tile. Occupied targets, |
| 88 | +dual-target moves, construction, spawning, absence, loyalty, War, DM rolls, and |
| 89 | +unknown action kinds fail closed. |
| 90 | + |
| 91 | +Presentation consumes `ahbg.presentation.snapshot` only. `motions` are optional |
| 92 | +visual traces with `unit`, `from`, and `to`; they validate referenced ids but do |
| 93 | +not validate adjacency or legality. |
| 94 | + |
68 | 95 | ## Tool responsibilities |
69 | 96 |
|
70 | 97 | ### Grok — graphics / game presentation |
@@ -177,6 +204,21 @@ empty-tile movement are executable. The rest of that loop remains `hmmm`. |
177 | 204 |
|
178 | 205 | ## Usage |
179 | 206 |
|
| 207 | +Verify from the `stack` repository root: |
| 208 | + |
| 209 | +```bash |
| 210 | +PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s ahbg/engine/tests -p 'test*.py' |
| 211 | +PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s ahbg/presentation/tests -p 'test*.py' |
| 212 | +find ahbg -type d -name __pycache__ -print |
| 213 | +``` |
| 214 | + |
| 215 | +The final command should print nothing. The AHBG workflow also rejects generated |
| 216 | +Python cache directories. |
| 217 | + |
| 218 | +CI lives at `.github/workflows/ahbg-ci.yml`. It runs for pull requests touching |
| 219 | +`ahbg/**` and for pushes to `main`; feature-branch pushes may not create a |
| 220 | +remote run, so the local checks above are the feature-branch gate. |
| 221 | + |
180 | 222 | Presentation board (Grok): |
181 | 223 |
|
182 | 224 | ```bash |
|
0 commit comments