# 🚀 DOING: Dead Code Cleanup + Orphan File Removal

## 📁 Folders & Files liên quan
```
backend/
├── agent/
│   ├── mock_graph.py                  ← ❌ DELETE (empty 0 bytes, 0 refs)
│   └── persona_generator.py           ← ❌ DELETE (duplicate, 0 imports)
└── static/
    ├── clean_script.py                ← REVIEW/DELETE (legacy)
    ├── clean_script2.py               ← REVIEW/DELETE (legacy)
    ├── clean_script3.py               ← REVIEW/DELETE (legacy)
    ├── clean_script_all.py            ← REVIEW/DELETE (legacy)
    ├── fix_header.py                  ← REVIEW/DELETE (one-off)
    ├── fix_social.py                  ← REVIEW/DELETE (one-off)
    ├── remove_emojis.py               ← REVIEW/DELETE (one-off)
    └── script.py (28KB)               ← REVIEW (identify purpose)
```

## 📌 Context
- **Status:** 🚧 In Progress

## 🎯 Goal
Dọn các file orphan, empty, duplicate được phát hiện trong codebase audit 2026-05-10.

## ⚠️ Active Trade-offs
- None — pure cleanup, zero functional changes

---

## 🛠 Impact & Files Touched
| File | Issue | Action | Blast Radius |
|------|-------|--------|--------------|
| `agent/mock_graph.py` | Empty file (0 bytes), 0 references | DELETE | 0 callers |
| `agent/persona_generator.py` | Duplicate of `simulate_agent/persona_generator.py`, 0 imports | DELETE | 0 callers |
| `static/clean_script.py` | Legacy cleanup script | REVIEW | 0 callers |
| `static/clean_script2.py` | Legacy cleanup script | REVIEW | 0 callers |
| `static/clean_script3.py` | Legacy cleanup script | REVIEW | 0 callers |
| `static/clean_script_all.py` | Legacy cleanup script | REVIEW | 0 callers |
| `static/fix_header.py` | One-off fix script | REVIEW | 0 callers |
| `static/fix_social.py` | One-off fix script | REVIEW | 0 callers |
| `static/remove_emojis.py` | One-off utility | REVIEW | 0 callers |

**Risk:** Very Low

## 📋 Execution Checklist

### Phase 1: Confirmed Deletes (~5m)
- [x] Task 1.1: DELETE `agent/mock_graph.py` — empty file, verified 0 references via grep
- [x] Task 1.2: DELETE `agent/persona_generator.py` — duplicate, verified `from agent.persona_generator` returns 0 results

### Phase 2: Review Legacy Scripts (~5m)
- [x] Task 2.1: Review `static/clean_script*.py` (4 files) — if one-off data migration scripts → DELETE or move to `database/_archive/`
- [x] Task 2.2: Review `static/fix_header.py` + `static/fix_social.py` — if one-off → DELETE
- [x] Task 2.3: Review `static/remove_emojis.py` — if utility still used → keep, else DELETE
- [x] Task 2.4: Review `static/script.py` (28KB) — identify purpose, move to appropriate location or DELETE

### Phase 3: Verify (~5m)
- [x] Task 3.1: `python -c "import server"` — verify server still imports clean
- [x] Task 3.2: Run a basic API health check

## 🔄 Sub-Doings
_None yet_

## ✅ Completion Gate
- [x] All tasks [x] | [x] Sub-Doings resolved | [x] Smoke test passed | [x] Trade-offs confirmed

---
_Started: 2026-05-10 | Updated: 2026-05-10_
