Skip to content

Refactor compile helpers: co-locate stats logic, isolate infrastructure concerns, and collapse batch wrapper layers#27825

Merged
pelikhan merged 3 commits intomainfrom
copilot/refactor-compile-post-processing
Apr 22, 2026
Merged

Refactor compile helpers: co-locate stats logic, isolate infrastructure concerns, and collapse batch wrapper layers#27825
pelikhan merged 3 commits intomainfrom
copilot/refactor-compile-post-processing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Semantic review of pkg/cli/compile_*.go found three structural issues: compilation stats logic was split across multiple files, compile_post_processing.go mixed unrelated infrastructure/path concerns, and batch tool execution had redundant wrapper layers.

  • Compilation stats clustering

    • Moved CompilationStats and WorkflowFailure definitions into compile_stats.go.
    • Moved trackWorkflowFailure, printCompilationSummary, and collectWorkflowStatisticsWrapper into compile_stats.go so type + operations live together.
  • Post-processing vs infrastructure separation

    • Kept compile_post_processing.go focused on manifest/workflow generation wrappers only.
    • Moved infrastructure helpers to a new compile_infrastructure.go:
      • updateGitAttributes
      • saveActionCache
    • Moved getAbsoluteWorkflowDir into compile_file_operations.go as a general file/path helper.
  • Batch wrapper chain simplification

    • Removed redundant pass-through functions (runBatchActionlint, runBatchZizmor, runBatchPoutine, runBatchRunnerGuard).
    • Updated pipeline call sites to use public runners directly for lock-file tools and a shared directory-tool helper.
    • Added runBatchDirectoryTool(...) for uniform strict/non-strict handling across directory scanners.

Example of the simplified batch flow:

