Sigra.Install.Report (Sigra v1.20.0)

Copy Markdown View Source

Record-as-you-go accumulator for installer decisions, rendered as a 4-column post-install summary (GEN-05).

The walker threads a Report through every run_feature/3 call and every file write, injection, and skip flows through one of the record_* functions. At the end of the walk, render_summary/1 emits a stable 4-column table.

This replaces the ad-hoc Mix.shell().info([:yellow, "* skipping ", ...]) inline prints scattered through lib/mix/tasks/sigra.install.ex.

Summary

Functions

Renders the 4-column summary table as iodata. Column order is Generated | Modified | Skipped | Manual Action. Entries within a column are sorted alphabetically so snapshot tests are stable.

Types

skipped_entry()

@type skipped_entry() :: %{path: Path.t(), reason: String.t()}

t()

@type t() :: %Sigra.Install.Report{
  generated: [Path.t()],
  manual_actions: [String.t()],
  modified: [Path.t()],
  skipped: [skipped_entry()]
}

Functions

new()

@spec new() :: t()

record_generated(r, path)

@spec record_generated(t(), Path.t()) :: t()

record_manual_action(r, instruction)

@spec record_manual_action(t(), String.t()) :: t()

record_modified(r, path)

@spec record_modified(t(), Path.t()) :: t()

record_skipped(r, path, reason)

@spec record_skipped(t(), Path.t(), String.t()) :: t()

render_summary(r)

@spec render_summary(t()) :: iodata()

Renders the 4-column summary table as iodata. Column order is Generated | Modified | Skipped | Manual Action. Entries within a column are sorted alphabetically so snapshot tests are stable.

Column widths are padded to the maximum of (header width, longest entry in that column) so long paths don't break alignment. An empty report still emits a valid header row.