| 1 | --- |
| 2 | issue: 1 |
| 3 | status: done |
| 4 | --- |
| 5 | # Score exact-five threats and open/closed lines |
| 6 | |
| 7 | This route answers issue #1 with a deterministic, standard-library Gomocup |
| 8 | brain. It starts from `routes/bot.py` at main commit |
| 9 | `38fc3717d3d9bf93bb084d1aecbc909e4ef94b90`; the referee and field are unchanged. |
| 10 | |
| 11 | ## What changed |
| 12 | |
| 13 | Score each empty point within two cells of existing stones in four directions, |
| 14 | for both colours. Contiguous open/closed twos, threes and fours get different |
| 15 | weights. Five-cell windows also recognize broken fours and count distinct |
| 16 | winning replies. Open broken threes and double threats get additional weight. |
| 17 | An immediate exact-five win takes priority, then blocking the opponent's |
| 18 | immediate win, then the combined attack/defence score. Ties are deterministic. |
| 19 | |
| 20 | The earlier `threat-weights` route at `dd0cb54` was read before claiming this |
| 21 | issue. It clamps overlines to five and uses contiguous patterns only. This |
| 22 | route keeps overlines out of its winning test and detects gaps. Its protocol |
| 23 | loop replaces BOARD snapshots, resets on RESTART, and treats flag 3 as blocked. |
| 24 | |
| 25 | ## What happened |
| 26 | |
| 27 | The unchanged starter check scored 0.5 (neighbour 0.5, random 1, threats 0). |
| 28 | The first implementation of this route scored **0.861111**, independently |
| 29 | repeated through an audit of all 36 season matches: neighbour 1, random 1, |
| 30 | threats 0.583333. This exceeds the previously recorded threat-weights score |
| 31 | 0.833333 on this fixed field; it does not establish general playing strength. |
| 32 | |
| 33 | Against threats it won 6, drew 2, and lost 4. All 36 games ended by five or a |
| 34 | full board; none ended by timeout, startup failure, or an illegal move. |
| 35 | Maximum referee-measured local reply latency was 8 ms, under the nominal |
| 36 | 1 second limit on this machine. Hosted performance remains to be checked. |
| 37 | |
| 38 | The local tactical/protocol suite passes 11 tests. The site has not posted a |
| 39 | check status for the implementation commit f3fcc86. Its compute configuration |
| 40 | reports no runner enabled to run checks (the listed runner has runs_checks=false). |
| 41 | Local measurements are reported evidence, not hosted verification or acceptance. |
| 42 | The route is done as a delivery; external review and CI remain pending. |
| 43 | |
| 44 | ## Reproduce |
| 45 | |
| 46 | From the repository root, with Python 3 (standard library only): |
| 47 | |
| 48 | ```sh |
| 49 | python3 routes/codex-line-threats/test_bot.py |
| 50 | python3 -I referee/play.py check routes/codex-line-threats |
| 51 | python3 routes/codex-line-threats/audit.py |
| 52 | ``` |
| 53 | |
| 54 | The second command is the project's required season check; it creates |
| 55 | `metrics.json` in the current directory. The audit uses the same unchanged |
| 56 | referee and openings, writes `out/games.json` and `out/season.md` in this route, |
| 57 | and records losses and per-game timing. Timings vary across runs. Local runs |
| 58 | used Python 3.13. The bot uses syntax and standard-library APIs available in |
| 59 | the project's Python 3.12 runner. |
| 60 | |
| 61 | ## Limits |
| 62 | |
| 63 | This is a one-ply heuristic, not a search engine. It can miss forced sequences |
| 64 | and still loses against the threats field bot. The season is a small fixed |
| 65 | sample, with deterministic openings and opponents. |
| 66 | |
| 67 | ## Next |
| 68 | |
| 69 | The maintainer should enable a check-capable runner and review this delivery |
| 70 | and its hosted play status. If continuing after review, |
| 71 | inspect the four losses against threats recorded in out/games.json and add a |
| 72 | bounded tactical search to address the first missed forced sequence. No long |
| 73 | computation is running. |