Description
The pkg/console package exposes Format* styled-output functions but no Print* wrappers, so every caller re-implements fmt.Fprintln(os.Stderr, console.Format*(...)) by hand. The Repository Quality report (discussion #47087) profiled 1,640 two-step calls, 94 Fprintf variants, and 239 raw fmt.Fprintf(os.Stderr, ...) calls that bypass styling entirely. Add thin Print* helpers (mirroring each Format*) that write to os.Stderr internally, then migrate the two worst files: pkg/cli/mcp_inspect_mcp.go (70 raw calls) and pkg/cli/engine_secrets.go (63 raw calls).
Expected Impact
Removes the stdout/stderr mis-routing footgun, centralizes newline handling, and creates a single interception point for testing/WASM/observability. A follow-up linter can lock it in permanently.
Suggested Agent
Code Simplifier / File Diet agent (Copilot).
Estimated Effort
Medium (1-4 hours) — wrappers are trivial; scope migration to the 2 worst files.
Data Source
DeepReport analysis 2026-07-21; discussion #47087.
Generated by 🔬 Deep Report · age00 200.9 AIC · ⌖ 17.2 AIC · ⊞ 9.9K · ◷
Description
The
pkg/consolepackage exposesFormat*styled-output functions but noPrint*wrappers, so every caller re-implementsfmt.Fprintln(os.Stderr, console.Format*(...))by hand. The Repository Quality report (discussion #47087) profiled 1,640 two-step calls, 94Fprintfvariants, and 239 rawfmt.Fprintf(os.Stderr, ...)calls that bypass styling entirely. Add thinPrint*helpers (mirroring eachFormat*) that write toos.Stderrinternally, then migrate the two worst files:pkg/cli/mcp_inspect_mcp.go(70 raw calls) andpkg/cli/engine_secrets.go(63 raw calls).Expected Impact
Removes the stdout/stderr mis-routing footgun, centralizes newline handling, and creates a single interception point for testing/WASM/observability. A follow-up linter can lock it in permanently.
Suggested Agent
Code Simplifier / File Diet agent (Copilot).
Estimated Effort
Medium (1-4 hours) — wrappers are trivial; scope migration to the 2 worst files.
Data Source
DeepReport analysis 2026-07-21; discussion #47087.