Test process cleanup
Close native game clients, browser tabs and temporary servers started for tests between runs and before resource-intensive builds. Leaving them running wastes CPU and memory and can cause out-of-memory failures.
Ensure cleanup also runs after failed tests, for example with finally blocks.
Clean up only instances started for your tests. Keep user-owned instances and
sessions explicitly requested for manual testing available until asked to stop.
Game testing
Use the browser harness in tools/client/game_test.mjs for repeatable client
testing; see DEVELOPERS.md under "Browser game testing". Prefer observed
state transitions over fixed sleeps and ad hoc WASM memory probes. Keep real
browser input coverage and check significant outcomes against server state.
Focused debugging and verification
- Select work from a concrete reported failure or an explicitly chosen milestone.
docs/feature-backlog.mdpreserves completed alpha work, historical evidence and deferred scope, not an active execution queue. A new player-visible failure reopens the relevant gate even when an older fixture passed. Do not promote historical precision or more earned leveling without a demonstrated alpha-path dependency. - Before choosing work, name the task, the observed failure or missing behavior, and the specific remaining acceptance criterion this change will complete. State its completion check before starting.
- Prefer implementing missing behavior and fixing reproduced failures. Add regression coverage when it protects that change or completes a clearly identified coverage requirement.
- After the focused regression and appropriate required checks pass, commit and move to the next actionable task. Broaden verification only when a new failure, material risk or explicit acceptance criterion requires it.
- Report behavior changes, verification, research and TODO closures separately. More tests or retained screenshots do not themselves establish that a feature advanced.
- Do not expand an item's completion criteria while working on it. Record newly discovered work separately with a justified priority.
- Research must answer a named implementation question. Stop when the evidence budget is exhausted; record the exact missing evidence and the condition that would justify reopening the search.
- Prefer the smallest reproducible scenario. Use controlled fixtures and existing checkpoints to reach the relevant state; clearly distinguish these from earned-progression evidence.
- Do not spend time earning levels, farming supplies, or replaying established gameplay merely to reach a test condition.
- Use short WASM checks to reproduce an issue and verify its fix. Reserve extended playthroughs for explicitly scoped integration milestones after relevant known blockers are resolved.
- Default to a 15-minute budget for exploratory manual gameplay. If it has not reproduced a specific issue or resolved a stated uncertainty, stop that exploration and reassess the approach.
- Keep historical research bounded to the current implementation question. Record unresolved evidence gaps and move to another actionable issue instead of repeating unsuccessful searches.
- Prefer milestones that fix behavior or add a necessary regression over accumulating more verification of unchanged behavior.
Database migrations
Preserve existing world databases when changing the schema. Add the next
numbered SQL migration in server/migrations/ and verify startup upgrades an
existing database. The local test database is disposable and can be recreated
without asking. Other compatibility with earlier development versions of this
server is not required. The target client protocol and game behavior remain
those of the original 14.9.1 game.
Persistence cadence
Keep frequently changing, low-significance simulation state, such as player and NPC positions, in memory between periodic database checkpoints. Do not persist it on every simulation tick or movement packet; avoid unnecessary database churn.
Persist significant changes, such as equipping items, inventory transfers, ammunition consumption and rewards, immediately. Commit related changes atomically before reporting success to clients.