Re-enable 9 parked sim_test tests with a multi-deck walk driver (#33) - #47
Merged
Conversation
…im_test tests (#33) The 9 `*_test_pending_v3walk` integration tests drove a hardcoded FLAT gangway walk (helm on the concourse plane). With the 3-deck Mockingbird the pilot spawns on the Upper deck and must descend `x` stairs through the docking tube to reach the concourse, so that route no longer exists. Replace the flat helpers with a layout-robust driver: - `test/walk.gleam`: a pure BFS over a composite `DeckPlan` honouring the same `is_walkable` / `edge_blocks` / stairs deck-change rules the sim's `character.step` obeys, yielding a tile-by-tile path. Unit-tested in `test/walk_test.gleam` against the real Highport+Mockingbird composite. - `test/sim_test.gleam`: the driver decodes the exact plan the sim handed the client (the `space` message's `plan`) and `walkers`' per-character `deck`, then follows the path toward tile centres — trimming perpendicular drift first so the radius-0.3 collision circle never clips a diagonal wall/void on a turn. Navigates any layout dynamically (no berth/route magic numbers); consoles are resolved by id. Also retrain one stale post-undock assertion: the Mockingbird's helm is a wall-mounted console on tile (6,3) since the #36 interior rework, so the ship-local helm centre is (6.5, 3.5), not (6.5, 4.5). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Humans think in degrees, and JSON/wire readability is better for it, so degrees are now the unit for every angle in config, on the wire, and in the sim. Radians appear only where the math requires them (cos/sin and Godot rotations). - angle.gleam: deg_to_rad / rad_to_deg helpers - ship: heading is degrees end-to-end; turn_rate 3.0 rad/s -> 180 deg/s (a clean half-turn/sec, ~5% faster); thrust cos/sin convert locally - shipclass/composite/world: dock_port_orientation, berth orientation, and moored_heading are degrees; dropped the resolved pi/2 (1.5707...) literal and a now-dead const pi - mockingbird.json: dock_port_orientation 1.5707... -> 90 - client: heading converts deg->rad once at ship_state decode (renderer stays radian-native); automation reports degrees; vestigial PI/2 defaults -> 90 - tests updated; full server suite (255) passes Also folds in in-flight Mockingbird deck-glyph decor tweaks and a DESIGN.md note. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the Gleam half of #33 (priority: high).
What
The 9
*_test_pending_v3walkintegration tests inserver/test/sim_test.gleamdrove a hardcoded flat gangway walk ("stand at helm, walk east, south to the concourse"). With the 3-deck Mockingbird the pilot spawns on the Upper deck and must descendxstairs → docking tube → concourse, so that route no longer exists and the tests were parked.How
A layout-robust walk driver replaces the flat helpers:
server/test/walk.gleam— a pure BFS over a compositeDeckPlan, honouring the sameis_walkable/edge_blocks/stairs_target(deck-change) rules the sim'scharacter.stepobeys. Returns a tile-by-tile path. Unit-tested inwalk_test.gleamagainst the real Highport + Mockingbird composite (legal hops, crosses decks).server/test/sim_test.gleam— the driver decodes the exact plan the sim handed the client (thespacemessage'splan) pluswalkers' per-characterdeck, then follows the path toward tile centres, trimming perpendicular drift first so the radius-0.3 collision circle never clips a diagonal wall/void on a turn. It navigates whatever layout it's handed — no berth/route magic numbers; consoles resolved by id — so a ship growing a deck or a berth moving won't re-break it.All 9 tests re-enabled (suffix dropped).
One retrained assertion
undock_splits_bodies_by_tileasserted the post-undock ship-local helm at(6.5, 4.5). Since the #36 interior rework the Mockingbird's helm is a wall-mounted console on tile (6,3), so its centre is(6.5, 3.5). Retrained to match (verified against the loaded ship class). The pilot never walks in that test, so this is stale ship geometry, not driver behaviour.Verification
Local full-suite run reached 254 passed, 1 failure — the single failure being exactly the stale
(6.5,4.5)assertion above, now fixed. CI (gleam test) will confirm the final green state.Not in this PR
The pytest-harness half of #33 (restore a
sparrowschema-3 test fixture +shot_m35_interiorroute) is intentionally left out — it overlaps an in-flight ship-schema refactor (dock-port orientation → degrees) and is best done once that settles.🤖 Generated with Claude Code