Skip to content

Apply NRA goal-sweep codemods: promote acyclic hidden imports and drop 3 name-only subclasses - #2265

Merged
trissim merged 1 commit into
mainfrom
refactor/nra-goal-sweep
Nov 24, 2026
Merged

trissim merged 1 commit into
mainfrom
refactor/nra-goal-sweep

Conversation

@trissim

@trissim trissim commented Nov 24, 2026

Copy link
Copy Markdown

Applied NRA (da434f76) sequential refactor goals (hidden_import_promotion, false_distinction_erasure --codemod-goal-detector name_only_subclass) on src/toad/{qt,client}, keeping the 5 intentional Android splash/remote and shared-client Textual boundary modules (qt/android.py, qt/client_start.py, qt/main.py, client/committed_presentation.py, client/session_history_details.py) untouched:

  • Delete 3 name-only subclasses (false_distinction_erasure):
    • src/toad/client/connection.py: delete RemoteUserMissing and RemoteRouteNotSelectable (differed from RuntimeError only by name, never caught/tested anywhere).
    • src/toad/client/mention_completion.py + src/toad/widgets/channel_prompt.py: delete NoMention (empty subclass of MentionCompletion, never tested/dispatched on).
  • Promote acyclic hidden imports (hidden_import_promotion):
    • src/toad/client/{context_intent,history_changes,view_binding_protocols}.py: promote 9 acyclic TYPE_CHECKING/function-local imports (ContextNode, DetachedInspection, InspectionState, SessionIdentity, EventSourceKey, FragmentKey, HistoryFragment, TranscriptFragment, PreparedPageSource, PreparedTranscriptPage, SessionScope, TranscriptHistoryContract, ThreadRowsChanged).
    • src/toad/qt/{agent_surface,bus_switcher,keymap_screen,settings_screen}.py: promote acyclic QtHistoryWindow, CoreEventStream, QtToadApp, and BusRow/KeptLines/OpenSection/BusAddress/ConversationRows imports; drop now-dead self._BusRow/self._KeptLines/self._OpenSection stashes in QtBusSwitcher.

Verified:

  • toad.qt.android pre-splash: 253 modules (toad.qt.window=False, agent_comms.comms=False, packaging=False).
  • toad.qt.android.load_client() post-load: 1757 modules (agent_comms.comms=False, packaging=False); all 10 touched modules import cleanly.
  • tools/qt_inherit_ratchet.py: 0 / 0 / 0 / 0 / 0; tools/shadow_check.py: 0; tools/guarded_imports.py: 0.
  • tests/guards/test_shared_frontend_members.py + test_qt_members_are_not_shadowed.py: 11 passed (3.92s).

@trissim
trissim merged commit 316d615 into main Nov 24, 2026
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