# `Juggernaut.View.Explain`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/view/explain.ex#L1)

One mutant of a run in full (`mix juggernaut.explain`, see the
[agent output guide](agent-output.md)): where it is, what changed (diff and source
excerpt), its status and kill kind, the test that killed it (`file:line`) or the tests
that ran and passed, why those tests were selected, the nearest miss, any ignore
comment or triage claim, where a reused result came from, the control rerun and its
duration.

The agent document is `{"format": 1, "kind": "explain", "run_id": ..., "mutant": ...}`
where `mutant` is the agent survivor object (`Juggernaut.View.Agent.survivor/4`)
followed by the keys only an explanation has: `key`, `kill_kind`, `test_lane`, `killed_by`,
`duration_ms`, `reused_from`, `control`, `reason`, `ignore` and `triage`.

Options: see `Juggernaut.View`.

# `document`

```elixir
@spec document(
  Juggernaut.Run.t(),
  Juggernaut.Mutant.t(),
  keyword() | Juggernaut.View.options()
) ::
  Jason.OrderedObject.t()
```

The agent document (`kind: explain`).

# `render`

```elixir
@spec render(
  :human | :agent,
  Juggernaut.Run.t(),
  Juggernaut.Mutant.t(),
  keyword() | Juggernaut.View.options()
) :: iodata()
```

`mutant` of `run` in `format` (`:human` or `:agent`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