func RunActionlintOnFiles(lockFiles []string, verbose bool, strict bool) error {
    return runBatchLockFileTool("actionlint", lockFiles, verbose, strict, runActionlintOnFiles)
}

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 gh repo view --json owner,name --jq .owner.login + "/" + .name 64/pkg/tool/linux_amd64/vet GOINSECURE 331057/b011/asm.rev-parse ache/go/1.25.8/x--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 1740026078 SZyr/UNQkpBpW_IvLZuHOSZyr x_amd64/compile GOINSECURE l GOMODCACHE x_amd64/compile -c ger.test FnMM/DTE1YZYN5-LgmGb0FnMM ortcfg.link -n1 b/gh-aw/pkg/acticonfig --end-of-options--get-regexp 9Ym34G_sfJyM6o-I^remote\..*\.gh-resolved$ (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 1740026078 aMu6/n6X7R7Av3bGkLZAPaMu6 .cfg GOINSECURE contextprotocol/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-buildtags -c 5138120/b395/_pkg_.a log .cfg -n1 --format=format:config --end-of-options--get-regexp ache/go/1.25.8/x^remote\..*\.gh-resolved$ (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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name 2b6868ce6d8e1be7GOINSECURE GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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, .object.type] | @tsv xterm-color 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp 2587553978/.githgit .cfg 64/pkg/tool/linu--show-toplevel infocmp -1 xterm-color 64/pkg/tool/linux_amd64/vet /usr/bin/git 331057/b252/_pkgnode rTOi/gKjgtBqA_nQ/opt/hostedtoolcache/node/24.14.1/x64/bin/npm ache/go/1.25.8/xinstall git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git ility-kit.md GO111MODULE 64/bin/go /usr/bin/git remo�� -v go (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, .object.type] | @tsv GOMODCACHE x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git conf�� --get remote.origin.url /usr/bin/git template-expressgit GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv /tmp/compile-allbase (original) l /usr/bin/gh remote.origin.urgit GO111MODULE 64/bin/go gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE layTitle node (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, .object.type] | @tsv 331057/b202/impo--workflow -trimpath ache/go/1.25.8/x--limit -p strings -lang=go1.25 ache/go/1.25.8/x--name-only -o st-2411874223/.github/workflows -trimpath 1/x64/bin/node -p crypto/internal/rev-parse -lang=go1.25 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linutest@example.com (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git sRemoteWithRealGtr sRemoteWithRealG\n .cfg git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git 331057/b234/impogit -trimpath ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet 1/x64/bin/npm /tmp/gh-aw-add-ggit stmain.go ache/go/1.25.8/x--show-toplevel 1/x64/bin/npm rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/link /usr/bin/git 5138120/b459/ttygit remote 5138120/b459/imp--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, .object.type] | @tsv t0 rev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/approach-validator.md --json /opt/hostedtoolcache/node/24.14.1/x64/bin/node ea0379a4d10830dcgit GO111MODULE x_amd64/compile node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript2571895618/001/test-inlined-imports-enabled-with-env-temgit s/test.md clusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle -json GO111MODULE 64/bin/go 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, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linuorigin /usr/bin/git CompiledOutput20git -trimpath 5138120/b399/age-b git rev-�� --show-toplevel 5138120/b399/agentdrain.test /usr/bin/git t0 /tmp/go-build123rev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linuremote /usr/bin/git 5849-60793/test-git -trimpath ache/go/1.25.8/x-b git conf�� user.email test@example.com /usr/bin/git -json GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json ag.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_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, .object.type] | @tsv --show-toplevel x_amd64/link /opt/hostedtoolcache/node/24.14.1/x64/bin/node tPQEqnyUP .cfg x_amd64/compile /opt/hostedtoolcache/node/24.14.1/x64/bin/node /tmp�� needs.build.outputs.version x_amd64/compile /usr/bin/git 331057/b038/_pkggit om/modelcontextprev-parse 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv Secret: ${{ secrets.TOKEN }} epo}/actions/runs/3/artifacts /usr/bin/infocmp e GO111MODULE 64/bin/go infocmp -1 xterm-color go /usr/bin/git mLsRemoteWithReagit mLsRemoteWithRearev-parse 64/bin/go /usr/bin/git (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, .object.type] | @tsv --show-toplevel -goversion /usr/bin/git -c=4 -nolocalimports -importcfg git init�� /home/REDACTED/work/gh-aw/gh-aw/pkg/repoutil/repoutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/repoutil/repoutil_test.go 5138120/b465/vet.cfg -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv user.email test@example.com /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json .cfg 64/pkg/tool/linu--show-toplevel /opt/hostedtoolcache/node/24.14.1/x64/bin/node /tmp�� github.repository 64/pkg/tool/linux_amd64/vet /usr/bin/git rtcfg .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/archie.md -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git -C /tmp/TestGuardPolicyTrustedUsersCompiledOutput4072870969/001 config /usr/bin/gh remote.origin.urgit GO111MODULE 64/bin/go gh (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, .object.type] | @tsv ErrorFormatting4136972566/001 ^remote\..*\.gh-resolved$ ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile l GO111MODULE x_amd64/compile ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile conf�� 5138120/b472/_pkg_.a remote.origin.url 5138120/b472=> -json GO111MODULE x_amd64/compile node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv k/gh-aw/gh-aw/.github/workflows/agent-persona-explorer.md initial commit epo.git json' --ignore-pgit GO111MODULE 64/bin/go git -C /tmp/gh-aw-test-runs/20260422-125849-60793/test-4018167833/.github/workflows rev-parse ache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go ache/node/24.14.1/x64/bin/node (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, .object.type] | @tsv --count b57e8536..HEAD $name) { hasDiscussionsEnabled } } README.md ion-test..token-config es/.bin/git git rev-�� HEAD b57e8536 tnet/tools/git token-test.txt (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv b57e8536..HEAD --stdout modules/@npmcli/run-script/lib/node-gyp-bin/go ion-test..token-/bin/sh git odules/npm/node_git commit -m 'Initial commit' git rev-�� HEAD b57e8536..HEAD 64/bin/node -m (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv --count st/suppress-warnings.cjs $name) { hasDiscussionsEnabled } } -b ion-test..token---experimental-import-meta-resolve git st/dist/workers//home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs show�� email "test@examnode 60d99e16 bin/node token-test.txt git git git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --git-dir x_amd64/vet /usr/bin/git DIATz0CEW .cfg 64/pkg/tool/linu--show-toplevel git init�� GOMODCACHE 64/pkg/tool/linutest@example.com /usr/bin/git itbranch_with_hygit itbranch_with_hyrev-parse 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git NPmp1mTzC GO111MODULE 64/bin/go git rev-�� --show-toplevel ortcfg /usr/bin/git d/gh-aw/main.go d/gh-aw/capitalirev-parse 64/bin/go git (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, .object.type] | @tsv --show-toplevel x_amd64/compile /usr/bin/git -json rk x_amd64/compile git conf�� s/test.md remote.origin.url 64/pkg/tool/linux_amd64/vet -json GO111MODULE x_amd64/compile 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv -m l /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go 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, .object.type] | @tsv ithub/workflows/approach-validator.md config /usr/bin/git remote.origin.urgit GO111MODULE x_amd64/compile git rev-�� runs/20260422-124835-33098/test-2843431405 x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv gOmuTuB92KxtC2YCkmX2/gOmuTuB92KxtC2YCkmX2 l /usr/bin/git -c=4 -nolocalimports -importcfg git -C /tmp/TestGuardPolicyMinIntegrityOnlymin-integrity_only_defaults_repo1362114250/001 config /usr/bin/git remote.origin.urgit GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 331057/b007/symauser.email 64/pkg/tool/linutest@example.com ache�� 1181172258/.github/workflows r73k/ZR15bOYtzO_sNGC5r73k ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE g/x/net/http/httrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140only 331057/b029/symauser.email 64/pkg/tool/linutest@example.com env 350403376/custom/workflows wyMD/ZnqvKWWFy1YdeRMpwyMD ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� --check **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti-v go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE pBvTgXO/G1KutSxXHjoE8hqd2SJr env 3654472415 GO111MODULE .cfg GOINSECURE g/x/net/http2/hprev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-buildtags (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 om/modelcontextprotocol/go-sdk@v1.5.0/internal/x-ifaceassert 64/pkg/tool/linux_amd64/vet GOINSECURE l/buffer GOMODCACHE 64/pkg/tool/linux_amd64/vet ortc�� 1740026078 stmain.go .cfg GOINSECURE a95/uritemplate/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-trimpath (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile /opt�� prettier --check ser.test **/*.ts **/*.json --ignore-path ser.test (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linu-test.short=true GOINSECURE /unix GOMODCACHE 64/pkg/tool/linu/tmp/go-build1235138120/b111/vet.cfg env 331057/b224/_pkg_.a 7LFx/9x5EhNlMwHDxpQFH7LFx .cfg GOINSECURE able GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 om/modelcontextp-nolocalimports 64/pkg/tool/linu-importcfg GOINSECURE GOMOD GOMODCACHE sY5xy3c/9ezsDU_VWw7VJguVlRAx env 1740026078 gNV_/-ERQMY_tDmUJytyNgNV_ x_amd64/link GOINSECURE contextprotocol/init GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile /opt�� g_.a --check 64/pkg/tool/linux_amd64/vet **/*.ts **/*.json --ignore-path 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 api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 331057/b255/_pkg_.a 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 2 --dir test-logs/run-2 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 350403376/custom/workflows .cfg x_amd64/link GOINSECURE th2/internal GOMODCACHE x_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� --check **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name rg/x/text@v0.36.0/internal/stringset/set.go 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 331057/b007/syma--show-toplevel 64/pkg/tool/linux_amd64/vet env 1181172258/.github/workflows k-ff/hcoMcb4nJlDk1Ubnk-ff .cfg GOINSECURE b/gh-aw/pkg/giturev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/aes/gcm 331057/b029/symabis 64/pkg/tool/linux_amd64/vet env 331057/b225/_pkg_.a ho52/RILG8Ja3npv64jHUho52 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE ce GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� DefaultBranchFromLsRemoteWithRealGitmain_branch1221605139/001' DefaultBranchFromLsRemoteWithRealGitmain_branch1221605139/001' ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--get-regexp go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 331057/b013/syma--git-dir 64/pkg/tool/linux_amd64/vet env 1181172258/.github/workflows 7Ps3/Xuna8G_bMUX3GMM57Ps3 ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe GOINSECURE t/internal/strinrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-extld=gcc (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE 331057/b021/atomconfig ache/go/1.25.8/xuser.name 64/pkg/tool/linuTest User env 331057/b228/_pkg_.a 4ACQ/f02Eva1ttQPQuPWq4ACQ ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE l/httpcommon GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE ck GOINSECURE GOMOD GOMODCACHE node sRem�� --check **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 1181172258 fWCy/na03iXLzDBM34i--fWCy ache/go/1.25.8/x64/pkg/tool/linu-nolocalimports GOINSECURE /semver GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linurev-parse (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 .cfg 64/pkg/tool/linu-nolocalimports GOINSECURE b/gh-aw/pkg/consrev-parse GOMODCACHE 64/pkg/tool/linu/tmp/go-build1235138120/b462/_testmain.go env 350403376/custom/workflows GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE th2 GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-importcfg (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE node /hom�� --check **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel 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 -c=4 -nolocalimports -importcfg /tmp/go-build1235138120/b419/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/tar.go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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 x_amd64/vet env o actions/setup-cli/install.sh..-errorsas GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_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 6 331057/b078/ GOMODCACHE 64/pkg/tool/linux_amd64/vet env l.go l_test.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE contextprotocol/rev-parse 331057/b078/syma--show-toplevel ache/go/1.25.8/x64/pkg/tool/linutest@example.com (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build1235138120/b404/cli.test /tmp/go-build1235138120/b404/cli.test -test.testlogfile=/tmp/go-build1235138120/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /tmp/go-build2954449555/b404/cli.test /tmp/go-build2954449555/b404/cli.test -test.testlogfile=/tmp/go-build2954449555/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go ode_�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x--json /usr/bin/git 1SUlY0Hxg 5138120/b187/vetrev-parse ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ortcfg /usr/bin/git g/gitutil/gitutils g/gitutil/gituti-lh 1/x64/bin/node git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git --check **/*.cjs ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 5849-60793/test-ls GO111MODULE /opt/hostedtoolc/tmp/gh-aw/aw-feature-branch.patch git (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, .object.type] | @tsv se 5138120/b006/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv ck 'scripts/**/*.js' --ignore-path .prettierignoGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env y_with_repos_array_c108485190/00remote.origin.url n.go 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link (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, .object.type] | @tsv -json GO111MODULE x_amd64/link GOINSECURE jsonrpc2 GOMODCACHE x_amd64/link env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv tions-lock.json pkg/actionpins/data/action_pins.json; \ echo "��� Action pins synced successfulgit GO111MODULE bin/node GOINSECURE GOMOD GOMODCACHE go tion�� 64805394/001 64805394/002/work 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env _.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -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)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv ." GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go 6480�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env _.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE n-dir/node GOINSECURE GOMOD GOMODCACHE go tion�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 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, .object.type] | @tsv se 5138120/b011/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE 331057/b133/aritconfig ache/go/1.25.8/x--get ache/go/1.25.8/xremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv itbranch_with_hy--detach itbranch_with_hyphen342216597/002/work 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE sh (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/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion **/*.json --ignore-path ../../../.pretti--show-toplevel go env 5849-60793/test-2916045784/.github/workflows GO111MODULE ache/go/1.25.8/x64/bin/go 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 x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json age/compact/comp-ifaceassert x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-buildtags -V=f�� e-analyzer.md -Eee/499QsILxkBjFfa_H-Eee x_amd64/compile GOSUMDB GOWORK 64/bin/go x_amd64/compile (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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name 9d2033b42f8e339aGOINSECURE GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE 3ChZaxU4tgCH env -json GO111MODULE 6f085b31ee0789e7-d GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 331057/b235/_pkg_.a NNuM/NZNs7zEf3uyY_7BzNNuM k GOINSECURE osh-tekuri/jsons/tmp/js-hash-test-772974631/test-hash.js GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sRem�� se 5138120/b053/vet.cfg .cfg -I /tmp/go-build828run -I ache/go/1.25.8/x3 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch -json GO111MODULE /usr/bin/git GOINSECURE GOMOD GOMODCACHE git push�� origin l /usr/bin/git GOSUMDB GOWORK 64/bin/go git (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git conf�� --local --get ode_modules/.bin/git cal/bin/git git /git git add . git tions/setup/node_modules/.bin/git -M main bin/git git (dns block)
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git conf�� --local --get ode_modules/.bin/git de_modules/.bin//usr/lib/git-core/git git /git git add . git tions/setup/node_modules/.bin/git -M main bin/git git (dns block)

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

