Skip to content

chore: remove dead code reported by deadcode#1303

Merged
computermode merged 3 commits into
mainfrom
remove-deadcode
May 30, 2026
Merged

chore: remove dead code reported by deadcode#1303
computermode merged 3 commits into
mainfrom
remove-deadcode

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented May 30, 2026

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 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.


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 renderBrailleChart activity UI, auth.Token, remote.LsRemote / ExtractOwnerFromRemoteURL, DeleteRefCLI and ExtractSessionIDFromCommit in strategy, v2 metadata doctor/reconcile helpers, several commit-trailer parse/format APIs, ReadTaskCheckpoint, and investigate.StateStore.Root / review.IsReviewEnvEntry.

Tests & benches: large cuts in integration_test (Gemini/Droid hook runners, many Simulate* / TestEnv helpers), testutil, benchutil.AddAndCommit, common_helpers_test.go, and e2e helpers (CloneAndEnableEntire, extra explain/attach options). global_test.go drops a go:linkname hook into go-git’s plugin reset.

Cleanup: unused imports, orphaned regex/consts, and setup tests stop writing obsolete EnableOptions.Yes fields now that that field is gone.

Reviewed by Cursor Bugbot for commit c0079d5. Configure here.

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>
Copilot AI review requested due to automatic review settings May 30, 2026 00:30
@computermode computermode requested a review from a team as a code owner May 30, 2026 00:30
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread cmd/entire/cli/strategy/common.go
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

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:linkname test hook.
  • Adjusted tests to stop writing now-unused struct fields (e.g., EnableOptions.Yes) to satisfy govet/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
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>
@computermode computermode enabled auto-merge May 30, 2026 00:53
@computermode computermode merged commit d0327df into main May 30, 2026
9 checks passed
@computermode computermode deleted the remove-deadcode branch May 30, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants