refactor: split compile-check input key writers into their own file

Merged
HA
3d ago
+304-293

Summary

  • Brings the compile-check input key source back under the 500-line limit on production Go files, which the integration branch's build-and-test has failed on since #3343 merged.
  • No behavior change: the functions move verbatim.

User Impact

None. The integration branch's build-cli (and the jobs that depend on it) failed in TestProductionGoFilesStayFocused because input_key.go had 523 lines. This check counts raw lines and runs only after a merge into the integration branch, so the pull requests that grew the file did not see it.

Changes

  • cli/dispatcher/internal/compilecheck/input_key_identity.go (new, 304 lines): the functions that write each identity into the digest, from writeCompilerIdentity to projectPath, in their original order with their comments.
  • cli/dispatcher/internal/compilecheck/input_key.go (now 230 lines): how the key is assembled, with its types and flag lists. Only the imports the moved functions used are removed.

Verification

  • With the import blocks and blank lines removed, the two files concatenated are identical to the original file.
  • go test -run TestProductionGoFilesStayFocused ./internal/architecture/... in cli/release-automation passes.
  • go test -race ./internal/compilecheck/... in cli/dispatcher passes.
  • For each of the four Go modules: gofmt -l is empty, go vet ./... passes, golangci-lint run ./... reports 0 issues, and go test ./... passes in cli/dispatcher and cli/release-automation. In cli/common and cli/project-runner, one test each fails only because the local sandbox refuses a directory under /tmp and a Unix socket bind; neither module is touched here.
  • scripts/check-code-complexity.sh and scripts/check-file-length.sh pass.