Skip to content

[plan] Add Frontmatter and ToolsMap type aliases across pkg/workflow/ #19580

Description

@github-actions

Objective

Improve codebase readability and intent documentation by introducing type aliases for the pervasive map[string]any usage in YAML frontmatter processing.

Context

Discussion #19575 identified 1,191 map[string]any usages across 121 function signatures in pkg/workflow/. A MapToolConfig alias already exists in pkg/workflow/mcp_config_types.go:52 but adoption is inconsistent.

Approach

  1. Add the following type aliases to pkg/workflow/compiler_types.go:
    type Frontmatter = map[string]any
    type ToolsMap = map[string]any
  2. Replace map[string]any parameter/return types across pkg/workflow/ (~40 files, ~121 sites) where the value represents YAML frontmatter or tools config data
  3. Prioritize key files first:
    • pkg/workflow/compiler_orchestrator_workflow.go — extractYAMLSections
    • pkg/workflow/agent_validation.go — validateMaxTurnsSupport
    • pkg/workflow/safe_outputs_config.go — extractSafeOutputsConfig
    • pkg/workflow/compiler_safe_outputs.go — parseOnSection
  4. Run go build ./... to verify no breakage
  5. Run make fmt && make test-unit to validate

Acceptance Criteria

  • Frontmatter and ToolsMap type aliases defined in pkg/workflow/compiler_types.go
  • Function signatures in pkg/workflow/ updated to use the aliases where they represent frontmatter/tools data
  • go build ./... passes with no errors
  • make test-unit passes

Generated by Plan Command for issue #discussion #19575 · ◷

  • expires on Mar 6, 2026, 11:40 AM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions