topological sort
fix spec
cache compatibility