feat: complete human-vs-ESP32 gameplay and cumulative statistics

This commit is contained in:
2026-08-29 23:33:27 +03:00
parent 650ade2726
commit c8e0c9168b
14 changed files with 269 additions and 19 deletions
+13 -2
View File
@@ -780,7 +780,7 @@ If all criteria pass, set this milestone to `DONE`, append its execution record,
## Milestone 015 — Complete human-vs-ESP32 gameplay and cumulative statistics
**Status:** `READY`
**Status:** `DONE`
**Depends on:** Milestone 014
### Objective
@@ -808,11 +808,22 @@ Integrate and prove the complete bot game, delayed multi-shot turns, rematch, an
If all criteria pass, set this milestone to `DONE`, append its execution record, and change Milestone 016 from `BLOCKED` to `READY`.
### Execution record
- Date: 2026-08-29
- Board model and revision: ESP32-C6FH4 QFN32, revision v0.2.
- Toolchain and library versions: PlatformIO Core 6.1.19; `espressif32` 7.0.1; ESP-IDF 6.0.1; `esp_littlefs` 1.20.4.
- Result: PASS for automated integration verification; pending physical-device confirmation.
- Evidence: Integrated the existing bounded bot strategy into the game lifecycle and ESP-IDF one-shot timer. Bot work is queued onto the HTTP-server work context after a 500900 ms delay, never performed in the timer callback, and is rescheduled only after a bot hit. The lifecycle resets bot knowledge for each new bot match, records bot-shot outcomes without exposing an opponent board to the strategy, and preserves cumulative counters across rematches. Added cumulative misses and sunk ships, exposed bounded match/cumulative counters through `GET /api/statistics`, and rendered Russian ESP32 labels and cumulative result statistics in the browser.
- Measurements: `make -C test/host run` passed command queue, domain, bot strategy, lifecycle, presenter, HTTP API, synchronization, human-game integration, and bot-game integration suites. The bot integration verifies both possible first players, the 500900 ms scheduled turn, non-duplicated bot progression, complete human-versus-bot finish, exact per-match/cumulative counters, rematch reset with a new game ID, and reboot-scoped reset. `node --check data/app.js`, gzip integrity checks, and compressed JavaScript syntax checks passed. Source/compressed web assets total 33,260 B. `pio run -e esp32-c6-devkitm-1 -t buildfs` and `pio run -e esp32-c6-devkitm-1` passed; firmware uses 39,492 / 327,680 B RAM (12.1%) and 1,018,174 / 2,097,152 B flash (48.6%).
- Issues or deviations: No firmware upload or real-time physical-client bot run was performed. Verify the ESP32 timer delay, reconnect during a pending bot turn, and repeated on-device games after upload. The product rule permits abort only for a disconnected human opponent; bot games retain that locked behavior.
- Next action: Milestone 016 is ready. Do not start it unless explicitly requested.
---
## Milestone 016 — Harden errors, recovery, and resource usage
**Status:** `BLOCKED`
**Status:** `READY`
**Depends on:** Milestone 015
### Objective