Mergestro

Inputs & troubleshooting

The GitHub Action's inputs, the subcommands, and fixes for the problems people actually hit. Every CLI flag and YAML key, and the JSON schemas, are in the configuration reference.

Action inputs

All optional. Inputs are strings in YAML, so quote numbers and booleans.

InputDefaultWhat it does
base-refthe PR's baseBranch to diff against.
advisoryfalseReport, never block.
max-survivors0Survivors tolerated before blocking; 0 means any survivor blocks.
block-on-severityunsetBlock when a survivor reaches a tier (low, medium, high, critical), whatever the count.
block-on-zero-assertionfalseAlso block on tests that assert nothing.
block-on-patternunsetGate a pattern lane (slop, security, convention, docs, weakened-tests, all) or a rule id. Comma-separated.
max-per-function5Mutants tested per function — the main cost lever.
jobs4Mutants tested in parallel. Raise on bigger runners.
timeout60Per-mutant test timeout, in seconds.
test-workspacefalseRun the whole workspace's tests per mutant, not only the changed crate's.
budgetunsetWall-clock limit on the mutation run (10m, 600, 90s).
block-on-budgetfalseBlock when the budget left mutants untested.
in-placefalseMutate the checkout so mutants reuse the existing build.
debt-budgetunsetPer-PR structural-debt budget: net complexity, duplication and coupling.
block-on-debtfalseBlock when the debt delta exceeds the budget.
commenttruePost the pull-request comment, updated in place.
comment-inlinefalseAlso post each survivor on its line (GitHub).
sarifunsetWrite the findings as SARIF 2.1.0 to this path.
upload-sariffalseUpload it to code scanning (needs security-events: write).
configunsetPath to a YAML config file; inputs override it.
metrics-fileunsetAppend a JSON-Lines record of the run, for slop-gate analyze.
versionslop-gate-v0.6.1Release of the prebuilt binary to install.
tokenGITHUB_TOKENToken that posts the comment.

Exit codes

CodeMeaning
0Passed, or ran advisory.
2Blocked by a threshold you set. The report says which.
1Operational failure. Never a verdict about your code.

Subcommands

Troubleshooting

Exit 2 — surviving mutations exceed the allowed count

The real signal: your suite passed over mutations of the lines you changed. Add the assertion the survivor points at (file, line and the exact mutation are listed), or raise max-survivors on purpose.

Exit 2 — the test suite was not green & stable

The pre-flight found the suite red or flaky, so survivors could not be trusted. Fix the red test. For a flaky one, --preflight-runs 2 catches the flip before any mutant runs.

Exit 1 — no merge-base, or a diff error

A shallow checkout: the base ref is not reachable. Check out with fetch-depth: 0. Outside pull-request events, set base-ref.

Exit 1 — cargo-mutants not found

cargo install cargo-mutants. The Action and the image already include it.

Exit 1 — mutants accounted for fewer than expected

The engine died part-way, usually from the Windows temp-path limit. Run on Linux, or in the Docker image.

Warning — could not post the PR comment

The token lacks pull-requests: write, or the run is not tied to a pull request. The verdict is unaffected.

Runs are too slow

Compiling and testing each mutant dominates. In order: cache the build (rust-cache + in-place), lower max-per-function, set a budget, then shard. Use slop-gate estimate to see the mutant count first.

Timed-out mutants

If your normal suite runs near the limit, raise timeout. Otherwise it is the engine correctly stopping a mutant that loops forever.

More symptoms, with causes and fixes, are in the operations guide.