~bigbes/game-prototype-ftl

d77efb6b6fd63e03b5d272b11c8ab888b7725dfa — Eugene Blikh 30 days ago c0489ec
docs(combat): record verify summary
1 files changed, 26 insertions(+), 0 deletions(-)

M docs/tasks/combat.md
M docs/tasks/combat.md => docs/tasks/combat.md +26 -0
@@ 204,6 204,32 @@ Per Design `TDD: yes`. PH1 + PH2 tests written first and must fail on the pre-im
- PH2                          -> IF5                  @ ship.go, ship_test.go
- PH3  IF1, IF2, IF3, IF4, IF5 -> IF6                  @ render.go, main.go

## Verify

**Result:** passed in-session; unit tests + browser smoke deferred to user (see Notes).

Invariants / assumptions:
- CK1 (IV1) — `grep 'hajimehoshi/ebiten' combat.go ship.go combat_test.go ship_test.go` → empty.
- CK2 (IV2) — `grep -E '\.(Hull|MaxHull|ShieldLayers|...)\s*[+\-*/]?='` outside `combat.go` → empty (the only hit is a `==` comparison in `main.go:42`, a read).
- CK3 (IV5) — `Result =` writes only in `combat.go:123, 125`; `main.go` reset path is whole-struct replacement via `NewCombat()`, gated on `Result != GameOngoing`.
- CK4 (IV7) — `GOOS=js GOARCH=wasm go build .` → succeeds.
- CK5 (IV8) — `HudY/HudX/HudColW/HudColCount` defined only in `hud.go:8-11`; all other refs are reads.
- CK6 (AS2) — `math/rand` ships in WASM build (covered by CK4).

Interfaces:
- CK7 (IF1) — `NewCombat()` callers: `main.go:48, 128` (init + R-restart).
- CK8 (IF2) — `updateCombat(&c, sys, dt, rng)` called from `main.go:43`; signature matches.
- CK9 (IF3) — `playerShieldMax(sys)` called from `render.go:160` (drawShieldsIndicator) + `combat.go:94` (internal).
- CK10 (IF4) — `GameOngoing/Victory/Defeat`, `HitFlashDuration`, `WeaponChargeMax` referenced read-only across `render.go` and `main.go`.
- CK11 (IF5) — `NewEnemyShip()` called from `main.go:129`.
- CK12 (IF6) — `drawShip(screen, ship, sys, hitFlashT)` 4-arg signature: 1 call site at `main.go:105`, matches definition `render.go:54`.

Build: `go build . && GOOS=js GOARCH=wasm go build . && go vet ./...` → all clean.

Notes:
- Unit tests (PH1's 17 `combat_test.go` tests + PH2's 2 `ship_test.go` tests + 32 prior tests) cannot execute in this Claude Code session: Ebitengine v2.9.9 `internal/ui` package's `init()` calls `currentMouseLocation()` which dereferences nil when no Window Server is attached (`/Users/blikh/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.9.9/internal/ui/ui_darwin.go:286`). Compile + `go vet ./...` are clean. **User: run `go test ./...` in a regular terminal to confirm green.**
- End-to-end browser smoke (auto-fire, shield regen, evasion, hit-flash, R-restart, mid-fight power re-routing) requires `make play-web` and a real browser session — also deferred to the user.

## Conclusion

### Deviations from plan