Repository navigation
fix(e2e): start a Current Debate in the staging spec - #100
Conversation
Since #72, Library disables Add Source until a debate is current. The staging spec never started one, so every run since Actions came back on 2026-10-01 waited out its 180-second timeout on a disabled button. The spec now starts a uniquely named debate from Library, sweeps debates an interrupted run left behind, and deletes its debate with the test user's own session after deleting the source through the UI. Actions time out after 30 seconds so cleanup still runs, and a failure logs the step name and URL path only. Docs: record the real cause in operations.md and describe the new suite steps, port and failure output in testing.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (3)
ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe staging E2E test now creates and removes a uniquely named debate and source, verifies persisted state after reload, and completes a bounded Ask request. The operations and testing documentation describe the updated flow, failure diagnostics, and local-run requirements. ChangesStaging E2E Flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Test as Staging E2E test
participant UI as Library UI
participant REST as Supabase REST API
participant AI as AI endpoint
Test->>REST: Delete debates with the suite prefix
Test->>UI: Create uniquely named debate
UI->>Test: Return debate creation response and ID
Test->>UI: Add source
Test->>UI: Clear local state and reload
Test->>UI: Verify debate and source
Test->>AI: Send bounded Ask request
AI->>Test: Return response
Test->>UI: Delete source
Test->>REST: Delete created debate by ID
Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The cleanup uses the staging user's existing permissions, and database ownership checks constrain deletion to that user's data. Production targeting is rejected, and protected CI runs are serialized. No material security risk introduced or worsened by this change was identified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
The Current Debate store persists under its own key, so clearing only the session store let the restored motion come from localStorage. Clear both stores, wait for the sources, debates and current_debates reads, and check the current-debate indicator too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Local results at 16b2f79. GitHub Actions refused every job at this head ("recent account payments have failed or your spending limit needs to be increased"), so these are local passes, not CI passes.
|
|
Merged |
Fixes the Protected staging E2E job. No staging run has passed since 2026-09-23, and every real run since Actions came back on 2026-10-01 has failed.
Root cause
The spec was stale. Staging was behind main too, but that didn't cause these failures.
getByRole('button', { name: 'Add Source' }), and the log shows that the locator resolved to a<button disabled>.current_debatesrow, so the button could never become enabled.Changes
e2e/staging/authed-flows.spec.ts:debate-trainer-storageanddebatelab-current-debate) and reloads. It then waits for thesources,debatesandcurrent_debatesreads and checks that the motion, the Current Debate indicator and the source all come back from staging. Codex caught that the first version cleared only the session store, so the motion could have come from the cache.E2E staging debateat the start, so a run killed before cleanup can't leave a Current Debate behind for the next run.finallycleanup still runs. Before this change a failure used up the whole test timeout.test.step. On failure it logsStaging step "<name>" failed at path <pathname>. It logs only the pathname, never the query or hash, which can carry auth handoff tokens.No assertion was removed or loosened. The source-removal check is stricter, because it now waits for the sources request before asserting the title is gone.
Docs:
docs/operations.mdrecords the real cause and adds an incident clue: run the staging suite locally before blaming staging.docs/testing.mddescribes the new suite steps, the required port, the failure output, and theerror-context.mdcaveat below.Staging sync (staging only,
brifeyypjauyusmkptkx)Production was not touched. I confirmed the ref before each command.
20261001100000_account_deletion_and_export.sql. The dry run listed exactly that file.--use-api:account(new, v1),voice(new, v1),workspace-invites(new, v1),adminv14→15,aiv19→20,ai-streamv20→21,create-checkoutv11→12,create-portalv11→12,export-gdocv11→12,import-sourcev12→13,redeem-promov10→11,sharev11→12.npm run backend:status -- --project-ref brifeyypjauyusmkptkx --checknow reports "Nothing pending" and exits 0.STRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRETandELEVENLABS_API_KEY. I didn't touch secrets.The CI demo code exists only in the GitHub
stagingenvironment. For the local runs I extended the expiry of an older staging test code ("Prompt evaluation PR42") by a few hours, and on 2026-10-03 by another 2 hours for the re-check (13 of 20 uses). I'll restore its originalexpires_at(2026-09-10 15:57 UTC) once the main run is green.Verification
Local runs against staging used
CI=1 PORT=18080and--project=staging --retries=0:Staging step "complete one AI request in Ask" failed at path /app/ask. Cleanup still ran, leaving 0 debates, sources, chats and current pointers for the test user;net::ERR_NETWORK_CHANGED/ERR_SOCKET_NOT_CONNECTED, while another worktree's Docker stack was starting. I left the assertion as it is and reran. Both runs left 0 debates, sources, chats and current pointers for the test user.GitHub Actions is blocked by billing. The
database-testsrerun was not started ("recent account payments have failed or your spending limit needs to be increased"). Its first attempt at 36aba00 ran and failed one test that this PR doesn't touch:[mobile-chromium] full-stack/first-run.spec.ts:79 [hu], where the motion dialog never opened after the tour's start button. That spec passed on main at 34d1573. Because of the billing block, here are the local results at 16b2f79 (Node 22). They are a local pass, not a CI pass:npm run verify: docs, lint, typecheck, unit with coverage, collaboration, edge (341 passed) and build all pass.test:swtimed out once while two browser suites shared the machine and passed on rerun. Browser E2E: 245 passed, 4 flaky, 1 failed (quality-backlog.spec.ts:20 [hu], a timeout). That spec then passed 12/12 alone with--retries=0. The desktop and mobile projects ignoree2e/staging/, so this PR's spec change can't reach them.After merging I'll dispatch
staging-e2e.ymlon main once Quality is green for the merge commit. That run is the CI proof; this PR's checks don't run the staging job.Proposal: redacted ARIA snapshot on failure (not implemented)
Playwright already writes an unredacted page ARIA snapshot to
test-results/**/error-context.mdon every failure, even with traces, screenshots and video off. It stays on the runner today because the workflow uploads nothing. It can include staging account text such as the test email, motions and chat content.If the step and path line isn't enough, a safe next step could print a redacted snapshot into the log: run
page.locator('main').ariaSnapshot(), keep only roles, test IDs, and the accessible names of buttons and links, and drop all text nodes, input values and anything that looks like an email. I'd hold off until a failure shows the step and path line isn't enough.🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Documentation