Spaces:
Paused
Paused
Commit History
-
docs: record in the PRD what the evidence resolved
Unverified signatureTwo risks close on measurement rather than argument: WebSockets on HF Spaces (verified through the edge proxy, and the owner's own Space already does it) and free-tier CPU for concurrent matches (measured p99 4.6-9.1ms per tick against a 50ms budget). Three replace them, all platform-level, all confirmed. Q2 is answered — start on free CPU Basic. Q1 hardens from a preference into a blocker: a private Space returns 404 for the running app, so nobody can play until it is public. Adds an evidence-base index so each claim points at the dossier behind it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzkfXsTz4hxPfuySb1GvySd19cbc4 -
docs: platform and protocol findings reshape the plan
Unverified signatureThree more dossiers land — client coupling, HF Spaces, MCP — and each moves the plan rather than confirming it. Platform (dossier 04): a private Space returns 404 for the running app, so making it public is a confirmed hard blocker, not a preference. The account is not PRO and HF now gates Docker Spaces behind a paid plan to create; whether a free account can still rebuild an existing one is unverified, so T-007a tests that first. Classic persistent storage no longer exists. And a Space rebuilds on every git push — so deploying destroys in-flight matches, which makes match snapshotting architectural rather than hardening (ADR-0012, moved into Phase 3). Client (dossier 03): the renderers already fog-gate every entity through one named predicate and read team colour per owner, so a filtered state projection needs no renderer changes — the client was written as if it already received one. ADR-0009 takes per-seat projection with a staged migration, and drops both the map and the fog grid…718b0cb -
docs: delivery plan, engine/command dossiers, and the ADRs they ground
Unverified signatureAdds TASKS.md — 65 tasks across 8 phases, each traced to a PRD requirement and an ADR, with exit criteria stated as tests. Two analysis dossiers land and change the plan materially: - The engine is far closer to N-player than a literal count suggests. Combat, movement, gather, supply and fog are already owner-generic, and victory is already last-side-standing with a passing three-owner test. Of 53 owner literals, 35 live in Odyssey layers a skirmish never loads. The larger surface is the ~80 literals in the client. - Five engine defects block multiplayer. The worst is a module-global entity-id counter that makes two concurrent matches in one process non-replayable, silently. Three further hardcoded owner literals would ship a rigged game: seat B would lose squad formations, lose worker auto-repair, and be the only seat that kites. New records: ADR-0006 (wrap the command surface rather than rewrite it), ADR-0008 (two seats first, N seats second — the two-seat path ne…ef7537c -
docs: PRD, ADR log and feasibility spikes for the multiplayer port
Unverified signatureEstablishes the planning substrate for porting Stellar Frontier: RTS to SpaceCities — a multiplayer RTS with an MCP interface for agent players. - docs/PRD.md: goals, non-goals, users, functional/non-functional requirements, risks and success criteria. - docs/adr/: the decision log, with the first five records accepted — the log itself, importing upstream with history, server authority over peer lockstep, routing single-player through the multiplayer path, and a zero-dependency WebSocket transport. - docs/analysis/00-feasibility-spikes.md: executable evidence for the two decisions that could have invalidated the plan. A ~90-line RFC 6455 server round-trips against real Chromium, and the headless sim costs p99 22ms/tick with 800 units in contact against a 50ms budget. The branch is based on upstream 50ceb88 with all 542 commits of history, so blame reaches through to the original authorship and `upstream/main..HEAD` stays a precise record of what this port changed. Co-A…1c18fd4
-
Odyssey: bound the living galaxy to 3 seed-drawn background worlds
Claude +1: Claude Opus 5Unverified signaturecreateGalaxy instantiated and simulated all 11 worlds from turn one. It now brings up the start seat plus a pseudo-random draw of BACKGROUND_WORLDS (3) others — backgroundWorldIds, keyed on the galaxy seed and the start world from its own distinctly-seeded stream, returned in fixed roster order so the background scheduler and every galaxy-wide scan read exactly as before. Which neighbours are alive is now part of what a seed means; same seed still replays the same galaxy. The rest of the roster stays DORMANT: still on the starmap, still jumpable, still a full skirmish map — built in on arrival (jumpCapital already did this for a never-visited destination) and simulating from then on like any world you leave behind. addPlanet now honours a standing claim when it builds a world in, so a dormant world the faction-spread sweep claimed flies those colours when the player finally lands on it. Three paths assumed every world's state existed, and are fixed here: - initiateJump treated a mis…b88cc9c
-
Document the main-branch gate, and fix the docs my own changes falsified
Claude +1: Claude Opus 4.8Unverified signatureThe three items left open after the review merge. BRANCH PROTECTION. I cannot set it: there is no MCP tool for the branch protection API and a direct call returns 403, so this is a repository setting only a human with admin can apply. What I can do is remove the guesswork, so CONTRIBUTING.md now carries the exact steps — target `main`, require status checks, and the two check names verbatim (`tests (node 20)` and `tests (node 22)`, both, because the matrix produces one per Node version and requiring only one lets a version-specific regression through), plus require-up-to-date and block-force-pushes. It also notes the coupling nobody would otherwise notice: those names come from the workflow's job `name:` line, so editing that silently unhooks the gate. DOCS THAT CONTRADICT THE CODE. Fixed the ones this branch's own work falsified, rather than pruning anyone's design work: - README's module map predated inputCommands.js and described input.js as one thing. It also called tools/ "a …2b4cf02 -
Correct finding 3's impact claim — measured, it is narrower than I wrote
Claude +1: Claude Opus 4.8Unverified signatureI claimed the adaptive AI layer was "effectively inert" and that adaptDefenceMult returned 1.0. That is wrong as a general statement, and I only found out by going back and measuring the fix's effect on real gameplay instead of trusting the maths. Running a full 4-minute skirmish against the old code and the new one gives IDENTICAL results: same peak confidence (0.60), same adaptMode swing (0.50 -> 0.34), same defence multiplier (0.808). While the AI keeps eyes on the enemy, the live sighting refreshes the belief every cycle and the compounding decay never gets a chance to bite. That is also why the game seemed fine and why nobody noticed. The bug bites in exactly one situation: after vision is LOST. Scouting an 8-Lancer army (1200 ore) and then killing the scout, the AI remembers 304 ore at 30s, 4 at 60s and 0 at 120s under the old code, against 1050 / 900 / 600 under the fix — and its confidence falls under the 0.25 threshold that gates acting on intel somewhere between 30 and 60 s…de82848 -
Cut 1.1.0, un-deprecate the CI actions, and run the browser smoke test
Claude +1: Claude Opus 4.8Unverified signatureFinding 9 of docs/code-review-2026-08.md, and the release checklist step that had never gated any of this work. CONTRIBUTING's release checklist is thorough and was going unused: the app sat at 1.0.0 while [Unreleased] accumulated Observer Mode, patrol orders, the counter-triangle work, doctrine research timing, Odyssey world selection, the endgame clock, a fourth archetype, competitions with Elo, genome evolution and an in-app AI editor. Bumped version.js, package.json and version.json in lockstep (release-manifest.test.js gates that), and dated the changelog section. Save formats are deliberately NOT bumped — nothing changed shape this cycle, so 1.0.0 saves load as-is, and version.json now says so. Deliberately NOT done: `git tag v1.1.0` and any deploy. Those are outward-facing and yours to make; everything they need is prepared. actions/checkout and actions/setup-node bumped v4 -> v5. Both were being force-run on Node 24 with a deprecation warning on every job. Ran the browser s…dd41939 -
Close the guard gaps behind the last three bugs; withdraw one review finding
Claude +1: Claude Opus 4.8Unverified signatureFindings 4, 5 and 8 of docs/code-review-2026-08.md, plus a correction to 7. #8 tools/ ships to the browser but was outside the purity guard. boot.js imports tools/selfplay.js; competition.js, competitionWorker.js and playerFingerprint.js import tools/duelCore.js and tools/genome.js. So three "Node bench" files run in a browser Worker and decide the outcomes that become persisted Elo ratings, while the purity scan only ever walked engine/ and what engine/ imports — structurally identical code guarded on one side of a directory line and unguarded on the other. The review said moving the files was "simplest and better". Measuring first showed otherwise: 30+ prose references across engine/, README and docs would have had to move with them, for no safety gain. Extended the scan instead, and DERIVED the extra roots by walking out from index.html (plus the Worker entry, whose `new Worker(new URL(...))` edge no import walk can see) so a fourth file pulled into the app tomorrow is covered the…021c865
-
Get CI green, and make the AI's opponent belief fade the way it says it does
Claude +1: Claude Opus 4.8Unverified signatureActs on the first three findings of docs/code-review-2026-08.md. CI has been red since 2026-08-05 and two PRs merged through it. Two causes, both fixed here: - competitionLedger.js had two wrong JSDoc signatures. addRosterEntry never declared the `genome` field its body reads and writes (the RosterEntry typedef omitted it too), and recordCompetition typed its match rows as bare `object`, so every row.aName / row.winner / row.margin read in the file was an error the moment a checker looked. Adds a real CompetitionResultRow typedef and narrows the one ternary TypeScript was widening to `string`. - CI installed TypeScript unpinned via `npx --package typescript`, so the same tree reported 2 errors under 5.7 and 21 under 7.0.2 — a green commit could go red overnight with no code change. The invocation is pinned to 5.7.2; the compiler still stays out of package.json, it is just no longer a moving target. Verified clean on both 5.7.2 and latest. The third is a real behavi…15f3a03 -
Add an external code review: CI is red, and the adaptive AI forgets too fast
Claude +1: Claude Opus 4.8Unverified signatureA full architecture + TDD review of the tree at 56d13d7, written up in docs/code-review-2026-08.md. Three findings are load-bearing: - `npm run typecheck` exits 1 and has since 2026-08-05; PRs #90 and #91 both merged to main through a red build. Two bad JSDoc signatures in competitionLedger.js (a missing `genome` field, and `rows: object[]`). - CI installs TypeScript unpinned via `npx --package typescript`, so the same source reports 2 errors under 5.7 and 21 under 7.0.2. The gate is not reproducible. - engine/aiIntel.js writes its faded belief back each think cycle and re-fades it from the same timestamp, so the documented linear 240s fade is really a compounding decay that reaches zero in ~60s at the real 1.5s cadence. The adaptive AI is effectively inert once it loses sight of the enemy. Measured against the real module; the report carries a red test that reproduces it. The report also covers why the existing tests could not catch the last one (they step time once …4b8ad05 -
The cast's labels do not survive held-out maps -- say so
Claude +1: Claude Opus 5Unverified signatureVerified four cells on replicates the archive never trained on. Three moved bin. The harness was checked before the result was believed: re-run on the archive's own replicates it reproduces the filed descriptor exactly, so it is faithful and the descriptor is not stable. Root cause is that the residual variance is ACROSS WORLDS rather than within one. One genome held fixed measures army 3/3 on korrath, 58/143 on ferros and 47/208 on vesper; a pooled median over that is a description of the roster, not of the genome. Both fixes that landed earlier were necessary and neither was sufficient -- the median really did fix the heavy-tail pathology it was aimed at, and the pinned runSeed key really did make re-measurement possible at all, but neither touches cross-world spread. Coverage fell 15/16 to 10/16, and that part IS the fix working: the first run's 94% was inflated by a descriptor scattering genomes into bins at random. The genomes and their strength numbers stand -- 16 real matches…cc7170f -
Record the adaptive-opponent work in the ledger and changelog
Claude +1: Claude Opus 5Unverified signatureThree ledger rows: the design and what it fixes, what `check` did and did NOT tell us, and the player-facing half. The middle row matters most. check came back byte-identical to the pre-change baseline -- mean 0.714, the same two hoarding rows, the same five dev-flatline rows -- and that is a weaker result than it looks, because check runs against the `passive` sparring bot whose base is too small to push confidence past the dead band. So the row records the separate probe that proves the code is live rather than dead: a 20-minute ferros/Hard run printing adaptMode every five minutes, 0.500 -> 0.740 against the tech bot's real army by 5 min, relaxing to 0.560 as the picture changes, against 0.500 -> 0.380 versus passive. An identical guardrail number is only reassuring once you have shown the guardrail exercises the change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KL6GbjkxUNWs3frZUYANK200bdb7 -
Phase 6: play against yourself -- fingerprint a human into a genome
Claude +1: Claude Opus 5Unverified signatureThe search was never the point of the genome. The point was that a genome is a thing a PLAYER can own: edit one into existence, or have their own play captured into an AI and then face it. playerFingerprint.js is that second half. It measures a finished match from GROUND TRUTH, deliberately not fog-limited. engine/aiIntel.js reads an opponent through fog because an AI acting on what it has not scouted is cheating; this is analysis of a game that already happened, the same way a replay is. Confusing the two would either cripple the fit or smuggle omniscience into the opponent. Every dial is fitted as a RATIO against the archetype's own baseline, never an absolute, because that is how the engine composes its layers: a player who ran 18 workers is not workerTargetMult 18, they are "1.5x what this temperament would have run", and only the ratio transfers to another world. Every value clamps to its own gene's schema bounds, so an extreme game yields a legal, runnable AI rather than a brok…21a54e4 -
Phase 4: the adaptation POLICY is evolvable, not just its constants
Claude +1: Claude Opus 5Unverified signatureFive genes in a linkage group of their own -- punishPosture and punishConfidence (when to call an opponent greedy, and how much evidence to demand before acting), adaptRateMult and adaptBandMult (how twitchy or stubborn the stance is), defenceSwingMult (how far the stance swings investment). They are one module because they interact strongly with each other and weakly with everything else, which is precisely the condition module-wise crossover exists for: a low evidence bar paired with a twitchy rate is a completely different opponent from either alone, and a child should inherit that pairing intact rather than half of it. Every one is read through a `?? default` at its use site, so an absent value is exactly the shipped behaviour and the search needs no engine change to explore them -- the same property that made a candidate AI JSON in the first place. This is the difference between breeding a fixed BUILD and breeding a reactive POLICY, and it is what lets MAP-Elites eventually spre…4f42c67 -
Phase 1: the AI gets a belief about its opponent
Claude +1: Claude Opus 5Unverified signatureengine/aiIntel.js. Every other reactive read in the AI answers a question about right now -- are there enemies at my base, how many can I see, what do they field most -- and none of them survives losing sight of the enemy, because entity sighting goes through the LIVE fog layer. Kill the scout and the AI's picture of its opponent is empty, and it has no way to know it. This is the other kind of knowledge: what sort of game the opponent is playing. It persists between sightings and decays when unrefreshed. It is the first piece of AI state that can be WRONG -- everything else is a fact about the current frame -- and that is the point. An opponent model you can deceive is what makes scouting worth its cost and killing the scout a real counter-play. Three numbers, and they are three for a reason: mil / eco ore-value of what has been SEEN, split by whether it shoots posture mil / (mil + eco): 0 is a pure economy game, 1 is a pure war game confidence how much has been see…2991d58 -
Record the check guardrail result in the ledger row
Claude +1: Claude Opus 5Unverified signatureNot assumed from 'engine/ is untouched' -- run and reported. Mean 0.714 over 44 runs; supply-deadlock, hostile-but-idle and production-stall clean; hoarding 2/44 at exactly the korrath/matching + oort/matching residual the 2026-08-01 row already records; dev-flatline 5/44. The named-defect list did not grow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KL6GbjkxUNWs3frZUYANK1a8a51b -
Record what the first evolutionary run measured -- including that it fails
Claude +1: Claude Opus 5Unverified signatureSearch-ledger rows and the design doc's results section. Three findings, and the second one is why the champion is not being promoted. IT GENERALISES. Five-way round-robin on four HELD-OUT worlds at the full 40-minute clock, 320 matches: evolved 50W-14L (78%) at Medium against Economic's 36-28, and 40W-24L (63%) at Hard against Aggressive's 38-26. Medium is ~4.5 sigma over even and unambiguous; Hard is a statistical tie for first. So the loop is not producing noise and it is not overfitting the three worlds it trained on. IT IS ALSO GOODHART'S LAW IN A CAN. Split those same matches by winReason and at Hard every one of its 40 wins is timeout-score and none is an elimination, while 16 of its 24 losses ARE eliminations. It does not play better -- victory.js pays 1.35x for combat units and 0.25x for banked ore, so an army that never fights and so never takes attrition is the most valuable thing you can own when the clock runs out. Duel Elo was chosen over score() because "a win cannot b…6f03f6f
-
Evolve the AI: a genome, mutation, crossover, and a selection loop
Claude +1: Claude Opus 5Unverified signaturePhase 1 of docs/ai-evolution-design.md. Nothing under engine/ changes -- the whole point is that a candidate AI was already JSON, so the genotype lives in tools/ and the shipped simulation never learns any of this exists. tools/genome.js is the schema and the operators. GENOME_SCHEMA is one source of truth for what a legal gene is -- 28 genes over two chromosomes and six linkage groups -- and the operators are per gene KIND rather than one operator for everything, which is the decision that matters most here: ratios mutate multiplicatively (an additive step means something different at 0.2 than at 1.5, and 0 would be absorbing), headcounts additively so 0 stays reachable because 0 is a real allele, flags rarely because they are epistatic switches that decide whether other genes mean anything at all, and unitMix through sequence operators because it is a cyclic production cycle where order and multiplicity both carry meaning. Crossover cuts at MODULE boundaries, not per gene: the linka…9f53528 -
Design brainstorm: how the AI could evolve by mutation and crossover
Claude +1: Claude Opus 5Unverified signatureA candidate AI is already JSON -- applyOverrides writes rows into STRATEGIES / ARCHETYPES / DIFFICULTY_OPTIONS, and every field is read through a `|| 1`-style default, so an arbitrary mutation is always a runnable AI rather than a crash. That tolerant genotype->phenotype map is the expensive half of an evolutionary setup and this codebase already has it by accident of its own conventions. What is missing is a gene schema, variation operators, and a generation loop. The document works through: which of the three tables should evolve (strategy yes, archetype carefully, difficulty never -- it is the duel fairness pin); the gene inventory as it stands and three genes worth adding so evolution can reach build order rather than only tempo; why the five gene KINDS need five different operators (log-normal steps for ratios, rare flips for the epistatic flags, order crossover for the unitMix sequence); why crossover should cut at module boundaries, with the Aggressive-borrows-Economic's-worker…a4e6e2e -
Phase 5 fix: the ⌂ Home confirm was the third, un-closed door to Save
Claude +1: Claude Opus 4.8Unverified signaturePhase 5 closed the save path for a WATCHED / REPLAYED AI-vs-AI match in two places — hud.js hides the topbar Save/Load buttons, and saveShape.js's resumableMode refuses to checkpoint one — but the ⌂ Home button is visible in EVERY mode and its confirm dialog knew nothing about game.spectateMatch. During a spectated match `scenario` is false and liveCompetitionFixture() is null, so the dialog fell through to the ordinary skirmish copy: "Your progress autosaves — Save & Exit checkpoints it now so you can Continue later", with **Save & Exit** as the default-focused primary button. Every word of that was false, and clicking it was worse than the copy. autoSave() returns false (resumableMode refuses a spectated match, so snapshot() is null), so it fell through to saveToFile(), which: • downloaded stellar-frontier-skirmish-seed<N>-<stamp>.json of the AI-vs-AI exhibition — a plain skirmish save that loads back handing the human FULL COMMAND of one entrant's army, the exact outcome…22ad0a6 -
Phase 5 (replay + season): re-run any recorded match, and close a ladder
Claude +1: Claude Opus 4.8Unverified signaturedocs/competitions-and-elo.md Phase 5's remaining two bullets, which completes the plan — all six phases (0-5) have now landed, noted in a new closing section. REPLAY IS A RE-RUN, NOT A RECORDING. A stored history row already carries its world, its exact seed, its swapAsym half, its pinned difficulty and both entrants' strategies; the roster carries each entrant's archetype. That is the complete input to createSelfPlayState, so buildReplayConfig(row, ledger) rebuilds the match and startSpectatedMatch runs it through the spectator the previous stage built — same speed control, same Observer Mode, nothing captured, nothing stored. What gets rebuilt is the SEATING, not the labelling: a row is always reported A-relative but was played in one of the worker's two directions, so buildReplayConfig un-does flipRow's relabelling and restates the recorded outcome seat-relative, which is what lets spectatedMatchOutcome be compared to it directly. DETERMINISM HELD — BUT ONLY AFTER A REAL BUG, AND …090c049 -
Phase 5 (spectate): watch an AI-vs-AI match live, at 1x-8x
Claude +1: Claude Opus 4.8Unverified signaturedocs/competitions-and-elo.md Phase 5, the spectate half. Replay-from-the-ledger and Season stay open. Observer Mode was one `if` away from supporting this, and that is all it took: enterObserverMode's `if (!game.galaxy) return` became `if (!game.galaxy && !game.spectateMatch) return`, with spectateId falling back to the state's own planetId. The camera path, input.js's seven delegation points, observedState()'s existing game.state fallback and boot.js's render swap were already general and are untouched — the Odyssey observer tests are the safety net that the galaxy path did not move. Where Observer Mode is OFFERED stays exactly two places: an Odyssey, and a match the human is not playing. An ordinary skirmish is still refused; revealing its fog would just be a cheat. A WATCHED MATCH IS EXHIBITION ONLY, deliberately. Every rated result in this system is a pairing — side-swapped, multi-seed, replicate-parity swapAsym — because a single unswapped match is confounded by the seat edge se…450f6c1 -
Phase 4 follow-up: the Standings screen names the human, and states D4's seat note
Claude +1: Claude Opus 4.8Unverified signatureThe Standings table is the ONE place a human rating is read against the AI ratings it is being compared with — and it was the one place D4's two requirements were not met. The human rendered as an ordinary row: no marker saying which entrant is the person, and no seat disclosure beside the number the disclosure exists to qualify. The gap was not theoretical: the Gauntlet completion view's own "View Standings" button routes the player straight there and even preselects their bracket, so the screen that says "you finished first, 1239" was the screen that said nothing about the seat that rating was earned in. The cause was a dropped field, not a missing screen. A RosterEntry already carries `human`, but standingsFor never put it on the standing it derived, so shapeStandingsTable's rows were exactly {name, rating, games, record, avgMargin, provisional} and the renderer had no way to know a human was in the table at all. - competitionLedger.js: standingsFor carries `entrant.human` through…a40dbd8 -
Phase 4 (part 2): the playable Gauntlet — play a real match, rate it, resume it
Claude +1: Claude Opus 4.8Unverified signatureThe human-inclusive half of docs/competitions-and-elo.md Phase 4, on top of part 1's persisted ledger support: a fifth Competition tab where you play ONE live match against each AI entrant in a field, in order, and every result lands on the same bracketed ladder the AI entrants are rated on. One live match per opponent is the format's defining decision, not an economy measure: an AI-vs-AI pairing is worlds x seeds x 2 sides of simulated matches (seconds of compute), but a person cannot play 40 real matches. That is why Gauntlet is the human-inclusive format that ships first, and why the config screen prices a run in HOURS OF REAL PLAY before Start is clickable ("4 live matches — one per opponent — up to about 1 h 20 min"), defaulting to Quick (20 min), since the same field at Standard is over three hours. - boot.js startCompetitionMatch(fixture): a near-copy of startGame, deliberately — same resolveSeed/difficultyDials/createGameState/bootState chain, same loop, same HUD. A gaunt…1ff6f70
-
Phase 3 (part 2): the in-game Tournament tab — round-robin, Swiss and knockout
Claude +1: Claude Opus 5Unverified signaturedocs/competitions-and-elo.md's Phase 3 wants real tournaments in the game: a format picker, a field builder, a budget estimate before you commit, round-by-round progress, live standings and a bracket view, with every pairing folding into the ladder. Part 1 landed pairing.js (the shared schedules); this stage wires all three formats into the Worker and the competition screen. Quick Duel, the roster and the standings screen are untouched in behaviour. - competitionWorker.js gains a SECOND job kind: `{ kind: "tournament", format, field, difficulty, worlds, seeds, seedBase, rounds? }` -> runTournamentJob(job, onProgress). A job with no `kind` is still the original single duel, dispatched to runCompetitionJob completely unchanged. The tournament's injected `runPair` is a thin wrapper around runCompetitionJob ITSELF, so a tournament pairing is byte-for-byte the same work a Quick Duel already does — side-swapped both directions, replicate-parity swapAsym, one pinned difficulty for …204faa9 -
Phase 2 (part 2): roster + persistent ladder wired into Quick Duel, archetype threaded end-to-end
Claude +1: Claude Sonnet 5Unverified signatureTurns Phase 1's one-off Quick Duel into the persistent competition mode docs/competitions-and-elo.md Phase 2 describes: Quick Duel / Roster / Standings, one coherent mode behind a small tab row, all three reading and writing the SAME competitionLedger.js ledger. THE KEY UX CHANGE: ad-hoc, free-typed entrants are retired. Each Quick Duel entrant is now either picked "From Roster" (a <select> of competitionLedger's current roster) or drafted "New Entrant" (name + strategy + archetype + faction) -- a new draft joins the roster, via addRosterEntry, the instant startDuel() actually commits to running (after buildJob's own validation passes, before the Worker spins up), never on a keystroke, so an abandoned draft never pollutes the roster. A finished duel's rows are folded into the ledger for the pinned difficulty bracket via recordCompetition alone -- no second, hand-rolled elo.js applySeries call in competition.js. The results view's old "Elo isn't saved" line is gone, replaced by "Elo up…628afc1 -
Phase 1: the in-game Quick Duel screen (competition.js, competitionWorker.js)
Claude +1: Claude Sonnet 5Unverified signaturedocs/competitions-and-elo.md's Phase 1 finishes here: the previous stage on this branch landed elo.js and tools/duelCore.js (the fairness-critical match primitive extracted out of tools/ailab.js); this stage builds the actual screen that uses them. - competitionWorker.js (new, root, module Worker): imports ONLY tools/duelCore.js (pinnedDuelDials/duelSeed/runDuelMatch) -- never tools/ailab.js, whose ~1600 lines of CLI/printing/search/leaderboard code have no business in a browser bundle. Since ailab.js's own runDuel/runSwappedDuel/flipDuelResult aren't reachable from here (and flipDuelResult isn't even exported), the side-swapped world x seed loop is a small, fresh re-implementation of runSwappedDuel's own SHAPE, built only from duelCore's primitives: one shared `dials` object for both sides (the fairness point), swapAsym by replicate parity, both directions per (world, rep) so neither entrant is stuck in one seat, each match posted as `{type:"progress", completed, tota…d2a6f14 -
Phase 0: split tools/selfplay.js into a browser-safe core + tools/selfplay-cli.js
Claude +1: Claude Sonnet 5Unverified signaturedocs/competitions-and-elo.md's Phase 0: tools/selfplay.js ended with a module-scope `process.argv[1]` guard, which throws ReferenceError the moment the file is imported anywhere without a `process` global (a browser main thread, or a Worker) — the blocker every later phase in that doc depends on being gone. - tools/selfplay.js now keeps ONLY the pure core: createSelfPlayState, tickSelfPlay, runSelfPlayMatch, fingerprint, and the DT constant they share. Zero `process`/`document` references anywhere in the file, not even in a comment. Function bodies are byte-for-byte unchanged from before the split. - tools/selfplay-cli.js is the new Node CLI entry point (parseArgs, runCmd, USAGE, main, and the process.argv[1]-guarded invocation line), importing the four core functions from "./selfplay.js". `node tools/selfplay-cli.js run ...` behaves identically to the old `node tools/selfplay.js run ...` — same flags, same output. - tools/ailab.js's import of createSelfPlayState/runSe…022fcd2 -
Design: in-game competitions with an Elo ranking
Claude +1: Claude Opus 5Unverified signatureThe competition machinery is a developer tool today -- tools/ailab.js and tools/selfplay.js, driven from a Node CLI by whoever is tuning the AI. The request is to make it a game feature: the player organises a competition, between AI entrants alone or with themselves in the field, with a ranking that accumulates. Most of it already exists. The match primitive (both seats driven by the real runAI, resolved by engine/victory.js unmodified), the fairness machinery (pinned APM/micro, side-swap, swapAsym parity, never-blended difficulty brackets, sorted-pair seeds), and the scheduling (round-robin, Swiss with backtracking matching and proper byes) all ship in tools/ already, each shaped by a bug an independent review actually found. Three things do not exist: any rating system, any browser entry point (tools/selfplay.js:197 dereferences process.argv at module scope, so importing it in a browser throws), and any human seat. Measured what decides the shape of it, rather than guessing: a mat…34e3780 -
Bench: detectors must prove the state never resolved
Claude +1: Claude Opus 5Unverified signature§2.11 shipped with one guardrail row going the wrong way (supply-deadlock 1/44 -> 6/44) and deliberately left the detector alone, on the grounds that sharpening a metric you are being judged on is not the judged party's call. Taken up separately, the answer was bigger than that row. The pattern was in the detectors' own history. Sorted by the SHAPE of the predicate: the two written as a pure instantaneous fraction (supply-deadlock, production-stall) are exactly the two that have ever needed rescuing, while the three carrying a growth / non-resolution term (dev-flatline, hoarding, and hostile-but-idle since its entitlement gate) survived two separate scale-ups of the AI untouched. A busy AI is momentarily blocked, momentarily idle and momentarily rich all the time; only a stuck one is still in that state with nothing having moved. - supply-deadlock += supplyCapGrowthTail <= 0 (the ceiling never rose) - production-stall += armyGrowthTail <= 0 (the army never grew) - bot…f038c75
-
Record the guardrail result, including the row that got worse
Claude +1: Claude Opus 5Unverified signature`ailab check` (44 runs, 60 sim-min) after the worker-economy change: dev-flatline 10/44 -> 5/44, hostile-but-idle 4/44 -> 0/44, hoarding and production-stall flat, and supply-deadlock 1/44 -> 6/44. Documented rather than smoothed over. A 60-minute probe of one firing row (ferros/aggressive) against both engines says what the growth is measuring: 1 Command Center / 20 buildings / 105 supply before, 4 / 169 / 1,248 after, supply climbing 280->579->807->1,048->1,248 across the run. The neighbour is living at its ceiling while growing, not stuck -- but the detector samples an instant and has no notion of resolution, even though its own `why` string claims it measures "the state that never resolves itself". Also records a fix that was built and then rejected on measurement: a fourth ore holdback (ctx.supplyReserve -- a Habitat's ore held back from unit production while blocked with none on the way), which came back byte-identical on all five detectors. It cannot bind in real play, because…22d8abf -
AI: give the Odyssey economy something to bootstrap from
Claude +1: Claude Opus 5Unverified signatureRan the four shipped strategies against EACH OTHER (`ailab duel --candidates`, 6 worlds x 2 seeds x both owner slots, Medium and Hard) instead of against a scripted sparring bot. Economic won both brackets outright -- 71% at Medium, 68% at Hard -- and Aggressive came LAST at Medium on 25W-47L. The solo sweep says the same thing from the other side: on ferros, the same Economist archetype reaches development 3 under `default` and 27 under `economic`. One cause, visible twice. aiEconomy.js sizes the Odyssey worker target as `archetype x strategy x difficulty + industryCount * 2`, and the only term that grows during a session is a reward for industry the AI has to already be rich enough to have built. On a strategy that also spends freely on units -- default and aggressive, which galaxy.js hands to roughly half the galaxy -- unit production takes every ore first, industry is never funded, the target never grows, and the loop never starts. Confirmed by a single-dial diagnostic rather than…bc8dc44 -
Tier 3: record the outcomes in the plan document
Claude +1: Claude Opus 5Unverified signatureMarks all seven refactors delivered, with the answer each design question actually got — including the two that changed what was built (the AI seam is "export in place", not a new leaf module; the declarative save schema was rejected on inspection and replaced by the guard it was for) and the four findings the work turned up that were not in the plan. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZ2MLqDX3grEPTJpwivWZX2a72b3c -
Tier 2f: name the rebuild signature, and record Tier 2 as delivered
Claude +1: Claude Opus 5Unverified signatureThe 141-line signature expression was inline in renderSelectionPanel, with 11 anonymous IIFEs each re-deriving a selection lookup that rebuildSelectionPanel derives again a thousand lines later. It is the panel's entire reactivity model — a panel whose own state contributes no term silently never redraws, which is what left the Freight Lane and Colony Policy controls inert — so it is worth being able to read as a unit. Extracted to a named panelSignature(), which is also the seam the Tier-3 registry moves into: genuine per-panel co-location (each panel declaring its own signature beside its own render) needs the decomposition itself, and this makes that a move rather than a rewrite. Doc updated with Tier 2's outcome, including the three things that changed the plan rather than following it: the perf item that measured as a loss and was reverted with its numbers recorded, the self-play ordering fixed in the comment rather than the code (the sanctioned option, with the bound pinned by a…8d248b1 -
Record Tier 1 as delivered in the improvement plan
Claude +1: Claude Opus 5Unverified signatureAll 42 Tier-1 items shipped: 1,897 -> 1,964 tests, 0 failures throughout, typecheck clean, // @ts-check coverage 10 -> 20 files. Notes what the work itself surfaced beyond the written findings (the NET tests correctly rejecting an over-eager first cut, galaxySnapshot's own key-order claim being false, and three further typedef drifts that only appeared once persist.js was annotated), and records the two deliberate deferrals with their measurements: strictNullChecks costs 198 errors today, and C6's silhouette test needs the art decision that sits in Tier 2. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZ2MLqDX3grEPTJpwivWZX6422576 -
Tier 1, step 5: close the coverage gaps and the doc drift (C6-C16, E1, E2)
Claude +1: Claude Opus 5Unverified signatureThe mutation-proven gaps first. Each of these was verified by re-introducing the exact defect and confirming the new test goes red. C8 — drawBuildingBars and drawBuildGhost were covered only by assert.doesNotThrow, so replacing either body with `return;` survived the full suite: every health bar, build-progress bar, output gauge and paused/stalled badge in the game could vanish with CI green on both Node versions. The recording ctx this file already had is now used to assert real output, that a damaged building gets a bar, and that a paused producer is drawn differently from a running one. (Not "draws more" — a running-but-throttled factory draws the busier badge of the two.) C9 — dropping aiColonyTarget, aiLastThreatAt, or the entire playerAi block from persist.js also survived. Re-checked by mutation: both single-field drops now fail. The failure mode is "the AI behaves differently after reload", the hardest class of bug to report. C14 — commit ac44339's ore-surplus army-cap featu…cce54f5 -
Add a tiered, TDD-first code-improvement plan from a full-codebase review
Claude +1: Claude Opus 5Unverified signatureEight parallel reviews — engine core, AI + ailab, economy/logistics, persistence/galaxy, UI/HUD, render, the test suite itself, and the cross-cutting seams (types, import graph, duplication, tooling) — judged the code rather than the game design. Findings were executed, not inferred: real games run, source mutated in scratch clones against the full suite, canvas save-depth instrumented, tsc probed against engine/types.js, and the import graph built from actual import statements across 181 files. The result is docs/code-improvement-tiers.md: 69 findings ranked into 42 Tier-1 items (ship now — a named red-first test and S/M effort each), 20 Tier-2 (structural, several move replays), and 7 Tier-3 (deep refactors, each gated on a design question stated up front). Four patterns recur across domains that never talked to each other, and they matter more than any single finding: - Six load-bearing "why" comments assert invariants the code no longer holds — radiusOf's claimed equality, sep…af3ad6f
-
Fix two real bugs in Tier 5 Swiss tournament found by belated review
Claude +1: Claude Sonnet 5Unverified signatureA scripting accident crashed the original orchestration before Tier 5 got the same independent verify+review every other tier received, so it shipped self-graded. Dispatching two independent agents after the fact (a verifier and an adversarial reviewer) found two real problems the self-grading missed, plus one instance of an already-known bug class: 1. HIGH: a bye credited worlds.length x seeds x 2 (a maximum-margin sweep) as pure wins with zero losses -- reproduced live tying a candidate that structurally cannot fight with a genuine winner, and confirmed that credit exceeded the best real margin observed across the project's own strategy roster. Fixed: a bye now adds only to its own `byes` counter, never wins/losses. 2. MEDIUM: pairRound's own comment and CLI text claimed a repeat pairing only happens when every opponent has already been played. False -- fuzz-tested against a brute-force checker, the old greedy-no-backtracking walk produced an avoidable repea…e9ad1d0 -
Add a fair head-to-head tournament system on top of self-play
Claude +1: Claude Sonnet 5Unverified signatureTiers 2-5 of the AI championship roadmap, all in tools/ailab.js: - duel: candidate A vs candidate B, both driven by the real AI via Tier 1 self-play, resolved by engine/victory.js's own skirmish rule. Fairness is structural: pinnedDuelDials() reads difficulty once into one object both sides' configs spread from, so APM/micro/difficulty cannot diverge. - Side-swap (default) and never-blended difficulty brackets (runSwappedDuel/runDuelBrackets/runRoundRobinSwapped), closing the gap a single fixed-side, single-difficulty measurement can't rule out. - search --tournament-against: the existing dial-search scored by duel standing against a fixed baseline instead of solo score(). - swiss: Swiss-style pairing (closest-standing pairs, rotated byes) for candidate pools too large for round-robin. Independent adversarial review caught a real bug: duel always seated candidate A as "player" and B as "ai", so on a world with a map-baked asym block (oort, nimbus) the fixed side decided…07e72eb -
Add ailab leaderboard: Tier 0 of the AI championship roadmap
ClaudeUnverified signatureRanks N candidate strategies against the same fixed sparring bot, with difficulty/opponent/worlds/seeds held identical across every candidate so none gets an APM or micro edge — a proxy signal usable today, with no engine changes, ahead of true head-to-head self-play (docs §2.8, which needs engine/ai.js's controller to become owner-parametric). - tools/ailab.js: runLeaderboard + snapshotTables/restoreTables (clean per-candidate override isolation) + the `leaderboard` CLI command. - tools/candidates/: five runnable example candidates. - test/ailab.test.js: determinism, override isolation (including on throw), and ranking-correctness coverage. - docs/odyssey-ai-review.md + .claude/skills/ai-lab/SKILL.md: document the command and its "proxy, not self-play" caveat.d71f0e0
-
Add an Odyssey total-domination strategy guide (Hard/Gigantic/Abundant/Pop-200)
ClaudeUnverified signatureDocuments a conquest playbook for pacifying all 11 worlds against Hard difficulty, grounded directly in engine/galaxy.js, engine/diplomacy.js, engine/aiArchetypes.js/aiDifficulty.js/aiStrategy.js, engine/supply.js and engine/combat.js, and backed by real tools/ailab.js probes per archetype. Links from README's Odyssey section.236011f
-
docs: record the surplus army-cap fix and its measured results
Claude +1: Claude Sonnet 5Unverified signatureExtends §2.3's ledger with the 2026-08-01 follow-up: the save-file evidence that motivated it, the before/after probe numbers, the sweep/compare results (zero regressions), and an honest note on the residual 2/44 hoarding cases the fix doesn't fully clear. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UK1eufUwvNwY4CbCwh742j4d7f7a7 -
Update README and the player field manual for everything shipped since 1.0.0
Claude +1: Claude Sonnet 5Unverified signatureThe docs had fallen behind a large batch of unreleased work: Observer Mode, veterancy, three new static-defense buildings (Bastille, Aegis Bastion, Plasma Torpedo Battery), a Grid Substation, the Chemical Plant/Fabricator trade-industry branch, three-tier Assault/Bulwark doctrines with timed research, formations ranked by weapon range, Patrol orders, a Tech & Industry Chart hotkey, a rival AI Antimatter Gate, deeper Domination/diplomacy (gifts, favor requests, faction stance ripples), Freight Lanes, colony standing orders, bulk trading, a Technologist AI archetype, configurable match length, and an Odyssey starting-world picker — plus fixes to since-corrected claims (the AI's "no counter outside the triangle" blind spot, gatherers idling at a dry node, high ground's blind spot against itself). Every new number (veterancy ranks, building stats, doctrine costs/timings, concealment fractions, AI counter-pick cadence, etc.) was verified directly against engine/*.js and data.js rather than…d3432c5
-
Fix a real regression the batch's own agents mistook for sibling noise
Claude +1: Claude Sonnet 5Unverified signatureEvery one of the 9 parallel teams that hit test/ailab.test.js's "the skirmisher opponent actually fights" failure independently concluded it was pre-existing and unrelated to their own change, verified only by stashing their own files. It wasn't: git bisect against the true pre-batch commit (e059c69) shows the whole suite was 17/17 green there, and traces the regression to 4b95948 ("Doctrine research develops over time instead of landing instantly"). On ferros/economic vs the skirmisher bot (seed 7), the AI now loses every worker and building before ever fielding a single combat unit, where before it still lost the fight (docs/odyssey-ai-review.md's own §2.9 already documents this matchup as a known, deliberately-unfixed rush-survivability gap) but got a worker and a unit out first. Isolated three candidate mechanisms (research-time duration, aiResearch disabled outright, gating the AI's research decision on ctx.threats) and none fully restored the old trajectory, so this reads as the…bd3d963 -
Add a dependency-ordered implementation roadmap for the improvement catalog
ClaudeUnverified signatureSequences the 71 proposals in docs/improvement-proposals.md into phases, resolving the catalog's own review section along the way: merges its 7 duplicate pairs into single workstreams, decides its 6 open collisions (verified the counterToPlayerArmy collision directly against the code), and curates a subset of the Gate-cluster proposals instead of scheduling all 8 per the monoculture warning. Phase 1 (T1 legibility) and Phase 2 (AI counter-intelligence) have no dependencies and can start immediately; Phase 4 (new static defense) is gated on Phase 2 landing first.e059c69 -
Add the tiered, all-dimensions improvement-proposals catalog
Claude +1: Claude Fable 5Unverified signatureA fanned-out review team (nine dimension agents plus a completeness critic) read the engine, tests, and design docs and produced 71 improvement proposals covering combat, economy, tech/industry, defense/victory, the AI, the Odyssey meta-layer, worlds, UX, and presentation/platform. Each proposal is anchored to the progression ladder (T1 Opening / T2 Developed / T3 Advanced / Strategic Endgame, plus cross-tier), graded by effort and impact, written under the project invariants (deterministic DOM-free engine, no build step, no dependencies, pay-in-gathered-commodities), and grounded in the exact files and functions a change would start from. The critic's closing pass lists duplicates to merge (two dimensions independently designed the same rival-Gate feature), collisions to decide before scheduling (three dimensions patching counterToPlayerArmy, free-vs-paid world intel, Gate-charge economics), coverage gaps nobody owned (scenarios, replays, debrief, accessibility, audio, modding-by-dat…3ebe49b
-
Record the forgiveness-dial measurement, denominator effect and all
Claude +1: Claude Opus 5Unverified signaturepassive 0.619 -> 0.619, byte-identical on all five detectors skirmisher 0.336 -> 0.365, hostile-but-idle 34/44 -> 18/44 The passive column being unchanged is the result, not a missing one: a player who never draws blood never provokes anyone, so the dial is correctly a no-op against that opponent. The skirmisher improvement is mostly the METRIC getting fairer rather than the AI playing better, and the ledger says so. Provocation used to latch for ever, so a neighbour that had cooled off — or been killed — kept counting as "hostile and refusing to attack" for the rest of the run. Those samples now drop out of the measure because the neighbour is no longer entitled to attack. Some of it is genuinely correct behaviour finally being scored as correct; none of it should be read as the AI having become more dangerous. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V6aK9g6A9dYtyinJSVXHqQ1c7c87b -
Make the grievance / aggression cooldown part of the AI's personality
Claude +1: Claude Opus 5Unverified signatureSouring was already flavoured by temperament — a Warlord world turns on you twice as fast as a patient one (grievanceMult) — but COOLING OFF was flat. Every world recovered from being bled at the same DRIFT_RATE, and `provoked`, the flag that lets a never-initiating strategy answer back, latched for good. So once you had fought anyone, every temperament held the grudge identically and for ever, which is the one place the three archetypes read the same. One `forgiveness` dial now drives both halves of that cooldown: - The stance drift is ASYMMETRIC. Recovery runs at DRIFT_RATE * forgiveness; souring keeps the stock rate, because that direction is already grievanceMult's job. A test pins the separation — the obvious implementation (scaling the whole drift) would have made a slow-forgiving personality also turn hostile slowly, which is not what was asked for. - Provocation is a TIMESTAMP, not a latch. It fades after PROVOKE_MEMORY / forgiveness seconds of quiet, …f8f75e7 -
Record the measured before/after in the review, including what didn't work
Claude +1: Claude Opus 5Unverified signatureThe comparison is apples-to-apples: the "before" column is the PRE-FIX engine measured with today's bench, from a git worktree at the pre-fix commit, because three detectors were redefined mid-pass and comparing across metric definitions would have been meaningless. passive 0.497 -> 0.619 supply-deadlock 4->1 · hoarding 14->2 · dev-flatline 19->11 skirmisher 0.373 -> 0.336 Two columns are not wins, and the doc says so rather than defending them: - production-stall did not move at all (18/44 both sides), across two attempts. Probing the worlds it fires on shows the residue is the Rusher archetype doing exactly what it is designed to do — six workers, one Barracks — on Medium, where rusherGraduates deliberately doesn't apply. That isn't a stall the code can fix; changing it means changing what a Rusher is. The parallel-Habitat change aimed at it is kept because it is what moved supply-deadlock, not because it did what it was aimed at. - the skirm…db98ac8