Skip to content

test: agentic browser tests with TesterArmy e2e - #99

Merged
Programcode merged 9 commits into
mainfrom
feat/agentic-e2e
Oct 3, 2026
Merged

Programcode merged 9 commits into
mainfrom
feat/agentic-e2e

Conversation

@Programcode

@Programcode Programcode commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What this adds

An agentic browser suite in agentic/, built on TesterArmy's e2e runner (e2e@0.15.2) and run against the verify-debatelab stack. In each test an AI agent works toward a goal written in plain language (agent.act) and judges the screen (agent.assert). Exact locators and database reads then check the result.

It covers what the Playwright layers cannot:

  • Goal-level journeys that survive copy and layout changes. A new student starts their first debate from the onboarding tour, and a student starts a debate and generates a case. The recorded flows live in agentic/replay/ and replay with no model call until the UI changes.
  • Judgments a selector cannot make. Seven main pages must read fully in Hungarian, which the parity spec deliberately cannot check, and no label or button text may be clipped. Both run on desktop and on a 393 px viewport.
  • Explorations. verify.sh e2e explore "<goal>" --session student --agent <persona> sends a persona (first-timer, coach, edge-input or hungarian) through the app. It reports findings with reproduction steps, screenshots and a trace.

Bugs it found, fixed here

  • Four interface strings were missing from every catalog, so Spanish and Hungarian users saw English. They are the theme toggle label, the model selector's label and accessible name, and Sparring's "Speaking order". The accessible name also used the raw feature id, and now uses the translated tool name.
  • Brainstorm's output format said "Top 5 Legjobb Szög" in Hungarian, and the results heading said "Top 5 Érvelési Szög". CI's first agentic run caught the English "Top". Both now start "Az 5", like the export heading already did.
  • Mobile Settings scrolled sideways in Hungarian. A long email pushed Sign out 4 px past a 393 px screen. The email now wraps.
  • A scan for the same root cause found 88 more literal t() keys missing from every catalog, mostly in toasts, dialogs and Library folder actions. That work is a backlog plan, not part of this PR: plans/2026-10-02-missing-translation-keys.md.

How it runs

  • verify.sh e2e <run|explore|list|cache> runs doctor, loads the stack environment and the OpenRouter key, turns e2e telemetry off, and writes summary.md, report.json, traces and failure videos to .verify/artifacts/. The config refuses any non-loopback URL and never starts a dev server, because a plain npm run dev talks to production.
  • Each test signs in a fresh demo-code user through the real Login page and deletes it afterwards. A request to a hosted Supabase project fails the test, and so does a page wider than its viewport.
  • The testing agent uses two OpenRouter models, separate from the app's provider mode. Free qwen/qwen3.8-27b:free acts and meta/muse-spark-1.3-contributor judges. A full suite run costs under two cents. E2E_AGENT_MODEL and E2E_JUDGE_MODEL override them.
  • .github/workflows/agentic-e2e.yml runs the suite nightly at 03:47 UTC, on pull requests that change the suite, and on demand. A manual run can instead run one exploration with a chosen persona and viewport. It is not a required check, and it writes the report to the job summary.

Supporting changes

  • @playwright/test moves from 1.62 to 1.63, the version e2e's web engine requires, so both runners share one Playwright and one browser build.
  • The Playwright-free half of e2e/full-stack/stack.ts moved to stack-core.ts, and stack.ts re-exports it.
  • tsconfig.agentic.json is chained into npm run typecheck, because the e2e runner does not type-check.
  • The e2e agent skill is vendored at .claude/skills/e2e/ with DebateLab rules on top. Agents must go through verify.sh and must never add app.command.
  • Docs: a new "Agentic browser tests" section in docs/testing.md, plus updates to docs/development.md, the verify-debatelab skill, AGENTS.md and the plans index.

Verification

Final head 6aac107, which is 59bc164 merged with main (PRs #100, #101, #107). CI did not run on either head. GitHub stopped every job after 2 seconds with "recent account payments have failed or your spending limit needs to be increased". The local results below are the evidence, and none of them is a CI pass.

At 6aac107, run one after another so no two Playwright runs shared test-results/:

  • npm run verify:full passed. It covers docs, lint, typecheck, 265 unit tests in 24 files (after test: cut tests that can't catch a regression, fix the misbuilt ones #107's test cut), 30 collaboration tests, edge, build, service worker, the desktop @smoke set (29 passed), and the full desktop and mobile Playwright suite (237 passed, 5 skipped).
  • ./.superset/db-gate.sh passed with pgTAP 419 of 419 and full-stack Playwright 71 passed, 1 skipped.
  • The agentic suite passed 17 of 18 on both viewports on the first run. In the one failure, OpenRouter returned "[Meta] The requested model was not found" before the judge answered, and the runner exited with code 3 for infrastructure. verify.sh e2e run --last-failed then selected only that test, and it passed.

At 59bc164, before the merge: npm run verify passed (1228 unit tests and 249 Playwright tests, with 1 flaky in admin-announcements.spec.ts), the database gate passed, and the agentic suite passed 18 of 18. A Codex review of the whole branch at 59bc164 (gpt-6.1-sol, high effort) found nothing; the later merge brought in only main and two small conflict resolutions. An earlier Codex pass found that --last-failed could never find the previous report; ee533e6 fixes that.

The last CI run that executed was on ee533e6. Quality, browser tests, database tests and live E2E passed. Agentic E2E failed on the Hungarian Brainstorm copy fixed in 59bc164. The same run marked /app/settings flaky because the judge flagged the "Pro" plan badge; the judge prompt now lists model names and plan names as product names.

Earlier in the branch: the first npm run verify caught a real regression in authed-pages.spec.ts:58 (the translated tool name capitalized the English accessible name), fixed by the ModelSelector lowercase commit. Exploration as first-timer on desktop finished 4 of 4 steps with no findings for $0.003.

Known limits and decisions for Adam

  • Actor reliability. Free Qwen is slow, and its upstream rate-limits under load. Replayed steps never call it, but every exploration step does, so a long exploration can stop with temporarily rate-limited upstream. The Muse Spark judge cannot act, because Meta's endpoint only accepts tool_choice: "auto". The reliable paid actor is E2E_AGENT_MODEL=openai/gpt-6-luna, at cents per exploration.
  • Output language after sign-up. A student who picks Hungarian before signing up gets a Hungarian interface but English AI output. The signed-out reset in AuthProvider keeps the interface language and resets output language to English, and the existing first-run spec checks only the interface language. This PR leaves that alone because it is a product decision.
  • No phone emulation. e2e 0.15 only sizes the viewport. It has no touch or phone user agent, so the Playwright Pixel 5 project still owns mobile behavior.
  • Pre-1.0 dependency. e2e is pinned exactly. Its minor releases have broken APIs, and an engine minor bump re-records the replay cache.
  • Telemetry. e2e sends anonymous telemetry by default. The wrapper always sets E2E_TELEMETRY_DISABLED=1, but one event (command and versions, no content) went out from a bare npx e2e list during setup.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added agent-assisted end-to-end testing for desktop and mobile, including guided exploration and replay support.
    • Added automated checks for onboarding, debate case generation, and Hungarian-language screens.
    • Added a scheduled and on-demand workflow for running these checks and publishing test evidence.
  • Documentation

    • Added guides for setting up, writing, running, and troubleshooting end-to-end tests.
  • Bug Fixes

    • Improved translation and accessibility labels for model selection, sparring setup, and theme controls.
    • Improved the settings page layout for long account email addresses.

Programcode and others added 5 commits October 2, 2026 15:55
Adds an e2e suite in agentic/ that runs against the verify-debatelab
stack. An AI agent drives goals and judges screens, and exact locator
and database assertions pin the result. It covers what the Playwright
layers cannot: goal-level onboarding and case-generation journeys,
Hungarian copy and clipped-text judgments on every main page, and,
in live mode, whether a generated case is on topic. Explorations with
named personas hunt for bugs.

- verify.sh e2e <run|explore|list|cache> runs doctor, loads the stack
  env and the OpenRouter key, disables telemetry, and keeps evidence
- agentic-e2e.yml workflow: nightly, on suite changes, and on-demand
  exploration; not a required check
- Playwright moves to 1.63 (e2e's web engine peer) so both runners
  share one browser build
- the Playwright-free half of e2e/full-stack/stack.ts moves to
  stack-core.ts for reuse
- vendors the e2e agent skill with DebateLab rules on top

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The first agentic run judged every main page in Hungarian and found
English the parity spec cannot reject: the theme toggle's label, the
model selector's label and accessible name, and Sparring's "Speaking
order". Their keys were in no catalog, so every non-English user saw
the inline English fallback. The selector's accessible name now uses
the translated tool name instead of the raw feature id.

The same run caught mobile Settings scrolling sideways: a long email
pushed Sign out 4 px past a 393 px screen in Hungarian. The email now
wraps.

Also records the first replay entries, makes free Qwen the default
testing model with budgets that fit it, and adds a backlog plan for
the 88 other literal t() keys missing from every catalog.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Free Qwen stays the actor: its recorded flows replay without a model
call. As the judge it failed about a third of judgment-heavy tests on
rate limits, timeouts and false positives, so judgments now go to
meta/muse-spark-1.3-contributor (E2E_JUDGE_MODEL overrides it). A full
suite run costs about half a cent. The judge cannot act, because Meta
only accepts tool_choice "auto", so explorations keep the actor.

The Hungarian judgment now exempts language names offered as choices
and inflected English loanwords, and the context names MI as the
Hungarian AI abbreviation and ellipsis truncation as intended.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Translating the tool name capitalized it ("Factoids"), which changed the
English accessible name and broke the authed-pages spec that finds the
selector by "Select AI model for factoids".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An unset GitHub Actions variable reaches the job as an empty string, and
`??` kept it, so CI would have asked OpenRouter for model "". Also correct
the suite cost to the measured figure (under two cents).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 3, 2026 7:39am UTC
debatelab-staging Ready Ready Preview Oct 3, 2026 7:39am UTC

Copilot AI balanced review requested due to automatic review settings October 2, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Free
  • Run ID: e60aaf6a-2cc7-42d6-9bb6-6090437479a0
📥 Commits

Reviewing files that changed from the base of the PR and between ee533e6 and 6aac107.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • agentic/hungarian.e2e.ts
  • docs/testing.md
  • package.json
  • plans/README.md
  • src/locales/hu.json
 _______________________________________
< CI/CD: Code Inspection/Catch Defects. >
 ---------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 121e008e-7aff-40ee-9126-fe7745e6733b

📥 Commits

Reviewing files that changed from the base of the PR and between 34d1573 and ee533e6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (38)
  • .claude/skills/e2e/SKILL.md
  • .claude/skills/e2e/references/agent.md
  • .claude/skills/e2e/references/bug-bash.md
  • .claude/skills/e2e/references/debugging.md
  • .claude/skills/e2e/references/explore.md
  • .claude/skills/e2e/references/mcp.md
  • .claude/skills/e2e/references/running.md
  • .claude/skills/e2e/references/setup.md
  • .claude/skills/e2e/references/writing-tests.md
  • .claude/skills/verify-debatelab/SKILL.md
  • .claude/skills/verify-debatelab/bin/verify.sh
  • .github/workflows/agentic-e2e.yml
  • .gitignore
  • AGENTS.md
  • agentic/case-generation.e2e.ts
  • agentic/first-debate.e2e.ts
  • agentic/hungarian.e2e.ts
  • agentic/replay/185f3f3b58f5231404f8aece6743cb319e69c2bd78482e64b82cab4207b3f413.json
  • agentic/replay/b4819cfeff66096f89bd15a116b3d35d58a8b3bbea01d479ba86a4b32575157f.json
  • agentic/replay/c194c806fb663c3248e8b760c4857321ddf1b33facc8effb258d09fea6fcf918.json
  • agentic/replay/c7adcf13daafc4d7b7fdb639f07aee1d7a7d8028597c925bd41fdeff99dc3848.json
  • agentic/sessions.e2e.ts
  • agentic/support/fixtures.ts
  • docs/README.md
  • docs/development.md
  • docs/testing.md
  • e2e.config.ts
  • e2e/full-stack/stack-core.ts
  • e2e/full-stack/stack.ts
  • package.json
  • plans/2026-10-02-missing-translation-keys.md
  • plans/README.md
  • src/components/ModelSelector.tsx
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/hu.json
  • src/pages/SettingsPage.tsx
  • tsconfig.agentic.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds agentic E2E configuration, test fixtures and scenarios, verification and CI workflows, and usage guides. It also updates UI translations and settings layout, and adds a plan that inventories missing translation keys.

Changes

Agentic E2E Testing

Layer / File(s) Summary
E2E runtime and stack helpers
e2e.config.ts, e2e/full-stack/*, package.json, tsconfig.agentic.json
The E2E configuration defines local browser targets, agent models, test settings, and exploration personas. Stack helpers provide fake-provider controls and demo-user setup and cleanup. Package scripts and TypeScript checks include the agentic tests.
Student fixtures and sessions
agentic/support/fixtures.ts, agentic/sessions.e2e.ts
Shared fixtures create and clean up demo users, seed onboarding and language state, and check hosted Supabase requests and horizontal overflow. The student session setup signs in and saves a session.
Browser scenarios and replay records
agentic/*.e2e.ts, agentic/replay/*
The tests cover debate onboarding, case generation, and Hungarian interface text and layout across seven routes. Replay records cover desktop and mobile onboarding and case-generation flows.
Verification and CI execution
.claude/skills/verify-debatelab/bin/verify.sh, .github/workflows/agentic-e2e.yml, .gitignore, AGENTS.md, docs/README.md, docs/development.md, docs/testing.md
The verification script adds E2E commands, stack checks, model-key loading, and evidence output. The workflow runs the suite or an exploration, publishes summaries, stops the stack, and uploads artifacts. Project guidance covers the verification flow. .e2e/ is ignored; the testing-guide entry in docs/README.md is unchanged.
E2E operating and reference guides
.claude/skills/e2e/*, .claude/skills/verify-debatelab/SKILL.md
The guides document setup, test writing, agents, running, exploration, debugging, MCP, and bug bashes. The DebateLab verification guide documents E2E commands, model-key sources, replay behavior, evidence, sessions, and exploration findings.

UI Labels and Settings Layout

Layer / File(s) Summary
Translated labels and responsive account row
src/components/ModelSelector.tsx, src/locales/{en,es,hu}.json, src/pages/SettingsPage.tsx
The model selector uses a translated feature name for its accessible label. The locale catalogs add model-selection, sparring speaking-order, and theme-toggle labels. The settings account row allows email wrapping and prevents the Sign out button from shrinking.

Translation Backlog Plan

Layer / File(s) Summary
Missing translation keys inventory
plans/2026-10-02-missing-translation-keys.md, plans/README.md
The plan describes 88 literal keys identified as missing from catalogs, proposes verification steps, and lists the keys by file. The backlog index links to the plan.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant VerifyScript
  participant LocalStack
  participant E2ERunner
  participant DebateLabApp
  Developer->>VerifyScript: Run e2e run or e2e explore
  VerifyScript->>LocalStack: Check stack health and load environment
  VerifyScript->>E2ERunner: Start the selected E2E operation
  E2ERunner->>DebateLabApp: Run browser actions and assertions
  E2ERunner-->>VerifyScript: Return status and write evidence
Loading

Security Architecture Review

Security architecture risk: 🔵 Low · up to ee533

The new automated tests reuse an existing external-service credential and operate against a local test database. No new production privilege expansion was established, but approval rules, credential limits, and protections for retained test output remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated sensitive authority comprises the external model credential in the CI test process and service-role access to the local test database. The normal launcher derives database credentials from local Supabase status. Effective external-account quotas and credential permissions were not established.

Security Findings and Attack Paths

  • inferred — Where CI supplies the secret, a contributor able to execute modified repository code can read it despite read-only checkout permissions. This attack path already existed in the base live-test workflow for every pull request. The new workflow adds executions using the same credential, but the comparison does not establish increased independently attackable scope or authority.

Trust Boundaries and Controls

  • observed — The student fixture blocks browser requests to hosted supabase.co projects, and configuration restricts the initial application target to loopback. The server-side helper itself checks only that environment values are present before constructing its service-role client. That inherited behavior depends on the launcher for local database scoping; the browser route is not enforcement over server-side database calls.

Resilience and Maintainability Implications

  • observed — The existing reservation function atomically enforces disabled, expiry, and use-limit conditions. Subsequent account creation, role assignment, settings, and session handoff are separate operations without visible compensation on failure. These production transitions are unchanged; the new tests exercise them against temporary local accounts rather than introducing a new hosted transition.

Hardening Proposals

  • proposed — Consider a separately scoped, low-limit testing credential and an explicit approval boundary for secret-bearing revisions. Verify repository secret policies and retention or redaction protections before treating inherited CI exposure as fully contained.
  • proposed — Consider enforcing loopback database destinations inside the privileged shared helper and making deletion failures explicit. These would strengthen inherited safeguards, not remediate an established PR-introduced vulnerability.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Note

🎁 Summarized by CodeRabbit Free

Your 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 help to get the list of available commands.

e2e reads the previous failures from <output>/report.json, and every
wrapped run gets a fresh output directory, so the documented retry exited
NO_LAST_RUN. Seed the new directory with the latest run's report.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The Hungarian agentic test flagged "Top 5 Legjobb Szög" on /app/brainstorm.
Both Brainstorm labels now read "Az 5 ...", matching the export heading.
The judge prompt now names AI model names and plan names (Pro) as exempt
product names, since the model picker shows "Claude Sonnet 5" with a Pro badge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

# Conflicts:
#	docs/testing.md
#	package.json
@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request base or head changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Programcode
Programcode merged commit 292e7fd into main Oct 3, 2026
5 of 11 checks passed
@Programcode
Programcode deleted the feat/agentic-e2e branch October 3, 2026 08:07

This branch was successfully deployed

3 active (1 outdated) deployments
Preview – debate-navigator — 6aac1070 Deployed Oct 3, 2026 by vercel[bot]
Preview – debatelab-staging — 6aac1070 Deployed Oct 3, 2026 by vercel[bot]
Preview — 46781db7 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants