Scoria.WarningInventory (scoria v0.1.0)

Copy Markdown View Source

Parses and classifies compiler warning output for maintainer inventory runs.

Inventory runs in capture mode (no WAE) so warnings can be measured even when the suite fails. Unclassified compile warnings should prompt registry updates.

Summary

Functions

Captures compile + test warning output for inventory and ratchet checks.

Classifies parsed warning maps with cluster, lane, and ratchet metadata.

Removes transient entries under test/tmp/ after ratchet capture (not the directory itself).

Summarizes classified rows by cluster id count.

Builds a stable dedupe key for inventory rows.

Ensures test/tmp/ is empty before warning inventory or ratchet capture runs.

Joins baseline owner/expiry metadata onto classified rows by surface name.

Returns lane ids associated with a file path.

Parses captured mix output into warning maps.

Maps cluster ids to Phase 67 ratchet ordering tiers.

Functions

capture_output()

@spec capture_output() :: String.t()

Captures compile + test warning output for inventory and ratchet checks.

Runs in capture mode (no WAE) so warnings can be measured even when the suite fails.

classify(warnings)

@spec classify([map()]) :: [map()]

Classifies parsed warning maps with cluster, lane, and ratchet metadata.

cleanup_transient_tmp!()

@spec cleanup_transient_tmp!() :: :ok

Removes transient entries under test/tmp/ after ratchet capture (not the directory itself).

cluster_counts(rows)

@spec cluster_counts([map()]) :: %{required(atom()) => non_neg_integer()}

Summarizes classified rows by cluster id count.

dedupe_key(map, cluster_id)

@spec dedupe_key(map(), atom()) :: {atom(), String.t(), String.t()}

Builds a stable dedupe key for inventory rows.

ensure_clean_tmp!()

@spec ensure_clean_tmp!() :: :ok

Ensures test/tmp/ is empty before warning inventory or ratchet capture runs.

join_baseline(rows, opts \\ [])

@spec join_baseline(
  [map()],
  keyword()
) :: [map()]

Joins baseline owner/expiry metadata onto classified rows by surface name.

lane_ids_for_file(file)

@spec lane_ids_for_file(String.t()) :: [atom()]

Returns lane ids associated with a file path.

parse_output(output)

@spec parse_output(String.t()) :: [map()]

Parses captured mix output into warning maps.

ratchet_tier(cluster_id)

@spec ratchet_tier(atom()) :: atom()

Maps cluster ids to Phase 67 ratchet ordering tiers.