Pure policy for comparing Threadline.Health.trigger_coverage/1 output with
host-configured expected audited table names.
Intersection semantics: Only tables listed in expected_tables are
evaluated. Each must appear in the coverage list as {:covered, name}.
{:uncovered, name} for an expected name is a violation. If a name is not
present in the coverage list at all (e.g. typo or table outside the catalog
Health enumerates), that is reported as {:missing, name}.
An empty expected_tables list yields no violations; the Mix task fails
closed before invoking this module when the configured list is missing or empty.
Findings
partition_findings/2 sorts Threadline.Health.Finding structs into three
buckets so a CI gate can fail on the ones it is responsible for while still
surfacing everything else: :error findings on an expected table gate the
task, :error findings on a table the host never listed are informational
only, and :warning findings never fail the task regardless of table.
Summary
Functions
Partitions Threadline.Health.Finding structs into gated, not-gated and
warning buckets, given the host's expected-table positive list.
Counts expected tables vs how many are fully covered (no violation row).
Returns a sorted list of violations for tables the host expects to be covered.
Functions
@spec partition_findings([Threadline.Health.Finding.t()], [String.t()]) :: %{ gated: [Threadline.Health.Finding.t()], not_gated: [Threadline.Health.Finding.t()], warnings: [Threadline.Health.Finding.t()] }
Partitions Threadline.Health.Finding structs into gated, not-gated and
warning buckets, given the host's expected-table positive list.
:gated—:errorfindings whosetableis inexpected_tables. These are the findings a CI gate must fail on.:not_gated—:errorfindings whosetableis not inexpected_tables. Printed for visibility; never fails the task.:warnings— every:warningfinding, regardless of table.
Each bucket keeps the input list's order. Pure; does not read the database
or call Mix.raise.
Counts expected tables vs how many are fully covered (no violation row).
Returns a sorted list of violations for tables the host expects to be covered.
coverage is [{:covered | :uncovered, String.t()}] from
Threadline.Health.trigger_coverage/1. expected_tables is a list of
unique public table name strings.