Exclude pause/resume from undo; fix verify round-wrap false positive

togglePause no longer writes log entry (shared/turn.js). Lifecycle op, not
player action. Undo stack now targets last real action, not flag flip.
Removed dead pause/resume cases from expandUndo.

verify.js false positive: round wrap via non-nextTurn event (removeParticipant)
not detected — cycleActed never reset, actors flagged as acted_twice. Fix:
detect round change on ANY event, drain removed/inactive before finalize
(avoids false skipped when actor removed mid-round).

Tests updated: togglePause logging test asserts no log; undo test asserts
excluded. Repro confirmed via minimal verify case (removeParticipant r1->r2).
This commit is contained in:
david raistrick
2026-07-06 18:30:51 -04:00
parent 2c997de0da
commit bf1fccfd3b
4 changed files with 21 additions and 25 deletions
+12 -1
View File
@@ -220,7 +220,18 @@ function checkCycles(steps, rounds) {
if (started && pre && post.currentTurnParticipantId &&
pre.currentTurnParticipantId !== post.currentTurnParticipantId) {
const wrapped = pre.round !== undefined && post.round !== undefined && post.round !== pre.round;
if (wrapped && isNextTurn) {
if (wrapped) {
// drain removed/inactive before finalizing so removed actors
// aren't flagged as skipped.
if (pre && pre.activeIds && post.activeIds) {
const postSet = new Set(post.activeIds);
for (const id of [...cycleActive]) {
if (!postSet.has(id)) {
cycleActive.delete(id);
cycleActed.delete(id);
}
}
}
finalize(s.step);
cycleRound = post.round;
cycleActive = new Set(post.activeIds || []);