import json, os, html as H from collections import Counter R = [] for k in range(3): p = f'results_N{k}.json' if os.path.exists(p): R += json.load(open(p)) seen = set(); R = [r for r in R if not ((r['kind'], r['number']) in seen or seen.add((r['kind'], r['number'])))] ACT = {'nudge': 'comment', 'superseded': 'close', 'obsolete': 'close', 'stale_close': 'close'} cards = [] for r in R: act = ACT.get(r['verdict']) msg = r.get('message') c = dict(kind=r['kind'], number=r['number'], title=r.get('title', ''), category=r['verdict'], area=r.get('area', 'other'), confidence='high' if r.get('confidence') == 'high' else 'medium', by=None, reason=f"[{r.get('area','?')}] {'BLOCKER: ' + r['blocker'] + ' · ' if r.get('blocker') else ''}WHY: {r.get('why','')} · EVIDENCE: {r.get('evidence','')}", message=msg or ('(pointer comment already posted — nothing to send)' if r['kind'] == 'issue' and r['verdict'] == 'nudge' else '')) if r['kind'] == 'issue' and r['verdict'] == 'nudge' and msg and r['number'] != 25178: c['action'] = 'edit'; c['category'] = 'nudge'; c['reason'] = '[EDIT yesterday\'s pointer comment] ' + c['reason'] elif act == 'comment' and msg: c['action'] = 'comment' elif act == 'close' and msg: pass else: c['action'] = 'none' cards.append(c) order = ['nudge', 'maintainer_action', 'superseded', 'obsolete', 'stale_close', 'keep'] cards.sort(key=lambda c: (c['area'], order.index(c['category']) if c['category'] in order else 9, c['number'])) V = Counter(c['category'] for c in cards); A = Counter(c['area'] for c in cards) areas = [a for a, _ in A.most_common()] mat = Counter((c['area'], c['category']) for c in cards) th = ''.join(f'
| area | {th}total |
|---|
nudge = still valid on main + a concrete blocker the author can fix (comment only, stays open). " "maintainer_action = ball is with us (approved / unreviewed / pending decision): no author nudge. " "superseded / obsolete / stale_close = should close instead (evidence on each card). keep = active or maintainer-owned.