Skip to main content

Module reporter

Module reporter 

Source
Expand description

Console output + JSON reports.

Report guarantees:

  • files[] is sorted by path, so audits are reproducible run to run.
  • Each mode serializes exactly its own summary fields via an untagged enum (scan distribution, convert/fetch counters, verify gate).

§JSON report schema (summary)

Top level: tool, version, mode, root (tree modes) or url (fetch), started_at, duration_ms, options, summary, files[], unknown_files, error_files, and the omit-when-empty warnings, verify_failed_files. The summary shape depends on mode (scan: encoding buckets; convert/fetch and fix: outcome counters; verify: gate counts). Every field of FileRecord, OptionsBlock, the four summary structs, and Report itself documents its JSON name; all of them implement both Serialize and Deserialize, so downstream tools can read reports back without hand-written mirrors. Report’s Deserialize dispatches on mode — the per-mode summaries share field names, so parsing a report requires knowing its mode.

Per-file action vocabulary (open set across versions — new actions may appear): FILE_ACTIONS.

Structs§

ConsoleCfg
Console verbosity settings.
ConvertSummary
convert / fetch summary.
FileRecord
A single processed file in the report.
FixSummary
fix summary: convert counters plus the verify gate result on the same tree. fetch_error is impossible in fix mode and is omitted.
OptionsBlock
Effective CLI options snapshot, embedded in every JSON report.
Report
Full JSON report document.
ScanSummary
scan summary: per-encoding distribution counts.
VerifySummary
verify summary.

Enums§

Summary
Mode-specific summary, serialized inline (untagged).

Constants§

FILE_ACTIONS
Every per-file action the tool currently emits. New actions may appear in future versions (treat the list as an open set); unknown actions in a parsed report are not an error.

Functions§

print_header
Print the mode header line.
print_problem
Print a per-file problem line (stderr, always shown).
print_verbose
Print a per-file verbose line (stdout, -v only).
rfc3339_from_secs
Format a unix timestamp as RFC 3339 UTC (1970-01-01T00:00:00Z style). chrono is deliberately not a dependency; the civil-from-days algorithm is well-known and unit-tested.
rfc3339_now
Current wall-clock time as RFC 3339 UTC.
write_report
Serialize the report and write it next to a trailing newline.