--format agent (or JUGGERNAUT_FORMAT=agent) makes every task write one compact JSON document to stdout and nothing else there; progress and warnings go to stderr. It is meant for coding agents and scripts: everything needed to act on a survivor is in the document, and nothing is cut without saying so.

The document is format 1. Its keys keep the order shown here, and within format 1 a key is never renamed or removed; new keys may be added, so read the keys you need and ignore the rest. Strings are UTF-8 (invalid bytes are replaced with U+FFFD).

Exit codes

CodeMeaning
0The gate passed, or a read-only task succeeded.
1The gate failed, or the run is incomplete (--fail-fast, --budget or --max-mutants left mutants unrun).
2Usage or configuration error. Nothing was scored.
3Infrastructure or harness error. Never a verdict about your tests.

When several apply, the precedence is 2, then 3, then 1, then 0: a run with any harness error exits 3 even when mutants survived, and its survivors are still reported.

A run (mix juggernaut)

{
  "format": 1,
  "kind": "run",
  "summary": {
    "run_id": "20261123T150102Z-7f3a",
    "verdict": "fail",
    "exit_code": 1,
    "advisory": false,
    "lane": "gate",
    "scope": {"kind": "changed", "base": "main", "files": 3},
    "commit": "84d4297",
    "dirty": true,
    "seed": 412093,
    "counts": {"mutants": 412, "killed": 380, "survived": 9, "no_coverage": 1,
               "timeout": 2, "ignored": 18, "equivalent": 1, "compile_error": 1,
               "harness_error": 0, "pending": 0, "reused": 120, "integration_only": 3},
    "kill_kinds": {"assertion": 301, "exception": 70, "timeout": 2, "crash": 1, "boot": 8},
    "score": {"run": 97.4, "core": 100.0, "files": {"lib/my_app/client.ex": 83.8}},
    "thresholds": {"core": 100, "changed": 80, "per": "file"},
    "failures": [{"rule": "changed", "file": "lib/my_app/client.ex", "mutant_id": null,
                  "score": 78.0, "threshold": 80}],
    "new_ignores": [{"file": "lib/x.ex", "filter": ["integer:zero"], "line": 12,
                     "prefix": "juggernaut:ignore", "reason": "retry count"}],
    "triage_claims": [{"id": "Grant.check/2:relational:4be1c09", "core": true,
                       "acked": false, "state": "unacked", "reason": "...", "by": "agent:x"}],
    "weakening": [],
    "durations_ms": {"wall": 41230, "phases": {"plan": 210, "sync": 95, "compile": 3120,
                     "pool_boot": 2600, "probe": 9800, "mutants": 24900, "report": 60}},
    "reused": {"results": 120, "recorded_ms": 51200,
               "basis": "recorded durations of the reused results"},
    "recycles": 0
  },
  "survivors": [
    {
      "id": "Client.backoff/1:integer:0a91c3e",
      "status": "survived",
      "core": false,
      "file": "lib/my_app/client.ex",
      "line": 106,
      "column": 22,
      "function": "MyApp.Client.backoff/1",
      "operator": "integer",
      "variant": "pred",
      "diff": "@@ -106 +106 @@\n-    min(attempt, 10)\n+    min(attempt, 9)\n",
      "excerpt": {"start_line": 104, "lines": ["  defp backoff(attempt) do", "..."]},
      "selection": "tests",
      "selection_reason": null,
      "tests_ran": [{"id": "test/my_app/client_test.exs:88",
                     "name": "test backoff caps at a minute", "ms": 14, "passed": true}],
      "nearest_miss": {"test": "test/my_app/client_test.exs:88", "site_hits": 3},
      "suggested_test_file": "test/my_app/client_test.exs",
      "verify": "mix juggernaut.check 0a91c3e --format agent"
    }
  ],
  "not_scored": [],
  "integration_only": [],
  "page": {"page": 1, "per_page": 20, "total": 10, "more": 0, "next": null}
}

