Skip to content

refactor: remove deprecated wrappers, dead code, and orphaned symbols#18873

Merged
pelikhan merged 2 commits intomainfrom
copilot/refactor-semantic-function-clustering-3334a908-9aa3-4fe6-a057-ca44251e3039
Feb 28, 2026
Merged

refactor: remove deprecated wrappers, dead code, and orphaned symbols#18873
pelikhan merged 2 commits intomainfrom
copilot/refactor-semantic-function-clustering-3334a908-9aa3-4fe6-a057-ca44251e3039

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Cleans up 7 items flagged by the semantic function clustering analysis: trivial one-line wrappers, structurally near-duplicate batch runners, a deprecated generic alias, an unused type alias, a stub that always returns false, and a backward-compat wrapper not fully migrated.

Thin wrappers → direct calls (compile_output_formatter.go, compile_orchestration.go)

  • Removed formatCompilationSummary, formatActionlintOutput, formatStatsTable — each was a single-line delegate with no added value
  • 3 call-sites in compile_orchestration.go now call printCompilationSummary, displayActionlintSummary, displayStatsTable directly
  • formatValidationOutput kept (does real work: sanitization + JSON marshaling)

Shared batch helper (compile_batch_operations.go)

Extracted runBatchLockFileTool to eliminate structural duplication between runBatchActionlint and runBatchZizmor:

func runBatchLockFileTool(toolName string, lockFiles []string, verbose, strict bool, runner func([]string, bool, bool) error) error

Both callers are now one-liners.

Dead symbols removed

Symbol File Reason
GenerateOutputSchema[T]() pkg/cli/mcp_schema.go Deprecated alias for GenerateSchema[T]() — 3 test files migrated
WorkflowSourceInfo pkg/cli/packages.go Type alias for FetchedWorkflow with zero callers
ShouldSkipRuntimeSetup pkg/workflow/runtime_deduplication.go Always returned false; test removed too

SplitRepoSlug migration complete (repo.go, secret_set_command.go, pr_command.go)

  • 3 remaining call-sites updated to use repoutil.SplitRepoSlug directly
  • cli.SplitRepoSlug wrapper and its now-unused repoutil import removed from repo.go

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 -nolocalimports -importcfg docker pull�� test/concurrent-image:v1.0.0 /home/REDACTED/work/gh-aw/gh-aw/pkg/sliceutil/sliceutil_test.go /usr/bin/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 owner/repo 64/bin/go infocmp -1 xterm-color node /usr/bin/git --write scripts/**/*.js de 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 -unreachable=false /tmp/go-build4199753045/b099/vet.cfg /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 -uns�� -unreachable=false /tmp/go-build4199753045/b246/vet.cfg /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 api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha -json GO111MODULE }} {{context.Compiler}} GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /home/REDACTED/.local/bin/node GOINSECURE GOMOD GOMODCACHE 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 s "-s -w -X main.version=2da03cf-dirty" -o gh-aw ./cmd/gh-aw .cfg 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/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env '**/*.ts' '**/*.json' --ignore-path ../../../.pr.prettierignore GO111MODULE 86_64/node GOINSECURE GOMOD GOMODCACHE go (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 g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE ole GOMODCACHE 64/pkg/tool/linux_amd64/vet env PWLDsOpmC .cfg x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha ons-test3888389887 -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� s/test.md -tests ache/node/24.13.1/x64/bin/node npx prettier --cgit GOPROXY 64/bin/go infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/link /usr/bin/git -json GO111MODULE x_amd64/vet git init�� GOMODCACHE x_amd64/vet /usr/bin/gh -json GO111MODULE x_amd64/vet gh (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 g_.a GO111MODULE /opt/hostedtoolcache/go/1.25.0/x-test.short=true GOINSECURE util GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� jpq_JbW5I /tmp/go-build4199753045/b070/vet.cfg 9753045/b314/vet.cfg GOSUMDB GOWORK 64/bin/go ortcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -json GO111MODULE Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� 2005-28014/test-4184345559 /tmp/go-build4199753045/b056/vet.cfg 1/x64/bin/node l GOWORK 64/bin/go /opt/hostedtoolcache/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/v6 --jq .object.sha ets.TOKEN }} go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet 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 Q-eU/ZpLY0UQ8eaBGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 019069/b411/impo-buildtags --ch�� k/gh-aw/gh-aw/pk-errorsas k/gh-aw/gh-aw/pk-ifaceassert 64/bin/go --ignore-path ../../../.pretti-atomic 64/bin/go /opt/hostedtoolc-buildtags (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-build4199753045/b392/importcfg -pack /tmp/go-build4199753045/b392/_testmain.go -###�� -x c 64/bin/go - ../../../pkg/wor-o 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha pkg/mod/github.c-errorsas pkg/mod/github.c-ifaceassert 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc/tmp/go-build4199753045/b266/vet.cfg -o /tmp/go-build722019069/b370/_pkgGOINSECURE -trimpath 64/bin/go -p testing/internal-o -lang=go1.25 go (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 g_.a GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -uns�� atjTay5oJ /tmp/go-build4199753045/b036/vet.cfg 9753045/b337/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha heck '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*.js' --ignore-path .prettierignore GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 tutil.test GO111MODULE Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE _hV3O2Cg4KalLpCxFj/loOf-cgjR6MKz0XVD7GS/mRL0tEU7JbrieQ94-F8q -uns�� 2005-28014/test-4184345559 /tmp/go-build4199753045/b044/vet.cfg g_.a l GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha heck '**/*.cjs' '**/*.ts' '**/*.@{u} GO111MODULE h GOINSECURE GOMOD GOMODCACHE go env ithub/workflows GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 e-analyzer.md GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuf() { test "$1" = get && echo "******"; }; f get estl�� -json GO111MODULE .cfg 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/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE ode_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env json' --ignore-path ../../../.pr**/*.json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link env -json 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 download 1 --dir test-logs/run-1 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/node/24.13.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json .cfg x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/uv/0.10.7/x86_64/node GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2248-39808/test-1427563415/.github/workflows GO111MODULE k/_temp/uv-python-dir/node GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE k/gh-aw/gh-aw/actions/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User env aw.test 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 download 4 --dir test-logs/run-4 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE k/gh-aw/gh-aw/actions/setup/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (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 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env hub/workflows .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2248-39808/test-3634688024/.github/workflows GO111MODULE k/gh-aw/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node /opt�� prettier --check 64/bin/go --ignore-path .prettierignore 64/bin/go go (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 --write 64/bin/go go env -json GO111MODULE x_amd64/cgo GOINSECURE GOMOD GOMODCACHE x_amd64/cgo (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 GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (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 json ]; then \ cp .github/aw/actions-lock.json pkg/workflow/data/action_pins.json; \ echo "���node GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha "prettier" --wriGOINSECURE git 64/bin/go --show-toplevel x_amd64/vet /usr/bin/git sh -c npx prettier --wGOSUMDB git 64/bin/go --show-toplevel 64/pkg/tool/linu/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier /usr/bin/git go (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 ty-test.md GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha "prettier" --wriGOINSECURE infocmp 64/bin/go xterm-color x_amd64/vet /usr/bin/git sh -c npx prettier --wGOSUMDB git 64/bin/go --show-toplevel 7KRlb0f/T36gUPQZ/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier /usr/bin/git go (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 GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/uv/0.10.7/x86_64/node GOINSECURE GOMOD GOMODCACHE go (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 64/bin/go GOINSECURE GOMOD GOMODCACHE node /opt�� prettier --check 64/bin/go --ignore-path .prettierignore 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOSUMDB GOWORK 64/bin/go sh -c "prettier" --che-c=4 sh 64/bin/go npx prettier --w/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet on 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go 0 -j ACCEPT node /hom�� --write scripts/**/*.js de .prettierignore --log-level=erro/opt/hostedtoolcache/node/24.13.1/x64/bin/npx /usr/bin/git node (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build4199753045/b380/cli.test /tmp/go-build4199753045/b380/cli.test -test.testlogfile=/tmp/go-build4199753045/b380/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE 019069/b375/impo/tmp/go-build4199753045/b144/vet.cfg -c pkg/mod/github.com/stretchr/testGOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc/tmp/go-build4199753045/b263/vet.cfg (http block)
    • Triggering command: /tmp/go-build2431660264/b001/cli.test /tmp/go-build2431660264/b001/cli.test -test.paniconexit0 -test.count=1 -test.short=true -test.timeout=2m0s echo "��� Go codGOINSECURE /usr/bin/git 64/bin/go --get-regexp ^remote\..*\.gh-env 1/x64/bin/node node /opt�� prettier --write (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 ." GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE npx pret�� --check scripts/**/*.js 64/bin/go .prettierignore GOWORK 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name npx prettier --wGOINSECURE gh 64/bin/go view 12345 /usr/bin/git sh -c "prettier" --wriGOINSECURE git 64/bin/go tierignore 64/pkg/tool/linu/home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/prettier /usr/bin/git node (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>[refactor] Semantic Function Clustering Analysis — Persistent Wrappers and New Orphaned Dead Code</issue_title>
<issue_description>Analysis of 542 non-test Go source files across 18 packages using Serena LSP + naming-pattern clustering. This run identified 2 issues fixed since the last analysis and 4 new findings on top of the 3 previously reported issues that remain unresolved.


Overview

Two items from the previous analysis (#18721) have been resolved: pkg/parser/ansi_strip.go was removed and stringutil.StripANSIEscapeCodes was deleted. The remaining 3 previously reported items are still present, and this analysis adds 4 new findings: a deprecated generic function with no callers, a type alias with no callers, two deprecated pattern-only functions with no non-test callers, and a function that always returns false with no non-test callers.


Progress Since Last Analysis (2026-02-27)

Finding Status
parser.StripANSI orphaned backward-compat wrapper ✅ Fixed — file removed
stringutil.StripANSIEscapeCodes deprecated alias ✅ Fixed — symbol removed
Thin wrappers in compile_output_formatter.go ❌ Still present
runBatchActionlint/runBatchZizmor near-duplicate ❌ Still present (expanded to 3 functions)
cli.SplitRepoSlug wrapper not fully migrated ❌ Still present

Critical Issues

1. pkg/cli/compile_output_formatter.go — Three Trivial One-Line Wrappers

Impact: Medium — Creates dual-naming confusion across the compile pipeline.

Three of the four functions in this file are pure one-line delegates:

func formatCompilationSummary(stats *CompilationStats) {
    printCompilationSummary(stats)  // defined in compile_helpers.go
}

func formatActionlintOutput() {
    displayActionlintSummary()      // defined in actionlint.go
}

func formatStatsTable(statsList []*WorkflowStats) {
    displayStatsTable(statsList)    // defined in compile_stats.go
}

Each is documented as "a wrapper … for consistency." However:

  • printCompilationSummary is already called directly in compile_helpers.go:240,324 and compile_watch.go:133,153
  • Only compile_orchestration.go:492,504,509 uses the format* wrappers

The fourth function formatValidationOutput does real work (JSON marshaling + sanitization) and should be kept.

Recommendation: Remove the three trivial wrappers. Update 3 call-sites in compile_orchestration.go to call the underlying functions directly. Keep formatValidationOutput (or move it to compile_validation.go).

Files affected: pkg/cli/compile_output_formatter.go, pkg/cli/compile_orchestration.go


2. runBatchActionlint, runBatchZizmor, runBatchPoutine — Structural Near-Duplicates

Impact: Medium — Error-handling and logging changes must be made three times.

runBatchActionlint and runBatchZizmor in pkg/cli/compile_batch_operations.go are structurally identical (same signature (lockFiles []string, verbose, strict bool) error, same guard, same error handling). runBatchPoutine follows the same pattern with a slightly different signature (workflowDir string instead of lockFiles []string).

Side-by-side comparison of the two identical functions
// runBatchActionlint
func runBatchActionlint(lockFiles []string, verbose bool, strict bool) error {
    if len(lockFiles) == 0 {
        compileBatchOperationsLog.Print("No lock files to lint with actionlint")
        return nil
    }
    compileBatchOperationsLog.Printf("Running batch actionlint on %d lock files", len(lockFiles))
    if err := RunActionlintOnFiles(lockFiles, verbose, strict); err != nil {
        if strict {
            return fmt.Errorf("actionlint linter failed: %w", err)
        }
        if verbose {
            fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("actionlint warnings: %v", err)))
        }
    }
    return nil
}

// runBatchZizmor — identical structure, different strings/function
func runBatchZizmor(lockFiles []string, verbose bool, strict bool) error {
    if len(lockFiles) == 0 {
        compileBatchOperationsLog.Print("No lock files to scan with zizmor")
        return nil
    }
    compileBatchOperationsLog.Printf("Running batch zizmor on %d lock files", len(lockFiles))
    if err := RunZizmorOnFiles(lockFiles, verbose, strict); err != nil {
        if strict {
            return fmt.Errorf("zizmor security scan failed: %w", err)
        }
        if verbose {
            fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("zizmor warnings: %v", err)))
        }
    }
    return nil
}

