leanest

Run only the tests your PR can actually affect.

Diffs your PR, judges each test's relevance in parallel, and runs the real subset through your existing runner.

real output, rdyrct #236
$ leanest select playwright --base origin/main

Changed:
  src/app/lib/api.ts
  src/app/lib/csv.ts
  src/worker/email-layout.ts
  src/worker/routes/admin.ts
  tests/e2e/admin-users-export.pw.ts

35 tests found

Selected 4 / 35 tests
  RUN tests/e2e/admin-users-export.pw.ts
  RUN tests/e2e/billing-truth.pw.ts
  RUN tests/e2e/downgrade.pw.ts
  RUN tests/e2e/privacy-and-email-abuse.pw.ts

Skipping 31 tests.
full suite
7m 25s
153 tests · 35 spec files
leanest-selected
1m 28s
7 tests · 3 spec files
this run
5.1× faster
26.5k Jev tokens, 1.6s

Measured on a real PR against rdyrct 's Playwright suite. A pure CI or config diff gives Jev no application code to reason about, so confidence drops and leanest runs closer to everything, on purpose. The number above is the representative case: a real feature change.

How it decides

Diff

git diff against your base branch. No API call yet, this step is free.

Discover

Finds your e2e specs by reading the framework's own config, not a guessed glob.

Judge

One semantic question per test, evaluated in parallel by Jev: could this diff affect it.

Decide

Low confidence always means run. A test whose own file changed always runs.

Run

Hands the selected paths to your real playwright or vitest, unmodified.

The CLI

One binary. It selects, then hands off to your real runner, so your reporter, retries and CI-required-check behavior stay exactly as they are.

commands
leanest playwright

Select, then actually run Playwright on the selection.

leanest vitest

Select, then actually run Vitest on the selection.

leanest select playwright

Show the selection only, run nothing.

leanest inspect playwright

Rank every test by relevance, for debugging.

options
--base <ref>

Base branch to diff against. Default main.

--dir <path>

Target directory. Default the current one.

--changed

Diff the working tree instead of a branch.

--json

Machine-readable output.

--shadow

Run the full suite, but log what would have been skipped.

--full

Skip selection, run everything.

bring your own key

Your key, your account, your data.

leanest has no server of its own. The CLI calls TypeSafe's Jev API directly with your TYPESAFE_API_KEY. Nothing routes through leanest's infrastructure, because there isn't any.

No key, an expired one, or a timeout all resolve the same way: leanest runs the full suite and prints why, instead of silently skipping coverage.

⚠ Jev unavailable (...), running the full suite.
set the secret once
gh secret set TYPESAFE_API_KEY --repo you/your-repo
reference it in the workflow
typesafe-api-key: ${{ secrets.TYPESAFE_API_KEY }}

GitHub does not expose repo secrets to workflows triggered from forked-repo pull requests by default, the same protection Codecov and similar tokens rely on.

Add it to your repo

Replace your existing "run e2e tests" step. Same reporter, same exit code, fewer tests executed.

.github/workflows/test.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0

- uses: baronunread/leanest@v1
  with:
    framework: playwright
    typesafe-api-key: ${{ secrets.TYPESAFE_API_KEY }}