summary

  • verdict is pass, fail, incomplete or error, and exit_code the code the task exits with. advisory is true for the inner lane: a fast, partial check meant for the edit loop, not a gate (its exit codes are the same).
  • counts holds every status, plus reused (results taken from the cache) and integration_only (kills only an integration test made; they count in killed too).
  • kill_kinds splits the kills: assertion, exception, timeout, crash (the test process or the VM died) and boot (the application failed to start with the mutant).
  • score.files has the score of each file; failures lists every rule that failed. Each entry always has the five keys rule (core, changed, no_coverage or incomplete), file, mutant_id, score and threshold, with null where a key does not apply.
  • new_ignores are ignore comments that are new in this run, and triage_claims the equivalence claims that apply (state is applies, unacked or lapsed). Both are shown to the people who review the run: say so when you add one.
  • weakening lists tests weakened since a cached result's commit (kind, file, detail, commit); any finding invalidates the cached results of that commit.
  • durations_ms are the run's measured phase clocks. reused.recorded_ms is what the reused results took when they were recorded, not time measured in this run.

survivors

The survivors on this page: mutants that survived, those with no_coverage (no test reached them; tests_ran is empty) and, under timeouts: :survived, kills only by timeout ("status": "timeout"). Core mutants come first, then by file and line.

To kill one: read diff and excerpt (the function's source), look at tests_ran (the tests that ran with the mutant on and still passed) and nearest_miss (the test that executed the mutated code most often), and write a test in suggested_test_file that tells the two versions apart. Then run verify: exit 0 means the mutant is now killed.

selection says how the job's tests were chosen: tests (the tests that reach the mutated code), file, suite, warm_first, boot (a fresh boot of the app), reconfirm or none. selection_reason explains a selection other than tests.

not_scored, integration_only and page

  • not_scored lists every mutant that could not be judged (harness_error, compile_error, or pending: left unrun), each with id, status, file, line, function, operator and reason. It is never paged.
  • integration_only lists every mutant that only an integration test killed (id, core, file, line, function, operator, variant, killed_by): a change no unit test catches. It is never paged.
  • page: survivors come 20 to a page by default (--page, --per-page). When more is not 0, next is the command that prints the next page.

Other documents

Every task that offers --format agent writes the same envelope, {"format": 1, "kind": ...}:

TaskkindContents
mix juggernaut --dry-runplanthe mutants a run would make, by file and operator
mix juggernaut.check ID...checkexit_code and mutants: each mutant with its status, kill_kind, test_lane, killed_by, control, the tests that ran, duration_ms, verify, and survivor (whether the gate counts it as one)
mix juggernaut.explain IDexplainrun_id and mutant: the survivor object above plus key, kill_kind, test_lane, killed_by, duration_ms, reused_from, control, reason, ignore and triage
mix juggernaut.survivorssurvivorsa recorded run's survivors, grouped and paged
mix juggernaut.historyhistoryone entry per recorded run
mix juggernaut.profileprofilewhere a run's time went
mix juggernaut.comparecomparetwo runs, or a run and a report, mutant by mutant
mix juggernaut.adviseadvisemutants by category, test files that behave unlike their lane (misclassified), seams, warm-safe declarations, then next (commands an agent may run) and for_a_person (commands it must not)

Errors

A usage, configuration or infrastructure error is a document of its own, on stdout:

{"format": 1, "kind": "error", "exit_code": 2,
 "error": {"type": "config", "message": "...", "file": ".juggernaut.exs"}}

type is usage, config (both exit 2) or infrastructure (exit 3); any further keys of error are details, sorted by name.

The event stream

--stream writes one JSON object per line as the run goes. Each has v (1), event, run_id and t_ms (milliseconds since the run started) first. The events are run_started, phase_started, phase_finished, plan, reuse, worker, mutant, survivor (the full survivor object, after its mutant line), boot_lane, warning and run_finished. With --format agent the last line is a report event holding the agent document as document.

A loop for agents

  1. Set JUGGERNAUT_FORMAT=agent and JUGGERNAUT_ACTOR=agent:<name>.
  2. Run mix juggernaut --lane inner after an edit, or keep mix juggernaut --watch open.
  3. Read summary first, then each survivor, write the missing test, and run its verify command.
  4. Follow page.next until page.more is 0, and read not_scored.
  5. Run mix juggernaut.advise --format agent when runs are slow or survivors sit behind suite, file or boot selections.

Exit 3 is never a verdict about your tests: report it rather than change tests for it. Do not add ignore comments or triage claims to make a gate pass without saying so. mix juggernaut.install --agents writes these instructions into AGENTS.md and an agent skill.