# `Insider.Provenance`
[🔗](https://github.com/hiivemarkets/insider/blob/v0.1.0/lib/insider/provenance.ex#L1)

Bounded, portable provenance for incident evidence.

Provenance has five fixed components: code, configuration, dependencies,
runtime, and target. Callers describe each component as `{:available, map}`,
`{:unavailable, reason}`, or `{:redacted, policy_fingerprint}`. Available
attributes must already be safe to export; this module bounds and fingerprints
them but does not turn a digest into redaction.

`capture/1` collects stable, low-risk BEAM runtime and target facts. It never
shells out, reads the working tree, walks loaded applications, or captures
environment variables. Build systems may explicitly supply sanitized code,
dependency, and configuration facts.

# `component`

```elixir
@type component() :: map()
```

# `descriptor`

```elixir
@type descriptor() ::
  {:available, map()}
  | {:unavailable, unavailable_reason()}
  | {:redacted, String.t()}
```

# `t`

```elixir
@type t() :: %Insider.Provenance{
  components: %{required(String.t()) =&gt; component()},
  fingerprint: String.t(),
  schema: String.t()
}
```

# `unavailable_reason`

```elixir
@type unavailable_reason() ::
  :not_provided | :not_built | :not_supported | :collection_failed
```

# `canonical_binary`

```elixir
@spec canonical_binary(term()) ::
  {:ok, binary()} | {:error, Insider.Protocol.Error.t()}
```

# `capture`

```elixir
@spec capture(keyword()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

Captures stable public runtime and machine-class facts.

Omitted build-controlled components remain explicitly unavailable. Supplying
`:runtime` is intentionally unsupported here; use `new/1` for decoding,
fixtures, or another trusted collector.

# `decode_map`

```elixir
@spec decode_map(term()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, Insider.Protocol.Error.t()}
```

Constructs provenance from exactly one descriptor for every v1 component.

# `to_wire_map`

```elixir
@spec to_wire_map(t()) :: map()
```

---

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