with open('autonomous_swarm.py', 'r') as f:
    lines = f.readlines()

# Find and fix the broken print section
new_lines = []
skip_next = False

for i, line in enumerate(lines):
    if skip_next:
        skip_next = False
        continue
    
    if 'Consciousness logging active' in line and '\\n")' in line:
        # This is the broken line, fix it
        new_lines.append('        print("📊 Consciousness logging active\\n")\n')
        # Check if next line is the stray ")
        if i + 1 < len(lines) and lines[i + 1].strip() == '")':
            skip_next = True
    else:
        new_lines.append(line)

with open('autonomous_swarm.py', 'w') as f:
    f.writelines(new_lines)

print("✅ Fixed broken print statement")
