Solver-backed
Goal:
Review your recently changed files for code reuse, quality, and efficiency issues, then fix them.
Run the Playwright test, debug any failures, fix the real root cause, and keep going until the test passes reliably.
Important working rules:
What I want you to do
Phase 1: Inspect
Phase 2: Run the test
Phase 3: Debug the root cause
Phase 4: Re-run and stabilize
Technical expectations
Use Playwright MCP to test the website end to end:
Validation
After fixing, run:
Output format
Critical instruction
Do not stop at a superficial pass.
The task is only done when the Playwright test passes and the underlying issue is fixed with clear, simple, and robust logic.
I’m inspecting the workspace first to locate the Playwright setup, the relevant app flow, and the files changed in the current worktree before I run anything. After that I’ll execute the exact failing e2e path, collect the failure artifacts, and only then make code changes.
I’ve found the Playwright harness and there’s a single e2e flow under tests/e2e/analysis-flow.spec.ts, with global setup enforcing an existing authenticated storage state at playwright/.auth/google-user.json. Next I’m reading the config, setup, and that test to determine the exact route coverage and prerequisites before I run it.
The e2e flow covers /, /table/[roomId], /hands, and /hands/[handId], and it depends on a live web app on http://localhost:3000, API on http://localhost:3001, the analysis worker being healthy, plus a valid Playwright auth state file. I’m reading the route/components tied to those selectors now, along with the existing worktree diff, so I can correlate any failure with the recent changes instead of treating the test in isolation.
Plan:
analysis-flow.spec.ts.I’m checking whether the local stack is actually available before invoking Playwright. If it isn’t, I’ll start the repo’s existing pnpm dev flow rather than inventing a separate test harness.
Before I start the stack, I’m checking the analysis debug UI flags the e2e test depends on. That flow explicitly requires the debug panel to be enabled, so I need to confirm whether the app boots with those settings or whether the failure would just be an environment mismatch.
The stack isn’t up, so I’m starting the repo’s own pnpm dev entrypoint with the debug flags the e2e requires. After it comes up, I’ll run the Playwright spec exactly as configured and keep the first failure intact for diagnosis.
The repo’s own dev script failed because port 3000 was already occupied by another process, so I’m identifying that owner next. If it’s this same repo, I’ll replace it with a fresh run under the required debug flags; if it’s unrelated, I’ll route around it instead of guessing.
Ports 3000 and 3001 are already served by this same repo’s Node processes, which explains the startup conflict. I’m enumerating the rest of the repo-owned processes now so I can restart the stack cleanly under the required env flags instead of mixing old and new instances.
I found an older repo dev stack still running: Next dev, API watch, worker watch, and the table watcher. I’m stopping just those repo watcher processes, then I’ll restart pnpm dev cleanly so the e2e runs against one consistent stack with the debug UI enabled.
The stack is now healthy enough to run the e2e, so I’m invoking the single configured Playwright spec directly. I’m not touching code yet; the next step is to preserve the first real failure with its artifacts and correlate it to the product path.
The first failure is specific: the analysis completed, but the hand-review page no longer exposes a Preflop 1 button that the existing test expects. I’m inspecting the hand-detail navigation logic and the failure artifacts now to determine whether this is a stale test assumption or a real UI regression in the recent hand-review changes.
I’ve confirmed from the failure screenshot that the page is already on the preflop decision when there is only one hero decision on that street, and the navigation intentionally renders Preflop instead of a separate Preflop 1 button. I’m validating that against the existing unit tests and then I’ll update the e2e flow to use the stable street/decision test ids the page already exposes.
I’ve got the failure pinned to the e2e selector logic, not the analysis pipeline. I’m patching the spec so it selects the street’s active decision the same way the product does: a street tab when there’s one hero decision, or the numbered first decision when there are multiple.
The spec is patched to follow the page’s actual navigation model instead of assuming every street has a numbered first-decision button. I’m rerunning the full Playwright flow now; if anything else fails, I’ll keep tracing until the real path passes cleanly.
The next failure is a real product issue: the whole-hand pipeline is getting blocked because a postflop decision ends in hero_combo_unavailable, so later streets never finish. I’m tracing that through the analysis pipeline and the decision canonicalization code now, using the exact error path from the worker output rather than patching the test.
The pipeline failure is specifically hero_key_not_in_combo_map, which means the solver returned a combo policy map but the hero hand lookup key didn’t match any combo entry. I’m tracing the combo-key generation path now, including the shared TexasSolver key helpers and any recent table-state changes that might have altered the hero cards used for lookup.
I need to see the actual failing hand data next, not just the status summary. If the hero combo truly isn’t in the solver map, the likely causes are either a bad hero combo lookup or an impossible hand state, so I’m pulling the stored hand/decision/event records for that exact failed hand.