Skip to content

refactor: remove dead code flagged by vulture (unused imports/variables) #1032

Open

Description

@vybe

Summary

A /refactor-audit scan (2026-06-02, vulture ≥80% confidence) flagged a handful of unused imports/variables. The four safe ones below are near-zero-risk quick wins; two more are excluded pending verification because they may be intentional.

Context

Dead imports/variables add noise and can mislead readers about dependencies. Removing the unambiguous ones is a trivial cleanup.

Findings — safe to remove

File Line Item
src/backend/routers/agents.py 29 unused import volume_remove
src/backend/routers/slack.py 27 unused import SlackOAuthInitResponse
src/backend/routers/ops.py 739 unused variable alert_id
src/backend/staging-acceptance.py 16 unused import AsyncMock

Findings — verify first (NOT auto-remove)

File Line Item Why hold
src/backend/services/event_bus.py 44 unused import RedisResponseError May be a re-export or intended for except-clause use
src/backend/services/subscription_auto_switch.py 174 unused variable old_subscription_id May be a debugging/audit breadcrumb

Acceptance Criteria

  • The four safe items removed
  • The two "verify first" items either removed (if confirmed dead) or left with a short comment explaining why they stay
  • /test-runner green; backend imports cleanly (no runtime import errors)

Technical Notes

  • Grep each symbol across the repo before deleting to confirm it isn't referenced dynamically or re-exported.
  • Single small PR.

Activity

  1. added
    complexity-lowComplexity: low (board points 1-3)
    status-incubatingIdea under consideration — pre-Todo, not yet greenlit for development
    on Jun 12, 2026
  2. added
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    and removed
    status-incubatingIdea under consideration — pre-Todo, not yet greenlit for development
    on Jul 3, 2026
  3. vybe commented on Jul 6, 2026

    @vybe
    ContributorAuthor

    Refreshed findings from the 2026-07-06 /refactor-audit run (vulture 2.15, ≥80% confidence). Two of the original items are gone (routers/agents.py volume_remove, staging-acceptance.py AsyncMock — already cleaned up); one new item appeared. Current set:

    File Line Item
    src/backend/adapters/transports/twilio_media_stream.py 31 unused import pop_frames (new)
    src/backend/routers/slack.py 26 unused import SlackOAuthInitResponse
    src/backend/routers/ops.py 737 unused variable alert_id
    src/backend/services/event_bus.py 44 unused import RedisResponseError (verify first — may be re-export/except-clause intent)
    src/backend/services/subscription_auto_switch.py 200 unused variable old_subscription_id (verify first — possible audit breadcrumb)

    Line numbers updated; the verify-first caveats from the original body still apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowComplexity: low (board points 1-3)priority-p2Importantstatus-readyGreenlit and ready for development (vetted; counterpart to status-incubating)theme-reliabilityTheme: Reliabilitytype-refactorCode improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions