Improve error messages with dependency chains and extract validateCircularity Method for readability.