M007 S04: Branch exhaust sets invalidated=true — no way to return to main sequence after branch ends #12

Closed
opened 2026-05-15 19:21:59 +00:00 by Mark · 0 comments
Owner

Severity: LOW
File: src/engine/openings.ts:36-37

Problem

When a contingency branch runs out of turns, advanceOpeningTurn() sets invalidated: true (line 37). This ends the entire opening, even if the main sequence still has remaining turns. Contingency branches are treated as terminal forks, not temporary diversions.

This may be an intentional design choice (branches exhaust the opening), but if branches are meant to be temporary, they should return to the main turn sequence instead.

Current behavior:

  • Branch activates → branch turns play → branch turns run out → opening invalidated → ends

Alternative:

  • Branch activates → branch turns play → branch turns run out → return to main sequence at current index

Fix

If branches should return to the main sequence, change line 36-37 from:

// Branch exhausted
return { ...activeState, invalidated: true };

to something that returns to the main sequence without incrementing the turn counter.

**Severity:** LOW **File:** src/engine/openings.ts:36-37 ## Problem When a contingency branch runs out of turns, `advanceOpeningTurn()` sets `invalidated: true` (line 37). This ends the entire opening, even if the main sequence still has remaining turns. Contingency branches are treated as terminal forks, not temporary diversions. This may be an intentional design choice (branches exhaust the opening), but if branches are meant to be temporary, they should return to the main turn sequence instead. **Current behavior:** - Branch activates → branch turns play → branch turns run out → opening invalidated → ends **Alternative:** - Branch activates → branch turns play → branch turns run out → return to main sequence at current index ## Fix If branches should return to the main sequence, change line 36-37 from: ```ts // Branch exhausted return { ...activeState, invalidated: true }; ``` to something that returns to the main sequence without incrementing the turn counter.
Mark closed this issue 2026-05-16 17:23:30 +00:00
Sign in to join this conversation.
No description provided.