Objective
Split pkg/cli/logs_report.go (1,065 lines) into section-focused files.
Context
Discussion: #26221
This file contains 15+ independent builder functions, each constructing a completely separate section of the logs report. These functions share no state and can be cleanly separated.
Approach
Move builder functions to dedicated files:
logs_report_tools.go — buildToolUsageSummary, isValidToolName
logs_report_mcp.go — buildMCPFailuresSummary, buildMCPToolUsageSummary
logs_report_firewall.go — buildFirewallLogSummary, buildRedactedDomainsSummary, buildAccessLogSummary, aggregateDomainStats, convertDomainsToSortedSlices
logs_report_errors.go — buildCombinedErrorsSummary, buildMissingToolsSummary, buildMissingDataSummary
- Keep top-level
buildLogsData, renderLogsConsole, renderLogsJSON, writeSummaryFile, and helper types in logs_report.go
Files to Modify
- Split:
pkg/cli/logs_report.go
- Create:
pkg/cli/logs_report_tools.go
- Create:
pkg/cli/logs_report_mcp.go
- Create:
pkg/cli/logs_report_firewall.go
- Create:
pkg/cli/logs_report_errors.go
Acceptance Criteria
Generated by Plan Command for issue #discussion #26221 · ● 150.1K · ◷
Objective
Split
pkg/cli/logs_report.go(1,065 lines) into section-focused files.Context
Discussion: #26221
This file contains 15+ independent builder functions, each constructing a completely separate section of the logs report. These functions share no state and can be cleanly separated.
Approach
Move builder functions to dedicated files:
logs_report_tools.go—buildToolUsageSummary,isValidToolNamelogs_report_mcp.go—buildMCPFailuresSummary,buildMCPToolUsageSummarylogs_report_firewall.go—buildFirewallLogSummary,buildRedactedDomainsSummary,buildAccessLogSummary,aggregateDomainStats,convertDomainsToSortedSliceslogs_report_errors.go—buildCombinedErrorsSummary,buildMissingToolsSummary,buildMissingDataSummarybuildLogsData,renderLogsConsole,renderLogsJSON,writeSummaryFile, and helper types inlogs_report.goFiles to Modify
pkg/cli/logs_report.gopkg/cli/logs_report_tools.gopkg/cli/logs_report_mcp.gopkg/cli/logs_report_firewall.gopkg/cli/logs_report_errors.goAcceptance Criteria
logs_report.gois ≤ 300 linesmake build && make test-unitpass without errorsmake fmt && make lintpass without errors