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.
Find a file
opencode 1c815c07e4
Some checks failed
CI / build (push) Failing after 3s
docs(audit): add 2026-Q3 audit + 6-phase production-grade roadmap (master ref for rmi-backend/frontend)
Comprehensive audit covering:
- 649 files, 241k LOC, 21 god-files over 1000 LOC
- 148 unmounted routers (21 mounted, 164 defined)
- 11 circular import cycles
- 0 alembic migrations
- 2532 except-Exception swallows, 0 AppError class
- 60% coverage gate unenforced (actual 8.17%)
- GitHub CI has || true on every job (decorative)
- Pre-commit configured but not installed
- 28 gitleaks findings (incl main.py.bak with mainnet addresses)
- 285 dead modules
- 7 hallucinated files in RMI_SYSTEM_MAP.md

Plan: 6 phases, 5-6 weeks, 1-2 engineers:
1. Stop the bleeding (1 week)
2. Delete dead code (1 week)
3. Split god-files (2 weeks)
4. Consolidate scattered domains (1.5 weeks)
5. Standardize + harden (1 week)
6. Open-source pivot to 3 repos (1 week, parallel with 5): rmi-core (MIT) / rmi-ip (BSL 1.1) / rmi-pro (private)

Open-source vs proprietary split recommendation included for each module category.
2026-07-06 17:44:58 +02:00
.forgejo Merge branch 'feat/issue-forms' 2026-07-02 15:11:00 +02:00
.github chore(rmi-backend): apply fleet-template standards — add .editorconfig + .gitattributes, fix stale IPs, tighten qdrant-audit CI gate 2026-07-06 14:18:34 +02:00
.semgrep merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
alembic merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
app fix(rmi-backend): drop passlib — route backup codes through direct bcrypt 2026-07-06 16:17:47 +02:00
data merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
dify-agents merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
docker/x402-rs merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
docs merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
infra style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
infrastructure/database merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
plans merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
prompts merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
public merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
requirements merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
scripts style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
sdks style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
src/rug_munch_mcp style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
static merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
supabase merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
tests style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
widget merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
x402-gateway merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
, r.stdout) # Check if we can read wallets from the data directory directly - theyre merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.deploy-cleanup.sh merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.dockerignore merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.editorconfig chore(rmi-backend): apply fleet-template standards — add .editorconfig + .gitattributes, fix stale IPs, tighten qdrant-audit CI gate 2026-07-06 14:18:34 +02:00
.env.example chore: add Makefile + .env.example for rmi-backend 2026-07-02 14:52:19 +02:00
.gitattributes chore(rmi-backend): apply fleet-template standards — add .editorconfig + .gitattributes, fix stale IPs, tighten qdrant-audit CI gate 2026-07-06 14:18:34 +02:00
.gitignore merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.gitleaksignore security(gitleaks): ignore scammer Telegram tokens in CryptoScamDB data 2026-07-03 17:40:55 +02:00
.gitmessage merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.mise.toml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.pre-commit-config.yaml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.secretsallow merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
.trivyignore merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
AGENTS.md chore(rmi-backend): apply fleet-template standards — add .editorconfig + .gitattributes, fix stale IPs, tighten qdrant-audit CI gate 2026-07-06 14:18:34 +02:00
alembic.ini merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
ARCHITECTURE.md docs: rewrite README and add PRODUCT, ARCHITECTURE, ROADMAP, TODO per governance framework 2026-07-03 15:56:26 +02:00
AUDIT-2026-Q3.md docs(audit): add 2026-Q3 audit + 6-phase production-grade roadmap (master ref for rmi-backend/frontend) 2026-07-06 17:44:58 +02:00
backend.log merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
CLEANUP.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
CODE_OF_CONDUCT.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
CODEOWNERS merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
CONTRIBUTING.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
DARKROOM_ADMIN_V2.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
databus_warm_cron.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
DESIGN.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
docker-compose.email.yml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
Dockerfile merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
Dockerfile.worker merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
EMAIL_SETUP.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
generate_env.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
hf-model-card.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
huggingface.yaml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
justfile merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
LICENSE merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
LICENSING_PRICING_STRATEGY.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
LINT-CLEANUP-REPORT.md docs(rmi-backend): add LINT-CLEANUP-REPORT.md tracking fix 2026-07-06 15:43:09 +02:00
logo-preview.html merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
main.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
main.py.bak merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
Makefile chore: add Makefile + .env.example for rmi-backend 2026-07-02 14:52:19 +02:00
mypy.ini merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
PORT_MAP.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
PRICING_ARCHITECTURE.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
PRODUCT.md docs: rewrite README and add PRODUCT, ARCHITECTURE, ROADMAP, TODO per governance framework 2026-07-03 15:56:26 +02:00
PROPRIETARY_REGISTRATION.txt merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
pyproject.toml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
pytest.ini merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
RAG_MODERNIZATION.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
RAG_R2_SETUP.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
README.md docs: rewrite README and add PRODUCT, ARCHITECTURE, ROADMAP, TODO per governance framework 2026-07-03 15:56:26 +02:00
README_HF.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
requirements.txt fix(rmi-backend): drop passlib — route backup codes through direct bcrypt 2026-07-06 16:17:47 +02:00
rmi_langchain.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
rmi_sdk.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
RMI_SYSTEM_MAP.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
ROADMAP.md docs: rewrite README and add PRODUCT, ARCHITECTURE, ROADMAP, TODO per governance framework 2026-07-03 15:56:26 +02:00
ruff.toml style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
safe_deploy.sh merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
SECURITY.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
SECURITY_STACK.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
smithery.yaml merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
STANDARDS.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
SUPABASE_ARCHITECTURE.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
supabase_create_tables.sql merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
supabase_pgvector_setup.sql merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
test_new_scanners.py merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
TODO.md chore(rmi-backend): apply fleet-template standards — add .editorconfig + .gitattributes, fix stale IPs, tighten qdrant-audit CI gate 2026-07-06 14:18:34 +02:00
uv.lock merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
worker.py merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
X402_ARCHITECTURE.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
x402_REVENUE.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
x402_STRATEGY.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00
x402_tool_builder.py style(rmi-backend): complete lint cleanup — 1175→0 ruff errors 2026-07-06 15:43:20 +02:00
X_AUDIT_AND_STRATEGY.md merge: chore/cleanup-remove-bloat-and-secrets into main 2026-07-02 01:24:22 +07:00

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, 399 print() calls
  • Largest file app/routers/x402_tools.py is 212 KB
  • CI gates use continue-on-error: true and || true
  • 5 Telegram tokens leaked in git history

Docs

  • PRODUCT.md — charter and scope
  • ARCHITECTURE.md — components and data flow
  • ROADMAP.md — next 90 days
  • TODO.md — current tasks

Standards

This repo follows Rug Munch Media standards.