M007 S04: OpeningSuggestion ignores contingency branches — shows wrong symbols when branch is active #4
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
bug
feature-request
in-progress
milestone
ops-task
quickfix
security/high
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/chainbound#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: HIGH
Found by: Fresh evaluation of M007 implementation
File: src/components/OpeningSuggestion.tsx:19
Problem
OpeningSuggestion always reads from the main turn sequence (
activeOpening.opening.turns[activeOpening.currentTurnIndex]) even when a contingency branch is active. The branch auto-switching logic in CasualDuel.tsx correctly setsactiveBranchIndexandbranchTurnIndex, but the suggestion UI never uses them.This makes S04 (Contingency Trees) non-functional from the UI — the engine correctly detects branch conditions and switches, but the player sees wrong suggested symbols.
Fix
OpeningSuggestion needs to check if
activeOpening.activeBranchIndex !== nulland if so, read fromactiveOpening.opening.contingencies[activeBranchIndex].branchTurns[branchTurnIndex]instead of the mainopening.turns[currentTurnIndex].There is also a dead function
getSuggestedTurn()at engine/openings.ts:131 that already implements this logic correctly but is never imported or called — it should be used here.Unblocking — lint gate now passes clean (
47dfc01).