Copilot AI changed the title [WIP] Refactor compile_post_processing.go for better organization Refactor compile helpers: co-locate stats logic, isolate infrastructure concerns, and collapse batch wrapper layers Apr 22, 2026
Copilot AI requested a review from pelikhan April 22, 2026 13:07
@pelikhan pelikhan marked this pull request as ready for review April 22, 2026 13:23
Copilot AI review requested due to automatic review settings April 22, 2026 13:23
@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great work on this compile helpers refactor! The separation of stats logic, infrastructure concerns, and the batch wrapper simplification all make the pkg/cli/compile_*.go package significantly easier to navigate and maintain.

The PR is well-described, focused on a single coherent concern, includes a new test file (compile_batch_operations_test.go), and follows the agentic development process expected by this project.

This looks ready for maintainer review! 🚀

Generated by Contribution Check · ● 1.8M ·

Copy link
Copy Markdown
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 compile helpers to better separate concerns: workflow compilation statistics are co-located, infrastructure/file-path helpers are isolated from post-processing, and batch tool execution wrappers are simplified.

Changes:

  • Moved CompilationStats/WorkflowFailure and related helpers (trackWorkflowFailure, summary/stats collection) into compile_stats.go.
  • Split infrastructure concerns into compile_infrastructure.go and relocated getAbsoluteWorkflowDir to compile_file_operations.go.
  • Collapsed redundant batch wrapper layers, introducing runBatchDirectoryTool(...), and updated pipeline call sites; added focused unit tests for the new batch behavior.
