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_cookieswas 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 repoRugMunchMedia/rmi-frontendbackend/subtree (273 files, ~1.7MB) โ duplicate scaffold, NOT the source of truth
๐ฎ Broken files removed
, r.stdout)...โ shell heredoc accident with literal newlines in filename5s},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 pointsalembic.ini,alembic/โ DB migrationsruff.toml,mypy.ini,pytest.iniโ lint/type/test configsafe_deploy.sh,databus_warm_cron.pyโ ops scriptsjustfile,uv.lock,requirements.txtโ modern Python toolingrmi_sdk.py,rmi_langchain.py,x402_tool_builder.pyโ domain modulessmithery.yaml,huggingface.yamlโ service configsdocker-compose.email.ymlโ email service configsupabase/*.sqlโ Supabase migrationsPROPRIETARY_REGISTRATION.txtโ legal docmain.py.bakโ backup, consider deleting in future PRbackend.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)
.secretsallowis an allowlist โ anything not on it must be blocked- Empty/short-lived subtrees should be deleted immediately, not left as legacy
- A
CLEANUP.mdin each repo prevents this pattern from recurring