issues
Links GitHub issues and pull requests to commits and, through impact.jsonl, to agent sessions; puts session cost next to each PR, issue and ticket type. First working reader of ../issue-trackers.md (GitHub Issues). Reads metadata only through gh api graphql (read-only); PR titles and branch names are parsed for ticket keys and then dropped, bodies and comments are never read. Specs: METHOD.md (I-*).
- Input: local clones with a GitHub
origin(--repo, repeatable); GitHub via theghCLI (must be authenticated:gh auth status);impact.jsonlandsessions.jsonlfrom the data dir. - Output:
issues.jsonl(one record per PR and per issue),issues_summary.jsonin the data dir (or--out). - CLI:
python3 04-auto-analysis/issues/issues.py --repo PATH [--repo PATH ...] [--days N] [--config PATH] [--out DIR] [--impact FILE] [--sessions FILE] - Data touched: PR and issue number, state, state reason, timestamps, labels, commit shas, merge sha, closing-issue numbers, author login (output only as sha256[:12]). No network beyond
gh; no writes to GitHub. - Pipeline stage
issuesof03-analyze/pipeline.py(afterdeployments, skipped without network orgh); its summary goes to sectionissuesofreadout.json(../../03-analyze/output.md). Standalone, run afterimpact(it joins on impact's linked commits). - Record schema:
02-measure/schemas/issue.schema.json(v: 1, ISO UTC,hash12authors,repo_label= basename of the repo as in impact).
Tests: ../tests/test_issues.py (fake gh, fixtures in ../tests/fixtures/issues/, no network).
Reconfigure
Constants at the top of issues.py: DAYS, PAGE, MAX_PAGES, PR_COMMITS, TYPE_LABELS, KEY_RX, REF_RX, BRANCH_RX. No config key yet (adding one means adding issues to DEFAULTS in 02-measure/schemas/config.py).
Adapt, trade-offs, decisions for the human
- Adapt:
TYPE_LABELSto the repo's label names;KEY_RXto the team's Jira/Linear key convention;MAX_PAGESfor busy repos (issues_summary.truncatedlists repos that hit it). - Trade-offs: a PR joins a session only through commits impact already linked (trailer, or window confirmed by decide); PRs whose commits were rebased or squashed remotely join only if the merge sha was pulled and linked. Cost is split by commit share, so a session is never counted twice.
- Decisions for the human: which repos may be read; whether label-derived types are good enough or a tracker (Jira, Linear) should be the source of ticket type.