import json
from pathlib import Path
from collections import Counter
import sys
root = Path(__file__).resolve().parents[4]
before = json.loads((root / 'tools/dev/runs/20260923-122252-checks-mfm4xyll/report.json').read_text())
after = json.loads((root / sys.argv[1]).read_text())
for key in before['conditions'].keys() | after['conditions'].keys():
    if before['conditions'].get(key) != after['conditions'].get(key):
        print('CONDITION DIFFERENCE', key, before['conditions'].get(key), after['conditions'].get(key))
old = Counter(next(c for c in before['checks'] if c['id'] == 'gameplay')['errors'])
new = Counter(next(c for c in after['checks'] if c['id'] == 'gameplay')['errors'])
print('NEW', list((new - old).items()))
print('RESOLVED', list((old - new).items()))
