From 1177709a44a65cf00dd51d7b7b48e41852a4cf97 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Tue, 28 Apr 2026 03:17:56 +0300 Subject: [PATCH] docs(crew-movement): record verify summary --- docs/tasks/crew-movement.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/tasks/crew-movement.md b/docs/tasks/crew-movement.md index 983719aa3889f4b20c4e8e04b36c29d70cf2ace6..3124ce653c8f3687076d9de914ab5415ee9f0d44 100644 --- a/docs/tasks/crew-movement.md +++ b/docs/tasks/crew-movement.md @@ -131,3 +131,30 @@ Per task `TDD: yes` — tests from Phase 1 and Phase 2 written first, must fail - `inpututil` is a standard Ebitengine subpackage that works under WASM; no conditional imports needed. If it doesn't, Phase 3 falls back to `ebiten.IsMouseButtonPressed` + manual edge detection. - Mouse coords in the browser: `ebiten.CursorPosition()` is documented to return logical-space coords via `Layout`; this is how WASM-served Ebitengine games handle input. If verify finds the browser returns raw canvas pixels, the fix is a single `(windowW, windowH) := ebiten.WindowSize()` scale step. + +## Verify + +**Result:** passed + +Positive: +- CK1 — `go test -v ./...` → 14/14 pass (7 walkability/BFS, 7 crew tick) +- CK2 — `go build ./...` → clean native build +- CK3 — `make build-wasm` → clean WASM build, `web/main.wasm` produced +- CK4 — WASM smoke: 3 crew render at correct tiles (A in Pilot, B in Shields, C in Engines) with distinct tints +- CK5 — click on Bob → white selection ring appears around B +- CK6 — click MedBay tile (7,13) with Bob selected → Bob walks Shields → MedBay tile-by-tile, ring follows + +Negative: +- CK7 — `TestBFSPath_unreachable` covers walkable→off-ship; CK8 covers same-tile (returns nil) +- CK8 — `TestBFSPath_sameTile` returns empty +- CK9 — `TestUpdateCrew_idle` confirms empty-path tick is a no-op +- CK10 — WASM smoke: click off-ship tile (20,5) with Bob selected → no movement, selection persists + +Invariants / assumptions: +- CK11 (IV1) — `grep "hajimehoshi\|inpututil" ship.go tiles.go crew.go` → empty +- CK12 (IV2) — `grep "TilePx\|VirtualW\|VirtualH" ship.go tiles.go crew.go` → empty (no pixel constants in pure files) +- CK13 (IV3) — `grep "c\.\(TileX\|TileY\|MoveT\|Path\)\s*=" render.go` → empty (render never mutates Crew) +- CK14 (IV4) — `TestBFSPath_deterministic` passes +- CK15 (IV5) — `grep "//go:build" --include="*.go"` → empty; no platform-suffixed files; native + WASM both build clean + +Smoke: WASM at `http://localhost:8765/` — selection, BFS dispatch, multi-tile movement, and unreachable-click no-op all observed visually.