hive-not-swarm
aien-dev/hive-not-swarm
Brought by drakestapleton
hive-not-swarm / sources / count_pr_links.py
| 1 | """Recount the Section 4.1 pull-request link counts from sources/repository_pr_links.json.""" |
| 2 | import json |
| 3 | from pathlib import Path |
| 4 | |
| 5 | data = json.loads((Path(__file__).resolve().parent / 'repository_pr_links.json').read_text()) |
| 6 | CUT = '2026-10-12T00:00:00Z' |
| 7 | for label, keep in (('before', lambda t: t < CUT), ('on_or_after', lambda t: t >= CUT)): |
| 8 | prs = [p for p in data['pull_requests'] if keep(p['createdAt'])] |
| 9 | states = {} |
| 10 | for p in prs: |
| 11 | states[p['state']] = states.get(p['state'], 0) + 1 |
| 12 | print(label, 'pull_requests', len(prs), |
| 13 | 'formal_closing_link', sum(p['formal_closing_link'] for p in prs), |
| 14 | 'issue_number_in_title_or_body', sum(p['issue_number_in_title_or_body'] for p in prs), |
| 15 | 'states', dict(sorted(states.items()))) |