-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomprehensive_cleanup.py
More file actions
68 lines (58 loc) · 2.3 KB
/
comprehensive_cleanup.py
File metadata and controls
68 lines (58 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import glob
import shutil
def comprehensive_cleanup():
print('🧹 EXECUTING COMPREHENSIVE CLEANUP PROTOCOL')
print('TARGET: Remove redundant phase directories and development artifacts')
cleanup_actions = []
# 1. Identify redundant phase directories (keeping only latest)
phase_dirs = [
'phase1_baseline', # Keep - core models
'phase3_wakeword', # Redundant?
'phase3_automation_phase4_cognitive', # Keep - core logic
'phase5_autonomous_extensions', # Redundant?
'phase5_neural_reflex', # Keep - emotion detection
'phase6_self_optimizing_core', # Keep - autonomy
'phase6_edgeos_integration', # Redundant?
'phase7_autonomy_framework', # Redundant?
'phase_9-enhanced_intelligence' # Keep - latest
]
# 2. Scan for development artifacts
dev_artifacts = [
'**/__pycache__',
'**/*.pyc',
'**/*.log',
'**/test_*.py',
'**/*_test.py',
'**/backup_*',
'**/temp_*',
'**/*.bak',
'**/*.old'
]
print('\n📋 CLEANUP PLAN:')
print('Phase directories to evaluate for consolidation...')
cleaned_count = 0
# Clean development artifacts first
for pattern in dev_artifacts:
for filepath in glob.glob(pattern, recursive=True):
try:
if os.path.isdir(filepath):
shutil.rmtree(filepath)
else:
os.remove(filepath)
cleaned_count += 1
print(f' 🗑️ CLEANED: {filepath}')
except Exception as e:
print(f' ⚠️ FAILED: {filepath} - {e}')
print(f'\n📊 CLEANUP SUMMARY:')
print(f' Development artifacts cleaned: {cleaned_count}')
print(f' Phase directory consolidation needed: MANUAL REVIEW REQUIRED')
return cleaned_count
if __name__ == '__main__':
cleaned = comprehensive_cleanup()
if cleaned > 0:
print(f'\n✅ CLEANUP COMPLETE: {cleaned} items removed')
print('⚠️ Phase directory consolidation requires manual decision')
else:
print(f'\n✅ SYSTEM ALREADY CLEAN: No development artifacts found')
print('⚠️ But phase directory sprawl remains - consider consolidation')