RMI Backend — FastAPI with 410+ routes, 32 token detectors, 96 chains, x402 paid API, MCP server for AI agents, Rug Munch Verified badge program. Pay-per-call crypto security. Wyoming-based.
|
Some checks failed
CI / build (push) Failing after 3s
PHASE 2.3 (AUDIT-2026-Q3.md):
Task 1 — Wire-in Wave 3 (1 router mounted, 2 deferred):
- app.routers.unified_scanner_router mounted at /api/v2/scanner/* (2 routes:
POST /api/v2/scanner/token/scan, POST /api/v2/scanner/wallet/scan).
Refactored prefix from /api/v2 -> /api/v2/scanner to avoid future conflicts
with the v1 /api/v1/scanner/ stub.
- app.routers.unified_wallet_scanner DEFERRED (no router APIRouter attribute;
library module consumed by unified_scanner_router via get_wallet_scanner()).
- app.routers.admin_extensions DEFERRED (DORMANT per audit; 25 routes at
/api/v1/admin/* would shadow /api/v1/admin/alerts_webhook).
Task 2 — Archive 136 dead-code files to app/_archive/legacy_2026_07/:
- 73 routers in app/routers/ (reach graph showed zero reach into mount.py).
- 63 flat app/*.py (domain modules never imported by live code).
- 1 file RESTORED post-archive: app/routers/x402_bridge_health.py (caught by
tests/unit/test_bridge_health.py which directly imports it; reach graph
considered tests/ only as transitive reach — to be patched in next cycle).
Forced-LIVE (NOT archived per user directive):
- app/ai_pipeline_v3.py (3 importers in audit window, importers themselves DEAD)
- app/splade_bm25.py (LIVE via app.rag_service)
- app/wallet_manager_v2.py (LIVE via x402_enforcement, x402_tools, sweep_all, sweep_now)
- app/crypto_embeddings.py (NOT in audit ARCHIVE list; heavy import graph)
Verification (forward-import closure from mount.py + main.py + factory.py + lifespan.py):
- imports = 348 app.* modules
- reached = 194 files reachable from roots
- archive set = audit_dead (186) - reached - forced_live (4) - test_live (1) = 136
- Net delta: 136 files moved, 44,932 LOC reduction, 293->295 active routes (+2 from Wave 3)
pyproject.toml updates:
- setuptools.packages.find: added exclude for app._archive*
- ruff.extend-exclude: added "app/_archive/"
- mypy.exclude: added "app/_archive/"
Smoke test: pytest tests/ — 817 passed, 3 pre-existing failures unchanged
(0 new failures; 0 routes lost; all 4 forced-LIVE files still importable).
Restoration: git mv app/_archive/legacy_2026_07/<name>.py <original-path>
and add the import to app/mount.py ROUTER_MODULES.
Refs: AUDIT-2026-Q3.md /home/dev/pry/rmi-final-deadcode-2026-07-06.md
|
||
|---|---|---|
| .forgejo | ||
| .github | ||
| .semgrep | ||
| alembic | ||
| app | ||
| data | ||
| dify-agents | ||
| docker/x402-rs | ||
| docs | ||
| infra | ||
| infrastructure/database | ||
| plans | ||
| prompts | ||
| public | ||
| requirements | ||
| scripts | ||
| sdks | ||
| src/rug_munch_mcp | ||
| static | ||
| supabase | ||
| tests | ||
| widget | ||
| x402-gateway | ||
| , r.stdout) # Check if we can read wallets from the data directory directly - theyre | ||
| .deploy-cleanup.sh | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .gitleaksignore | ||
| .gitmessage | ||
| .mise.toml | ||
| .pre-commit-config.yaml | ||
| .secretsallow | ||
| .trivyignore | ||
| AGENTS.md | ||
| alembic.ini | ||
| ARCHITECTURE.md | ||
| AUDIT-2026-Q3.md | ||
| backend.log | ||
| CLEANUP.md | ||
| CODE_OF_CONDUCT.md | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| DARKROOM_ADMIN_V2.md | ||
| databus_warm_cron.py | ||
| DESIGN.md | ||
| docker-compose.email.yml | ||
| Dockerfile | ||
| Dockerfile.worker | ||
| EMAIL_SETUP.md | ||
| generate_env.py | ||
| hf-model-card.md | ||
| huggingface.yaml | ||
| justfile | ||
| LICENSE | ||
| LICENSING_PRICING_STRATEGY.md | ||
| LINT-CLEANUP-REPORT.md | ||
| logo-preview.html | ||
| main.py | ||
| Makefile | ||
| mypy.ini | ||
| PORT_MAP.md | ||
| PRICING_ARCHITECTURE.md | ||
| PRODUCT.md | ||
| PROPRIETARY_REGISTRATION.txt | ||
| pyproject.toml | ||
| pytest.ini | ||
| RAG_MODERNIZATION.md | ||
| RAG_R2_SETUP.md | ||
| README.md | ||
| README_HF.md | ||
| requirements.txt | ||
| rmi_langchain.py | ||
| rmi_sdk.py | ||
| RMI_SYSTEM_MAP.md | ||
| ROADMAP.md | ||
| safe_deploy.sh | ||
| SECURITY.md | ||
| SECURITY_STACK.md | ||
| smithery.yaml | ||
| STANDARDS.md | ||
| STATUS.md | ||
| SUPABASE_ARCHITECTURE.md | ||
| supabase_create_tables.sql | ||
| supabase_pgvector_setup.sql | ||
| test_new_scanners.py | ||
| TODO.md | ||
| uv.lock | ||
| worker.py | ||
| X402_ARCHITECTURE.md | ||
| x402_REVENUE.md | ||
| x402_STRATEGY.md | ||
| x402_tool_builder.py | ||
| X_AUDIT_AND_STRATEGY.md | ||
RMI Backend
Repo: git.rugmunch.io/RugMunchMedia/rmi-backend
Deploy: /root/backend/ on Talos
Container: rmi-backend
Health: http://127.0.0.1:8000/health (currently unhealthy — Redis host not resolving)
What it is
FastAPI backend for the RMI platform. Serves token risk scans, wallet forensics, market data, Telegram bot commands, MCP agent tools, and x402-gated premium endpoints.
Status
Production, but degraded. The container runs and responds, but /health reports unhealthy because the Redis hostname rmi-redis:6379 is not resolving inside the container network.
Quick start (local)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m pytest tests/unit/ -x -q
Deploy
ssh netcup
cd /root/backend/
docker compose pull
docker compose up -d rmi-backend
Fleet dependencies
| Service | Address | Status |
|---|---|---|
| Postgres | rmi-postgres:5432 |
Up |
| Redis | rmi-redis:6379 |
Failing to resolve |
| Qdrant | 127.0.0.1:6333 |
Down (stale IP bind) |
| Neo4j | 127.0.0.1:7687 |
Up |
| ClickHouse | 127.0.0.1:8123 |
Up |
Current issues
- 8.61% test coverage
- 17
time.sleep(), 1,713 f-string logs, 399print()calls - Largest file
app/routers/x402_tools.pyis 212 KB - CI gates use
continue-on-error: trueand|| true - 5 Telegram tokens leaked in git history
Docs
PRODUCT.md— charter and scopeARCHITECTURE.md— components and data flowROADMAP.md— next 90 daysTODO.md— current tasks
Standards
This repo follows Rug Munch Media standards.