- Add .editorconfig (Python 4-space, default 2, LF, UTF-8) per fleet-template
- Add .gitattributes (LF normalization, lockfile binary, generated paths)
- Fix AGENTS.md:35 — netcup (100.100.18.18) → Talos (100.104.130.92)
- Mark TODO.md:5 done — Qdrant stale IP (fixed in 3c6b295)
- Remove continue-on-error: true from qdrant-cleanup job (inner step has || \, no behavior change)
Refs: standards/GAPS.md#4 (Make CI gates authoritative), standards/GAPS.md#9 (Repo tooling parity), standards/GAPS.md#12 (Documentation contradictions)
3.4 KiB
🚨 CRITICAL RULES (enforced by gitleaks pre-commit hook)
- No nested repos. Don't commit other complete project trees inside this one.
- No secrets. Never commit
.secrets/,.env,*.pem,*.key,*.crt, cookie jars. - No data blobs. Don't commit
*.zip,*.parquet, model weights, sqlite files. - No broken files. Shell heredoc accidents must be caught before commit.
- No duplicate scaffolds. If a
backend/orfrontend/subdir exists at root, it's either THE app or bloat — investigate before adding more.
See CLEANUP.md for cleanup history.
AGENTS.md — rmi-backend
Every AI agent working on backend code reads this first.
Last updated: 2026-06-29
What This Is
rmi-backend — FastAPI crypto intelligence backend. 757+ routes, 221 MCP tools, 89 DataBus chains, 39.4M wallet labels, 21 SENTINEL scanner modules.
Before You Start
Read these files in order:
- ~/AGENTS.md — fleet-wide contract, product table, git policy
- ~/CONVENTIONS.md — shared patterns (coding, naming, testing)
- ./AGENTS.md (this) — backend-specific instructions
- ./README.md — full project overview
- ~/STANDARDS.md — linting, testing, quality gates
- ~/TOOLCHAIN.md — developer tool inventory
The Server
ALL work happens on Talos (100.104.130.92).
ssh netcup
cd /root/backend
docker logs rmi-backend --tail 100
docker restart rmi-backend
curl localhost:8000/health
Code in /root/backend is Docker volume-mounted — changes go live on restart.
Testing
docker exec rmi-backend pytest -p no:pytest-brownie -v
docker exec rmi-backend pytest tests/unit/test_X.py -p no:pytest-brownie -v
The -p no:pytest-brownie is mandatory — eth-brownie tries to connect to ganache.
Linting
ruff check app/ --fix
ruff format app/
mypy app/ --strict
MCP Tools
mcp_discover, status_check, analytics_query, wallet_labels, eth_labels_tool, token_security, scam_intel, news_search, rag_query, report_generate, x402_marketplace (+ 210 more)
List: GET /mcp/tools Call: POST /mcp/call/{tool_id} Info: GET /mcp/info
Adding a New Scanner Module
- Create app/scanners/my_detector.py (fetches from first-party APIs only)
- Add import to app/scanners/init.py
- Add runner function in app/scanners/sentinel_pipeline.py
- Add endpoint to app/routers/x402_tools.py
- Add pricing to x402_enforcement.py
CRITICAL: Never call our own x402 endpoints internally.
Adding a New DataBus Chain
- Create provider in app/databus/providers/
- Register in app/databus/chains.py
- Register provider class in app/databus/registry.py
Rules
- All data through DataBus — never call providers directly
- Type everything — Pydantic v2 + mypy strict
- Async for all I/O — httpx.AsyncClient, asyncpg, asyncio
- Never bare except — always log + re-raise
- Use env vars — never hardcode hosts or secrets
- Add tests for new code — coverage > 80%
- Conventional commits — feat:/fix:/chore:/docs:/refactor:/test:
- No secrets in git — vault.py is the only storage
- No circular API calls — scanner modules don't call our own endpoints
- Don't add to main.py (28 lines, by design) — use app/mount.py
Git
Internal primary: root@talos:/srv/git/rmi-backend.git
Push talos main on every commit.
External remotes: GitHub (LLC), GitLab, HuggingFace (see ~/AGENTS.md)