Skip to content

Re-enable 9 parked sim_test tests with a multi-deck walk driver (#33) - #47

Merged
Dibujaron merged 2 commits into
mainfrom
fix/issue-33-multideck-walk-driver
Jul 22, 2026
Merged

Re-enable 9 parked sim_test tests with a multi-deck walk driver (#33)#47
Dibujaron merged 2 commits into
mainfrom
fix/issue-33-multideck-walk-driver

Conversation

@Dibujaron

Copy link
Copy Markdown
Owner

Closes the Gleam half of #33 (priority: high).

What

The 9 *_test_pending_v3walk integration tests in server/test/sim_test.gleam drove 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 descend x stairs → 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 composite DeckPlan, honouring the same is_walkable / edge_blocks / stairs_target (deck-change) rules the sim's character.step obeys. Returns a tile-by-tile path. Unit-tested in walk_test.gleam against 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 (the space message's plan) plus 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. 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_tile asserted 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 sparrow schema-3 test fixture + shot_m35_interior route) 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

Dibujaron and others added 2 commits July 20, 2026 21:25
…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>
@Dibujaron
Dibujaron merged commit ba6993e into main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant