rugmuncher-backend / CLEANUP.md
cryptorugmunch
merge: chore/cleanup-remove-bloat-and-secrets into main
bde2f3a
|
Raw
History Blame Contribute Delete
2.31 kB
# CLEANUP.md โ€” rmi-backend
> Audit + cleanup log. Most recent first.
## 2026-07-02 โ€” bloat + secrets removal
**Branch**: `chore/cleanup-remove-bloat-and-secrets`
### ๐Ÿšจ SECURITY: removed `.secrets/`
- `.secrets/ghost_session_cookies` was committed to main. Content was a Netscape cookie jar.
- **CRITICAL ACTION REQUIRED: rotate any cookies/secrets that were in this file.**
- The file may have been browsable by anyone with repo read access.
- Added `.secrets/` to `.gitignore` (was missing).
### ๐Ÿ—‘๏ธ Bloat removed
- `rmi-frontend/` subtree (~2.7MB) โ€” React app lives in its own repo `RugMunchMedia/rmi-frontend`
- `backend/` subtree (273 files, ~1.7MB) โ€” duplicate scaffold, NOT the source of truth
### ๐Ÿšฎ Broken files removed
- `, r.stdout)...` โ€” shell heredoc accident with literal newlines in filename
- `5s}`, `7s}`, `=2.0.0` โ€” fragment files from another shell accident
### ๐Ÿ›ก๏ธ .gitignore hardened
Added patterns for:
- Secrets (`.secrets/`, `*.pem`, `*.key`, `*.crt`, `.env`)
- Data blobs (`*.zip`, `*.parquet`, `*.sqlite`, `*.duckdb`)
- Model weights (`*.bin`, `*.safetensors`, `*.pt`, `*.onnx`)
## Files deliberately NOT removed
These look "extra" but are legit:
- `worker.py`, `main.py`, `Dockerfile.worker` โ€” runtime entry points
- `alembic.ini`, `alembic/` โ€” DB migrations
- `ruff.toml`, `mypy.ini`, `pytest.ini` โ€” lint/type/test config
- `safe_deploy.sh`, `databus_warm_cron.py` โ€” ops scripts
- `justfile`, `uv.lock`, `requirements.txt` โ€” modern Python tooling
- `rmi_sdk.py`, `rmi_langchain.py`, `x402_tool_builder.py` โ€” domain modules
- `smithery.yaml`, `huggingface.yaml` โ€” service configs
- `docker-compose.email.yml` โ€” email service config
- `supabase/*.sql` โ€” Supabase migrations
- `PROPRIETARY_REGISTRATION.txt` โ€” legal doc
- `main.py.bak` โ€” backup, consider deleting in future PR
- `backend.log` โ€” log file, should be ignored (will be cleaned by better .gitignore)
## Pre-cleanup size
134MB โ†’ ~70MB
## Lessons learned
- Pre-commit hooks must include gitleaks (it WAS configured but this file slipped through)
- `.secretsallow` is an allowlist โ€” anything not on it must be blocked
- Empty/short-lived subtrees should be deleted immediately, not left as legacy
- A `CLEANUP.md` in each repo prevents this pattern from recurring