Delete the dead TUI, and add a check that could have seen it

Merged
JE
3mo ago
+71-680

Rebased onto main. This was stacked on #652, which has since merged; the branch has been rebased so the diff is this PR's own 6 files and nothing else. Earlier review comments referring to a stacked base or a larger changed-file count predate that rebase.

Pure removal, plus one new (non-gating) make target. Separate from #652 so that stays reviewable as a bug fix.

Delete

internal/tui/spinner.go (187 lines) and internal/tui/paginated_picker.go (415 lines) have no callers — 602 lines of exported API nothing in the repo or the binary reaches, each holding a tea.NewProgram. Verified symbol by symbol before removing, not by file-level grep; the surviving Spinner matches elsewhere are bubbles/spinner's own struct field. Neither file had a test.

Removing internal Go symbols does not touch .surface, which tracks the CLI command surface, so no .surface-breaking entry is needed.

The allowlist in #652's launcher check shrinks from four files to two, which is the point — both deleted files were on it only as "no callers; slated for deletion."

Why unused could never have found this

.golangci.yml enables unused (staticcheck U1000), and it is the repo's only dead-code check. It runs per-package and treats every exported identifier in a non-main package as used by definition. That is exactly why 602 lines of exported, zero-caller internal/tui API survived it. No configuration fixes this — the analysis cannot see across package boundaries.

make deadcode

golang.org/x/tools/cmd/deadcode starts from a main and follows the call graph, so it sees what unused structurally cannot.

Rooted at the binary, not ./.... Only main packages are roots, so deadcode ./... loads every package and then reports everything no main reaches as unreachable — 1100+ of its 1250 lines here are the dev-tagged workspace tree, which the untagged build genuinely cannot reach. True, and useless. Naming the binary gives two answers worth reading:

deadcode ./cmd/basecamp            what a released basecamp can never run
deadcode -tags=dev ./cmd/basecamp  the same, with the dev `basecamp tui` tree

The version is pinned and invoked via go run, so output does not depend on what happens to be installed on the machine.

Deliberately NOT wired into make check. It is a report to read, not a gate: some zero-caller exported symbols are a deliberate API surface, and the dev tree is legitimately partial. Land the target, look at real output, decide separately. Adding a noisy gate is how a control nobody sized gets built.

It earned its keep immediately — it flagged two helpers that #652 had orphaned, which were removed there.

Scope

Held to the two TUI files. The other candidates originally considered — internal/models, internal/sdk, sdk/errors, resolve/comment_thread.go — are a separate backlog. internal/sdk in particular is documented in AGENTS.md as the SDK wrapper, and deleting it would mean editing the SDK-sync workflow in the same breath.

bin/ci green on this branch.


Summary by cubic

Removes two dead TUI launchers and adds a pinned whole-program dead-code report to catch similar cases. No CLI or runtime changes; .surface unchanged.

  • Delete internal/tui/spinner.go and internal/tui/paginated_picker.go; drop the dead-launchers block from internal/tui/forms_test.go; shrink the bubbletea launcher allowlist in internal/tui/launchers_test.go.
  • Add make deadcode (pinned golang.org/x/tools/cmd/deadcode@v0.40.0) that analyzes ./cmd/basecamp and again with -tags=dev; invoked via go run; report-only (not in make check) because unused cannot see cross-package dead code.
  • Document usage and GOOS/GOARCH caveats in AGENTS.md (root at the binary; analyze one target at a time; for cross-target runs: go install golang.org/x/tools/cmd/deadcode@v0.40.0 then GOOS=windows deadcode ./cmd/basecamp). No migration required.