mix juggernaut.triage (Juggernaut v0.4.0)

Copy Markdown View Source

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

Summary

Functions

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

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

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

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.

Functions

action(opts, args)

@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(env)

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

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

human(name, env)

@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(triage, root)

@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.