refactor: split oversized Go files for code clarity#39
Merged
Conversation
edded7c to
a248d14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure mechanical, behavior-preserving refactor for code clarity: every Go file over 1000 LOC (including test files) is split into smaller, same-package files. No behavior, API, or exported-symbol changes.
How the split was done:
goimportsrecomputed per-file imports;gofumptformatted.//go:build integration) and package clauses are replicated into each new file.Result:
Verification
go build ./...go vet ./...go test ./...Notes:
cli/integration_test(-tags integration) does not compile at baseline (main) in module-isolated mode (GOWORK=off) due to pre-existing references to symbols absent from this module (session.KindAgentInvestigate,strategy.SessionState.InvestigateRunID/InvestigateTopic,checkpoint.CommittedMetadata.InvestigateTopic) ininvestigate_test.go— a file not touched by this PR. The compile-error set is byte-for-byte identical toorigin/main, and the split files in that package parse cleanly. This is a pre-existing condition, unrelated to this refactor.cli/apihas a flaky network test (TestClient_Post_NilBody) that intermittently fails with a transportCloseIdleConnectionserror; it passes on re-run and is in a package not touched by this PR.Files split (per package)
redact_test.goexplain_test.go,explain.go,setup_test.go,setup.go,status_test.go,migrate_test.go,clean_test.go,migrate.go,rewind.go,setup_github_test.go,search_tui_test.go,attach_test.go,resume.go,lifecycle.go,sessions_test.go,search_tui.go,trail_cmd.gomanual_commit_test.go,manual_commit_hooks.go,phase_postcommit_test.go,manual_commit_condensation.go,common.go,manual_commit_attribution_test.go,common_test.go,push_common_test.go,hooks_test.go,content_overlap_test.go,manual_commit_rewind.go,checkpoint_remote_test.go,metadata_reconcile_test.gocheckpoint_test.go,committed.go,temporary.go,v2_store_test.gotestenv.go,manual_commit_workflow_test.go,hooks.go,agent_test.go,deferred_finalization_test.go,resume_test.go,explain_test.gosettings.gotranscript_test.gocmd.gosummarize_test.gocmd_test.goTest plan
go build ./...go vet ./...go test ./...