From 71d63fdbe9b550fcafc82612b4835f7936c2dcb3 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 25 Feb 2026 16:44:36 -0600 Subject: [PATCH] =?UTF-8?q?store:=20No=20re-exports=20when=20refactoring?= =?UTF-8?q?=20imports=20=E2=80=94=20update=20call=20sites=20directly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...factoring-imports-update-call-sites-dir-30d490.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 graph/decisions/no-re-exports-when-refactoring-imports-update-call-sites-dir-30d490.md 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.