Skip to main content
AI Select reads a git diff and runs a focused set of Momentic tests that covers the changed behavior. Use it in pull request CI when running every test would take too long.
AI Select is in alpha and may change. Contact us to join the waitlist.

Run selected tests

Run AI Select from the root of your git repository:
In supported CI providers, Momentic detects the pull request base ref. Use --ai-select-base when you need to set it explicitly:
Tests added, renamed, or edited in the diff are always included. If AI Select cannot build a safe selection, it runs the full in-scope test set instead.

How selection works

AI Select combines three sources of evidence:
  1. The git diff identifies the code and behavior that changed.
  2. A local code index traces imports and downstream consumers in your repository.
  3. The App Graph connects product journeys and UI states to the tests that exercised them in real runs.
The App Graph provides runtime relationships that static imports cannot express, such as a backend change surfacing in a browser flow. Selection quality improves as the graph observes more of your application and test suite. Build-graph systems such as Bazel are effective at selecting work within a declared dependency graph. Applying that approach to end-to-end tests requires teams to manually define and maintain the relationship between build targets, services, and tests. Code imports also stop at network and product boundaries: they do not show that a frontend journey depends on an API, queue, data store, or third-party integration. App Graph adds those observed runtime relationships without requiring every cross-system dependency to be orchestrated by hand. The test budget is a soft cap. AI Select can exceed it when more tests are needed to cover distinct changed behavior.

Use the code index in GitHub Actions

Check out full git history and install the code-index parsers before running AI Select:
See the complete GitHub Actions example for setup, code-index caching, standalone selection output, test execution, and result uploads.

Preview a selection

Use shadow mode to compare a selection with the full test run before using it to gate pull requests. Momentic still runs every in-scope test and records which ones AI Select would have skipped.
To inspect a selection without running tests, use momentic ai select:
In GNU/Linux CI, pipe the JSON selection through jq when you want to inspect or transform it before running the selected paths:
Use momentic run --ai-select when you do not need to customize the handoff; it performs selection and execution in one command.

Benchmark

The benchmark uses real code changes across frontend, backend, CLI, shared-library, configuration, and non-behavioral scenarios. The GPT-5.5 Codex baseline receives the same changes and candidate test files as AI Select, but does not use the App Graph or AI Select’s investigation workflow. We can share the raw results and reproduction harness on request.

Notes

  • AI Select needs enough git history to resolve the base ref. Use fetch-depth: 0 with actions/checkout.
  • The code index currently analyzes TypeScript and JavaScript imports. App Graph evidence can still connect behavior across other boundaries.
  • A budget limits selection size, not safety behavior. Edited tests are still included, and AI Select can fall back to running all tests.