From c3461b001847b1677f79a3876fde63902df8726e Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Tue, 28 Apr 2026 03:20:31 +0300 Subject: [PATCH] docs(crew-movement): record review conclusion --- docs/tasks/crew-movement.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/tasks/crew-movement.md b/docs/tasks/crew-movement.md index 3124ce653c8f3687076d9de914ab5415ee9f0d44..2dd3b19e1c73eaaa597a690b10eb247bba42f818 100644 --- a/docs/tasks/crew-movement.md +++ b/docs/tasks/crew-movement.md @@ -158,3 +158,24 @@ Invariants / assumptions: - 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. + +## Conclusion + +Outcome: crew-movement milestone shipped — tile pathing, crew tick, and click-to-move integration. HEAD `1177709`. + +Invariants: +- IV1 — `grep "hajimehoshi\|inpututil" ship.go tiles.go crew.go` empty. +- IV2 — `grep "TilePx\|VirtualW\|VirtualH" ship.go tiles.go crew.go` empty; mouse converted at the boundary in `main.Update`. +- IV3 — `grep "c\.\(TileX\|TileY\|MoveT\|Path\)\s*=" render.go` empty; render reads only. +- IV4 — `TestBFSPath_deterministic` passes; fixed neighbour order `{+1,0},{-1,0},{0,+1},{0,-1}` in `tiles.go:bfsPath`. +- IV5 — no `//go:build`, no platform-suffixed files; native + WASM both build clean; browser smoke confirms `inpututil.IsMouseButtonJustPressed` and `ebiten.CursorPosition` work under WASM. + +### Unknowns outcome +- UK1 (`ebiten.WindowSize` after resize) — moot. `ebiten.CursorPosition()` already returns logical coords post-`Layout`, so the implementation never had to consult `WindowSize`. Browser smoke confirmed correct tile mapping at the default canvas size; resize behaviour was not exercised. + +### Review findings +- Important #1 — reviewer flagged exact-tile selection (`TileX == tx && TileY == ty`) as imprecise vs the plan's pixel-radius wording. Pushed back: at `CrewRadius=6` and `TilePx=16` the visible circle fits inside the tile with a 2-px gutter on every side, so clicks on the visible crew always land in the crew's tile. The plan's own parenthetical accepted "tile-space check is sufficient: same tile". No fix. + +### Future work +- If `CrewRadius` later exceeds `TilePx/2`, the exact-tile selection check needs to switch to a pixel-distance test. Justification: only matters if Design changes the crew rendering size; currently 6 < 8 by construction. +- Tile occupancy / "reserve next tile" enforcement, flagged in Design as deferred. Justification: Design § "Tile occupancy" — explicitly out of scope for this milestone.