Show a summary per file
File Description
pkg/cli/compile_stats.go Centralizes compilation stats types + helper functions, and hosts workflow stats collection wrapper.
pkg/cli/compile_post_processing.go Removes stats + infra/path helpers to keep post-processing focused on manifest/workflow generation.
pkg/cli/compile_pipeline.go Updates call sites to use the simplified batch runners / shared directory-tool helper.
pkg/cli/compile_infrastructure.go New file for infra helpers (updateGitAttributes, saveActionCache).
pkg/cli/compile_file_operations.go Adds getAbsoluteWorkflowDir and removes moved stats summary helpers.
pkg/cli/compile_config.go Removes stats type definitions now owned by compile_stats.go.
pkg/cli/compile_batch_operations_test.go Adds unit tests validating empty-input and strict/non-strict directory-tool behavior.
pkg/cli/compile_batch_operations.go Simplifies batch execution by routing lock-file tools through runBatchLockFileTool and adding runBatchDirectoryTool.

Copilot's findings

Tip

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

  • Files reviewed: 8/8 changed files
  • Comments generated: 1

Comment thread pkg/cli/compile_stats.go
Total int
Errors int
Warnings int
FailedWorkflows []string // Names of workflows that failed compilation (deprecated, use FailedWorkflowDetails)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The FailedWorkflows field comment references FailedWorkflowDetails, but the struct field is named FailureDetails. This is misleading for future maintainers; update the comment to point to FailureDetails (or rename the field if FailedWorkflowDetails is intended).

