diff --git a/graph/decisions/no-re-exports-when-refactoring-imports-update-call-sites-dir-30d490.md b/graph/decisions/no-re-exports-when-refactoring-imports-update-call-sites-dir-30d490.md new file mode 100644 index 00000000000..4bf5590cd0c --- /dev/null +++ b/graph/decisions/no-re-exports-when-refactoring-imports-update-call-sites-dir-30d490.md @@ -0,0 +1,12 @@ +--- +id: 30d490e1-5ae8-4db8-a238-8973a09f99d1 +type: decision +title: "No re-exports when refactoring imports — update call sites directly" +tags: [python, refactoring, architecture, imports, paper-dynasty] +importance: 0.7 +confidence: 0.8 +created: "2026-02-25T22:44:36.786104+00:00" +updated: "2026-02-25T22:44:36.786104+00:00" +--- + +## 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_batter` → `batters.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.