chore: remove dead code reported by deadcode#1303
Merged
Merged
Conversation
Remove 75 unreachable functions found via: deadcode -test -tags=e2e,integration,authfilestore ./... Bare `deadcode ./...` flags test/bench/e2e helpers as dead because it ignores _test.go files and build-tagged code; the -test/-tags form gives the accurate set. Kept the promptOnlyReaderStub methods (interface satisfaction only). Also dropped imports, an orphaned const, two orphaned regex vars, and pre-existing dead `Yes: true` test writes that govet's unusedwrite surfaced once the package's go:linkname was removed. Verified: deadcode clean, go vet across all tags, mise run lint, and mise run test:ci (unit + integration + e2e canary) all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c0079d5. Configure here.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unreachable/dead code paths (production, tests, integration/e2e helpers) as identified by deadcode -test -tags=e2e,integration,authfilestore ./..., reducing maintenance surface without intended behavior changes.
Changes:
- Deleted ~75 unreachable functions/helpers across production code and test utilities (including e2e/integration runners and strategy/remote helpers).
- Cleaned up now-unused imports/constants/regexes and removed an unused
go:linknametest hook. - Adjusted tests to stop writing now-unused struct fields (e.g.,
EnableOptions.Yes) to satisfygovet/unusedwrite.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/testutil/repo.go | Removes unused repo-clone+enable helper from e2e testutil. |
| e2e/testutil/assertions.go | Removes unused console log assertion helper. |
| e2e/entire/entire.go | Removes unused checkpoint explain helper wrappers. |
| e2e/agents/agent.go | Removes unused run options (WithModel, WithPermissionMode). |
| cmd/entire/cli/trailers/trailers.go | Drops unused trailer regexes and parse/format helpers (strategy/condensation-related). |
| cmd/entire/cli/testutil/testutil.go | Removes unused file helpers and git-history checkpoint helpers from CLI testutil. |
| cmd/entire/cli/strategy/strategy.go | Removes unused task-checkpoint reader and related imports. |
| cmd/entire/cli/strategy/metadata_reconcile.go | Removes unused v2 “doctor/reconcile” disconnection logic and remote helpers. |
| cmd/entire/cli/strategy/common.go | Removes unused ref-deletion and session-ID extraction helpers and the trailers import. |
| cmd/entire/cli/strategy/common_test.go | Removes unused test-only cache reset helper and import. |
| cmd/entire/cli/strategy/common_helpers_test.go | Deletes unused full-deserialization test helper file. |
| cmd/entire/cli/setup_test.go | Removes unused writes to EnableOptions.Yes in telemetry-related tests. |
| cmd/entire/cli/review/env.go | Removes unused exported env-entry predicate wrapper. |
| cmd/entire/cli/investigate/state.go | Removes unused StateStore.Root() accessor. |
| cmd/entire/cli/integration_test/testenv.go | Removes unused integration test environment helpers (stdin runner, commit helpers, ref readers). |
| cmd/entire/cli/integration_test/hooks.go | Removes unused hook simulation APIs (response/output variants) and Gemini/Droid helper scaffolding. |
| cmd/entire/cli/global_test.go | Removes unused go:linkname reset hook and unsafe import. |
| cmd/entire/cli/checkpoint/remote/util.go | Removes unused owner-extraction wrapper. |
| cmd/entire/cli/checkpoint/remote/git.go | Removes unused LsRemote wrapper (keeps LsRemoteInDir). |
| cmd/entire/cli/benchutil/benchutil.go | Removes unused benchmark repo AddAndCommit helper. |
| cmd/entire/cli/auth/exchange.go | Removes unused auth.Token convenience entry point (keeps resource-scoped API). |
| cmd/entire/cli/activity_render.go | Removes inactive braille-chart renderer implementation. |
evisdren
previously approved these changes
May 30, 2026
# Conflicts: # cmd/entire/cli/integration_test/testenv.go
Their only producer DeleteRefCLI was removed in this PR; the deadcode tool flags unreachable functions but not unused exported vars, so these slipped through. Flagged by Cursor Bugbot review on #1303. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pfleidi
approved these changes
May 30, 2026
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.

https://entire.io/gh/entireio/cli/trails/459
Remove 75 unreachable functions found via:
deadcode -test -tags=e2e,integration,authfilestore ./...
Bare
deadcode ./...flags test/bench/e2e helpers as dead because it ignores _test.go files and build-tagged code; the -test/-tags form gives the accurate set. Kept the promptOnlyReaderStub methods (interface satisfaction only). Also dropped imports, an orphaned const, two orphaned regex vars, and pre-existing deadYes: truetest writes that govet's unusedwrite surfaced once the package's go:linkname was removed.Verified: deadcode clean, go vet across all tags, mise run lint, and mise run test:ci (unit + integration + e2e canary) all pass.
Note
Low Risk
Mechanical deletion of unused code with no remaining references; behavior of shipped CLI paths should be unchanged aside from smaller API surface in internal/test packages.
Overview
Removes ~75 unreachable symbols across the CLI after analysis with
deadcode -test -tags=e2e,integration,authfilestore, trimming dead production paths and test-only helpers that no longer have callers.Production / library surface: drops unused pieces such as the inactive
renderBrailleChartactivity UI,auth.Token,remote.LsRemote/ExtractOwnerFromRemoteURL,DeleteRefCLIandExtractSessionIDFromCommitin strategy, v2 metadata doctor/reconcile helpers, several commit-trailer parse/format APIs,ReadTaskCheckpoint, andinvestigate.StateStore.Root/review.IsReviewEnvEntry.Tests & benches: large cuts in
integration_test(Gemini/Droid hook runners, manySimulate*/TestEnvhelpers),testutil,benchutil.AddAndCommit,common_helpers_test.go, and e2e helpers (CloneAndEnableEntire, extra explain/attach options).global_test.godrops ago:linknamehook into go-git’s plugin reset.Cleanup: unused imports, orphaned regex/consts, and setup tests stop writing obsolete
EnableOptions.Yesfields now that that field is gone.Reviewed by Cursor Bugbot for commit c0079d5. Configure here.