def aggregate_by_key(records):
    totals = {}
    for row in records:
        key = row.get('key')
        value = row.get('value')
        if key is None or not isinstance(value, (int, float)) or isinstance(value, bool):
            continue
        totals[key] = totals.get(key, 0) + value
    return {k: totals[k] for k in sorted(totals)}
