Add phase-separation logic and cfg enforcement