Commit graph

4 commits

Author SHA1 Message Date
4686cb3cfd refactor(scanners): finish app.scanners → app.domains.scanners import migration + lint + mypy config (P4.8 cont)
Some checks failed
CI / build (push) Failing after 2s
2026-07-07 04:44:32 +07:00
f1d357e70a fix(rmi-backend,audit): re-apply Wave 3 mount + pyproject excludes (P2.3 lost+recovered)
Some checks failed
CI / build (push) Failing after 3s
The previous P2.3 commit (628c1d2) only captured the file renames; the
mount.py + pyproject.toml + unified_scanner_router.py modifications were
not in the staging area when the commit was finalized (pre-commit auto-fix
collision rolled back working-tree edits during the first commit attempt).

This follow-up restores the missing pieces:

- app/mount.py: adds app.routers.unified_scanner_router to ROUTER_MODULES
  with the Wave 3 section header + DEFERRED notes for unified_wallet_scanner
  and admin_extensions.
- app/routers/unified_scanner_router.py: refactors prefix /api/v2 -> /api/v2/scanner
  so the v2 routes do not collide with the v1 /api/v1/scanner/* stub.
- pyproject.toml: setuptools.packages.find, ruff.extend-exclude, and
  mypy.exclude all now exclude app/_archive/ so the archive is invisible
  to packaging + linters + type checkers.

Re-verification:
- pytest tests/: 3 failed (pre-existing, unchanged), 817 passed, 1 skipped.
- mount.py mounts 52 routers; /api/v2/scanner/{token,wallet}/scan live.
2026-07-06 21:02:58 +02:00
opencode
da2696a264 build(rmi-backend,audit): declare app/ as installable Python package
Some checks failed
CI / build (push) Failing after 2s
Phase 1 of AUDIT-2026-Q3.md item P1.3.

33 of 35 unit test files fail pytest collection without PYTHONPATH=.
Because pyproject.toml did not declare app/ as a package, pip install -e
".[dev]" did not register app as importable. After this commit:
- pip install -e .[dev] installs app as a real package
- pytest tests/ --collect-only works from any cwd without PYTHONPATH=
- New devs can follow README.md verbatim (no PYTHONPATH= env var)

Used [tool.setuptools.packages.find] with include = ["app*"] and
namespaces = false to auto-discover every sub-package that has __init__.py
(414 sub-packages). Sub-packages without __init__.py are namespace
packages and remain out of scope for Phase 1.3 (tracked for Phase 3):
  app/middleware, app/telegram_bot, app/routers, app/domain/threat,
  app/api/v1/rag, app/protection_api, app/services, app/mcp/tools.

Verified: from /tmp without PYTHONPATH, "import app" works and
"pytest tests/ --collect-only" reports 765 tests collected. The 8
remaining collection errors are pre-existing missing optional deps
(aiohttp in app/profile_flip_detector, app/bridge_health_monitor;
numpy in app/rag/ann_index) — unrelated to this fix.
2026-07-06 17:54:29 +02:00
bde2f3a97d merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00