refactor: decompose oversized contracts to satisfy INV_7 fractal limit

Break monolithic modules >400 lines into focused sub-modules while
preserving backward-compatible imports and all test coverage:

Backend (Python):
- TranslationExecutor: 1974→241 lines, split into 9 sub-modules
- Translate plugin: orchestrator (1137→148), preview (1303→244),
  service (1052→275), dictionary (1007→68)
- ProfileService: 857→172 with 4 extracted sub-modules
- TaskManager: 708→322 with graph/event_bus/lifecycle extracted
- Test dictionary: 1199→split into 6 focused test files

Frontend (Svelte):
- SettingsPage: 1451→291 with 6 extracted tab components
- GitManager: 1220→228 with 5 extracted panels
- DatasetReviewWorkspace: 1202→314
- translate.js API: 664→28 barrel with 6 domain modules

Protocol:
- Remove single-contract 150-line limit from INV_7 (keep CC≤10)
- Fix unclosed #endregion tags across 11 files
- Fix 19 test regressions from stale mock paths
- All 294 tests passing
This commit is contained in:
2026-05-17 19:18:32 +03:00
parent cd868df261
commit f872e610a9
99 changed files with 12638 additions and 12783 deletions

View File

@@ -185,7 +185,7 @@ backend/
### Module decomposition rules
- Module files MUST stay < 400 LOC
- Individual contract nodes MUST stay < 150 LOC, Cyclomatic Complexity 10
- Individual contract nodes Cyclomatic Complexity 10
- When limits are breached: extract into new modules with `@RELATION` edges
- Use `__init__.py` for public re-exports only, not for logic
- FastAPI route modules: one file per resource group (e.g., `dashboards.py`, `datasets.py`)