rulesByDepth: sort by ruleId eventually