Skip to content

[plan] Fix unstyled error report output in pkg/cli/compile_stats.go #39228

@github-actions

Description

@github-actions

Objective

Replace raw fmt.Fprintf(os.Stderr, ...) calls in pkg/cli/compile_stats.go with the console package formatting functions to fix inconsistent visual hierarchy in compile error reports.

Context

This issue was identified in discussion #39209 (Terminal Stylist analysis). The file already uses console.FormatErrorMessage() for some outputs but reverts to raw fmt.Fprintf calls for failure lists and recovery steps, creating inconsistent styling.

Current Problem (approx. 20 raw calls)

Examples of current raw calls:

// ❌ Current
fmt.Fprintf(os.Stderr, "  ✗ %s\n", filepath.Base(failure.Path))
fmt.Fprintf(os.Stderr, "  💡 Recovery plan:\n")
fmt.Fprintf(os.Stderr, "  %s %s:\n", prioritized.Severity.Icon(), heading)
fmt.Fprintf(os.Stderr, "    %d. %s\n", i+1, prioritized.Message)
fmt.Fprintf(os.Stderr, "       → %s\n", prioritized.Suggestion)
fmt.Fprintf(os.Stderr, "  i Suppressed %d cascading error(s)...\n", ...)
fmt.Fprintf(os.Stderr, "  Run 'gh aw compile --show-all'...\n", ...)

Approach

  1. Open pkg/cli/compile_stats.go and audit all fmt.Fprintf(os.Stderr, ...) and fmt.Fprintln(os.Stderr) calls.
  2. Replace failure/path lines with console.FormatErrorMessage() wrapped in fmt.Fprintln.
  3. Replace recovery plan headings with console.FormatInfoMessage() wrapped in fmt.Fprintln.
  4. Replace error detail lines (severity icon + heading, numbered messages, suggestions, suppressed count, show-all hint) with console.FormatInfoMessage() or console.FormatWarningMessage() as appropriate.
  5. Replace bare fmt.Fprintln(os.Stderr) blank-line separators — these can remain as-is or become fmt.Fprintln(os.Stderr, \"\").
  6. Run make fmt and make agent-report-progress before committing.

Files to Modify

  • pkg/cli/compile_stats.go

Acceptance Criteria

  • All fmt.Fprintf(os.Stderr, ...) calls in compile_stats.go that produce user-visible output use a console.Format* function
  • Visual hierarchy is consistent with surrounding console.FormatErrorMessage() calls
  • Existing tests pass (make agent-report-progress)
  • make fmt passes

Generated by 📋 Plan Command · 151.7 AIC · ⌖ 34.4 AIC · ⊞ 16.1K ·
Comment /plan to run again

  • expires on Jun 16, 2026, 7:11 AM UTC-08:00

Metadata

Metadata

Labels

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