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
-
Merge pull request #95: fix the three engine defects the 3D client reported
Unverified signatureMarket prices now round-trip a fought-over world, galaxyStatus reports what sweepColonies actually banks for a conquered colony, and snapLandingPoint is idempotent without giving up any landing area. Closes #92, #93, #94.50ceb88 -
Fix the three engine defects the 3D client reported (#92, #93, #94)
Claude +1: Claude Opus 5Unverified signatureAll three were found from outside — alma92350/3D-SpaceExploration-RTS vendors engine/ byte-for-byte — and filed unverified against this repo's suite, because that session could not clone it. All three reproduce here. The full suite is green (2519), typecheck clean, and each fix carries a test that fails without it. #92 — a world fought over did not round-trip its market prices. createMarket derives every raw commodity's price from its share of ALL nodes, and runs exactly twice: at creation, and on load. Wreck/crater nodes are pushed onto the map DURING play and the loader restores them before recomputing, so the reload derived the book from a bigger node set than the live one. Since the share is a fraction of the total, every raw commodity moved, not just the debris's own. Skip wreck and crater nodes — the same exclusion worldHasCommodity already applies. No live behaviour change (there is no debris at creation) and no save-format change. #93 — galaxyStatus reported income 0 for a co…96c6d29
-
Merge branch 'claude/odyssey-background-planets-kzzw1t': bound the Odyssey living galaxy to 3 seed-drawn background worlds
Claude +1: Claude Opus 5Unverified signatureCo-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8GVgSYoUteBRNyjp2yDRC93f607a -
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
-
Fix the AI Editor tab: a blank screen from an undefined STRATEGIES
Claude +1: Claude Opus 5Unverified signatureClicking 🧬 AI Editor threw `ReferenceError: STRATEGIES is not defined` and rendered nothing. The "Start from:" seed row read engine/aiStrategy.js's raw STRATEGIES table, which competition.js deliberately never imports — strategyLabel already says so in a comment 2300 lines above, and reuses setup.js's STRATEGY_OPTIONS instead. The seed row is now read off the same table: same four keys under `mult`, same labels, so what a player sees is unchanged. Why nothing caught it. `checkJs` is off in jsconfig.json (files opt in with a `// @ts-check` pragma) and competition.js has no pragma, so the type-check never looked; running tsc with --checkJs over the whole repo reports exactly these two lines and nothing else. The unit suite never builds this DOM, and the browser smoke test only walked a skirmish. So the smoke test now clicks every Competition tab. Each is asserted against the error log rather than a child count, which is the part worth stating: a half-rendered screen still has children…20d4e50 -
Merge branch 'claude/code-review-report-lyazay': repair the browser smoke job
Claude +1: Claude Opus 4.8Unverified signatureFixes the smoke job that went in broken two commits ago and turned main red. It failed with `sh: 1: playwright: not found`, and the cause was two wrong assumptions rather than a typo: - playwright-core ships no CLI; only the full playwright package carries the binary that downloads browsers. - `npx --package X -- node script.js` does not make X importable by the script. npx puts the package's BIN on PATH, not its module on a child node process's resolution path, so the require inside tools/smoke.js could never have resolved whichever package was named. Both checked directly this time. The working form is a --no-save install, which keeps package.json exactly as clean as npx would have; node_modules is already gitignored and walkJs already skips it. Verified before merging, which is the part that went wrong last time: the CI run on d3f8729 is green on all three jobs, and the `browser smoke test` job in particular passed both its install and its boot step on a real …d53cb74 -
Fix the smoke job: npx --package does not do what I assumed
Claude +1: Claude Opus 4.8Unverified signatureThe smoke job failed on main with `sh: 1: playwright: not found` (exit 127). Two mistakes, and I merged before CI confirmed either — which is precisely the discipline the review said was the root problem. Owning that: the fix is here, and this one waits for a green run before it merges. MISTAKE 1: playwright-core ships no CLI. Only the full `playwright` package carries the binary that downloads browsers. The install step could never have worked. MISTAKE 2, the more interesting one: `npx --yes --package X -- node script.js` does not make X importable by the script. npx puts the package's BIN on PATH; it does not put its module on a child node process's resolution path, so the `require` inside tools/smoke.js fails with MODULE_NOT_FOUND regardless of which package was named. I had verified the script by setting NODE_PATH by hand and never exercised the mechanism the CI command actually used, so my local run proved the test worked and proved nothing about the plumbing around it. Both ve…d3f8729 -
Merge branch 'claude/code-review-report-lyazay': a browser smoke test in CI
Claude +1: Claude Opus 4.8Unverified signatureCloses the one gap the headless suite structurally cannot cover. With no build step, a page can parse, import cleanly and still throw on load — a blank white screen that static-integrity.test.js is not designed to reach and unit tests never execute. Demonstrated with a one-line bad draw call in renderUnits.js: all 2502 tests pass, the game dies on its first frame, and tools/smoke.js exits 1 with the stack. Nine checks against real Chromium: the page boots, a skirmish starts, the clock advances, drag-select builds a panel, a right-click order dispatches, keys are handled, and the console stays clean. Playwright is fetched at run time via a pinned npx call and never enters package.json, matching the precedent the CI type-check step already set for TypeScript; the script lives in tools/ so `npm test` keeps globbing only test/*.test.js and stays offline. The clean-console assertion carries no allow-list, so the standing /favicon.ico 404 had to be fixed rather than excused — an inline SVG…bf831bb -
Boot the game in a real browser in CI — the one thing 2502 tests cannot see
Claude +1: Claude Opus 4.8Unverified signatureThere is no build step, so the files in the repo are the files the browser loads. The suite is headless and dependency-free, which is the point of it, and it means nothing in it can catch a page that parses, imports cleanly, and then throws on load. static-integrity.test.js catches STATIC breakage — a syntax error, an import pointing at a moved file, a getElementById for an id that does not exist — and stops exactly there. The failure it cannot reach is a blank white screen, and the way that has been found here before is a human clicking. Measured rather than asserted. Adding a bad draw call to renderUnits.js — one line, valid syntax, imports fine — leaves all 2502 tests passing and takes the game down on its first frame. tools/smoke.js catches it and exits 1 with the stack. A second mutation (a runtime throw in boot.js) is caught by BOTH this and the existing "imports cleanly under Node" guard, which is why the render one is the honest demonstration of what is new here. tools/smoke.…778e159 -
Merge branch 'claude/code-review-report-lyazay': close out the review follow-ups
Claude +1: Claude Opus 4.8Unverified signatureThe three items left open when the review itself merged. Branch protection on main could not be automated — no MCP tool covers the API and a direct call returns 403 — so CONTRIBUTING.md now carries the exact settings and the two required check names verbatim, including the coupling to the workflow's job `name:` line that would silently unhook the gate if edited. Applying it still needs a human with repo admin. It is the one thing that stops this recurring: CI was red for three days and two PRs merged through it. Docs corrected where this work had falsified them — README's module map (inputCommands.js, and tools/ no longer being purely a bench now that three of its files ship to the browser and decide Elo outcomes), hudPanelSignature.js's "800 lines of button construction" argument, and code-improvement-tiers.md's "6-module UI import cycle, guarded nowhere" (7 modules, and guarded by a Tarjan membership check — the same error the review itself made). The 152 KB proposal backlog and t…6d03c42 -
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 -
Merge branch 'claude/code-review-report-lyazay': code review, and its fixes
Claude +1: Claude Opus 4.8Unverified signatureAn external architecture + TDD review of the tree at 56d13d7 (docs/code-review-2026-08.md), and the work closing every finding in it. The starting point was a build that had been red since 2026-08-05 with PRs #90 and #91 merged straight through it. Eight findings are fixed; one is withdrawn as wrong. 1 CI red two days, merged through twice fixed: two bad JSDoc signatures 2 CI installed TypeScript unpinned fixed: pinned to 5.7.2 3 AI belief faded in ~60s, not 240s fixed: fade derived at read 4 Tests drove accumulators off-cadence fixed: advanceThinkCycles 5 Type guard could not fail on the break fixed: inline-typedef parser 6 Two 780+ line functions fixed: 871->309, 785->562 7 "15 unguarded UI import cycles" WITHDRAWN - the finding was wrong 8 tools/ shipped outside the purity net fixed: roots derived from index.html 9 Release stalled, actions deprecated fixed: 1.1.0, actions v5 The one behavioural bug is #3. engine/a…fa58c7d -
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 -
Split the two 800-line functions along the seams they already had
Claude +1: Claude Opus 4.8Unverified signatureFinding 6 of docs/code-review-2026-08.md. Both were mechanical moves, not rewrites — no behaviour changes, suite green at every step. hudSelection.js rebuildSelectionPanel: 871 -> 309 lines. It was a preamble followed by two dozen independent `if (<thing selected>) { ...build its controls... }` blocks, and the file was already splitting the newer ones out (renderMarket, renderFreight, renderLanes). This finishes that: twelve families now have their own function, and the dispatcher reads as a table of contents. hudPanelSignature.js's header asked for exactly this ("without scrolling past 800 lines of button construction") and docs/code-improvement-tiers.md files it as Tier 3; the { match, signature, render } registry both describe is a much smaller step now. Verified mechanically before moving anything: no block contains a return, continue or break that would change meaning inside a function, each extracted body is brace-balanced, and each block's real dependencies are only state / se…888ea3c -
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 -
Merge pull request #91: an in-app AI editor
Unverified signatureThe genome was always meant to be something a player owns, not only something a search breeds, and until now owning one meant editing JSON by hand. The whole form generates itself from GENOME_SCHEMA, so the screen cannot drift out of step with what the engine reads -- add a gene there and it appears here with the right control and the right limits -- and an illegal AI cannot be built through this UI at all, because the bounds ARE the schema's. The feature that justifies a real screen over a text box is that dials nothing is currently reading go grey and say why. Tick "never initiates" and the whole Attacking group dims, because under that flag the engine never commits a wave. Junk DNA is useful to a search and hostile to a person: someone tuning a muster size for ten minutes under a switch that makes it meaningless gets no feedback at all. Inert rows are dimmed rather than hidden or disabled -- the value is still real and still saved, so hiding it would lose their work and disabling …56d13d7 -
An in-app AI editor: build an opponent dial by dial
Claude +1: Claude Opus 5Unverified signatureThe genome was always meant to be a thing a player OWNS, and until now owning one meant hand-editing JSON -- a fine format for a bench, a poor one for a person. THE WHOLE FORM GENERATES ITSELF FROM GENOME_SCHEMA. Every control's widget, bounds and grouping come from the schema row, which buys two things: adding a gene to the schema makes it appear here automatically with the right control and the right limits, and it is impossible to build an illegal AI through this UI because the bounds ARE the schema's. Sliders for ratios and counts, checkboxes for flags, dropdowns for doctrine/faction, and an ordered chip list for unitMix -- ordered because the first entry is what gets built first, which is why the mix has a rotate operator at all. The feature that justifies a screen over a text box is that it GREYS OUT DIALS NOTHING IS CURRENTLY READING, and says why. Tick "never initiates" and the whole Attacking group dims to "inert while never initiates is on -- it never commits a wave"; match…4979046 -
Merge pull request #90: an adaptive AI, and a genome the player can own
Unverified signatureThe AI now keeps a fog-limited BELIEF about its opponent -- how much of their investment went into army versus economy, as far as it has actually scouted -- and acts on it: it punishes visible greed by raiding the worker line, and walls up against an opponent it can see massing. It is the first AI state that can be wrong, which is what makes scouting worth its cost and killing the scout a real counter-play. Confidence is deliberately separate from posture, because "I have seen nothing" and "I have seen an empty base" are different situations that one number cannot tell apart. The belief is a fading high-water mark rather than an average, so an army stepping out of vision does not erase itself. The stance is damped by both a dead band and a rate limit -- two adaptive AIs form a feedback loop and oscillate forever without one, and the opponent has to stay legible enough to read and answer. Easy never adapts at all, keeping the predictable line a new player needs. This is also the struc…65c0a37 -
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 -
The corrected cast: 10 cells from the median-descriptor archive
Claude +1: Claude Opus 5Unverified signatureReplaces the 15 cells the first archive produced, six of which existed only because the old mean-based descriptor was scattering genomes into bins at random. Coverage drops 94% -> 63%, and that drop IS the fix working rather than a regression: the earlier number was inflated by measurement noise, and this one is what a tightly-clustered, honestly-measured population looks like. The behaviours now separate cleanly -- waves 0.0 to 13.5, army 1 to 58 -- and the fitness spread (38-88% against the fixed four-baseline panel) tracks something real, with the small-army column scoring highest and the sprawling waves/large lowest. Held-out-replicate verification is running: the archive measured on replicates 0-1, so 2-3 are maps it never saw. Re-measuring on the SAME maps would be tautological now that runSeed is pinned, which is why the check has to use different ones. The README is updated once that lands -- it is the check the first cast failed, when two cells three bins apart swapped ends …dd5b8f9 -
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 5: the roster can carry a player's own genome
Claude +1: Claude Opus 5Unverified signatureThe keystone here turned out to be a validator, not a UI. Once a genome can arrive from outside the program -- a mirror someone was sent, an imported ladder, an edited file -- it stops being data this project produced and becomes data it is HANDED. And it is not inert: toOverrides writes it straight into the live ARCHETYPES/STRATEGIES tables the engine reads every think cycle. GENOME_SCHEMA is already the exact statement of what a legal gene is, so it is the exact validator. sanitizeGenome is a WHITELIST: a key the schema does not name is dropped rather than passed through, every number is coerced and clamped to its own gene's bounds, every categorical must be a declared allele, the mix is filtered to the known alphabet and capped in length. Nothing throws -- bad input yields a duller AI, never a broken one or an exception mid-tournament, which is the same tolerance mutation already relies on. Probing it with deliberately hostile input caught a real hole: Number([]) is 0, so `"garris…60d3ef9 -
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 -
Phases 2-3: the AI answers what it reads
Claude +1: Claude Opus 5Unverified signaturePHASE 2 -- the raid stops being a metronome. It fired on `waveCount % RAID_EVERY` and only on Hard: harassment on a schedule, regardless of whether harassment was the right answer. It now ALSO fires when the read says the enemy is visibly investing in economy over defence and enough of them has been scouted to act on it. That is harassment as a response: punish greed, and specifically punish the hoarder docs/ai-evolution-design.md found winning by never committing its army. An opponent that can be SEEN to be undefended should not be safe -- which removes that degenerate strategy structurally instead of penalising turtling inside a fitness function, where evolution would just route around it. The read is deliberately not gated on controller.micro. Reacting to what you scouted is ordinary competence, not the unit-level micro Hard buys, and an Easy/Medium AI that never once punishes a greedy opening is the passivity the bench keeps measuring. PHASE 3 -- a damped stance. posture is far t…5d60e36 -
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 -
Descriptors are a MEDIAN, and runSeed stops hashing the candidate's name
Claude +1: Claude Opus 5Unverified signatureThe archive run filled 15 of 16 cells at 94% coverage, and then verification undercut it: two cells filed three bins apart on the army axis (8 vs 113) differ in exactly one active gene, and re-measuring them returned 93 and 2 -- they had swapped ends of the axis. The cells were not distinct; the measurement was dealing cards. Probing it properly, one genome held fixed on pinned maps over 4 replicates per world: korrath 26/23/22/27 (stable), vesper 1/0/8/0, ferros 36/3/1/296. The distribution is HEAVY-TAILED, not merely noisy -- an Odyssey economy that gets going compounds, so about one run in twelve returns an order of magnitude more army than the rest. That rules out the fix already written. Averaging inherits a heavy tail rather than smoothing it, and the same twelve runs say so: the MEAN reads 21.0 / 14.8 / 36.9 at 1 / 2 / 4 replicates -- diverging, because whichever sample holds the 296 decides the answer -- while the MEDIAN over the identical samples reads 26 / 13 / 15 and conve…ee4f10e -
Calibrate the archive's health screen against the shipped AI, not a fixed list
Claude +1: Claude Opus 5Unverified signatureThe first real `archive` run refused 39 of its first 41 genomes and filled 2 of 16 cells. The diagnosis was unambiguous and it was not the genomes: arch0-arch3 ARE the four shipped strategies, and the screen refused all four. A filter that rejects the game's own hand-written AI is wrong by inspection. The cause was my own parameter choice. CHECKS is calibrated against the `passive` sparring bot; the descriptor run deliberately uses `turtle`, which provokes, so the AI spends on army and takes losses and `devFinal` never clears dev-flatline's threshold. The detector started firing on correct behaviour -- which is precisely the failure this file's own CHECKS header records three rewrites of. Choosing a different opponent reintroduced it a fourth time, in a command whose header comment already warned about it. So the screen is now RELATIVE. The seed strategies are evaluated first and always seated; the union of what they trip under this run's own opponent and match length becomes the tol…ef38dd0 -
Breed a CAST of distinct opponents, not one optimum: MAP-Elites
Claude +1: Claude Opus 5Unverified signature`evolve`'s first real run answered the question it was asked and produced something the game should not ship: a champion that beat all four hand-tuned strategies on held-out worlds by never attacking, because victory.js's score-at-clock tiebreak pays 1.35x for combat units and 0.25x for banked ore, so an army that never fights and never takes attrition is the most valuable thing you can own when the clock runs out. A better number, a worse opponent. Odyssey has no win condition, so the right target was never a maximum. It is what ARCHETYPES is trying to be by hand with four entries: a cast of distinct, legible opponents. `ailab archive` optimises for a filled grid instead. Three things differ from `evolve`, and each one closes a hole that run exposed: - THE ARCHIVE REPLACES THE POPULATION. A genome is binned by how it BEHAVES (aggression x army size, from the solo Odyssey bench) and only ever competes against the current occupant of its own cell. The doomstack turtle can w…09745ce -
Merge pull request #89: evolve the AI — a genome, mutation, and crossover
Unverified signatureParameterises the AI so it can evolve by mutation or by crossing two AIs, and runs the first search. Zero files under engine/ change -- a candidate AI was already JSON, so the genotype lives entirely in tools/. tools/genome.js: GENOME_SCHEMA (28 genes, two chromosomes, six linkage groups) with one operator per gene KIND -- multiplicative for ratios, additive for counts so 0 stays reachable, rare flips for the epistatic switches, sequence operators for the unitMix production cycle. Crossover cuts at module boundaries, which map one-to-one onto the engine files that consume them. ailab evolve: population, elites, tournament selection, self-adaptive step size, fitness = Swiss-scheduled duel Elo anchored by the four shipped baselines,每 difficulty bracket rated separately and aggregated by the worst. Two pre-existing bench bugs fixed: runDuel never forwarded a candidate's own archetype (so every CLI duel gave both seats the world's temperament), and duelSeed hashes the candidate names (s…3242bdb -
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
-
The first evolved candidate: 12 genomes x 6 generations, 3h21m
Claude +1: Claude Opus 5Unverified signatureChampion is generation 3's g3i0 -- later generations never beat it, which is itself the run's most useful result (see below). Recorded as a candidate file so it can be duelled and swept like any hand-written one; NOT promoted into engine/, and on the evidence so far it should not be. What it actually is, once the inert genes are stripped: max economy, uncapped army, never attack. Of the eleven dials it emits, three do anything -- neverInitiates, workerTargetMult, turretCountMult. attackTimeoutMult/ armyAttackSizeMult/garrisonMult are dead under neverInitiates (aiMilitary.js's readyToAttack gate), warFootingMult/Time are dead without a standingArmyCap, and matchBuffer/matchFloor are dead without matchEnemyForce. Junk DNA, exactly as the design doc's Sec 3.3 predicted, and carried rather than erased because the `|| 1` convention means an unread gene costs nothing. It found this because engine/victory.js's score-at-clock tiebreak weights combat units at 1.35x and banked ore at 0.25x, so…eddfd01 -
evolve: checkpoint the champion every generation, not only at the end
Claude +1: Claude Opus 5Unverified signatureA real run is long, and it gets LONGER as it succeeds: a population converging on `neverInitiates` stops resolving matches by elimination and starts running every one of them to the full clock, so generations slow down as the search works. Writing the champion and the log only on completion meant an interrupted run left nothing at all -- the difference between "still going" and "start over". Purely an output side effect, in the CLI's own onGeneration: it consumes no rng and changes no decision, so a checkpointed run breeds the identical champion. The final write goes through the same path, so an interrupted run and a completed one leave a file of exactly the same shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011KL6GbjkxUNWs3frZUYANKa6cc77c -
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 -
Merge pull request #88: in-game AI/human competitions with Elo ranking
Unverified signatureIn-game AI/human competitions with Elo ranking48fc0d3 -
Merge Phase 5: spectate, replay, seasons -- the plan completes
Claude +1: Claude Opus 5Unverified signatureObserver Mode was one guard away from spectating a skirmish: input.js already delegated every path, observedState() already fell back to game.state. Relaxing that guard, plus a speed ladder that scales how much sim time a real second buys (never the fixed step itself), makes an AI-vs-AI match watchable at 1x-8x with fog revealed and no orders possible. A watched match is exhibition only and says so in three places -- a single unswapped match is confounded by the seat edge and the map's asym halves, so rating it would put a differently-earned number in the same bracket with nothing able to tell them apart. Replay re-runs a recorded row from its own seed rather than storing frames, and verifying that claim rather than trusting it caught a real bug the spectate stage had shipped: tools/selfplay.js steps at 0.1 while createLoop defaults to 20 Hz (0.05), and a fixed step IS the simulation -- measured on one seed, the two produced OPPOSITE WINNERS. A watched match was never the match the Wo…49792e7 -
Phase 5 follow-ups: an undefined colour, an untrusted strategy, a stray "You"
Claude +1: Claude Opus 5Unverified signatureThree nits from Phase 5's review lenses, all real: - style.css referenced var(--fg) in the two new spectate-bar buttons. --fg is defined nowhere in the file (the codebase uses --text), so both silently fell back to an inherited colour. - buildReplayConfig took the strategy straight off a history row with only an `|| "default"`, while the archetype three lines below it is properly validated against ARCHETYPES. A history row is untrusted input -- cleanHistoryRow coerces the names and leaves the rest -- so a hand-edited or imported ladder could put any string there. The engine survives it (strategyFor falls back), but the replay would then run a DIFFERENT match than the row describes and report the mismatch as a divergence: a determinism failure that isn't one, in the one feature whose whole promise is exact reproduction. Now validated the same way. - hud.js's endgame score bar still read "⚔ You 400 · AI 380" during a watched match, where both seats are AI and nob…1293f93 -
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 -
Merge Phase 4: the human enters the field
Claude +1: Claude Opus 5Unverified signatureThe Gauntlet -- what the original request was actually about. Name a commander, pick a field of AI roster entrants, and play one real, live match against each, rated into the same persistent bracketed Elo ladder the simulated formats already feed. One match per opponent, not the worlds x seeds x 2 sweep an AI-vs-AI pairing uses: a human cannot play forty games, and that single constraint decides the rest of the design. No side-swap is possible, because the human can only hold owner 'player' (D4) -- which is the seat the measured 13%-of-think-cycles edge runs against. So the edge is disclosed in five places rather than corrected by a fudge nobody could derive, and every human row carries seatSwapped:false. Resumability is real, not aspirational: the whole gauntlet -- field, schedule, per-fixture results, next index -- lives in the versioned ledger, so a mid-run reload comes back with every margin and rating delta intact. Verified live in a browser, including a match played to a real s…23b4a7d