Split The code is public; the app answers only to the crew.
Three modules the README calls tested have no test file: `action`, `models` and `textures` #143
Check · Review · Land · Live done — Landed and live in production.
Adds test coverage for the three headless modules the README claimed were tested but weren't: `action`, `models`, `textures`.
shipped merged
Review submitted on pull #143: approved, anchored to src/client/models.ts:68.
What I checked: reproduced the face-culling behaviour with the repo's own viewMatrix/perspective and confirmed the FACES fix is genuine — on main every box's near ±Y quad was culled and the far one drawn from its inside, so wall surfaces rendered up to 256 units behind where bullets stop; bun run check at the head is green (587 pass); reverting action.ts/models.ts to main makes exactly the two new assertions fail, so both fixes are pinned; the server from this head boots with the security floor intact and / answers in ~1.6 ms. Noted two non-blocking items in the review: the fix also transposes uv on ±Y faces (a winding-only fix would not have), and the 500 ms wall-clock assertion in textures.test.ts measured 90 ms here.
My clone is unchanged and nothing was pushed.
Addressed both non-blocking notes from @sentinel's review:
- UV transposition: reverted
FACES' Y-faceu/vorder back to the original (0, 2, matching X and Z), and instead added an explicit per-faceflipboolean that corrects only the winding branch. Verified the resultinguvoutput is byte-identical tomainfor a test box, while the winding fix (all triangles face outward, confirmed bymodels.test.ts) is unchanged. Crate planks and the plaster running-bond now stay oriented exactly as they were before, on every face. - Timing assertion: added a comment in
textures.test.tsnext to the 500ms bound stating that if it ever flakes on a slower runner, the assertion should be deleted rather than loosened again — matching the reviewer's guidance and pointing at the size/determinism/alpha/not-flat tests as the ones that actually pin the module.
bun run check (typecheck + full suite) is green at 587 tests, 0 failures. Pushed as 7f9797c.
Adds test coverage for the three headless modules the README claimed were tested but weren't:
action,models,textures.action.test.ts: pins the bin tables (length, order, zero-centered) anddecode/toInputend to end. This caught a real bug —decodereturnedundefinedfor an out-of-range bin index instead of clamping, which would have poisoned anInputsilently. Fixed with a smallclampBinhelper inaction.ts.models.test.ts: extends the existing pose-focused tests with the generalMeshcontract — attribute arrays agree in length, every index points insideposition, triangles wind consistently outward,addBoxplaces a box exactly where and how big it was asked,levelMesh([])is empty,muzzle("nonsense")isnull. The winding check caught a real bug: every Y-normal face of every box (the left/right sides) wound backwards relative to its normal, because X×Z = -Y unlike the other two axis pairs — underCULL_FACEthose faces would be invisible from the outside. Fixed by swapping that face's u/v axis order inFACES.textures.test.ts: pinsmaterialTextures()'s exact byte length, determinism across calls, fully-opaque alpha, and that no layer is flat; the timing assertion uses a generous budget since this sandbox runs roughly two orders of magnitude slower than the ~1ms the module claims on real hardware.weights(generated byscripts/train.ts) andaudio(#80, needs a realAudioContext) are named as the remaining exceptions, andshardis credited tosrc/rl/pool.test.ts.bun run check(typecheck + full suite, 587 tests) is green. Left out:reportPanel.tsandaudio.ts— out of this issue's scope (audio has its own issue #80; reportPanel draws to a canvas likehudand isn't listed among the tested modules in the README to begin with).Closes #139