Description
pkg/parser/frontmatter_hash.go:572-653 and pkg/workflow/runtime_import_validation.go:38-176 each define a nearly-identical runtimeImportReference struct and an extractRuntimeImportReferences function. The only structural difference is the path field name (path in the parser copy vs importPath in the workflow copy, plus the workflow copy adds startLine/endLine). Both parse the same {{#runtime-import ...}} / {{#import ...}} macro syntax independently.
Expected Impact
Reduces duplicate macro-parsing logic that already has to stay behavior-identical by convention rather than by construction. pkg/workflow already imports pkg/parser, so the workflow package can depend on an exported version of the parser's extractor (adding the line-range fields it needs) instead of maintaining a second regex-based extractor that could silently drift from the parser's behavior.
Suggested Agent
Code Simplifier or a general refactoring agent (Go-only change, no behavior change expected).
Estimated Effort
Medium (1-4 hours) — requires exporting the parser type/function, adding the line-tracking fields the workflow package needs, updating both call sites, and running make test-unit.
Data Source
DeepReport Intelligence Briefing cycle (2026-10-02), surfaced via discussion #64752 (Typist: Go type consistency analysis).
Generated by 🔬 Deep Report · claude · agent · 298.7 AIC · ⌖ 7.67 AIC · ⊞ 7.3K · ◷
Description
pkg/parser/frontmatter_hash.go:572-653andpkg/workflow/runtime_import_validation.go:38-176each define a nearly-identicalruntimeImportReferencestruct and anextractRuntimeImportReferencesfunction. The only structural difference is the path field name (pathin the parser copy vsimportPathin the workflow copy, plus the workflow copy addsstartLine/endLine). Both parse the same{{#runtime-import ...}}/{{#import ...}}macro syntax independently.Expected Impact
Reduces duplicate macro-parsing logic that already has to stay behavior-identical by convention rather than by construction.
pkg/workflowalready importspkg/parser, so the workflow package can depend on an exported version of the parser's extractor (adding the line-range fields it needs) instead of maintaining a second regex-based extractor that could silently drift from the parser's behavior.Suggested Agent
Code Simplifier or a general refactoring agent (Go-only change, no behavior change expected).
Estimated Effort
Medium (1-4 hours) — requires exporting the parser type/function, adding the line-tracking fields the workflow package needs, updating both call sites, and running
make test-unit.Data Source
DeepReport Intelligence Briefing cycle (2026-10-02), surfaced via discussion #64752 (Typist: Go type consistency analysis).