refactor: decompose 6 monolithic modules (>1000 LOC) into domain packages

Decompose 6 large modules into packages with <400-line modules to satisfy INV_7:

- superset_client.py (2145->0) -> superset_client/ package (12 modules)
- assistant.py (2683->0) -> assistant/ package (12 modules)
- git_service.py (2101->11 shim) -> services/git/ package (9 modules)
- git.py (1757->0) -> routes/git/ package (11 modules)
- dashboards.py (1619->0) -> routes/dashboards/ package (8 modules)
- translate.py (1587->0) -> routes/translate/ package (11 modules)
- superset_context_extractor.py (1397->0) -> utils/superset_context_extractor/ (7 modules)

All modules <400 lines (INV_7). All 80 tests pass.
All external imports preserved via __init__.py re-exports or shim.
Semantic [DEF] contracts with @LAYER/@SEMANTICS added to all Module types.
This commit is contained in:
2026-05-09 10:13:07 +03:00
parent 344b47ca23
commit 201886eeb0
76 changed files with 9831 additions and 12576 deletions

View File

@@ -64,7 +64,7 @@ def test_git_service_init_repo_reclones_when_path_is_not_a_git_repo():
(target_path / "placeholder.txt").write_text("not a git repo", encoding="utf-8")
clone_result = MagicMock()
with patch("src.services.git_service.Repo") as repo_ctor:
with patch("src.services.git._base.Repo") as repo_ctor:
repo_ctor.side_effect = InvalidGitRepositoryError("invalid repo")
repo_ctor.clone_from.return_value = clone_result
result = service.init_repo(10, "https://example.com/org/repo.git", "token", repo_key="covid")