Skip to content
EN · PT

anchors mutation

Run the mutation suites declared in anchors.yaml and ingest the reports.

Runs what the PROJECT declared in `mutation:` and ingests the report.
anchors mutation only the files stale and below the floor, and the never measured
anchors mutation --all every file, through run:
anchors mutation --budget 10m fastest first, one file per run, until the time is spent
anchors mutation unit unit only
anchors mutation unit --target x/y.ts fills {{target}} in the declared command
anchors mutation --changed x/y.ts INCREMENTAL: mutates the impact path
anchors mutation unit --then check on passing, charges the gates next
In incremental mode, {{files}} receives only the CODE nodes: mutation alters the rule, and mutating
the test would invert the experiment - the test is the measuring instrument, not the object.
Mutation answers what coverage does not: change the line — does the test notice? A
SURVIVING mutant is a line nobody proves.
Mind the `scope:`: with `isolated` and `full` both ingested, the gate judges by the
ISOLATED one, which is far harsher — it is the one that says whether the unit's test proves the unit,
instead of it being proven by the dependents.
Terminal window
anchors mutation [layers...] [flags]
Flag Default What it does
--all run every file of the suites through run:, whatever their state — the whole run, as before the state selection
--budget 0s run the files FASTEST FIRST, in batches through run_changed:, until this much time is spent (e.g. 60s, 10m); the rest is left for a later run. The order comes from the times recorded by earlier runs; files never timed go last
--changed INCREMENTAL mode: changed file(s) — runs the run_changed: over the union of the impact paths, the same slice as check --changed
--include-fresh also run files measured at the current version that are below the minimum (by default only STALE files below the minimum run)
--include-passing also run stale files at the minimum or above (by default only files BELOW the minimum run); with –include-fresh, fresh passing files too
--root . project root
--scope filters by the declared SCOPE (isolated, full) — only on mutation. Without this, runs whichever are declared
--skip-unmeasured leave out the files never measured (by default they run)
--target target that replaces {{target}} in the declared run: (e.g. the file to mutate)
--then on PASSING, chains Anchors commands: check, coverage (separate by comma). Opt-in — without this, it runs and stops
-w, --workspace filters by the declared WORKSPACE (backend, mobile…) — repeatable or comma-separated. Combines with the layers: anchors mutation unit -w backend

Commands of the same family — what tells each apart:

Command What it does
anchors map Operate the dependency map (anchors.graph.yaml)
anchors ingest Ingest test signals (JUnit/lcov) the project generated and bind them to the map
anchors test Run the test suites declared in anchors.yaml and ingest the reports
anchors mutation Run the mutation suites declared in anchors.yaml and ingest the reports
anchors keep-evidence Declare that a change proves nothing new, keeping the files’ evidence fresh
anchors stamp Write the missing @contract stamps on test doubles (never rewrites an existing one)
anchors recode Rename an identity code and propagate it across the project
anchors renumber Renumber the revisions this branch added when the base already took their number
anchors generated-paths The paths of DERIVED files — whoever conflicts in them rebuilds
anchors merge-progress Progress merge driver: unites both sides, [x] beats [ ]