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:
@@ -61,12 +61,11 @@ describe('Logging contract: mutating ops', () => {
|
||||
expectLastLogged(storage);
|
||||
});
|
||||
|
||||
test('togglePause logs', async () => {
|
||||
test('togglePause does NOT log (lifecycle excluded from undo)', async () => {
|
||||
const e = enc([p('a', 10), p('b', 7), p('c', 3)]);
|
||||
const started = await startEncounter(e, ctx);
|
||||
await togglePause(started, ctx);
|
||||
expect(storage.logs()).toHaveLength(2);
|
||||
expectLastLogged(storage);
|
||||
expect(storage.logs()).toHaveLength(1); // start only
|
||||
});
|
||||
|
||||
test('addParticipant logs', async () => {
|
||||
|
||||
Reference in New Issue
Block a user