# `mix juggernaut.triage`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/mix/tasks/juggernaut.triage.ex#L1)

Manages the committed triage file, `.juggernaut.triage.json`.

    mix juggernaut.triage ID --equivalent --reason TEXT
    mix juggernaut.triage --revoke ID
    mix juggernaut.triage --ack ID --as NAME
    mix juggernaut.triage --list

A claim names a mutant of the latest scored run, says why it is equivalent (no test
can tell it from the original), records who made it (`JUGGERNAUT_ACTOR`) and the hash
of the mutated function, and lapses when that function changes. A claim that applies
makes the mutant `equivalent`: not run and not scored. A claim on core code changes
nothing until a human acknowledges it with `--ack`; agents must never acknowledge, and
an `--as` name or `JUGGERNAUT_ACTOR` starting with `agent` is refused.

`--list` shows each claim with its state now: `applies`, `unacked` (core, waiting for
a human) or `lapsed` (its function changed).

## Options

  * `--equivalent` - Claim the mutant ID is equivalent (needs --reason).
  * `--reason TEXT` - Why the claim holds.
  * `--revoke ID` - Remove the claim on ID.
  * `--ack ID` - Acknowledge a core claim as a human (needs --as).
  * `--as NAME` - Who acknowledges.
  * `--list` - List the claims and whether each still applies.

## Exit codes

  * 0 - recorded or listed
  * 2 - unknown id, missing reason, an agent acknowledging, a malformed triage file, or
    another usage error

# `action`

```elixir
@spec action(keyword(), [String.t()]) ::
  {:ok, term()} | {:error, Juggernaut.Error.t()}
```

The one action asked for: `{:equivalent, id, reason}`, `{:revoke, id}`,
`{:ack, id, name}` or `:list`.

# `actor`

```elixir
@spec actor(map()) :: String.t() | nil
```

Who makes a claim: `JUGGERNAUT_ACTOR`, trimmed, or `nil` when unset or blank.

# `human`

```elixir
@spec human(String.t(), map()) :: :ok | {:error, Juggernaut.Error.t()}
```

`:ok` unless `name`, or `JUGGERNAUT_ACTOR` in `env`, names an agent (starts with
`agent`): an acknowledgement is a human's.

# `listing`

```elixir
@spec listing(Juggernaut.Triage.t(), Path.t()) :: [String.t()]
```

One line per claim of `triage`: its id, its state against the project at `root` now
(`Juggernaut.Triage.state/3`), its reason, who claimed it and who acknowledged it.

---

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