Tell me about a time you debugged a broken function in a codebase and then extended its functionality.
Implement summarize_values(records, include_inactive, minimum_total) as a compact version of that task. Aggregate each record's value by its string key, optionally exclude inactive records, and return only groups whose total is at least minimum_total. Each record is a dictionary with key, value, and active fields; return a dictionary.
def summarize_values(records, include_inactive, minimum_total):