Suggested change
FailedWorkflows []string // Names of workflows that failed compilation (deprecated, use FailedWorkflowDetails)
FailedWorkflows []string // Names of workflows that failed compilation (deprecated, use FailureDetails)

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100

Excellent test quality

Metric Value
New/modified tests analyzed 3
✅ Design tests (behavioral contracts) 3 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 3 (100%)
Duplicate test clusters 0
Test inflation detected ⚠️ Yes (41 lines in test vs 10 in compile_batch_operations.go = 4.1:1)
🚨 Coding-guideline violations 0

Test Classification Details

Test File Classification Issues Detected
TestRunActionlintOnFiles_EmptyList pkg/cli/compile_batch_operations_test.go:12 ✅ Design Verifies nil-input contract; error path covered
TestRunBatchDirectoryTool_NonStrictSwallowsErrors pkg/cli/compile_batch_operations_test.go:18 ✅ Design Verifies non-strict mode swallows errors (behavioral contract)
TestRunBatchDirectoryTool_StrictWrapsErrors pkg/cli/compile_batch_operations_test.go:29 ✅ Design Verifies strict mode wraps errors with expected message; checks exact error text

Notes

⚠️ Test Inflation (score penalty only — not a failure)

compile_batch_operations_test.go added 41 lines against 10 production lines added in compile_batch_operations.go (ratio 4.1:1, threshold 2:1). This is expected in a refactoring PR where production code was extracted and moved to other files (compile_infrastructure.go, compile_stats.go) — the net production additions across the whole PR are 189 lines vs 41 test lines (0.22:1). No action required; the flag is a formula artifact of the per-file comparison.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 3 tests — unit (//go:build !integration) ✅

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). Build tag present. No mock libraries used. All assertions include descriptive messages.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

