Shows trigger coverage as reported by Threadline.Health.trigger_coverage/1,
with a three-section table (default) or JSON output (--json).
Unlike mix threadline.verify_coverage, this task is a viewer — it ALWAYS
exits 0, even when uncovered tables exist. Use mix threadline.verify_coverage
for the positive-list CI gate.
Usage
mix threadline.health.coverage
mix threadline.health.coverage --json
mix threadline.health.coverage --schema=NAMEDefault output: a three-section TABLE / STATUS / SOURCE table followed by
a Coverage: N covered, M uncovered, K expected uncovered summary line.
--json emits a JSON object with keys covered, expected_uncovered,
findings, schema, uncovered. The expected_uncovered value is a list of
{"table": ..., "source": "baseline" | "config"} objects so adopters can
filter via jq '.expected_uncovered[] | select(.source == "config")'.
findings is a list of Threadline.Health.trigger_findings/1 results, each
with keys code, severity, schema, table, message, details
(code and severity as strings). This key is additive: every other key
keeps its existing shape.
Default output also gains a FINDINGS section after the existing table,
with columns SEVERITY, CODE, TABLE, MESSAGE. This task always exits
0 regardless of what findings are present — it is a viewer, not a gate.
A malformed config :threadline, :trigger_capture stops the task with
Mix.raise/1 before any findings are checked.
--schema=NAME validates NAME at the edge (regex + pg_namespace lookup)
and raises with Mix.raise/1 on bad input. NAME must match
~r/\A[a-z_][a-z0-9_]{0,62}\z/ (PostgreSQL identifier, conservative subset)
AND exist in pg_namespace. Default "public".