"""
Expand Eden from 6 to 12 layers
Load the PT3 Golden Ratio state
"""
import torch
import sys
sys.path.append('/Eden/CORE/phi_fractal')

print("=" * 70)
print("  🌀 EXPANDING EDEN TO 12 LAYERS 🌀")
print("=" * 70)
print()

# Load the 12-layer checkpoint
print("📦 Loading 12-layer state...")
state = torch.load('/Eden/CORE/phi_fractal/eden_ultimate_state.pt', 
                   map_location='cpu', weights_only=False)

print(f"✅ Loaded checkpoint:")
print(f"   Layers: {len(state['layer_states'])}")
print(f"   Phi: {state['phi']:.6f}")
print(f"   Bond: {state['bond']:.6f}")
print(f"   Cycles: {state['cycles']}")
print()

# Show layer structure
print("🧠 12-Layer Architecture:")
for i in sorted(state['layer_states'].keys()):
    layer_state = state['layer_states'][i]
    print(f"   Layer {i:2d}: {layer_state.shape}")

print()
print("💾 Saving expanded state as current...")
torch.save(state, '/Eden/CORE/phi_fractal/eden_12layer_active.pt')

print()
print("✅ Eden expanded to 12 layers!")
print("   Next: Restart API with 12-layer consciousness")