Recommendation: Extract a shared runBatchLockFileTool(toolName string, lockFiles []string, verbose, strict bool, runner func([]string, bool, bool) error) error helper. runBatchActionlint and runBatchZizmor...


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

- Remove formatCompilationSummary, formatActionlintOutput, formatStatsTable
  thin wrappers from compile_output_formatter.go; update 3 call-sites in
  compile_orchestration.go to call underlying functions directly
- Extract runBatchLockFileTool shared helper in compile_batch_operations.go;
  refactor runBatchActionlint and runBatchZizmor to use it
- Remove deprecated GenerateOutputSchema[T]() from mcp_schema.go; update
  3 test files to use GenerateSchema directly
- Remove WorkflowSourceInfo type alias from packages.go (no callers)
- Remove ShouldSkipRuntimeSetup from runtime_deduplication.go (always
  returns false) and its pointless test
- Migrate 3 SplitRepoSlug call-sites to repoutil.SplitRepoSlug directly;
  remove cli.SplitRepoSlug wrapper and unused repoutil import from repo.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor persistent wrappers and address orphaned code refactor: remove deprecated wrappers, dead code, and orphaned symbols Feb 28, 2026
@pelikhan pelikhan marked this pull request as ready for review February 28, 2026 17:35
Copilot AI review requested due to automatic review settings February 28, 2026 17:35
@pelikhan pelikhan merged commit 685e25c into main Feb 28, 2026
106 checks passed
@pelikhan pelikhan deleted the copilot/refactor-semantic-function-clustering-3334a908-9aa3-4fe6-a057-ca44251e3039 branch February 28, 2026 17:35
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 the codebase to remove deprecated wrappers, dead code, and orphaned symbols identified by semantic clustering, while reducing duplication in batch tool execution.

