Play the game end to end, in a real browser - #213
Merged
Conversation
Every other test here checks one system. This one plays: opens the map,
loads the engine, walks a floor respecting walls, kills its enemies,
smashes a prop, opens a lockable container, saves, and continues — then
checks the dungeon came back exactly as it was left.
WHY IT EXISTS. Every bug the owner reported was found by playing, not by
reading: props sealing a corridor, the inventory stacking duplicate bars,
burns not counting, floors regenerating on Continue. Each individual system
was fine; the failures were between them. This is the test that would have
caught them, and it is the last thing to run before a build goes out.
WHAT IT COVERS THAT NOTHING ELSE DID
- the map paints, with five bunkers, the daily bar and a bunker profile
- a floor generates populated, and the player can actually walk it
- kills are credited, and BATCHED (1 request for 8 kills, not 8)
- the run reports contract progress with a well-formed body
- Save & Exit writes floors + seed + position, in under a kilobyte
- Continue restores the same floor: dead monsters dead, broken props
broken, opened container open, player where they stood
- nothing 404s, nothing 5xx's, and nothing throws for the whole run
TWO PAGES, AND THE LIMIT NAMED. The map is checked on the real /game route;
the run is driven on a harness that loads the same 14 engine scripts. Not
because it is easier: with no wallet and no Celo RPC the shell sits on
"loading player profile…" forever, so DungeonGame never mounts and never
loads the engine. That is an environment limit, and the one thing this
therefore does not cover is the single hand-off between shell and engine.
Said in the file rather than glossed over.
FOUR OF ITS FIRST FIVE FAILURES WERE THE TEST'S FAULT, not the game's, and
each is now a comment where someone would otherwise repeat it:
- it mounted with walletAddress: null, then asserted the engine reported
to the server — which it correctly does not do without a wallet;
- it walked the player straight through rock, so the resume guard
correctly refused to put them back there, which read as a save bug;
- it asserted xp only ever rises — xp is the bar WITHIN a level and drops
on level-up, so the kill counter is the thing to assert on;
- it asserted a fragment POST from Decor.open(), but that credit fires
from tryInteract (proximity + the OPEN button), which this does not
drive.
The fifth was real environment noise, filtered by a NAMED list rather than
a catch-all, because a broad filter is how a test stops finding bugs.
Also fixes the same flake test-seeded-floors had: a floor averages 1.6
lockable containers, so one run in four had none. It retries the MOUNT, not
a probe — a fresh mount draws a new RUN_SEED, so a probe's floor is not the
next mount's floor. Five consecutive clean runs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017A764RdnwpyWnG7uCNhMiQ
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A test that plays, rather than one that checks a system. No production code changes — one new script.
Why
Every bug you reported was found by playing, not by reading: props sealing a corridor, the inventory stacking duplicate bars, burns not counting, floors regenerating on Continue. Each individual system was fine — the failures were between them, and no test looked there.
This is the test that would have caught them, and it is the last thing to run before a build goes out.
What one run does
Opens the map → loads the engine → walks a floor respecting walls → kills its enemies → smashes a prop → opens a lockable container → saves → continues → checks the dungeon came back exactly as it was left.
The limit, named rather than glossed over
The map is checked on the real
/gameroute; the run is driven on a harness that loads the same 14 engine scripts. Not because it is easier: with no wallet and no Celo RPC the shell sits on "loading player profile…" forever, soDungeonGamenever mounts and never loads the engine.So the one thing this does not cover is the single hand-off between shell and engine. That is written in the file, because a test that hides its own blind spot is worse than one that has none.
Four of its first five failures were the test's fault
Worth listing, because each is now a comment where someone would otherwise repeat it:
walletAddress: null, then asserted the engine reported to the server — which it correctly does not do without a wallet.Decor.open(), but that credit fires fromtryInteract(proximity + the OPEN button), which this does not drive.The fifth was real environment noise (no route to Firebase, static server can't POST), filtered by a named list rather than a catch-all — a broad filter is how a test stops finding bugs.
And it fixes the same flake twice-learned
A floor averages 1.6 lockable containers, so one run in four had none and the loot step failed at random. It retries the mount, not a probe — a fresh mount draws a new
RUN_SEED, so a probe's floor is not the next mount's floor. Five consecutive clean runs.Verification
npm run test:play(new)test:season38/38 ·test:streak31/31 ·test:seeded15/15 ·test:bunkers34/34 ·test:inventory7/7test:raid·test:contracts·test:floors·test:streak-ui·test:bunkers-ui·test:season-routestest:traversabletsc --noEmitlintGenerated by Claude Code