The decision about when to create by-id or by-path persistent rules should be made in the generator rules file where it's obvious and easy to modify locally, not in the script.