# `Juggernaut.Run`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/run.ex#L1)

One mutation run: what was asked, where, by whom, and what happened (design notes §14.1).

`id` is `YYYYMMDDTHHMMSSZ-<4 hex>` (UTC), so ids sort by start time. `actor` is
`JUGGERNAUT_ACTOR` (trimmed; `nil` when unset or blank): who or what started the run,
for example `holsee` or `agent:builder-3`. `results` is keyed by mutant id.
`elixir` and `otp` are the versions the controller ran on. `boot_lane` is what the run
did with its boot set (`nil` without one): `boot_set` mutants, `warm_tried` of them run
first on a warm worker, `warm_killed` killed there (each then a strike in the boot lane,
never a verdict), `warm_ms` the job time those warm attempts took, `boot_lane` mutants
run in the boot lane, `strike_killed` of them killed by a test of their strike, at
`concurrency` at once for `reason`. `warm` holds, by mutant id, each warm attempt that
was killed or survived (`status`) and the hash of the mutated function the run saw
(`hash`): with the boot lane's result for the same mutant, the evidence a warm-safe
declaration rests on (`Juggernaut.WarmSafe.pairs/2`).

# `boot_lane`

```elixir
@type boot_lane() :: %{
  boot_set: non_neg_integer(),
  warm_tried: non_neg_integer(),
  warm_killed: non_neg_integer(),
  warm_ms: non_neg_integer(),
  boot_lane: non_neg_integer(),
  strike_killed: non_neg_integer(),
  concurrency: non_neg_integer(),
  reason: String.t(),
  warm: %{
    required(String.t()) =&gt; %{status: :killed | :survived, hash: String.t()}
  }
}
```

# `lane`

```elixir
@type lane() :: :inner | :gate | :release
```

# `scope`

```elixir
@type scope() :: %{
  kind: :changed | :since | :files | :full,
  ref: String.t() | nil,
  files: [String.t()]
}
```

# `t`

```elixir
@type t() :: %Juggernaut.Run{
  actor: String.t() | nil,
  argv: [String.t()],
  boot_lane: boot_lane() | nil,
  commit: String.t() | nil,
  config_fingerprint: String.t() | nil,
  dirty?: boolean(),
  dirty_hash: String.t() | nil,
  elixir: String.t(),
  finished_at: DateTime.t() | nil,
  format: 1,
  id: String.t(),
  lane: lane(),
  mutants: [Juggernaut.Mutant.t()],
  otp: String.t(),
  phases: [Juggernaut.Phase.t()],
  recycles: [%{worker: term(), reason: String.t()}],
  results: %{required(String.t()) =&gt; Juggernaut.Result.t()},
  scope: scope(),
  seed: non_neg_integer() | nil,
  started_at: DateTime.t(),
  summary: Juggernaut.Summary.t() | nil,
  version: String.t(),
  workers: pos_integer() | nil
}
```

# `actor`

```elixir
@spec actor(%{required(String.t()) =&gt; String.t()}) :: String.t() | nil
```

The actor from `JUGGERNAUT_ACTOR`, trimmed; `nil` when unset or blank.

# `format`

```elixir
@spec format() :: 1
```

The run file format version.

# `lanes`

```elixir
@spec lanes() :: [lane()]
```

Every lane.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Starts a run record. Required: `:lane` and `:scope`. Optional: `:started_at` (default
now, UTC, millisecond precision), `:env` (default `System.get_env/0`, read for the
actor), and any other field of the struct.

# `new_id`

```elixir
@spec new_id(DateTime.t(), binary()) :: String.t()
```

A run id for a start time and at least two random bytes.

# `scope_kinds`

```elixir
@spec scope_kinds() :: [atom()]
```

Every scope kind.

---

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