Fix fold metric
Add rules/utils.{h,cpp}