References: §24780779749

🧪 Test quality analysis by Test Quality Sentinel · ● 437.6K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). All 3 tests verify behavioral contracts (error handling, mode-specific behavior), build tag is present, and no mock libraries are used.

Generated by the Design Decision Gate workflow to document the
single-responsibility refactor of pkg/cli/compile_*.go helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Commit pushed: 1357127

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (230 new lines in pkg/cli/) but does not have a linked Architecture Decision Record (ADR).

An AI-generated draft ADR has been committed to your branch to help you get started:

📄 Draft ADR: docs/adr/27825-reorganize-compile-pipeline-helpers-by-single-responsibility.md

What to do next

  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete any missing sections — verify the decision rationale, refine the alternatives, and add context the AI couldn't infer
  3. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-27825: Reorganize Compile Pipeline Helpers by Single-Responsibility Concern

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

📋 What the draft ADR covers

The generated ADR documents the following decision:

Decision: Reorganize pkg/cli/compile_*.go helpers so each file owns exactly one concern — stats types + operations in compile_stats.go, infrastructure side-effects in compile_infrastructure.go, and a unified runBatchDirectoryTool replacing four near-identical pass-through wrappers.

Alternatives analyzed:

  • Keep existing layout + add documentation (rejected: documents structure but doesn't fix it)
  • Extract infrastructure into a separate sub-package (rejected: adds import indirection without meaningful boundary for helpers this tightly coupled)

Key normative requirements derived:

  • compile_stats.go MUST own CompilationStats, WorkflowFailure, and all operations on them
  • compile_infrastructure.go MUST NOT contain workflow-generation logic
  • New directory-scanning wrappers MUST delegate to runBatchDirectoryTool
  • Pass-through wrappers with no added logic MUST NOT be introduced
📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 27825-title.md for PR #27825).

🔒 This PR cannot merge until an ADR is linked in the PR body.

References: §24780779719

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · ● 100.1K ·

@pelikhan pelikhan merged commit c7c7e80 into main Apr 22, 2026
24 of 25 checks passed
@pelikhan pelikhan deleted the copilot/refactor-compile-post-processing branch April 22, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants