Objective
Extract 12 extraction/parsing functions from pkg/workflow/compiler.go and consolidate with existing extraction utilities into a renamed and enhanced pkg/workflow/frontmatter_extraction.go.
Context
Part of issue #2273. The compiler.go file contains extraction functions that should be in a dedicated extraction utilities file. This will improve code organization and make extraction logic easier to find and test.
Functions to Extract from compiler.go
Move these 12 extraction functions:
extractTopLevelYAMLSection
extractPermissions
extractIfCondition
extractFeatures
extractDescription
extractSource
extractSafetyPromptSetting
extractToolsTimeout
extractToolsStartupTimeout
extractExpressionFromIfString
extractCommandConfig
extractYAMLValue
Additional Extraction Functions to Move
From pkg/workflow/network.go:
extractNetworkPermissions (currently misplaced in runtime file)
Approach
- Rename
pkg/workflow/parse_utils.go to pkg/workflow/frontmatter_extraction.go
- Move all extraction functions from
compiler.go to this file
- Move
extractNetworkPermissions from network.go to this file
- Organize functions logically within the file
- Update all imports and references
Files to Modify
- Rename:
pkg/workflow/parse_utils.go → pkg/workflow/frontmatter_extraction.go
- Update:
pkg/workflow/compiler.go (remove extraction functions)
- Update:
pkg/workflow/network.go (remove extractNetworkPermissions)
Acceptance Criteria
AI generated by Plan Command for #2273
Objective
Extract 12 extraction/parsing functions from
pkg/workflow/compiler.goand consolidate with existing extraction utilities into a renamed and enhancedpkg/workflow/frontmatter_extraction.go.Context
Part of issue #2273. The
compiler.gofile contains extraction functions that should be in a dedicated extraction utilities file. This will improve code organization and make extraction logic easier to find and test.Functions to Extract from compiler.go
Move these 12 extraction functions:
extractTopLevelYAMLSectionextractPermissionsextractIfConditionextractFeaturesextractDescriptionextractSourceextractSafetyPromptSettingextractToolsTimeoutextractToolsStartupTimeoutextractExpressionFromIfStringextractCommandConfigextractYAMLValueAdditional Extraction Functions to Move
From
pkg/workflow/network.go:extractNetworkPermissions(currently misplaced in runtime file)Approach
pkg/workflow/parse_utils.gotopkg/workflow/frontmatter_extraction.gocompiler.goto this fileextractNetworkPermissionsfromnetwork.goto this fileFiles to Modify
pkg/workflow/parse_utils.go→pkg/workflow/frontmatter_extraction.gopkg/workflow/compiler.go(remove extraction functions)pkg/workflow/network.go(removeextractNetworkPermissions)Acceptance Criteria
frontmatter_extraction.gocreated (renamed fromparse_utils.go)compiler.goextractNetworkPermissionsmoved fromnetwork.gomake test-unitmake buildcompiler.goreduced by approximately 200-300 linesRelated to [refactor] 🔧 Semantic Function Clustering Analysis - Refactoring Opportunities #2273