Skip to content

refactor: split Go BLOCKER files exceeding 1,000 lines to resolve architecture violations#25660

Closed
Copilot wants to merge 7 commits intomainfrom
copilot/fix-architecture-violations
Closed

refactor: split Go BLOCKER files exceeding 1,000 lines to resolve architecture violations#25660
Copilot wants to merge 7 commits intomainfrom
copilot/fix-architecture-violations

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

Six Go files were flagged as BLOCKER architecture violations (>1,000 lines), mixing unrelated concerns in single files. All six are now under 1,000 lines via targeted function extraction — no logic changes.

Splits

pkg/cli/gateway_logs.go (1,332 → 201 lines)

  • gateway_logs_parser.goparseRPCMessages, parseGatewayLogs, processGatewayLogEntry, buildToolCallsFromRPCMessages and supporting helpers
  • gateway_logs_renderer.gorenderGatewayMetricsTable, guardPolicyReasonFromCode, displayAggregatedGatewayMetrics
  • gateway_logs_extractor.goextractMCPToolUsageData, buildGuardPolicySummary

pkg/cli/audit_report_render.go (1,139 → 691 lines)

  • audit_render_policy.gorenderPolicyAnalysis, renderFirewallAnalysis, renderGuardPolicySummary, renderRedactedDomainsAnalysis
  • audit_render_performance.gorenderPerformanceMetrics, renderEngineConfig, renderPromptAnalysis, renderSessionAnalysis
  • audit_render_tokens.gorenderTokenUsage, renderGitHubRateLimitUsage, renderMCPServerHealth

pkg/workflow/compiler_safe_outputs_config.go (1,035 → 263 lines)

The monolithic handlerRegistry map (778 lines of inline closures) is now split across four domain files that register handlers via init():

  • compiler_safe_outputs_handlers_issues.go
  • compiler_safe_outputs_handlers_prs.go
  • compiler_safe_outputs_handlers_discussions.go
  • compiler_safe_outputs_handlers_misc.go
// Before: single 778-line var handlerRegistry = map[string]handlerBuilder{ ... }

// After: main file
var handlerRegistry = map[string]handlerBuilder{}

// In each domain file:
func init() {
    handlerRegistry["create_issue"] = func(cfg *SafeOutputsConfig) map[string]any { ... }
    handlerRegistry["close_issue"] = func(cfg *SafeOutputsConfig) map[string]any { ... }
    // ...
}

pkg/workflow/compiler_orchestrator_workflow.go (1,062 → 670 lines)

  • compiler_orchestrator_helpers.goprocessAndMergeSteps, processAndMergePreSteps, processAndMergePostSteps, processAndMergeServices, mergeJobsFromYAMLImports, processOnSectionAndFilters

pkg/cli/logs_orchestrator.go (1,074 → 600 lines)

  • logs_orchestrator_concurrency.godownloadRunArtifactsConcurrent, runContainsSafeOutputType, runHasDifcFilteredItems

pkg/cli/logs_report.go (1,065 → 896 lines)

  • logs_report_network.gobuildAccessLogSummary, buildFirewallLogSummary, buildRedactedDomainsSummary, aggregateDomainStats, convertDomainsToSortedSlices

Not addressed

