Context
Identified by DeepReport intelligence briefing 2026-05-12 (Repository Quality report #31693).
pkg/parser/import_field_extractor.go is 1,127 lines and contains a single 508-line function — extractAllImportFields — that handles YAML parsing, validation, schema defaults, input substitution, and observability extraction all in one place. This is the most critical offender across the 211 Go files (57% of pkg/) currently exceeding the documented 300-line hard limit from AGENTS.md.
Expected Impact
- Brings the worst-offender file into compliance with
AGENTS.md 300-line limit
- Improves test coverage targeting (a 508-line function with one test exercises minimal branching)
- Reduces cognitive load for future contributors
- Sets a refactoring precedent for the other 210 oversized files
Suggested Approach
- Identify the natural seams: parse → validate → defaults → substitution → observability
- Extract each phase into its own well-named function (~100 lines each)
- Run
make agent-finish after each extraction to leverage the 2.1× test-to-source ratio
- Keep the public API stable; this is an internal refactor
Suggested Agent
Sergo or any Go-capable coding agent.
Estimated Effort
2 hours of agent time (per the report's own sizing).
Source: DeepReport 2026-05-12 #aw_dr3
Generated by DeepReport - Intelligence Gathering Agent · ● 9.5M · ◷
Context
Identified by DeepReport intelligence briefing 2026-05-12 (Repository Quality report #31693).
pkg/parser/import_field_extractor.gois 1,127 lines and contains a single 508-line function —extractAllImportFields— that handles YAML parsing, validation, schema defaults, input substitution, and observability extraction all in one place. This is the most critical offender across the 211 Go files (57% ofpkg/) currently exceeding the documented 300-line hard limit fromAGENTS.md.Expected Impact
AGENTS.md300-line limitSuggested Approach
make agent-finishafter each extraction to leverage the 2.1× test-to-source ratioSuggested Agent
Sergo or any Go-capable coding agent.
Estimated Effort
2 hours of agent time (per the report's own sizing).
Source: DeepReport 2026-05-12 #aw_dr3