HEXWORK - A Lantern in the Deep: 3D ASCII terminal roguelike RPG in Rust. Entirely designed and built by Muse Spark 1.3 to evaluate if I like the model.
hexwork crates hexwork-cli tests pty README-interface.md
4.3 kB
Markdown
at main

Independent player-interface evidence #

vt.py is a stdlib-only VT decoder, independent of the renderer and term crate. It retains glyph, foreground, background and bold for every cell. Colors are terminal default (None), indexed 0..255, or RGB. Unsupported controls and unsupported wide/combining glyphs fail loudly, rather than being discarded. The subset includes incremental UTF-8/CSI, H/f, J/K, SGR 0/1/22/38/48/39/49, basic ANSI colors, alternate screen, delayed wrap, resize and input-mode toggles. Terminal defaults are represented symbolically, not claimed as measured colors.

Run fixtures immediately:

python3 -m unittest discover -s crates/hexwork-cli/tests/pty -p test_vt.py -v

player_interface_pty.rs launches the real compiled executable through player_interface.py; no physical action is injected through headless APIs. Entry must create the HEXWORK_INTERFACE_METADATA JSONL file and append only after draw/flush. The driver removes any prior file before launch. It consumes frame, mode (FirstPerson/ChaseOrbit/TopTactical), screen, look_active, yaw, pitch, elevation, selected_z, player_z, tick, diagnostic_hash, history_len, width and height. Modal inventory is identified by the production screen value. It uses the actual terminal suspension text during too-small resize (no metadata is expected there). All waits/read volume and process cleanup are bounded.

Opt-in artifacts #

Set HEXWORK_PTY_ARTIFACT_DIR to a dedicated output directory. Each selected frame exports deterministic JSON and SVG with a 1:2 cell aspect. No artifacts are emitted by default. JSON retains symbolic terminal defaults; SVG uses an explicit illustrative #c0c0c0/#000000 default theme, not a terminal measurement. Only allowlisted scalar diagnostic metadata is exported; paths, run IDs, timestamps, raw output and user environment are excluded. XML is escaped. Artifact basenames are fixed by the test, never derived from player names. The metadata JSONL itself remains local to the isolated temporary harness.

Scope / gaps (not certification) #

Handwritten fixtures prove byte-split reconstruction, full-plus-diff equivalence, chrome reset, erase, wrap/resize, alternate screen and deterministic exports. They do NOT prove the production renderer's full/diff equivalence.

Executed physical scenarios cover Story truecolor/indexed/no-color, Classic no-color, and a frozen legacy keymap with PageUp=movement and 0=wait collisions. The default seed is 223; HEXWORK_PTY_SEED parameterizes it, with wrapper cases for seed 0 Story truecolor and seed 140 Story no-color. HEXWORK_PTY_ASCII=1 forces ASCII independently of color, with a truecolor wrapper case. A resumed Story case first completes a fresh route, then launches --load on that same isolated run; it checks build/run identity, seed, history, player location, camera/map/slice/recenter and paused canonical invariance. Artifact names include seed and ASCII/Unicode policy to avoid cross-seed/policy overwrites. They cover look/right/up/reset/exit, camera switch, inventory modal return, tactical slice/recenter/off-slice rejection, resize/suspension/restoration and chrome reset, 120x36 growth and 80x24 shrink. Canonical invariance is asserted across Story tactical slice/resize, including physical movement sent while too small. Both Story and Classic perspective modes are live: whole-route history and player location remain unchanged, but live ticks are not mislabeled camera effects. An additional physical route enables mouse capture, verifies 6-degree yaw/4-degree pitch drag, focus-loss drag reset without camera toggle, and a camera-relative forward step east after a 90-degree turn. Legacy truthful-hint checks currently reject advertised default slice/recenter bindings, not every possible hint grammar.

Remaining matrix: other camera-relative directions/chase movement, mouse release and mode-change reset isolation, repeat suppression, tilt bounds and octant boundary ties, remapped optional actions beyond frozen omissions, PageDown, independent live full/diff reference oracle, entity eligibility/occlusion/semantic-role scene matrix, and human AC10 normal-brightness release route. No unit test or SVG certifies AC10, and this harness does not certify full HEXWORK completion.