# `Threadline.Health.Policy`
[🔗](https://github.com/szTheory/threadline/blob/v1.2.0/lib/threadline/health/policy.ex#L1)

Validates `:expected_uncovered_tables` and `:audit_anyway` configuration
for `Threadline.Health.trigger_coverage/1`'s third bucket.

Adopters typically configure:

    config :threadline, :health,
      expected_uncovered_tables: ["oban_jobs", "oban_peers", "oban_producers"],
      audit_anyway: []

Validate at boot in `application.ex` to fail loud on bad config:

    Threadline.Health.Policy.validate!(Application.get_env(:threadline, :health, []))

Lazy validation at first poll tick is supported but discouraged in production —
a delay between release and first dashboard tick can hide config errors.

# `config`

```elixir
@type config() ::
  [config_opt()]
  | %{
      optional(:expected_uncovered_tables) =&gt; [String.t()],
      optional(:audit_anyway) =&gt; [String.t()]
    }
```

The keyword-list or map form accepted by `validate!/1`.

# `config_opt`

```elixir
@type config_opt() ::
  {:expected_uncovered_tables, [String.t()]} | {:audit_anyway, [String.t()]}
```

A health policy configuration entry containing a list of table names.

# `validate!`

```elixir
@spec validate!(config()) :: :ok
```

Returns `:ok` after validating `:expected_uncovered_tables` and `:audit_anyway`
config, or raises `ArgumentError` when the config is invalid.

Accepts a keyword list or a map, matching the dual-form intake used by
capture-time redaction validation.

Raises `ArgumentError` on:
- non-binary entries inside either list
- duplicate entries inside either list
- unknown top-level keys
- non-keyword / non-map input shape

---

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