JavaScript BLOCKER files (log_parser_shared.cjs at 1,703 lines, create_pull_request.cjs at 1,666 lines, and others) remain above threshold and require follow-up.

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 auth status GOPROXY GOROOT GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json mgJ6/e9tg3TYwOySGOMOD 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
    • Triggering command: /usr/bin/gh gh auth status iptables -w -t security /prepare-commit-msg OUTPUT -d 168.63.129.16 /prepare-commit-msg 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 go 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git 7b2108aefa1949acgit .cfg 64/pkg/tool/linu--show-toplevel git (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 -c=4 -nolocalimports -importcfg /tmp/go-build4052475642/b411/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/tar.go /hom�� --check scripts/**/*.js 64/bin/go -d git 64/bin/go y.s (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 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 --show-toplevel -tests /usr/bin/git 7905580/b079/vetgit go ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x/tmp/go-build1841077569/b222/vet.cfg /usr/bin/git f2419521:pkg/cli/opt/hostedtoolcache/node/24.14.1/x64/bin/npm --write ache/go/1.25.8/x--package-lock-only git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel go /usr/bin/git 8299/001/stabiligit GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--package-lock-only git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (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 se 1077569/b030/vet.cfg .cfg ./../.prettieriggit --hostname x_amd64/vet ache/go/1.25.8/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 go /usr/bin/git led-with-env-temgit GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git re GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel node /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel go /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 on' --ignore-pat-errorsas scripts/**/*.js rgo/bin/bash .prettierignore --log-level=erro--norc ache/go/1.25.8/x--noprofile /opt/hostedtoolc-tests -uns�� ./../pkg/workflow/js/**/*.json' --ignore-path go x_amd64/vet -json GO111MODULE k/_temp/uv-pytho--show-toplevel x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel ache/go/1.25.8/x-buildtags /usr/bin/git th .prettierignogit go /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolc-tests /usr/bin/git /tmp/go-build356git go x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/cgo /usr/bin/git se 1077569/b023/vetrev-parse .cfg git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 1077569/b096/vetrev-parse ache/go/1.25.8/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 -bool -buildtags /usr/bin/bash -errorsas -ifaceassert -nilfunc bash --no�� --noprofile -tests /usr/bin/git 7905580/b017/vetgit security .go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -bool -buildtags /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -ato�� -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc 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/vet /usr/bin/git ript files formagit .cfg .cfg git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo /usr/bin/git --noprofile x_amd64/vet ache/go/1.25.8/x--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 -unreachable=false /tmp/go-build1841077569/b210/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet h ../../../.pretgit go 64/pkg/tool/linu--show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -ato�� -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -bool -buildtags /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -V=f�� -stringintconv -tests /usr/bin/git 7905580/b027/vetgit security ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -bool -buildtags /usr/bin/tail -errorsas -ifaceassert -nilfunc tail -5 -stringintconv -tests /usr/bin/git js/**/*.json' --git go ache/go/1.25.8/x--show-toplevel git (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 -bool -buildtags /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo -V=f�� -stringintconv -tests /usr/bin/git 7905580/b021/vetgit security ndor/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha GOMODCACHE go /usr/bin/git LsRemoteWithRealgit LsRemoteWithRealrev-parse 64/bin/go /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git 3004851777/.githgit GO111MODULE 1/x64/bin/npx git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /home/REDACTED/.cargo/bin/bash --show-toplevel git /usr/bin/git bash --no�� --noprofile git /usr/bin/git --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/git 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 -bool -buildtags /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile -V=f�� -stringintconv -tests /usr/bin/git 7905580/b019/vetgit security ache/go/1.25.8/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 go /usr/bin/git -json GO111MODULE 64/bin/go /usr/bin/git conf�� --get-regexp ^remote\..*\.gh-resolved$ /usr/bin/git 3004851777/.githgit GO111MODULE ache/go/1.25.8/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 /home/REDACTED/.local/bin/bash --show-toplevel git /usr/bin/git bash --no�� --noprofile git /usr/bin/git --show-toplevel git /usr/bin/git git (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 te '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore bash 64/pkg/tool/linux_amd64/vet on' --ignore-patgit GOPROXY _modules/.bin/no--show-toplevel 64/pkg/tool/linux_amd64/vet -c rite '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path bash .cfg --noprofile go x_amd64/vet ache/go/1.25.8/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 xterm-color infocmp /usr/bin/git xterm-color 64/pkg/tool/linurev-parse 64/bin/go git -C /tmp/gh-aw-test-runs/20260410-152021-66447/test-3004851777/.github/workflows config /usr/bin/git remote.origin.urgit GO111MODULE 64/bin/go git (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 erignore /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/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 /etc/cron.hourly 64/pkg/tool/linux_amd64/vet /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link h ../../../.pretgit go 64/pkg/tool/linu--show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -o /tmp/go-build1841077569/b001/workflow.test -importcfg /usr/bin/git -s -w -buildmode=exe git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel go /usr/bin/infocmp -json GO111MODULE 64/bin/go infocmp -1 xterm-color go /usr/bin/git rdian.md GO111MODULE tions/setup/node--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 --show-toplevel git /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link --show-toplevel node /usr/bin/git /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/link -o /tmp/go-build641504629/b366/exe/a.out -importcfg /usr/bin/git -buildmode=exe -buildid=v_c_6pOrev-parse -extld=gcc 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 --noprofile .cfg 64/pkg/tool/linux_amd64/vet --noprofile go erignore 64/pkg/tool/linux_amd64/vet --no�� te '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path ../../../.prettieriggit bash ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ../pkg/workflow/git /bin/sh x_amd64/vet ache/go/1.25.8/x64/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 k/gh-aw/gh-aw/.github/workflows/agentic-observability-kit.md origin (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 ache/go/1.25.8/xrev-parse /usr/bin/git git rev-�� ithub-script/git/ref/tags/v9 git /usr/bin/git --show-toplevel 3056462/b422/parrev-parse /usr/bin/git 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 HEAD .cfg 64/pkg/tool/linux_amd64/vet node_modules,vengit go erignore 64/pkg/tool/linux_amd64/vet --no�� te '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' --ignore-path ../../../.prettieriggit bash ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet ../pkg/workflow/git go x_amd64/vet ache/go/1.25.8/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 k/gh-aw/gh-aw/.github/workflows/agent-persona-explorer.md --format=%(objectname) /usr/bin/git test/race-image:git 64/pkg/tool/linurev-parse 64/bin/go git -C ithub-script/git/ref/tags/v9 remote /usr/bin/git yphen3883056944/git yphen3883056944/rev-parse 64/bin/go 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 (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 5.0/internal/doc.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD bis 64/pkg/tool/linux_amd64/compile env 3838905937 bBouUBHdz ck GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 4GDF0MOYT 64/pkg/tool/linux_amd64/compile GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE b95b49415fe515e71126190ef8eb8b214494d4551c25b91b-d GOINSECURE GOMOD GOMODCACHE go env */*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore 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/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name til.go 64/pkg/tool/linux_amd64/compile GOINSECURE essage bis 64/pkg/tool/linux_amd64/compile env _.a ke8fejfLv x_amd64/vet GOINSECURE age/compact GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 0/feature/plural/common.go 64/pkg/tool/linux_amd64/compile GOINSECURE ha8_stub.o 64/src/internal/--git-dir 64/pkg/tool/linux_amd64/compile env 3619492493 PcfUGjA_S x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE tions/setup/js/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env */*.ts' '**/*.json' --ignore-path ../../../.prettierignore GO111MODULE 64/pkg/tool/linux_amd64/asm GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/asm (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 0/internal/language/compact/compact.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD bis 64/pkg/tool/linux_amd64/compile 64/s�� _.a sYAOo28ie ache/go/1.25.8/x64/pkg/tool/linu-test.short=true GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/xtest@example.com (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 0/internal/format/format.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env _.a J9_2Hh5RJ ache/go/1.25.8/x64/pkg/tool/linu-lang=go1.25 GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE tions/setup/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env 8299/001/stability-test.md 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/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name 5.0/deviceauth.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 3838905937 tVIFB3NxN ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE go-sdk/oauthex GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 h1Ee82J5b 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env LtLQ2zw4M GO111MODULE k GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE de/node/bin/sh GOINSECURE GOMOD GOMODCACHE go env 8299/001/stability-test.md GO111MODULE 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/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name rotocol/go-sdk@v1.5.0/oauthex/auth_meta.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User env _.a NG8R67gve eutil.test GOINSECURE go-sdk/auth GOMODCACHE eutil.test (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 S1XHWmzm6 64/pkg/tool/linu-nolocalimports GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build4052475642/b455/_testmain.go env rtcfg vohS5K4mu ger.test GOINSECURE GOMOD GOMODCACHE ger.test (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 go env */*.ts' '**/*.json' --ignore-path ../../../.prettierignore GO111MODULE .test GOINSECURE GOMOD GOMODCACHE .test (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 rotocol/go-sdk@v-nolocalimports 64/pkg/tool/linu-importcfg GOINSECURE y.o 64/src/internal/user.email 64/pkg/tool/linutest@example.com env 3838905937 GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE go-sdk/mcp GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 NgK5Xenpy ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env rtcfg uKJh7UXOD x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE int is not installed. Run 'make deps-dev' to in env edOutput1517860577/001 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuorigin (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 rotocol/go-sdk@v1.5.0/mcp/client.go 64/pkg/tool/linux_amd64/compile GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE other.o 64/src/crypto/in--show-toplevel 64/pkg/tool/linux_amd64/vet env 2667728660/.github/workflows GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE h_wasm.o 64/src/math/big/arith_wasm.s 64/pkg/tool/linux_amd64/compile (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 go env edOutput1517860577/001 GO111MODULE 64/pkg/tool/linux_amd64/vet hen \ echo "JSOgit GOMOD GOMODCACHE 64/pkg/tool/linuTest User (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --check **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti/tmp/go-build185949714/b222/_pkg_.a node /hom�� --check scripts/**/*.js 64/bin/go -d git 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 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 run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE 64/pkg/tool/linuremote2 env _.a uVfRvwDwi /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE go-sdk/internal/init 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 --show-toplevel /opt/hostedtoolc-tests /usr/bin/git alse go x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git '**/*.ts' '**/*.git go x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel go /usr/bin/git ck '**/*.cjs' '*git GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/link /usr/bin/git 2021-66447/test-git GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel /usr/lib/git-correv-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /bin/sh 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 js/**/*.json' --ignore-path ../../../.prettierignore go f2419521 -json GO111MODULE ache/go/1.25.8/x-bool ache/go/1.25.8/x-buildtags 7905�� f2419521:pkg/cli-errorsas **/*.cjs ache/go/1.25.8/x-nilfunc **/*.json --ignore-path ../../../.pretti-bool ache/go/1.25.8/x-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha y_with_explicit_repo1624932732/001 GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go 8d51�� 7/001/inlined-a.md GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git /usr/bin/git -u origin /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git user.name Test User /usr/bin/git 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 x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json l/format/format.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 9785�� -json GO111MODULE 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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env Gitmaster_branch2358230185/001' Gitmaster_branch2358230185/001' x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json /unsafebytes/uns-c=4 x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile er_b�� -json ii/equal_fold.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -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)
  • 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 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/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go 9785�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/refs/heads/copilot/fix-architecture-violations
    • Triggering command: /usr/bin/gh gh api repos/github/gh-aw/git/refs/heads/copilot/fix-architecture-violations go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -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 js/**/*.json' --ignore-path ../../../.prettierignore go n-dir/git -json GO111MODULE ache/go/1.25.8/x-unreachable=false ache/go/1.25.8/x/tmp/go-build1841077569/b186/vet.cfg 7905�� f2419521:pkg/cli/gateway_logs_extractor.go **/*.cjs ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet **/*.json --ignore-path ../../../.pretti-bool ache/go/1.25.8/x-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go 8d51�� -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git /usr/bin/git user.name Test User /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --git-dir go /usr/bin/git 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 GOINSECURE wasm.o 64/src/runtime/s--show-toplevel 64/pkg/tool/linux_amd64/vet env -json 5Lj-UidHf ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-path .prettierignore 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 64/bin/go **/*.ts **/*.json --ignore-path /bin/sh -c echo "��� JavaSc-p sh 64/bin/go tierignore git 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go **/*.ts **/*.json --ignore-path go env GOPATH sh 64/bin/go -d git 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build4052475642/b397/cli.test /tmp/go-build4052475642/b397/cli.test -test.testlogfile=/tmp/go-build4052475642/b397/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -nolocalimports -importcfg /tmp/go-build185949714/b207/importcfg -pack -c npx prettier --c-p GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/n/tmp/go-build185949714/b212/_pkg_.a node (http block)
    • Triggering command: /tmp/go-build3743056462/b397/cli.test /tmp/go-build3743056462/b397/cli.test -test.testlogfile=/tmp/go-build3743056462/b397/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true 3360181765/.githgo glpNKSOQr 64/pkg/tool/linu-json go env -json GO111MODULE 64/bin/go ./cmd/... ./pkg/...; \ else \ echo "golangci-lint is not installed. Run 'make deps-dev' to in GOMOD GOMODCACHE go (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 npx prettier --c-p GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go node /hom�� --check scripts/**/*.js 64/bin/go -d git 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/curl curl -s -H Authorization: ****** REDACTED b/gh-aw.git GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 8381753/b425/impGO111MODULE --ch�� che/go-build/c7/GOINSECURE **/*.ts 64/bin/go --ignore-path ../../../.pretti--norc 64/bin/go /opt/hostedtoolcGOPROXY (http block)
    • Triggering command: /usr/bin/gh gh api user --hostname github.com k/gh-aw/gh-aw/pkGOINSECURE k/gh-aw/gh-aw/pkGOMOD 64/bin/go **/*.json --ignore-path ../../../.pretti--noprofile /opt/hostedtoolcGOPROXY -o /tmp/go-build270GOSUMDB -trimpath 64/bin/go -p github.com/stret--norc -lang=go1.17 go (http block)

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

Copilot AI and others added 5 commits April 10, 2026 15:00
Move functions from the 1,332-line gateway_logs.go into three new files:
- gateway_logs_parser.go: RPC/gateway log parsing (parseRPCMessages,
  findRPCMessagesPath, parseGatewayLogs, processGatewayLogEntry,
  getOrCreateServer, getOrCreateTool, calculateGatewayAggregates,
  buildToolCallsFromRPCMessages)
- gateway_logs_renderer.go: console table rendering (renderGatewayMetricsTable,
  getSortedServerNames, guardPolicyReasonFromCode,
  displayAggregatedGatewayMetrics)
- gateway_logs_extractor.go: high-level extraction (extractMCPToolUsageData,
  buildGuardPolicySummary)

gateway_logs.go retains only types, constants, logger, and isGuardPolicyErrorCode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Extract policy/firewall rendering to audit_render_policy.go,
performance/engine rendering to audit_render_performance.go,
and token/rate-limit/MCP-health rendering to audit_render_tokens.go.

Reduces audit_report_render.go from 1,139 lines to ~691 lines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Move handler builder entries from the monolithic handlerRegistry
variable into four domain-specific files using init() functions:

- compiler_safe_outputs_handlers_issues.go: create/close/update_issue,
  link_sub_issue, add/remove_labels, assign_milestone, set_issue_type,
  assign/unassign_from_user
- compiler_safe_outputs_handlers_prs.go: create/push/update/close PR,
  review comments, submit/reply/resolve review, add_reviewer,
  mark_as_ready
- compiler_safe_outputs_handlers_discussions.go: add_comment,
  create/close/update_discussion, hide_comment
- compiler_safe_outputs_handlers_misc.go: dispatch_workflow/repository,
  call_workflow, noop, missing_tool/data, report_incomplete,
  assign_to_agent, upload_asset/artifact, autofix_code_scanning_alert,
  create/update_project, create_project_status_update, update_release,
  create_code_scanning_alert, create_agent_session

The main file is reduced from 1035 to 263 lines. handlerRegistry
starts empty and is populated via init() calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…tor_workflow

Move processAndMergeSteps, processAndMergePreSteps, processAndMergePostSteps,
processAndMergeServices, mergeJobsFromYAMLImports, and processOnSectionAndFilters
into a new compiler_orchestrator_helpers.go file.

compiler_orchestrator_workflow.go: 1,062 → 674 lines
compiler_orchestrator_helpers.go: 403 lines (new)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ions

- Split pkg/cli/gateway_logs.go (1332→201 lines) into:
  gateway_logs_parser.go, gateway_logs_renderer.go, gateway_logs_extractor.go
- Split pkg/cli/audit_report_render.go (1139→691 lines) into:
  audit_render_policy.go, audit_render_performance.go, audit_render_tokens.go
- Split pkg/workflow/compiler_safe_outputs_config.go (1035→263 lines):
  extracted handler registry into 4 domain init() files
- Split pkg/workflow/compiler_orchestrator_workflow.go (1062→670 lines):
  extracted helpers into compiler_orchestrator_helpers.go
- Split pkg/cli/logs_orchestrator.go (1074→600 lines):
  extracted concurrency functions into logs_orchestrator_concurrency.go
- Split pkg/cli/logs_report.go (1065→896 lines):
  extracted network analysis into logs_report_network.go"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ec5a1c29-2e00-4c3b-98c8-15bb82259626

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix architecture violations detected in Go files refactor: split Go BLOCKER files exceeding 1,000 lines to resolve architecture violations Apr 10, 2026
Copilot AI requested a review from pelikhan April 10, 2026 15:38
@pelikhan pelikhan marked this pull request as ready for review April 10, 2026 16:05
Copilot AI review requested due to automatic review settings April 10, 2026 16:05
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 several oversized Go files by extracting cohesive groups of functions into smaller, domain-focused files to address architecture/lint violations (targeting <1,000 lines per file), with intended behavior preservation.

Changes:

  • Split MCP gateway log parsing/rendering/extraction logic into dedicated files under pkg/cli/.
  • Split audit report rendering into policy/performance/token-focused files under pkg/cli/.
  • Refactored workflow compiler helpers and safe-outputs handler registry into smaller domain files under pkg/workflow/.
Show a summary per file
File Description
pkg/workflow/compiler_safe_outputs_config.go Replaces monolithic inline handler registry with an empty registry populated elsewhere.
pkg/workflow/compiler_safe_outputs_handlers_issues.go Registers issue-related safe-output handler builders via init().
pkg/workflow/compiler_safe_outputs_handlers_prs.go Registers PR-related safe-output handler builders via init().
pkg/workflow/compiler_safe_outputs_handlers_discussions.go Registers discussion-related safe-output handler builders via init().
pkg/workflow/compiler_safe_outputs_handlers_misc.go Registers miscellaneous safe-output handler builders via init().
pkg/workflow/compiler_orchestrator_workflow.go Removes large helper implementations after extraction into a helper file.
pkg/workflow/compiler_orchestrator_helpers.go Adds extracted orchestrator helper methods (steps/services/jobs/on-section processing).
pkg/cli/logs_orchestrator.go Removes large concurrent download/filter helpers after extraction.
pkg/cli/logs_orchestrator_concurrency.go Adds extracted concurrent artifact download + safe-output/DIFC filter helpers.
pkg/cli/logs_report.go Removes network/domain aggregation helpers after extraction.
pkg/cli/logs_report_network.go Adds extracted access/firewall/redacted domain summary aggregation helpers.
pkg/cli/gateway_logs.go Keeps core types/constants/helpers; removes parsing/rendering/extraction implementations.
pkg/cli/gateway_logs_parser.go Adds extracted gateway/rpc parsing + metrics aggregation helpers.
pkg/cli/gateway_logs_renderer.go Adds extracted console rendering + aggregated display helpers.
pkg/cli/gateway_logs_extractor.go Adds extracted MCP tool usage + guard policy summary building helpers.
pkg/cli/audit_report_render.go Removes policy/performance/token rendering implementations after extraction.
pkg/cli/audit_render_policy.go Adds extracted policy/guard/firewall/redacted rendering helpers.
pkg/cli/audit_render_performance.go Adds extracted performance/engine/prompt/session rendering helpers.
pkg/cli/audit_render_tokens.go Adds extracted token usage + GitHub rate limit + MCP health rendering helpers.

Copilot's findings

Tip

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

  • Files reviewed: 19/19 changed files
  • Comments generated: 3

Comment on lines +1 to +2
//go:build !integration

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The new helper file is excluded when building with the integration build tag (//go:build !integration). This will break go test -tags=integration / go vet -tags=integration because compiler_orchestrator_workflow.go still calls these methods (e.g., processAndMergeSteps, processOnSectionAndFilters), but their definitions won’t be compiled. Remove this build constraint (or provide an equivalent //go:build integration implementation) so integration-tag builds still compile.

Suggested change
//go:build !integration

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +8
//go:build !integration

// This file contains network/domain analysis functions extracted from logs_report.go
// to keep that file under 1,000 lines.

package cli

import "slices"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This extracted file is excluded under the integration build tag (//go:build !integration). The main logs_report.go (which is still built with -tags=integration) depends on these unexported helpers (e.g., buildAccessLogSummary, buildFirewallLogSummary), so integration builds/vet will fail due to missing symbols. Remove the build constraint (or add an integration variant) so go test -tags=integration ./... continues to compile.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +6
//go:build !integration

// This file contains the concurrent artifact download logic and safe-output/DIFC filter helpers
// extracted from logs_orchestrator.go to keep that file under 1,000 lines.

package cli
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This extracted file is excluded under the integration build tag (//go:build !integration). logs_orchestrator.go still calls downloadRunArtifactsConcurrent / runContainsSafeOutputType / runHasDifcFilteredItems, so go test -tags=integration / go vet -tags=integration will fail with missing symbols. Remove the build constraint (or add an integration implementation) so integration-tag builds compile.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot mentioned this pull request Apr 10, 2026
…sed decomposition

Generated by the Design Decision Gate workflow to document the architectural
decision to cap Go source files at 1,000 lines and split violations into
domain-specific sibling files using the init()-registry pattern.

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

Commit pushed: 85b02ce

🏗️ 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 (3,576 new lines across pkg/cli/ and pkg/workflow/) but does not have a linked Architecture Decision Record (ADR).

AI has analyzed the PR diff and generated a draft ADR to help you get started:

📄 Draft ADR: docs/adr/0001-enforce-file-size-limit-via-domain-based-decomposition.md

The draft captures the three architectural decisions implicit in this PR:

  1. A hard 1,000-line cap on Go source files
  2. Domain-based sibling-file decomposition as the remediation strategy (with _{concern}.go naming)
  3. The init()-based registry splitting pattern for monolithic map variables

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 — particularly the JavaScript enforcement timeline marked [TODO: verify], the Deciders list, and any alternatives you actually considered
  3. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-0001: Enforce File Size Limit via Domain-Based Decomposition

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

Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.


📋 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 numbered Markdown files (e.g., 0001-enforce-file-size-limit.md).

🔒 This PR has been marked as requesting changes. It cannot merge until an ADR is linked in the PR body.

Note

🔒 Integrity filter blocked 1 item

The following item were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

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

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.

This PR requires an Architecture Decision Record (ADR) before it can merge.

The PR introduces a significant architectural pattern — a 1,000-line file size cap with domain-based sibling-file decomposition and an init()-based registry-splitting strategy — but that decision was implicit in the code rather than explicitly recorded.

A draft ADR has been generated and committed to this branch at docs/adr/0001-enforce-file-size-limit-via-domain-based-decomposition.md. Please review the draft, complete the [TODO: verify] items (JavaScript enforcement timeline, Deciders list), and link the finalised ADR in the PR body before requesting re-review.

See the comment above for detailed instructions.

@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great work splitting those six BLOCKER Go files! The per-domain decomposition of compiler_safe_outputs_config.go via init() registration is a clean pattern, and the narrative ADR (docs/adr/0001-enforce-file-size-limit-via-domain-based-decomposition.md) is a nice touch for future maintainers.

One thing would help get this across the finish line:

  • Add regression tests — the PR makes no changes to logic, but the extraction of functions into new files (e.g. gateway_logs_parser.go, logs_orchestrator_concurrency.go, compiler_orchestrator_helpers.go) means the existing test suite needs to confirm everything still compiles and behaves identically. The project uses Go's standard testing package (*_test.go files alongside source files) — a quick scan of pkg/cli/ and pkg/workflow/ shows existing tests like audit_report_render_test.go and compiler_orchestrator_workflow_test.go as references. At minimum, confirm make agent-finish passes all checks and that no existing _test.go files need import-path updates for the relocated functions.

If you'd like a hand, you can assign this prompt to your coding agent:

Review PR #25660 in github/gh-aw which splits large Go files into smaller domain-focused files.

Your task:
1. Run `make agent-finish` and confirm all tests pass with zero failures.
2. Scan every new file added by this PR (pkg/cli/gateway_logs_parser.go, pkg/cli/gateway_logs_renderer.go, pkg/cli/gateway_logs_extractor.go, pkg/cli/audit_render_performance.go, pkg/cli/audit_render_policy.go, pkg/cli/audit_render_tokens.go, pkg/cli/logs_orchestrator_concurrency.go, pkg/cli/logs_report_network.go, pkg/workflow/compiler_orchestrator_helpers.go, pkg/workflow/compiler_safe_outputs_handlers_issues.go, pkg/workflow/compiler_safe_outputs_handlers_prs.go, pkg/workflow/compiler_safe_outputs_handlers_discussions.go, pkg/workflow/compiler_safe_outputs_handlers_misc.go) and check that all exported and unexported symbols they define are correctly referenced in existing _test.go files.
3. If any test file imports or references functions that were moved, update the imports accordingly.
4. If coverage for the moved functions is below the project baseline, add table-driven unit tests in the matching _test.go file following the existing patterns in pkg/cli/ and pkg/workflow/.
5. Run `make agent-finish` again to confirm everything passes.

Generated by Contribution Check · ● 3.7M ·

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.

Architecture Violations Detected — 2026-04-10

3 participants