Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ bun run lint:fix # Auto-fix lint issues
bun run fmt # Format check with oxfmt
bun run fmt:fix # Auto-fix formatting
bun run test:unit # Vitest unit tests
bun run test:e2e # Cypress E2E tests
bun run test:e2e # Cypress smoke suite, the default local check
bun run test:e2e:full # Full Cypress suite, normally covered by CI
```

## Monorepo Structure
Expand Down Expand Up @@ -112,10 +113,10 @@ See [Testing](./docs/testing.md) for full requirements, quality standards, and p

### E2E Runtime and PR Workflow

- Prefer focused Cypress specs while iterating, and create the draft PR before starting a full local E2E run so CI and review setup can proceed in parallel.
- A warm local `bun run test:e2e` typically takes about **4–6 minutes** because the component and integration suites run sequentially on one machine; cold dependency/browser setup can take longer.
- GitHub Actions is usually faster in wall-clock time: integration specs run across **four shards per browser** for Chrome and Firefox (eight parallel E2E jobs), while component tests run in a separate job. Recent successful workflows complete in roughly **3–5 minutes**.
- Local targeted tests remain the fastest feedback loop. The sharded GitHub run is the authoritative broad browser check; do not spend time emulating all CI shards serially before opening the PR.
- Prefer `bun run test:e2e` while iterating. It runs the local smoke suite and avoids blocking development on the full browser matrix.
- Use `bun run test:e2e:full` only when a local full-suite run is useful. The merge gate runs the full suite in GitHub Actions.
- A warm local full E2E run typically takes about **4–6 minutes** because the component and integration suites run sequentially on one machine; cold dependency/browser setup can take longer.
- GitHub Actions runs integration specs across **four shards per browser** for Chrome and Firefox (eight parallel E2E jobs), while component tests run in a separate job. Recent successful workflows complete in roughly **3–5 minutes**.

## Analytics Requirement

Expand Down Expand Up @@ -296,7 +297,7 @@ Detailed design rationale (the "why" and "how", not the "what") lives in [docs/]
Three jobs: a lightweight Haiku **`route`** classifier runs on any `@claude` mention in an issue/comment and emits a `profile`; its output gates **`implement`** or **`review`**. (The `review` job also triggers directly on PR open/sync, with no comment to route.)

- `@claude <anything>` — `route` picks a **profile** (`ui` / `code` / `docs` / `question` / `review`) and, for implement profiles, a browser (`playwright` / `chrome` / `none`).
- **implement** job (`ui` / `code` / `docs` / `question`): provisions only what's needed — dev server, Playwright browser, and Cypress binary install **on demand** only for browser/UI work, so docs/DB/backend/question tasks stay fast. `ui` gets full browser verification (render real data, check the `?unofficialrun=` overlay, add `track()` + tests, pass `bun run test:e2e`); the rest get scoped checks. Creates `claude/issue-{N}-*` branches and can push.
- **implement** job (`ui` / `code` / `docs` / `question`): provisions only what's needed — dev server, Playwright browser, and Cypress binary install **on demand** only for browser/UI work, so docs/DB/backend/question tasks stay fast. `ui` gets focused browser verification plus the `?unofficialrun=` overlay, then passes `bun run test:e2e`; the full suite remains covered by the merge checks. Creates `claude/issue-{N}-*` branches and can push.
- **review** job (`review` profile, or any PR open/sync): a **read-only**, **verifying** review. It checks out the PR head, starts a local dev server backed by the real read-only DB, and uses the **Playwright MCP** on `http://localhost:3000` to confirm the changed UI actually works (renders real data, interactions behave, no console errors). It does **not** re-run the test suite — `typecheck`/`lint`/`test:unit` and the fixtures-based e2e are already covered by the dedicated `tests-*`/`lint` workflows; the review reads their status and folds failures into the review as 🔴 BLOCKING — plus the static diff review (bugs, security, missing tests). Never edits or pushes. A review-phrased ask in **any** wording (e.g. "@claude take a look at this PR") routes here, not just the exact `@claude review`. Prompt: `.github/claude/review-prompt.md`.
- **Explicit overrides** (skip the classifier): `@claude review` → review; `@claude chrome` → Chrome DevTools MCP; `@claude frontend` → full Playwright + dev server; `@claude general` (or `lite`) → lean no-browser. If the router guesses wrong, re-run with the override.
- `implement` and `review` share a `claude-<PR/issue number>` concurrency group, so reviews and implementation on the same PR serialize instead of clobbering each other.
Expand Down
2 changes: 1 addition & 1 deletion docs/adding-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ From the model name, derive (MiniMax M3 shown as the worked example):

### Verify

`bun run typecheck && bun run lint && bun run fmt && bun run test:unit`, then `rg` for the old slug to confirm only the intentional hidden preset + blog links remain. Final gate: `bun run test:e2e` and a manual `bun run dev` check that the banner/modal/preset read `DISPLAY` and `/inference?preset=SLUG-launch` renders data.
`bun run typecheck && bun run lint && bun run fmt && bun run test:unit`, then `rg` for the old slug to confirm only the intentional hidden preset + blog links remain. Final gate: `bun run test:e2e:full` and a manual `bun run dev` check that the banner/modal/preset read `DISPLAY` and `/inference?preset=SLUG-launch` renders data.

---

Expand Down
6 changes: 3 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Enforced by `@pr-claude` — missing/low-quality tests are flagged 🔴 BLOCKING
1. New utility functions → colocated unit test
2. New UI features → E2E test in `cypress/e2e/<feature>.cy.ts`
3. Bug fixes → regression test reproducing the bug
4. Run `bun run test:unit` and `bun run test:e2e` before considering task complete
4. Run `bun run test:unit` and the local smoke suite, `bun run test:e2e`, before considering a task complete. The full E2E suite runs in CI and is available locally as `bun run test:e2e:full`.

## Pre-commit Checklist

Expand All @@ -25,9 +25,9 @@ bun run test:e2e

## Runtime and CI Sharding

A warm local `bun run test:e2e` typically takes about **4–6 minutes** because Cypress component tests and integration tests run sequentially on one machine. Cold dependency or browser setup can take longer, so use focused `--spec` runs while iterating and open the draft PR before starting the full local suite.
The local `bun run test:e2e` command is a smoke suite with 83 Cypress tests across the core page, chart, overlay, localization, and component paths. It is the default agent and developer check and is intended to stay under one minute once the app is running.

GitHub Actions runs integration specs across **four shards per browser** for Chrome and Firefox, for eight parallel E2E jobs, with component tests in a separate job. Recent successful workflows finish in roughly **3–5 minutes** wall-clock. The sharded CI run is the authoritative broad browser check and is substantially faster than reproducing both browsers and every shard serially on a local machine.
The complete suite is `bun run test:e2e:full`. It runs all Cypress component and integration specs. GitHub Actions runs that same coverage as one component job plus four integration shards per browser, Chrome and Firefox. The CI workflow is the merge gate for the full E2E suite.

## Quality Standards

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"fmt:fix": "oxfmt --write --no-error-on-unmatched-pattern",
"test": "bun run --cwd packages/app test",
"test:e2e": "bun run --cwd packages/app test:e2e",
"test:e2e:full": "bun run --cwd packages/app test:e2e:full",
"test:e2e:component": "bun run --cwd packages/app test:e2e:component",
"test:e2e:integration": "bun run --cwd packages/app test:e2e:integration",
"test:unit": "bun scripts/run-workspace-script.ts test:unit",
Expand Down
8 changes: 6 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
"build": "bun --env-file=../../.env next build --turbopack",
"start": "bun --env-file=../../.env next start",
"preview": "bun run build && bun run start --port 3001",
"test": "bun run test:unit && bun run test:e2e",
"test:e2e": "cypress run --component && cypress run",
"test": "bun run test:unit && bun run test:e2e:full",
"test:e2e": "bun run test:e2e:quick",
"test:e2e:quick": "bun run test:e2e:quick:component && bun run test:e2e:quick:integration",
"test:e2e:quick:component": "cypress run --component --spec cypress/component/chart-buttons.cy.tsx,cypress/component/scatter-graph.cy.tsx",
"test:e2e:quick:integration": "cypress run --spec cypress/e2e/sanity.cy.ts,cypress/e2e/inference-chart.cy.ts,cypress/e2e/evaluation-chart.cy.ts,cypress/e2e/reliability-chart.cy.ts,cypress/e2e/zh-pages.cy.ts,cypress/e2e/csv-export-overlay.cy.ts,cypress/e2e/overlay-optimal-only.cy.ts",
"test:e2e:full": "cypress run --component && cypress run",
"test:e2e:component": "cypress run --component",
"test:e2e:integration": "cypress run",
"test:unit": "bun --env-file=../../.env vitest run",
Expand Down