Skip to content

refactor: remove ForInspector wrapper indirection and add dual-path config parity test#22676

Merged
pelikhan merged 2 commits intomainfrom
copilot/refactor-semantic-function-clustering-36fc2f26-ce0a-47d8-adfa-5895d5ab21a4
Mar 24, 2026
Merged

refactor: remove ForInspector wrapper indirection and add dual-path config parity test#22676
pelikhan merged 2 commits intomainfrom
copilot/refactor-semantic-function-clustering-36fc2f26-ce0a-47d8-adfa-5895d5ab21a4

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

Three findings from the semantic function clustering analysis: ForInspector wrapper redundancy in mcp_scripts_generator.go, undocumented parseIntValue/ConvertToInt distinction, and no compile-time enforcement that the two safe-output config generation paths stay in sync.

ForInspector wrapper removal

5 public ForInspector wrappers were pure pass-throughs to private functions with identical signatures — removed the wrappers, promoted the private functions to public directly:

// Before: two declarations for one function
func generateMCPScriptsToolsConfig(mcpScripts *MCPScriptsConfig) string { ... }
func GenerateMCPScriptsToolsConfigForInspector(mcpScripts *MCPScriptsConfig) string {
    return generateMCPScriptsToolsConfig(mcpScripts)
}

// After: single public function
func GenerateMCPScriptsToolsConfig(mcpScripts *MCPScriptsConfig) string { ... }

Also promoted generateMCPScriptGoToolScriptGenerateMCPScriptGoToolScript for consistency (it was the only generator without a ForInspector wrapper). Updated all call sites: mcp_setup_generator.go, mcp_inspect_mcp_scripts_files.go, and test files.

parseIntValue / ConvertToInt

Both functions already carry comprehensive doc comments distinguishing their use cases — no change needed.

Dual-path config parity test

