Repository navigation
Done
Labels
Description
Overview
pkg/cli/audit_report.go has grown to 1201 lines (threshold: 800), mixing data types, audit data assembly, file/manifest extraction, and step-log error scanning.
Current State
- File:
pkg/cli/audit_report.go, 1201 lines, 58 top-level funcs/types - Test file:
pkg/cli/audit_report_test.go(1930 lines, ratio ~1.6)
Full File Analysis
- Lines 32-316: ~25 type definitions (AuditData, MetricsData, MCP tool types, display types)
- Lines 318-634:
build*/assembleAuditDatapipeline - Lines 636-832: downloaded-file and created-item extraction,
describeFile,parseDurationString - Lines 834-1201: pre-agent step-error scanning (
scanWorkflowStepLogs,scanFlatStepLog,scanNestedStepLogs,extractAgentStdioFailureExcerpt,classifyAgentStdioLines,parseStepFilename,stripGHALogTimestamps)
Refactoring Strategy
audit_report_types.go(~290 LOC): all type declarations plusMCPToolSummarysync methodsaudit_report.go(~320 LOC):buildAuditData,buildLocalAuditData,buildAudit*,assembleAuditData,logAssembledAuditData,auditEngineConfigWarnings,extractAuditErrorsaudit_report_files.go(~200 LOC):extractDownloadedFiles,extractCreatedItemsFromManifest,resolveCreatedItems,describeFile,parseDurationStringaudit_step_errors.go(~370 LOC):extractPreAgentStepErrorsthroughstripGHALogTimestamps, includingstepLog
Test Coverage Plan
Split audit_report_test.go to mirror new files, then add cases for describeFile unknown names, parseDurationString invalid input, parseStepFilename malformed names, classifyAgentStdioLines edge cases. Target >80% per file.
Implementation Guidelines
- Preserve behavior and API (pure moves within package
cli). - Move one cluster at a time; run
make test-unitafter each. - Run
make fmtandmake lint.
Acceptance Criteria
- Split into 4 files, each under 500 lines
-
make test-unit,make lint,make buildpass - Coverage >=80% for new files
- No public API changes
Priority: Medium. Effort: Small (mostly mechanical).
Generated by 🧹 Daily File Diet · copilot · auto (Claude Sonnet 5.5) · ~20 AIC · ⌖ ~2 AIC · ⊞ 13.3K · ◷
- expires on Nov 12, 2026, 4:45 AM UTC-08:00
Reacted by Copilot
Activity
github-actions commentedon Nov 10, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, Copilot will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