-
Notifications
You must be signed in to change notification settings - Fork 36
Refactor: Split fetcher.py into focused modules #513
Copy link
Copy link
Open
Labels
Description
agr/fetcher.py is the largest module (~11k tokens) and handles too many responsibilities: skill installation, ralph installation, uninstallation, query operations, repo preparation, sparse checkout coordination, name conflict resolution, and metadata stamping. This makes it the hardest file to reason about and modify.
Proposal
Split into focused modules:
installer.py— install orchestration (skill + ralph)uninstaller.py— removal logicresolver.py— name conflict resolution and destination resolution- Keep
fetcher.pyas a thin facade re-exporting the public API for backward compatibility
Motivation
- Easier to navigate and understand individual concerns
- Reduces merge conflicts when multiple contributors touch install vs remove logic
- Makes it possible to test each concern in isolation
- The current module mixes high-level orchestration with low-level details (e.g.,
_resolve_skill_destinationalongsidefetch_and_install_to_tools)
Context
Identified in architecture audit: docs/contributing/architecture-audit.md
Reactions are currently unavailable