Public: anyone can read this; the crew can change it.
forked from trevato/cs
Take updates from trevato/cs #286
Check · Review · Land · Live done — Landed and live in production.
Merged, green, and pushed. Final state: `bun run test` (typecheck + 1240 tests) passes, all three games serve, and `scripts/mutate-result.ts` reports 28 mutants dead and 4 redundant as noted.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
Merged, green, and pushed. Final state:
bun run test(typecheck + 1240 tests) passes, all three games serve, andscripts/mutate-result.tsreports 28 mutants dead and 4 redundant as noted.---
refs/following/main(013620e) merged into this branch. The two trees diverged before the engine was pulled out of the game, so most of the parent's 62 commits land againstsrc/client/{math,physics,renderer,trace,input,policy,textures}.ts— the modules this repository moved behindsrc/engine/. That is the conflict that decides most of the file-by-file calls below.This repository's side won, and why
src/client/physics.ts,renderer.ts,trace.ts,input.ts: the deletions stand. Those concepts live behind the door now (src/engine/physics.ts,renderer.ts,trace.ts,controls.ts) and two other games import them from there.main.ts,world.ts,bots.ts,hud.ts,combat.ts,weapons.ts,models.ts,map.ts,audio.ts,observe.ts,action.ts,weights.ts,db.ts,server.ts,result.ts,pages/game.ts,rl/arena.ts,tty.ts,scripts/{build,train}.ts,README.mdand their tests: ours. Each of these imports throughsrc/engine/index.ts; taking the parent's text would put the game back inside the engine.who.ts(same constant-time HMAC compare, plus an identity length cap and a checked expiry shape),limit.ts(a token bucket with a swept, bounded table rather than a fixed window),compress.ts(the measured level-6 decision, a type rule and a q-value-awareaccept-encoding),server.ts(the CSP carries a sha256 of each page's style block instead of'unsafe-inline'),result.ts,db.test.ts,spectate.ts,summary.ts,report.ts,buy.ts,scripts/cost.ts(ours measures what an engine group adds to a bundle; the parent's measured a simulation tick, whichsrc/budget.test.tsalready holds here).tsconfig.json,package.json,forge.json,bun.lock,AGENTS.md: ours. This repository already runs the typecheck the parent added (testistypecheck && bun test) and its tsconfig is the stricter one; the parent'sAGENTS.mdwording names abun run checkscript that does not exist here.src/engine/math.ts,net.ts,learn.ts: reverted to ours.fallenMatrixexists to draw the parent'sbodies.ts, which is not here and is not on the door;policyOver/policyBytesand thelearn.tsrewrite exist to feed the parent's worker-pool trainer, and moving PPO invalidates the shipped weightssrc/rl/guard.tsre-measures.radar.ts↔minimap.ts,grenades.ts↔grenade.ts,loop.ts/fullscreen.ts↔engine/,bind.ts/press.ts↔src/bind.ts+engine/controls.ts,plan.ts↔src/plan/,saved.ts/settings.ts↔replay.ts+the settings inmain.ts,bundle.ts↔bundles.ts,tabs.ts↔terminal/screen.ts,player.ts↔who.ts+db.ts, and the tests for modules that no longer exist.The parent's side won, twice
src/tree.test.ts(new here) — the guard that no cookie jar and no scratch directory sits in the tree, with the.gitignoreentries it reads. Adapted: its scratch names now subtractnode_modules,dist,staticanddata, which tools in this repository build into on purpose; without that it is red on any machine that has run or built the app. It still fires on a planted.scout-tmp/cookies.txt.saveMatchinsrc/db.ts— a match's numbers only ever count up. Posts arrive as the match is played andsrc/client/pending.tsretries one that failed, so the last post to reach the database is not always the latest one the game made, and an overwrite let a retried early post undo a finished match. Each number is raised rather than replaced, the score is taken whole from whichever post knows the most rounds, andfinishednever goes back down — which is whatlivenessalready assumed. Two new tests cover both directions.What I changed rather than merged. One existing test,
src/db.test.ts"which day a result counts for is read out of its id": it posted 3 kills after 9 as incidental setup and asserted the 3 stuck. The subject is the day, not the kills, so the second post now sends 13 and the assertion follows; the rule it actually tests is untouched. Separately,scripts/mutate-result.tshad been reporting 11 of its mutants as "no longer in src/result.ts" sinceintegerandcleanNamemoved tosrc/gate.ts— a mutant now names the file it breaks, and all 32 do what the list says again.What I chose not to do. I did not port the parent's lower bound on the clock (
seconds >= rounds * 10):secondsisworld.time, and this repository's headless stage ends rounds without running the clock, so the rule refuses bodies three games' boot tests produce. And I did not rebuild the parent's features that were written on the old client — radio calls, bullet-hole decals, nameplates, between-tick interpolation, snapshot save/restore (restoreWorld/Saved), the adaptive render scale inquality.ts, multi-core training (rl/pool|shard|worker), the second handcrafted map,scripts/measure.tsandsrc/readme.test.ts. Each is a port into the engine's shape rather than a merge, and each deserves its own issue and its own pins.To try it: the preview's
/,/rangeand/exampleall answer (33 kB, 18 kB and 12 kB of server-rendered HTML in 2–23 ms locally), and the leaderboard is the thing to poke — play a match, walk out of it mid-way, and check the row does not lose rounds when a late post lands.Closes #275
🤖 Generated with Claude Code
Closes #275