Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Remove dead code proven unreachable even from tests

Open
#973 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
devtools, tooling

Research direction

Start with CONTRIBUTING.md and the make targets make deadcode-check / make deadcode-baseline, which run the repository-pinned deadcode tool against .deadcode-baseline.txt. Then work through the candidate clusters in the issue table (internal/cloud/dashboard, internal/cloud/cloudserver, cmd/engram/main.go, internal/tui/styles.go, internal/store) verifying each symbol's references within its package on Linux, Windows and Darwin before deleting. Done means the candidates are removed, affected tests still pass, and the baseline file is refreshed without changing the pinned tool version or relaxing the ratchet.

Written by the indexing model from the issue text.

Description

priority:low status:needs-review type:refactor
📋 Pre-flight Checks
  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened
📦 Affected Area

Mechanical dead-code cleanup across CLI, cloud dashboard/server, store, TUI, and orphan test helpers.

🔍 Problem Description

The proposed cleanup remains relevant, but the original symbol counts and deletion list were measured on an older revision. Current source and static analysis on main at a43183c2 report 17 unreachable functions with tests included as analysis roots and 19 U1000 findings. These are overlapping sets, not 36 distinct deletion candidates.

Current candidate groups:

Cluster Candidates to revalidate before deletion
internal/cloud/dashboard Handler, staticSyncStatusProvider and its Status method, totalStatObservations, totalStatPrompts, totalStatSessions, paginationURL, parsePagination
internal/cloud/cloudserver withAuthHandler, validateLegacyPayload, validateMutationEntry
cmd/engram/main.go stdinScanner, userHomeDir globals
internal/tui/styles.go colorSurface, searchHighlightStyle. Keep colorBase: it is referenced by a live style.
internal/store pairResult, unused fakeSemanticRunner / routingRunner test scaffolding, and the unused sessionID field in migration test scaffolding
Orphan test helpers httpPushMutations, countElementsWithClass, assertClaudeCodeWritesUnderRoot, runHookInDir, writeMigratingEngramStub

Handler, staticSyncStatusProvider, and Status remain a single reachability/deletion unit. Review references within each package rather than treating every reported name as an independent unused symbol.

💡 Proposed Solution

Prepare a focused type:refactor cleanup of candidates proven dead on the implementation base. Delete rather than introduce replacement abstractions. Refresh the existing dead-code baseline in the same change when debt is removed.

Acceptance:

  • Revalidate the candidate set on the exact implementation revision and exclude any symbol that is now live, including colorBase.
  • Check Linux, Windows, and Darwin, tagged tests, documentation references, and current open PR diffs before deletion. The present revalidation is Windows-only; older cross-platform/open-PR checks do not establish today's coverage.
  • Preserve behavior and run the affected tests and repository ratchets. Use the repository-pinned deadcode tool for baseline refresh; do not change the tool version or relax the ratchet as part of cleanup.
  • Keep tests and the reviewed baseline tightening with the deletion work, splitting into coherent cleanup units if needed.
🔄 Alternatives Considered

Leave the existing debt in place, with the current ratchets preventing new debt. Cleanup still reduces misleading reading surface, but does not require a new CI policy or framework.

📎 Additional Context

The deadcode CI ratchet is already implemented. CONTRIBUTING.md documents make deadcode-check, make deadcode-baseline, and the pinned golang.org/x/tools/cmd/[email protected] comparison against .deadcode-baseline.txt. The original claim that CI has no guard is no longer current.

Current analysis was executed on Windows/amd64 with Go 1.26.4 against an isolated archive of a43183c2:

go run golang.org/x/tools/cmd/[email protected] -test ./...          # 17 unreachable functions
go run honnef.co/go/tools/cmd/[email protected] -checks=U1000 ./... # 19 findings

Staticcheck exited nonzero because it reported the listed unused-code findings. These exploratory tool versions are recorded for reproducibility, not proposed replacements for repository-pinned CI tools. No deletions or functional tests were performed for this update, and no refreshed Linux/Darwin, tagged-test, or open-PR reachability proof is claimed.

Dominant language
Go
Stars
7.1k
Forks
729
Avg merge
9h 11m
Merged PRs (30d)
359

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Gentleman-Programming/engram

All issues in Gentleman-Programming/engram

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.