Skip to content

[deep-report] Migrate CLI diagnostic fmt.Println calls to stderr via console.FormatErrorMessage / FormatInfoMessage #33792

@github-actions

Description

@github-actions

Context

The 2026-05-21 Repository Quality report (discussion #33768) found:

  • 1,844 raw fmt.Errorf calls vs only 70 uses of console.FormatErrorMessage (3.8 % adoption).
  • 64 fmt.Println calls in CLI commands that emit diagnostic output to stdout — violating the Unix convention that diagnostics belong on stderr and breaking pipe-able workflows.

Files flagged with the worst offenders:

  • pkg/cli/audit_cross_run_render.go — 13+ diagnostic fmt.Printlns.
  • pkg/cli/compile_stats.go — recovery-plan output to stdout.
  • pkg/cli/domains_command.go — status messages to stdout.
  • pkg/cli/forecast.go — analysis output to stdout (1,142-line file).

Guidelines already exist in .github/skills/error-messages/SKILL.md; the infrastructure (pkg/console/) is in place — adoption is the gap.

Quick-win task

For each of the 4 files above:

  1. Convert diagnostic fmt.Println("...")fmt.Fprintln(os.Stderr, console.FormatInfoMessage("...")) (or FormatErrorMessage / FormatWarningMessage as appropriate).
  2. Keep structured / final-output prints on stdout (e.g. JSON, hash output, expected report body).
  3. Add a single-line CI grep guard: pkg/cli/.*\.go files with bare fmt.Println( should be reviewed.

Success criteria

  • Diagnostic fmt.Println count in pkg/cli/ drops from ~64 to ~0 outside intentional stdout writers (e.g. hash_command.go).
  • gh aw compile ... | jq ... style pipes work cleanly with no diagnostic noise mixed into stdout.

References

  • Source report: discussion #33768
  • Skill guidelines: .github/skills/error-messages/SKILL.md
  • Estimated effort: 2-3h

Generated by 🔬 DeepReport - Intelligence Gathering Agent · ● 17.9M ·

  • expires on May 23, 2026, 4:03 PM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions