Description
The {{#runtime-import}} / {{#import}} markdown macro grammar is parsed independently in two packages: pkg/parser/frontmatter_hash.go:572 and pkg/workflow/runtime_import_validation.go:38 each declare their own near-identical runtimeImportReference struct (same 3-field shape, only the path field name differs), their own extraction function, and their own near-identical regex (runtimeImportReferenceRe vs runtimeImportMacroRe). The two implementations can silently drift apart if one is updated without the other.
Fix
Extract the shared struct, regex, and extraction function into one location (e.g. pkg/parser), and have pkg/workflow import it instead of maintaining a second copy.
Expected Impact
One implementation of the macro grammar instead of two that can drift apart — removes a latent source of inconsistent macro-parsing behavior between the two packages.
Suggested Agent
General coding agent — mechanical consolidation with existing test coverage in both packages to confirm behavior is preserved.
Estimated Effort
Quick (2-4 hours)
Data Source
DeepReport Intelligence Briefing (2026-10-06, incremental cycle) — sourced from Typist: Go Type Consistency Analysis discussion #66107, live-verified against current pkg/parser/frontmatter_hash.go:572 and pkg/workflow/runtime_import_validation.go:38.
Generated by 🔬 Deep Report · claude · agent · 207.7 AIC · ⌖ 7.97 AIC · ⊞ 7.1K · ◷
Description
The
{{#runtime-import}}/{{#import}}markdown macro grammar is parsed independently in two packages:pkg/parser/frontmatter_hash.go:572andpkg/workflow/runtime_import_validation.go:38each declare their own near-identicalruntimeImportReferencestruct (same 3-field shape, only the path field name differs), their own extraction function, and their own near-identical regex (runtimeImportReferenceRevsruntimeImportMacroRe). The two implementations can silently drift apart if one is updated without the other.Fix
Extract the shared struct, regex, and extraction function into one location (e.g.
pkg/parser), and havepkg/workflowimport it instead of maintaining a second copy.Expected Impact
One implementation of the macro grammar instead of two that can drift apart — removes a latent source of inconsistent macro-parsing behavior between the two packages.
Suggested Agent
General coding agent — mechanical consolidation with existing test coverage in both packages to confirm behavior is preserved.
Estimated Effort
Quick (2-4 hours)
Data Source
DeepReport Intelligence Briefing (2026-10-06, incremental cycle) — sourced from Typist: Go Type Consistency Analysis discussion #66107, live-verified against current
pkg/parser/frontmatter_hash.go:572andpkg/workflow/runtime_import_validation.go:38.