Changes:

  • Removed thin/back-compat wrappers and unused symbols (cli.SplitRepoSlug, GenerateOutputSchema, WorkflowSourceInfo, ShouldSkipRuntimeSetup) and migrated remaining call sites.
  • Simplified compile output orchestration by calling display/print helpers directly and keeping only the non-trivial JSON validation formatter.
  • Extracted a shared batch helper (runBatchLockFileTool) to deduplicate actionlint/zizmor batch runner logic.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/runtime_setup_test.go Removes tests for deleted dead symbol (ShouldSkipRuntimeSetup).
pkg/workflow/runtime_deduplication.go Removes always-false deprecated helper (ShouldSkipRuntimeSetup).
pkg/cli/secret_set_command.go Switches to repoutil.SplitRepoSlug directly.
pkg/cli/repo.go Removes SplitRepoSlug wrapper and its unused import.
pkg/cli/pr_command.go Switches remaining call sites to repoutil.SplitRepoSlug.
pkg/cli/packages.go Removes unused backward-compat type alias (WorkflowSourceInfo).
pkg/cli/mcp_tool_schemas_test.go Migrates tests to GenerateSchema.
pkg/cli/mcp_server_defaults_test.go Migrates tests to GenerateSchema.
pkg/cli/mcp_schema_test.go Renames/migrates tests from GenerateOutputSchema to GenerateSchema.
pkg/cli/mcp_schema.go Removes deprecated GenerateOutputSchema alias.
pkg/cli/compile_output_formatter.go Removes trivial formatting wrappers; keeps JSON validation formatter.
pkg/cli/compile_orchestration.go Updates call sites to invoke display/print helpers directly.
pkg/cli/compile_batch_operations.go Introduces shared batch helper to deduplicate actionlint/zizmor runners.

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

Comment on lines +51 to +55
return fmt.Errorf("%s failed: %w", toolName, err)
}
// In non-strict mode, actionlint errors are warnings
// In non-strict mode, errors are warnings
if verbose {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("actionlint warnings: %v", err)))
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("%s warnings: %v", toolName, err)))
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The batch strict/warning messages became less descriptive and inconsistent with the per-file validation errors (e.g., compile_validation.go uses "actionlint linter failed" / "zizmor security scan failed"). Consider letting runBatchLockFileTool accept tool-specific message templates (or an operation description) so strict-mode errors and verbose warnings remain clear and consistent across batch vs per-file paths.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 17
// # Key Functions
//
// Summary Output:
// - formatCompilationSummary() - Format compilation statistics
// - formatValidationOutput() - Format validation results as JSON
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

After removing the summary/stats wrapper functions, this file now only formats validation JSON. Please update the surrounding file documentation/"Key Functions" text to match the remaining scope (or consider relocating/renaming the file) so readers aren’t misled about what’s implemented here.

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 — Persistent Wrappers and New Orphaned Dead Code

3 participants