mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
test(domain): guard the ranked arena list against Godot registry drift
Task 8.20. `arena_registry.gd` is the documented single source of truth for arenas, but `domain/ranked.go` keeps a hand-maintained mirror of its floor-goal entries and nothing checked the two against each other -- ranked_test.go asserts the same three paths the production code hardcodes, so both could drift together silently. Drift is not hypothetical in either direction. The registry's own comment anticipates flipping an elevated variant to random:true once a checkpoint trained on that geometry is promoted, which ranked would then keep excluding indefinitely. A rename or removal is worse: the allocator would hand out a scene path that no longer exists, and the ranked server fails to load its arena at match start -- after allocation, so it burns a real match and a real server. Keeping the two copies is deliberate rather than a wart: ranked arena selection is server-authoritative and happens before any Godot process exists. So this guards the relationship instead of removing it, the same way the golden join-authorisation token guards the signing format. It parses the registry and fails if the sets disagree either way, if rotation order diverges from declaration order, or if a ranked path has no scene behind it. The parser asserts it found both eligible and ineligible entries, so a format change cannot make everything pass vacuously. Verified against four drift scenarios. The allocation-wiring half of 8.20 turned out to be already complete end to end, with coverage at each hop; recorded in the task row rather than rebuilt. Add a Server Unit Tests workflow, because none of this would otherwise run: the only Go tests CI executed were multiplayer-load's two load tests, so ~24k lines of control plane gated nothing. Docker-free so it can gate every push, and it vets the integration-tagged files too, since those are excluded from the default build and could otherwise rot uncompiled. CLAUDE.md's CI section claimed two workflows and no unit-test job; there were seven and now eight.
This commit is contained in:
+1
-1
@@ -215,7 +215,7 @@ are done; everything below is what's left on the tasks still open.
|
||||
| 8.17 `[D:8.14,8.16]` | Proposal policy (response window, cooldowns, offender/innocent split) | Live PostgreSQL execution and allocation integration remain |
|
||||
| 8.18 `[D:8.5,8.14,8.17]` | Store layer (serializable retries, claim SQL, atomic promotion) | Allocation runtime integration remains |
|
||||
| 8.19 `[D:8.18]` | Casual lineup (2–6 humans, bot backfill) | Queue candidate selection, opt-in 10 s backfill proposals, reconnect/leave penalties, live integration remain |
|
||||
| 8.20 `[D:8.18]` | Ranked admission (six unique verified humans) | `ArenaRegistry` integration and allocation wiring remain |
|
||||
| 8.20 `[D:8.18]` | Ranked admission (six unique verified humans) | Done. Allocation wiring was already complete end to end (allocator sets the `cosmic-clash.io/arena-path` annotation → `supervisor.withAllocatedCompatibility` maps it to `--arena-path` → `server_boot.gd` → `ServerMatchLoop.allocated_arena_path`), with coverage at each hop. `ArenaRegistry` integration is now a cross-language guard rather than a shared list: `server/domain/ranked.go` must keep its own ranked-eligible subset (the choice is server-authoritative and made before any Godot process exists), so `arena_registry_sync_test.go` parses `arena_registry.gd` and fails if the two disagree in either direction, if rotation order diverges, or if a ranked path has no scene behind it. Verified against four drift scenarios including promoting an elevated variant, which the registry's own comment anticipates. Live ranked admission against a real cluster remains ([#17](https://github.com/jcreek/CosmicClash/issues/17)) |
|
||||
| 8.21 `[D:8.5,8.20]` | Rating core (Glicko-2, weights, transactional updates) | Live maintenance/DB execution remains |
|
||||
| 8.22 `[D:8.21]` | Ranked profile (provisional games, tiers) | Persisted tier policy, client UI, reconnect transport remain |
|
||||
| 8.23 `[D:8.21]` | Ranked season policy (compression, rollover) | Live maintenance/DB execution remains |
|
||||
|
||||
Reference in New Issue
Block a user