Skip to content

Add Frontmatter and ToolsMap type aliases across pkg/workflow/#19585

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-type-aliases-frontmatter-toolsmap
Closed

Add Frontmatter and ToolsMap type aliases across pkg/workflow/#19585
Copilot wants to merge 3 commits intomainfrom
copilot/add-type-aliases-frontmatter-toolsmap

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

map[string]any was used pervasively (136+ sites, ~65 files) in pkg/workflow/ function signatures for YAML frontmatter and tools config data, obscuring intent.

Changes

  • New type aliases in pkg/workflow/compiler_types.go:
    type Frontmatter = map[string]any  // raw YAML frontmatter from workflow markdown
    type ToolsMap    = map[string]any  // tools config within frontmatter
  • 96 parameter sites updated: frontmatter map[string]anyfrontmatter Frontmatter
  • 40 parameter sites updated: tools map[string]anytools ToolsMap

Both use = alias syntax — identical to map[string]any at the type level, zero runtime impact, no callsite changes required outside pkg/workflow/.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw HEAD x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git HEAD .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw 1/x64/bin/node /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel infocmp /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/bot-detection.md /tmp/go-build1050071815/b413/_testmain.go /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 0071815/b398/filrev-parse (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha k/gh-aw/gh-aw/.github/workflows -buildtags ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -errorsas -ifaceassert -nilfunc ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -ato�� 0071815/b426/_pkg_.a -buildtags e/git -errorsas b/gh-aw/pkg/testrev-parse -nilfunc e/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel jHyrHyHKNcgB /usr/bin/git git rev-�� --show-toplevel git /usr/bin/tail --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git tail (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 2261080085/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet cker_id_test.go eep_workflow_tesrev-parse hub_toolset_inte--show-toplevel 64/pkg/tool/linux_amd64/vet m/_n�� e_outputs.go .cfg 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git '**/*.ts' '**/*.git o x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/lib/git-core/git .js' --ignore-pagit ion_test.go x_amd64/vet /usr/lib/git-core/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha xterm-color 64/pkg/tool/linu/sys/fs/cgroup /usr/bin/git .go .go x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/gh --noprofile (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --get remote.origin.url /usr/bin/git -c=4 -nolocalimports -importcfg git conf�� user.email test@example.com /usr/bin/git th .prettierignogit r _modules/.bin/no--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 767155004 (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha agent-persona-explorer.md 0071815/b115/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet **/*.json --ignore-path ../../../.prettixterm-color ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 0071�� "prettier" --write '../../../**/*.json' '!../../../pkg/workflow/-errorsas ache/go/1.25.0/x64/src/testing/internal/testdeps/deps.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/link rror (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha SameOutput3631573890/001/stability-test.md 0071815/b064/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet --ignore-path ../../../.prettirev-parse (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha json' --ignore-p-errorsas (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build1050071815/b405/importcfg -pack /tmp/go-build1050071815/b405/_testmain.go ules�� submodules | hea-errorsas (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/github-script/git/ref/tags/v8 --jq g_.a json' --ignore-pgit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /usr/bin/git git 40\}�� ster.patch git /usr/bin/git --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel infocmp cfg xterm-color ache/go/1.25.0/xrev-parse /usr/bin/git git rev-�� --show-toplevel git 223239/b001/workflow.test --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git 223239/b001/workflow.test (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha 0I7tGkOPP rev-parse /usr/bin/git json' --ignore-pgit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /tmp/gh-aw-test-git config /usr/bin/gh git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git cfg --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git rev-�� --show-toplevel git ache/go/1.25.0/x64/pkg/tool/linux_amd64/link --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git ache/go/1.25.0/x64/pkg/tool/linux_amd64/link (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha ring158300709/001/test1.md /tmp/go-build1050071815/b019/vet.cfg 0071815/b394=> ignore-path ../.git b/gh-aw/pkg/envurev-parse -main/dist/ripgr--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� WJFJ/2Edh8VmxWE60ClYMWJFJ /tmp/go-build1050071815/b136/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha e_outputs.go .cfg 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha 25/001/test-empty-frontmatter.md-p .cfg x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha 25/001/test-simple-frontmatter.m-p .cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 HEAD 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 origin 64/pkg/tool/linux_amd64/vet son (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 g/cli/actionlint.go 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 HEAD 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 HEAD 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 HEAD x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 HEAD x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha FETCH_HEAD (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile /usr/bin/infocmp /tmp/go-build105gh -trimpath /usr/bin/git infocmp -1 xterm-color git /usr/bin/tr tags/v5 rev-parse /opt/hostedtoolc--show-toplevel tr (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha on' --ignore-path ../../../.pret.prettierignore (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha on' --ignore-path ../../../.pret.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha on' --ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha on' --ignore-path ../../../.pret.prettierignore (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha [string\]any (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x-ifaceassert /usr/bin/git /tmp/go-build105git -trimpath ache/node/24.13.--show-toplevel git rev-�� --show-toplevel gh /usr/bin/bash k/gh-aw/gh-aw/.ggit --jq ache/node/24.13.--show-toplevel bash (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion ignore e_inputs_timeoutrev-parse _gateway_entrypo--show-toplevel x_amd64/link ret_�� rite '**/*.cjs' '**/*.ts' '**/*.json' --ignore-p-errorsas .cfg 64/pkg/tool/linux_amd64/vet cker_id_test.go eep_workflow_tesinit hub_toolset_integration_test.go tr/ytUgHB2WOGAJoX6mK9KE/Es5JHOhsremote.origin.url (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo tnet/tools/git (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo ache/uv/0.10.8/x-lang=go1.23 (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build1050071815/b383/cli.test /tmp/go-build1050071815/b383/cli.test -test.testlogfile=/tmp/go-build1050071815/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Add Frontmatter and ToolsMap type aliases across pkg/workflow/</issue_title>
<issue_description>## 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.goextractYAMLSections
    • pkg/workflow/agent_validation.govalidateMaxTurnsSupport
    • pkg/workflow/safe_outputs_config.goextractSafeOutputsConfig
    • pkg/workflow/compiler_safe_outputs.goparseOnSection
  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

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.



✨ PR Review Safe Output Test - Run 22669799144

💥 [THE END] — Illustrated by Smoke Claude ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…pes.go and update function signatures

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Frontmatter and ToolsMap type aliases in pkg/workflow/ Add Frontmatter and ToolsMap type aliases across pkg/workflow/ Mar 4, 2026
@pelikhan pelikhan closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants