|
| 1 | +# AHBG presentation |
| 2 | + |
| 3 | +Grok-owned graphics surface. It renders validated presentation snapshots and |
| 4 | +already-resolved motion traces. It does **not** define game mechanics or derive |
| 5 | +UCNS geometry. |
| 6 | + |
| 7 | +## Boundary |
| 8 | + |
| 9 | +- Included: Seed-of-Life circle rendering, UCNS-supplied tile centerpoints, |
| 10 | + unit markers, selection/inspection, public feed text, and visual traces of |
| 11 | + already-resolved moves. |
| 12 | +- Excluded: legal movement, adjacency authority, turns, War resolution, |
| 13 | + construction, permissions, RNG, DM state, private prompt state, or agent policy. |
| 14 | +- Snapshot standing is `ahbg.presentation.snapshot` / `not-mechanics`. |
| 15 | +- Every snapshot carries an exact `geometry_source` identity plus each tile's |
| 16 | + UCNS-derived `x`, `y`, and `source_slot`. The renderer only scales those |
| 17 | + coordinates for SVG display; it never rebuilds centers from local axial rules. |
| 18 | +- The current sample pins `The-Interdependency/ucns@1975fe70cf4e0826a8020c2da3047569e277af64`, |
| 19 | + the canonical `libs/ucns/` identity in the stack manifest when this surface was |
| 20 | + authored. Its `mobius_seed` module remains an explicit nonselecting UCNS |
| 21 | + candidate; presentation consumption does not promote its standing. |
| 22 | +- `project.py` accepts already-sanitized observation data, source-backed display |
| 23 | + coordinates, and resolved move events. It never decides whether those moves |
| 24 | + were legal and copies only declared browser-facing fields. |
| 25 | +- `geometry.py` scales supplied source coordinates into display pixels only. |
| 26 | + |
| 27 | +## Usage guidance |
| 28 | + |
| 29 | +Validate the package: |
| 30 | + |
| 31 | +```bash |
| 32 | +python -m unittest discover -s ahbg/presentation/tests -p 'test*.py' |
| 33 | +node --check ahbg/presentation/board.js |
| 34 | +``` |
| 35 | + |
| 36 | +Serve the board locally: |
| 37 | + |
| 38 | +```bash |
| 39 | +cd ahbg/presentation |
| 40 | +python -m http.server 8765 --bind 127.0.0.1 |
| 41 | +# open http://127.0.0.1:8765/board.html |
| 42 | +``` |
| 43 | + |
| 44 | +Project a sanitized observation only after the owning adapter has attached the |
| 45 | +UCNS-derived centers and exact source identity: |
| 46 | + |
| 47 | +```python |
| 48 | +from ahbg.presentation.project import snapshot_from_observation |
| 49 | + |
| 50 | +geometry_source = { |
| 51 | + "repository": "The-Interdependency/ucns", |
| 52 | + "commit": "1975fe70cf4e0826a8020c2da3047569e277af64", |
| 53 | + "module": "src/ucns/mobius_seed.py", |
| 54 | + "schema_id": "ucns.mobius-seed-of-life", |
| 55 | + "schema_version": "0.1.0", |
| 56 | + "projection_id": "seed-of-life-seven-equal-circles", |
| 57 | + "selection_effect": "none", |
| 58 | +} |
| 59 | +observation = { |
| 60 | + "turn": 1, |
| 61 | + "geometry_source": geometry_source, |
| 62 | + "tiles": [ |
| 63 | + {"tile_id": "CENTER", "ucns_slot": "CENTER", "x": 0.0, "y": 0.0}, |
| 64 | + {"tile_id": "RING_0", "ucns_slot": "RING_0", "x": 1.0, "y": 0.0}, |
| 65 | + ], |
| 66 | + "units": [{"unit_id": "A0", "tile_id": "RING_0", "label": "A0"}], |
| 67 | +} |
| 68 | +move = { |
| 69 | + "kind": "move", |
| 70 | + "data": {"unit_id": "A0", "from_tile_id": "CENTER", "to_tile_id": "RING_0"}, |
| 71 | +} |
| 72 | +snapshot = snapshot_from_observation( |
| 73 | + observation, |
| 74 | + plane_id="plane-0", |
| 75 | + move_events=[move], |
| 76 | + feed=[{"turn": 1, "text": "public display text only"}], |
| 77 | +) |
| 78 | +``` |
| 79 | + |
| 80 | +The snapshot validator is allowlist-based. Unknown root, geometry, tile, unit, |
| 81 | +feed, or motion fields fail closed. The projector drops undeclared observation, |
| 82 | +move-event, and feed metadata before validation, preventing a visual snapshot |
| 83 | +from becoming a transport for private/internal fields. |
| 84 | + |
| 85 | +The browser exposes tile inspection to pointer and keyboard input, permits |
| 86 | +interactive descendants under an SVG `group` role, scales unit-marker spread by |
| 87 | +occupant count, and renders the selection ring above the unit layer. |
| 88 | + |
| 89 | +## hmmm |
| 90 | + |
| 91 | +- whether later Flower-of-Life rings belong on this presentation surface; |
| 92 | +- the exact live engine-to-observation adapter that attaches UCNS positions is |
| 93 | + owned by the eventual engine integration, not by this graphics package; |
| 94 | +- construction animation remains unavailable until an owning mechanics layer |
| 95 | + emits an already-resolved construction event contract. |
0 commit comments