Added TestSafeOutputsConfigPathParity in safe_outputs_config_parity_test.go. Builds a SafeOutputsConfig with all 39 handlers enabled, then asserts the handler keys from handlerRegistry (new path → GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG) match those from generateSafeOutputsConfig (old path → config.json). Documents the two known old-path-only auxiliary keys (create_missing_tool_issue, create_missing_data_issue) and excludes them from the comparison. Any future handler added to one path but not the other will immediately fail this test.

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 --ignore-path ../../../.pretti/tmp/go-build3832061191/b217/vet.cfg go list�� -m -json 64/bin/go "prettier" --wri/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet x_amd64/vet 64/bin/go go (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 --ignore-path ../../../.pretti/tmp/go-build3832061191/b225/vet.cfg go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 --ignore-path ../../../.pretti/tmp/go-build3832061191/b201/vet.cfg go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse env .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-f (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name --show-toplevel /usr/bin/unpigz /usr/bin/git -c x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /home/REDACTED/worgit rev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name --show-toplevel git ache/node/24.14.0/x64/bin/npm --show-toplevel git 0/x64/bin/node ache/node/24.14.0/x64/bin/npm rev-�� nly git /usr/bin/git --show-toplevel /usr/lib/git-corjs/fuzz_sanitize_label_harness.cjs ache/node/24.14.0/x64/bin/node 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 --show-toplevel ache/go/1.25.0/xrev-parse /opt/hostedtoolcache/node/24.14.0/x64/bin/node -json GO111MODULE ache/go/1.25.0/x--show-toplevel node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/ai-moderator.md ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/infocmp ithub/workflows GO111MODULE ache/go/1.25.0/x--show-toplevel infocmp (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 0/x64/bin/node /usr/bin/git git init�� /usr/bin/git git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git /usr/bin/git node js/f�� /usr/bin/git /usr/bin/git /opt/hostedtoolcache/node/24.14.0/x64/bin/node -v git /usr/bin/git node (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 xterm-color x_amd64/vet ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -json GO111MODULE x_amd64/link ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (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 git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/bash --show-toplevel /usr/bin/unpigz /usr/bin/git bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git cjs --show-toplevel git ache/node/24.14.0/x64/bin/node --git-dir git /usr/bin/git git (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 k/gh-aw/gh-aw/.github/workflows go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet l GO111MODULE DiscussionsEnabl-v /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-buildtags /tmp�� k/gh-aw/gh-aw/.github/workflows sh me: String!) { repository(owner: $owner, name:-nilfunc l GOPROXY DiscussionsEnabl--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/bot-detection.md ache/go/1.25.0/x64/pkg/tool/linu-buildtags /usr/bin/git ithub/workflows GOPROXY x_amd64/link git rev-�� --show-toplevel x_amd64/link /usr/bin/git k/gh-aw/gh-aw/.ggit go /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel PmaxUgULkS6lBtndrk/cnjHJRsC75-1TI1_m0Vn/uTsMpJMIC8zTipfMwGSL /usr/bin/git st-4192715457/.ggit config g_.a git rev-�� --show-toplevel infocmp 86_64/node k/gh-aw/gh-aw/.ggit go ache/go/1.25.0/x--show-toplevel git (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 /tmp/TestHashConsistency_GoAndJavaScript701475139/001/test-frontmatter-with-nested-objects.md 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE repository(owne--show-toplevel git comm�� nt/action/git/ref/tags/v999.999.999 Add workflow /usr/bin/git ithub/workflows GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /tmp/go-build2187307599/b447/_pkg_.a -trimpath /usr/bin/git -p main -lang=go1.25 git -C /tmp/gh-aw-test-runs/20260324-124714-32483/test-3657849423 rev-parse /usr/bin/git @{u} -c=4 -nolocalimports git (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/link /usr/bin/git ger.test node ortcfg.link git rev-�� --show-toplevel kmIpjEVxgPIJbBLrkR/yyjxJESSHc308test@example.com /usr/bin/git 4714-32483/test-git config g_.a git (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 -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-f env .cfg GO111MODULE r: $owner, name:-f GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE lPIPkS6j74YO .cfg�� -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha .cfg GO111MODULE 64/pkg/tool/linu-f GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-f .cfg�� -json GO111MODULE r: $owner, name:-f GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (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 /tmp/go-build2187307599/b443/_pkg_.a -trimpath /usr/bin/git -p main -lang=go1.25 git -C /tmp/gh-aw-test-runs/20260324-124714-32483/test-3657849423 status /usr/bin/git .github/workflowgit -c=4 -nolocalimports git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260324-125015-37374/test-163651388/.github/workflows rev-parse /usr/bin/git --show-toplevel docker /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 7307599/b431/imprev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/docker --show-toplevel git /usr/bin/infocmp--show-toplevel docker (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 -test.paniconexit0 -test.v=true /usr/bin/git -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel git rev-�� --git-dir ache/go/1.25.0/xrev-parse /usr/bin/git ithub/workflows GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git conf�� user.name Test User Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --show-toplevel 7307599/b427/imprev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel e/git /usr/bin/git om/owner/repo.gigit om/owner/repo.girev-parse /usr/bin/git git rev-�� nt/action/git/ref/tags/v999.999.999 git /opt/hostedtoolcache/node/24.14.0/x64/bin/node --show-toplevel git 86_64/node node (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 graphql -f ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -f owner=github -f ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -d 7307599/b428/_pkg_.a x_amd64/vet 7307599/b428=> -json GO111MODULE x_amd64/vet bash (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 /opt/hostedtoolcinit /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha HEAD git 0/x64/bin/node --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha graphql -f .cfg -f owner=github -f git -C k/gh-aw/gh-aw config ache/node/24.14.0/x64/bin/node remote.origin.urgit GO111MODULE r: $owner, name:--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel iToVmhx/8HeYq0nArev-parse /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/lib/git-cor--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha 4714-32483/test-3657849423 config /usr/bin/infocmp remote.origin.urgit GO111MODULE r: $owner, name:--show-toplevel infocmp -1 k/gh-aw/gh-aw/.github/workflows x_amd64/vet ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -json GO111MODULE x_amd64/vet ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha tags/v5 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git 0/x64/bin/node --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git 0/x64/bin/node --show-toplevel infocmp /usr/bin/git git (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 m0s x_amd64/vet nerateMCP|TestMCgit GOWORK ed } } x_amd64/vet -uns�� k/gh-aw/gh-aw/.github/workflows erignore /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-f -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 git /usr/bin/git --show-toplevel git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260324-125250-48234/test-258937580 git conf�� user.email test@example.com /usr/bin/git /usr/bin/git infocmp /opt/hostedtoolcuser.email git (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 GOPROXY TestMCPScripts|TestSafeOutputsCo-nilfunc GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x-tests -uns�� /tmp/go-build3832061191/b140/vet.cfg go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 git /usr/bin/git tags/v3 /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 git /usr/bin/git --show-toplevel git /opt/hostedtoolc--show-toplevel git rev-�� tags/v5 node /usr/bin/git /usr/bin/git gh /opt/hostedtoolc--show-toplevel git (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 GOPROXY /opt/hostedtoolcache/go/1.25.0/x-test.short=true GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/xrev-parse /tmp�� erignore go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 git /usr/bin/git --show-toplevel git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260324-125250-48234/test-258937580 git rev-�� --show-toplevel node /usr/bin/git /usr/bin/git gh /opt/hostedtoolc--show-toplevel git (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 GOPROXY /opt/hostedtoolcache/go/1.25.0/x-nilfunc GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/xconfig estl�� k/gh-aw/gh-aw/.github/workflows erignore /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet l GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linuconfig (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 git At,event,headBranch,headSha,displayTitle --show-toplevel bash /usr/bin/git git rev-�� -aw/git/ref/tags/v1.0.0 git /usr/bin/git --show-toplevel /usr/libexec/docrev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 git /usr/bin/git --show-toplevel git /opt/hostedtoolc/tmp/gh-aw-test-runs/20260324-125250-48234/test-258937580 git conf�� user.name Test User /usr/bin/git /usr/bin/git infocmp /opt/hostedtoolc--git-dir git (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 GOPROXY x_amd64/link GOSUMDB GOWORK 64/bin/go x_amd64/link -uns�� /tmp/go-build3832061191/b152/vet.cfg erignore er: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnablgithub.repository -json GO111MODULE 64/bin/go HC/wPHmRHH07drGotDxh6_4/9rUbv3kNVNgnGPLEQds7 (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 git /usr/bin/git --show-toplevel git /opt/hostedtoolcHEAD git add initial.txt node /usr/bin/git /usr/bin/git infocmp /opt/hostedtoolc--show-toplevel git (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 GOPROXY x_amd64/compile GOSUMDB GOWORK 64/bin/go x_amd64/compile /tmp�� GOMODCACHE erignore (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 git /usr/bin/git --show-toplevel git /opt/hostedtoolc.github/workflows/test.md git comm�� -m Initial commit /usr/bin/git /usr/bin/git /usr/bin/git /opt/hostedtoolc--show-toplevel git (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 GOPROXY repository(owner: $owner, name:-test.short=true GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/xTest User /tmp�� k/gh-aw/gh-aw/.github/workflows erignore /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-f -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 git /usr/lib/git-core/git --show-toplevel git /opt/hostedtoolc--git-dir /usr/lib/git-core/git main�� run --auto /usr/bin/git --detach /usr/bin/git /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuconfig env .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (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 GOMOD GOMODCACHE 64/pkg/tool/linu-buildtags .cfg�� -json GO111MODULE repository(owne-nilfunc GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xconfig (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 GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/xrev-parse -uns�� k/gh-aw/gh-aw/.github/workflows go (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 ithub/workflows GOPROXY /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/xrev-parse -uns�� y_with_repos_array_c3810378284/001 go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet l GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel /usr/bin/unpigz /usr/bin/git -c x_amd64/vet /usr/bin/gh git rev-�� --show-toplevel /usr/bin/gh /usr/bin/git graphql -f /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel 0cSjIzFgRbwYh/es0b2eJmwxh68A6Buptest@example.com ache/go/1.25.0/x64/bin/node ry=1 git 740/b364/_pkg_.a git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git /opt/hostedtoolcache/go/1.25.0/x--show-toplevel git (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 -json GO111MODULE repository(owne-f GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x-trimpath (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel -goversion /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel C8zTipfMwGSL /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.--show-toplevel git (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 -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x-trimpath (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linu-f GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x-importcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x-buildtags (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 -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel git /usr/bin/git GOMODCACHE 64/pkg/tool/linuinit ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel 861b364c0437b62f6dbb3a4d /usr/bin/git k/gh-aw/gh-aw/.ggit VNgnGPLEQds7 /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git rev-�� --show-toplevel git e --show-toplevel git ache/node/24.14./tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_with_explicit_repo3063474525/001 gh (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (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 ithub/workflows GOPROXY (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel /usr/bin/unpigz /usr/bin/git -c x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git ache/uv/0.11.0/x86_64/node --show-toplevel git /usr/bin/git git ache�� --show-toplevel nly /usr/bin/git licyMinIntegritynode git /tmp/go-build396740/b376/cli.tes--show-toplevel git (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 GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linurev-parse -uns�� 2720045268/.github/workflows ache/go/1.25.0/xGO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 161474/b417/_pkggit GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/xremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion /usr/bin/git git /opt/hostedtoolc--show-toplevel sed s/^-�� /usr/bin/infocmp--show-toplevel node /usr/bin/git /usr/bin/git infocmp /opt/hostedtoolc--show-toplevel git (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 r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env .cfg GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo DROP xterm-color x_amd64/vet /usr/bin/infocmp--show-toplevel git rev-�� --show-toplevel infocmp /usr/bin/git xterm-color x_amd64/vet ache/node/24.14.-t git (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build2187307599/b402/cli.test /tmp/go-build2187307599/b402/cli.test -test.testlogfile=/tmp/go-build2187307599/b402/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse env .cfg GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse (http block)
    • Triggering command: /tmp/go-build396740/b376/cli.test /tmp/go-build396740/b376/cli.test -test.testlogfile=/tmp/go-build396740/b376/testlog.txt -test.paniconexit0 -test.timeout=10m0s rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git /home/REDACTED/worgit rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git licyMinIntegritygit rev-parse (http block)
    • Triggering command: /tmp/go-build218261597/b001/cli.test /tmp/go-build218261597/b001/cli.test -test.testlogfile=/tmp/go-build218261597/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.short=true --show-toplevel git /usr/bin/git --show-toplevel gh 0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (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 .cfg GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse env .cfg GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel docker /usr/bin/git mcp/memory x_amd64/vet /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /home/REDACTED/worgit l /usr/bin/infocmp--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name --show-toplevel 5bb5fc4c..HEAD /usr/bin/git --show-toplevel git 0/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.0/x64/bin/node git (http block)

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…onfig parity test

- Issue 2: Remove 5 ForInspector public wrappers from mcp_scripts_generator.go;
  promote private functions to public by capitalizing names. Also make
  generateMCPScriptGoToolScript public for consistency. Update all call
  sites (mcp_setup_generator.go, mcp_inspect_mcp_scripts_files.go, tests).
- Issue 3: parseIntValue/ConvertToInt already have comprehensive doc comments
  distinguishing their use cases — no changes needed.
- Issue 1: Add TestSafeOutputsConfigPathParity test that validates both config
  generation paths produce the same set of handler keys for a comprehensive
  SafeOutputsConfig, catching future sync gaps between the two paths.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/55e4602f-9476-4232-abcf-53098b1e288c
@pelikhan pelikhan marked this pull request as ready for review March 24, 2026 12:55
Copilot AI review requested due to automatic review settings March 24, 2026 12:55
Copilot AI changed the title [WIP] Refactor semantic function clustering in pkg/ refactor: remove ForInspector wrapper indirection and add dual-path config parity test Mar 24, 2026
Copilot AI requested a review from pelikhan March 24, 2026 12:56
@pelikhan pelikhan merged commit 6ef1eed into main Mar 24, 2026
60 checks passed
@pelikhan pelikhan deleted the copilot/refactor-semantic-function-clustering-36fc2f26-ce0a-47d8-adfa-5895d5ab21a4 branch March 24, 2026 12:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors MCP scripts generation functions to remove the ForInspector wrapper indirection and adds a parity test to ensure both safe-outputs config generation paths stay in sync on handler coverage.

Changes:

  • Exported MCP scripts generation helpers (tools.json, server entrypoint, and per-tool handler scripts) and updated call sites in workflow compiler + CLI inspector + tests.
  • Added a unit test enforcing parity between handler keys produced by handlerRegistry vs. generateSafeOutputsConfig, with allowances for legacy-only auxiliary keys.
  • Updated MCP scripts-related tests to use the newly exported function names.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/workflow/safe_outputs_config_parity_test.go Adds a parity test comparing handler keys across the “new” vs “old” safe-outputs config generation paths.
pkg/workflow/mcp_setup_generator.go Updates compiler generation to call newly exported MCP scripts generator functions.
pkg/workflow/mcp_scripts_timeout_test.go Updates test to call exported tools.json generator.
pkg/workflow/mcp_scripts_generator_test.go Updates tests to call exported generator functions.
pkg/workflow/mcp_scripts_generator.go Exports previously internal MCP scripts generators and removes the CLI wrapper functions.
pkg/cli/mcp_inspect_mcp_scripts_files.go Switches CLI inspector to use exported generator functions when writing MCP scripts artifacts.
Comments suppressed due to low confidence (2)

pkg/cli/mcp_inspect_mcp_scripts_files.go:92

  • Go-based MCP script tools (toolConfig.Go) are not handled here: tools.json generation can emit a ".go" handler, but this loop will hit the final else { continue } and never write the corresponding .go file. Add an else if toolConfig.Go != "" branch that calls workflow.GenerateMCPScriptGoToolScript and writes <toolName>.go.
			content = workflow.GenerateMCPScriptPythonToolScript(toolConfig)
			extension = ".py"
		} else {
			continue
		}

pkg/workflow/mcp_scripts_generator_test.go:97

  • The assertion checks for "serverName": "mcpscripts", but the failure message says "safeinputs". Updating the message to match the expected server name will make failures easier to interpret.
	toolsJSON := GenerateMCPScriptsToolsConfig(config)

	if !strings.Contains(toolsJSON, `"serverName": "mcpscripts"`) {
		t.Error("Tools config should contain server name 'safeinputs'")
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +84 to +86
if handlerCfg != nil {
registryKeys = append(registryKeys, handlerName)
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test intent says it should fail when a new handler is added to one config-generation path but not the other, but this loop silently drops any handlerRegistry entry whose builder returns nil. If a new handler is added and allHandlersSafeOutputsConfig isn’t updated to enable it, the test can still pass (false negative). Consider requiring that every handlerRegistry builder returns non-nil for the test config (and fail with a message to update allHandlersSafeOutputsConfig), then always append the handlerName.

Suggested change
if handlerCfg != nil {
registryKeys = append(registryKeys, handlerName)
}
require.NotNil(t, handlerCfg,
"handlerRegistry builder for %q returned nil for allHandlersSafeOutputsConfig test config.\n"+
"Update allHandlersSafeOutputsConfig to enable this handler so that config-path parity is checked.",
handlerName)
registryKeys = append(registryKeys, handlerName)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] Semantic Function Clustering Analysis: Refactoring Opportunities in pkg/

3 participants