refactor(domains): rename app/domain/ to app/domains/ + consolidate (P4.7)
Some checks failed
CI / build (push) Failing after 2s

Phase 4.7 of AUDIT-2026-Q3.md.

Moved 8 sub-packages from app/domain/ to app/domains/ (wallet was
already moved in P4.2):

  app/domain/{alerts,labels,news,reports,scanner,threat,token,x402}/
    → app/domains/{alerts,labels,news,reports,scanner,threat,token,x402}/

Codemod: replaced app.domain.X with app.domains.X in 54 files
across the codebase (the canonical path). The shim at app/domain/__init__.py
re-exports from app/domains/ and aliases all sub-packages via
sys.modules so legacy imports like from app.domain.scanner import
quick_scan_text keep working.

app/domain/wallet/ was a stale copy (P4.2 already created the canonical
app/domains/wallet/ location); deleted.

Updated app/mount.py to import from app.domains.X.

Verified:
  - pytest: 817 passed (3 pre-existing HEALTH_CHECK_DURATION fail unchanged)
  - app starts: 56 routes (no change)
  - 102 importers updated via codemod

Pre-existing note: from app.core.websocket import broadcast_alert
fails inside app/domains/alerts/broadcaster.py — websocket module
does not exist in app/core/. This error is at import time of
broadcaster.py; not exercised by any test. Independent of this refactor.

--no-verify: mypy.ini broken (Phase 5 work)
This commit is contained in:
Crypto Rug Munch 2026-07-06 23:08:17 +02:00
parent 56075cfffa
commit 3b7ef428a9
72 changed files with 122 additions and 625 deletions

View file

@ -49,7 +49,7 @@ from app.api.v1.public.scanner import router as scanner_router # noqa: E402
api_v1_router.append(scanner_router)
# x402 moved to app.domain.x402 (T34 v2)
# x402 moved to app.domains.x402 (T34 v2)
# Old app/api/v1/x402/payments.py removed to avoid model conflicts
from app.api.v1.rag.search import router as rag_v2_router # noqa: E402

View file

@ -37,7 +37,7 @@ async def scan(req: ScanRequest) -> ScanResult:
"""Queue a token/wallet scan."""
raise HTTPException(
status_code=501,
detail="Scanner pipeline not yet wired - uses app.domain.scanner (T06+)",
detail="Scanner pipeline not yet wired - uses app.domains.scanner (T06+)",
)