Remove unused service protocol aliases and use direct service imports

This commit is contained in:
2026-04-17 16:01:27 +02:00
parent 7d16391c6c
commit 6e1e3c4546
4 changed files with 25 additions and 111 deletions

View File

@@ -224,6 +224,10 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
**Goal:** Make a deliberate decision and enforce it consistently. Option A: adopt the protocol injection pattern everywhere — update all 16 non-compliant routers to accept their service via the typed `Dep` alias. Option B: acknowledge the pattern is unused overhead and remove the protocol aliases and `cast()` wrappers from `dependencies.py`, letting all routers import concrete services directly (the current de facto standard). Option B is cheaper; Option A makes service substitution in tests easier.
**Decision:** Option B applied — service protocol aliases and provider wrappers have been removed in favor of direct concrete service imports.
**Status:** Completed ✅
**Possible traps and issues:**
- Option A requires updating all 16 routers and their test files simultaneously; this is a broad change with high regression risk. Stage it one router at a time.
- Option B means deleting `services/protocols.py` (398 lines) and all `cast("…Service", …)` calls in `dependencies.py`. Ensure nothing outside this layer references the Protocol classes (check test files).