import json
import subprocess
r = subprocess.run(['uv', 'run', 'python', 'scripts/audit_exception_handling.py', '--json'], capture_output=True, text=True)
data = json.loads(r.stdout)
app = [f for f in data['files'] if 'app_controller' in f.get('filename', '')][0]
print(f"V={app['violation_count']} C={app['compliant_count']} S={app['suspicious_count']} ?={app['unclear_count']}")
print()
for cat in ['INTERNAL_BROAD_CATCH', 'INTERNAL_SILENT_SWALLOW', 'INTERNAL_RETHROW', 'INTERNAL_OPTIONAL_RETURN']:
    sites = [f for f in app['findings'] if f.get('category') == cat]
    print(f'{cat}: {len(sites)} remaining')
