claude-memory/graph/decisions/no-re-exports-when-refactoring-imports-update-call-sites-dir-30d490.md
2026-02-25 16:44:42 -06:00

1.5 KiB

id type title tags importance confidence created updated relations
30d490e1-5ae8-4db8-a238-8973a09f99d1 decision No re-exports when refactoring imports — update call sites directly
python
refactoring
architecture
imports
paper-dynasty
0.7 0.8 2026-02-25T22:44:36.786104+00:00 2026-02-25T22:44:42.053812+00:00
target type direction strength edge_id
b235f924-b532-40cd-be39-4fb765938add BUILDS_ON incoming 0.8 c7805bed-d50e-4016-b518-c0be2094d687

Decision\nWhen moving code to a new module location, do NOT add re-exports in the original file for backwards compatibility.\n\n## Rationale\nRe-exports (e.g. adding from batters.models import BattingCardRatingsModel in the old calcs_batter.py) create ongoing tech debt and obscure true import paths, making future refactoring harder.\n\n## Practice\nFind every call site and update the import directly to point to the new location.\n\n## Applied In (paper-dynasty/card-creation)\nAfter extracting to batters/models.py and pitchers/models.py, these files were updated:\n- batters/card_builder.py — updated import to batters.models\n- pitchers/card_builder.py — updated import to pitchers.models\n- tests/test_batter_calcs.py — updated bp_singles, wh_singles imports from calcs_batterbatters.models\n\n## Discovery tip\nA full-repo grep for the old module path (e.g. from batters.calcs_batter import) catches all call sites before you finalise the refactor.