code: func CompactRules(rules []rbacv1.PolicyRule) ([]rbacv1.PolicyRule, error) {
  	compacted := make([]rbacv1.PolicyRule, 0, len(rules))
  
  	simpleRules := map[simpleResource]*rbacv1.PolicyRule{}
  	for _, rule := range rules {
  		if resource, isSimple := isSimpleResourceRule(&rule); isSimple {
  			if existingRule, ok := simpleRules[resource]; ok {
  				// Add the new verbs to the existing simple resource rule
  				if existingRule.Verbs == nil {
  					existingRule.Verbs = []string{}
  				}
  				existingRule.Verbs = append(existingRule.Verbs, rule.Verbs...)
  			} else {
  				// Copy the rule to accumulate matching simple resource rules into
  				simpleRules[resource] = rule.DeepCopy()
  			}
  		} else {
  			compacted = append(compacted, rule)
  		}
  	}
  
  	// Once we've consolidated the simple resource rules, add them to the compacted list
  	for _, simpleRule := range simpleRules {
  		compacted = append(compacted, *simpleRule)
  	}
  
  	return compacted, nil
  }
docs: // CompactRules combines rules that contain a single APIGroup/Resource, differ only by verb, and contain no other attributes.
  // this is a fast check, and works well with the decomposed "missing rules" list from a Covers check.