- CLEANUP_PLAN.md: Detailed plan for organizing workspace structure - SAFETY_ANALYSIS.md: Analysis proving no runtime dependencies will break - RECOVERY_PLAN.md: Step-by-step recovery procedures if anything goes wrong All analysis complete - ready to execute cleanup safely. Files document current state and recovery methods.
6.0 KiB
✅ SAFETY ANALYSIS - Files Can Be Moved Without Breaking System
🔍 Analysis Performed
I've thoroughly analyzed the codebase for any references or dependencies on the files we plan to move.
✅ SAFE TO MOVE - No Breaking Changes
Documentation Files (*.md)
Status: ✅ COMPLETELY SAFE
Checked:
- README.md references SETUP.md, DOCKER.md, TESTING.md, PHASE_*.md files
- These are informational references only - not runtime dependencies
- Moving them won't break the system
Why Safe:
- Markdown files are documentation only
- No code imports them
- No scripts read them at runtime
- They're only for human readers
n8n Workflow Files (*.json)
Status: ✅ COMPLETELY SAFE
Files to move:
- All n8n-*.json files
- All telegram-*.json files
- Money_Machine.json
Checked:
- ❌ No Python imports found
- ❌ No shell script references found
- ❌ No TypeScript imports found
- ❌ No Docker COPY commands for these files
- ❌ No hardcoded paths in code
References Found:
complete_telegram_setup.shline 12: Referencestelegram-manual-trade-FINAL.jsonin echo statement only (informational)setup_telegram_bot.shline 34: Referencestelegram-manual-trade-FINAL.jsonin echo statement only (informational)
Why Safe:
- These are import files for n8n (imported manually via UI)
- Not read by any running code
- Only referenced in echo statements telling users what to import
- Moving them won't affect runtime
Shell Scripts (*.sh)
Status: ✅ SAFE WITH ONE NOTE
Files to move:
- docker-build.sh
- docker-start.sh
- docker-stop.sh
- docker-logs.sh
- complete_telegram_setup.sh
- setup_telegram_bot.sh
- GET_BOT_TOKEN.sh
- send_trade.sh
- trade.sh
- test-exit-orders.sh
Critical Check - Docker Compose Reference:
complete_telegram_setup.shline 47: Usesdocker-compose -f docker-compose.telegram-bot.yml- This is SAFE - it references docker-compose file in root, which we're NOT moving
Critical Check - Source Command:
setup_telegram_bot.shline 16:source .env.telegram-bot- This is SAFE - .env.telegram-bot stays in root
Why Safe:
- Scripts run from root directory (systemd WorkingDirectory=/home/icke/traderv4)
- We can update user documentation to run them from new location
- Docker compose files stay in root
- No script sources another script from the files we're moving
Test Files (*.ts)
Status: ✅ COMPLETELY SAFE
Files to move:
- test-drift-v4.ts
- test-full-flow.ts
- test-position-manager.ts
- test-price-monitor.ts
Checked:
- These are standalone test files
- No imports in other code
- No runtime dependencies
- Only run manually for testing
Archive Files
Status: ✅ COMPLETELY SAFE
Files to move:
- telegram_trade_bot.py (unused)
- telegram-to-webhook.py (unused)
- quick-trade.html (unused)
- webapp-trade.html (unused)
- CREATE_NEW_BOT.md (documentation)
Why Safe:
- These files are not used by the system
- telegram_trade_bot.py is NOT the active bot (telegram_command_bot.py is)
- HTML files are standalone demos
🔐 CRITICAL FILES STAYING IN ROOT
Files That MUST Stay in Root:
✅ telegram_command_bot.py - Referenced by Dockerfile.telegram-bot line 9
✅ watch-restart.sh - Referenced by systemd service
✅ docker-compose*.yml - Referenced by scripts and systemd
✅ Dockerfile* - Referenced by docker-compose files
✅ .env* - Referenced by docker-compose and scripts
Verified:
- Dockerfile.telegram-bot:
COPY telegram_command_bot.py .✅ (keeping in root) - trading-bot-restart-watcher.service:
ExecStart=/home/icke/traderv4/watch-restart.sh✅ (keeping in root) - All docker-compose files use
context: .✅ (stays in root)
📝 DOCUMENTATION UPDATES NEEDED
README.md References (Informational Only)
The README.md mentions these files in the "Documentation" section:
- Line 281:
DOCKER.md→ Will update todocs/setup/DOCKER.md - Line 282:
SETUP.md→ Will update todocs/setup/SETUP.md - Line 283:
TESTING.md→ Will update todocs/guides/TESTING.md - Line 327-330: Table references → Will update paths
Impact: ✅ Zero runtime impact - these are just documentation links
🎯 EXECUTION STRATEGY
Phase 1: Create Directory Structure
mkdir -p docs/setup
mkdir -p docs/guides
mkdir -p docs/history
mkdir -p workflows/trading
mkdir -p workflows/analytics
mkdir -p workflows/telegram
mkdir -p workflows/archive
mkdir -p scripts/docker
mkdir -p scripts/setup
mkdir -p scripts/testing
mkdir -p tests
mkdir -p archive
Phase 2: Move Files (Git mv)
Using git mv to preserve history:
- Move all docs to docs/
- Move all workflows to workflows/
- Move all scripts to scripts/
- Move all tests to tests/
- Move archive files to archive/
Phase 3: Update README.md
Update file path references in documentation section
Phase 4: Delete Empty Directories
rmdir data screenshots
Phase 5: Test
- ✅ Verify containers still running
- ✅ Check docker-compose still works
- ✅ Test telegram bot still responds
- ✅ Verify watch-restart.sh still works
Phase 6: Git Commit
Commit all changes with clear message
✅ FINAL VERDICT
100% SAFE TO PROCEED
Reasoning:
- ✅ No runtime code reads the files we're moving
- ✅ All Docker COPY commands reference files staying in root
- ✅ Systemd service references files staying in root
- ✅ Shell script references are either:
- Informational echo statements, or
- Reference files staying in root
- ✅ README.md references are documentation only (will update paths)
- ✅ No imports/requires of files being moved
- ✅ All critical files (telegram_command_bot.py, watch-restart.sh, Dockerfiles, docker-compose) stay in root
The system will continue running without any interruption.
🚀 READY TO EXECUTE
Shall I proceed with the cleanup?
- Phase 1-6 will be executed systematically
- Each step will be verified
- System will remain operational throughout
- Git history will be preserved