Unified framework for dislocation-based defect energetics