You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: enforce Router → Service → DB with an import contract and a shrink-only baseline #4418
Invariant #1 says routers hold no business logic and services hold no HTTP concerns. Nothing enforces it, and the code has drifted.
Context
About 680 direct db.*() calls under src/backend/routers/.
15 service modules import from routers.
About 1,400 function-local imports under services/ and routers/, many of them working around import cycles.
Acceptance Criteria
An import contract (routers → services → db) runs in CI with a shrink-only baseline.
Helpers that services import from routers move into services.
The baseline is committed with its starting counts.
Technical Notes
Mirror the existing ratchets under tests/unit/.
Found in the 2026-11-09 architecture review; facts checked on dev at 13d32e22f. See "Proposed Targets" in docs/planning/TARGET_ARCHITECTURE.md (PR #4405).
Activity