# Safety rules and when everything runs

> The cases where trimtest runs the whole suite for a project instead of guessing which tests a change affects.

trimtest runs the whole suite (per project) instead of guessing when it cannot trace a change:

- **No baseline recorded yet.**
- **A full-run trigger changed:** a lockfile, a build config, or a file matched by `[full_run] extra`.
- **A tracked path git reports is not a source file trimtest parses:** a submodule bump, an ignored path.
- **`--strict` or `on_unobserved = "full"`** and a change that no test is known to reach.
- **A tracked file was deleted that no test is known to depend on.** It can still break the build, for example a
  Cargo `[[bench]]` target.

A project with no tests runs nothing.

## Always-run tests

- New tests and tests that failed last time always run, ahead of the rest.
- When a run is narrowed (`--project`, `--shard`) the failures from the parts you did not run are kept for next time.

## Unobserved changes

A changed file that nothing is known to depend on is reported as `unobserved`. By default that is a warning; set
`on_unobserved = "full"` (or pass `--strict`) to run everything instead. Under the default, such a change selects
nothing by itself, so it can under-select: `select --json` reports it as `uncertain`, and `select --exit-code`
exits `3` when nothing else is selected.

## Why it is built this way

A missed failure costs far more than a slightly larger test run. Every rule above favours running more. The
[soundness bench](/trust/soundness/) mutates real open-source projects to check that this holds.
