Add replayable debug reports.
A report dumps everything needed to understand a game that went wrong:
the full state (decks card by card, shop row and tier deck order,
discards, pending choices, banked Mana/Trumpets/apples), the round's
battles, and the whole event log. Available as JSON, which replays, or
text, which reads — and the text ends with a paste-ready repro test.
Battles now record the randomness they consume alongside what they
started from, so a result can be replayed long after the round cleared
those banks: same lineups, same dice, same events, down to the log text.
Results predating the recording say so rather than quietly re-rolling.
Three ways in: the 🐛 panel's download/copy buttons, GET
/api/debug/report (DEBUG-only, since a report holds both players' hands
and the shop deck order), and `mise run report`, which reads the
database directly so a live game can be dumped without DEBUG.
This commit is contained in:
@@ -30,6 +30,10 @@ description = "Build everything: frontend + server binary (bin/server)"
|
||||
depends = ["build-web"]
|
||||
run = "go build -o bin/server ./cmd/server"
|
||||
|
||||
[tasks.report]
|
||||
description = "Dump a game's debug report (no args: list recent games)"
|
||||
run = "go run ./cmd/report"
|
||||
|
||||
[tasks.test]
|
||||
description = "Run all Go tests"
|
||||
run = "go test ./..."
|
||||
|
||||
Reference in New Issue
Block a user