Skip to content

refactor(db): drop six verified-dead repository/bundle methods (vulture, #1136)#1287

Open
axisrow wants to merge 1 commit into
mainfrom
ao/tg_content_factory_5863f66be3-65/dead-code-db
Open

refactor(db): drop six verified-dead repository/bundle methods (vulture, #1136)#1287
axisrow wants to merge 1 commit into
mainfrom
ao/tg_content_factory_5863f66be3-65/dead-code-db

Conversation

@axisrow

@axisrow axisrow commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Part of #1136 (vulture axis of epic #1130). Six methods deleted; each verified dead across all five surfaces (FastAPI/Web/CLI/agent/TUI) before removal. Per #1136, "dead by graph" ≠ "unneeded" — so every candidate passed a full grep + git-history check first.

For each: repo-wide grep (src/ tests/ scripts/ docs/ conftest.py) returned exactly 1 hit — the definition — with no string references. The codebase's dynamic repo access targets other specific names (clear_dialogs, get_recent_for_channels, get_channels, …), and the dispatcher's dynamic dispatch is f"_handle_{command}"-shaped and unrelated to any of these.

Repository methods (unused readers; the repo layer stays)

  1. ChannelsRepository.get_channels_by_tag — born in feat: RSS, tags, S3 storage, refinement pipeline, ReAct fallback, test fixes #271 (tags feature) with no caller (git grep at 2af529e: definition only). The tag feature's surfaces use list_all_tags/create_tag/delete_tag/set_channel_tags/get_channel_tags (see src/cli/commands/channel.py); this reverse reader ("channels by tag") was never wired to any surface.
  2. DialogCacheRepository.has_dialogs — born in bc2bddd (persist dialog cache) with no caller. Live dialog_cache methods (enumerated from call sites): clear_all_dialogs, clear_dialogs, count_dialogs, get_all_phones, get_cached_at, get_dialog, list_dialogs, replace_dialogshas_dialogs absent.
  3. GenerationRunsRepository.list_by_status — definition-only at every commit that touched it (feat: add 12 missing agent tools and fix ghost MODULE_GROUPS entries #292, [codex] close issue 554 audit gaps #555, feat(parity): close CLI ↔ Web ↔ Agent-tool parity gaps #780); moderation/runs surfaces use list_pending_moderation / list_runs instead.

Bundle wrappers (unused thin wrappers over LIVE repo methods that stay)

  1. AccountBundle.list_live_usable_accountsAccountsRepository.get_live_usable_accounts stays (17 live refs).
  2. AccountBundle.update_premiumAccountsRepository.update_account_premium stays (24 live refs).
  3. MessageBundle.get_message_statsMessagesRepository.get_stats stays (used via Database.get_stats → dashboard route).

No public-API/parity impact: none of the six is reachable from any of the five surfaces.

Verification (no regression guard possible — code is gone; proof = green suite + this note)

  • ruff check src/ tests/ conftest.py — clean.
  • Import smoke test for all four touched modules — OK.
  • pytest tests/repositories/ tests/test_bundles.py — 426 passed.
  • Full suite (pytest tests/ -m "not aiosqlite_serial" -n auto then -m aiosqlite_serial) — green. The only failures elsewhere are pre-existing on origin/main: tests/test_quality_scoring_service.py (7 tests fail on clean main) and the xdist-flaky tests/routes/test_debug_routes.py::test_debug_timing_page; both deselected and reproduced on clean main, unrelated to this diff.

Not deleted here (doubtful → left for owner decision)

  • "Test-only" code in the DB layer is absent from this PR; bundle wrappers like update_flood, save_stats, list_notification_queries are called only by their own unit tests and are deliberately left untouched pending owner call (test-locking vs delete-with-tests). They are flagged in the issue audit, not here.

Part of #1136 / #1130.

…re, #1136)

Removes six methods flagged by vulture and verified dead across all five
surfaces (FastAPI/Web/CLI/agent/TUI). For each, repo-wide grep (src/ tests/
scripts/ docs/ conftest.py) returned exactly 1 hit — the definition — with
no string references. Dynamic repo access in the codebase targets other
specific names (clear_dialogs, get_recent_for_channels, get_channels, …);
the dispatcher's dynamic dispatch is f"_handle_{command}"-shaped and unrelated.

Repository methods (underlying repo layer stays — these are unused readers):
1. ChannelsRepository.get_channels_by_tag — born in #271 (tags feature) with
   no caller (git grep at 2af529e: definition only). The tag feature uses
   list_all_tags/create_tag/delete_tag/set_channel_tags/get_channel_tags
   (see src/cli/commands/channel.py); this reverse reader was never wired
   to any surface.
2. DialogCacheRepository.has_dialogs — born in bc2bddd with no caller. All
   live dialog_cache methods (enumerated from call sites): clear_all_dialogs,
   clear_dialogs, count_dialogs, get_all_phones, get_cached_at, get_dialog,
   list_dialogs, replace_dialogs — has_dialogs absent.
3. GenerationRunsRepository.list_by_status — definition-only at every commit
   that touched it (#292, #555, #780); moderation/runs surfaces use
   list_pending_moderation / list_runs instead.

Bundle wrappers (unused thin wrappers over LIVE repo methods that stay):
4. AccountBundle.list_live_usable_accounts — AccountsRepository.
   get_live_usable_accounts stays (17 live refs).
5. AccountBundle.update_premium — AccountsRepository.update_account_premium
   stays (24 live refs).
6. MessageBundle.get_message_stats — MessagesRepository.get_stats stays (used
   via Database.get_stats -> dashboard route).

No public-API/parity impact: none of the six is reachable from any of the
five surfaces.

Part of #1136 / #1130.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant