Skip to content

Commit dad485c

Browse files
Document AHBG executable surfaces
1 parent ab20fc7 commit dad485c

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

ahbg/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,33 @@ ahbg/
6565
CALIBRATION.md Frozen triplicate + reciprocal-check protocol.
6666
```
6767

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+
6895
## Tool responsibilities
6996

7097
### Grok — graphics / game presentation
@@ -177,6 +204,21 @@ empty-tile movement are executable. The rest of that loop remains `hmmm`.
177204

178205
## Usage
179206

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+
180222
Presentation board (Grok):
181223

182224
```bash

0 commit comments

Comments
 (0)