An automated pipeline that fetches GitHub issues, enriches them with type checker data and primer results, then ranks them by priority using a multi-pass LLM pipeline.
The pipeline has two main phases: collect and rank.
Collect phase (--mode collect): Fetches and enriches GitHub issues.
github_issues.py)__main__.py:_is_typechecking_issue)code_extractor.py)code_extractor.py:repair_snippet)issue_checker.py, dep_resolver.py)status_classifier.py)relationship_resolver.py)Rank phase (--mode rank): 5-pass LLM pipeline (pipeline.py).
passes/categorize.py) — classify issue type/areapasses/primer_impact.py) — match issues to primer errors (mostly deterministic string matching with LLM fuzzy fallback)passes/dependencies.py) — identify blocking relationshipspasses/score.py) — weighted signals including false positives, performance, strategic adoption, team priority, IDE usability, primer breadth, and more (see _SYSTEM_PROMPT in score.py for current weights)passes/rank.py) — final ordering with tie-breaking__main__.py — CLI entry point, collect/rank/full modespipeline.py — orchestrates the 5-pass LLM rankingissue_checker.py — runs pyrefly/pyright/mypy on code snippetsdep_resolver.py — scans code snippets for imports, resolves pip package names, and pre-installs dependencies before running checkersllm_transport.py — LLM API calls (Anthropic + Llama) with retry logicreport_formatter.py — generates markdown and JSON outputspec_fetcher.py — fetches typing spec sections for groundingscripts/compare_typecheckers.py)Clones ~137 open-source Python projects and runs pyrefly/pyright/mypy on each. Produces primer_errors.json consumed by the ranker's primer_impact pass.
--shard-index / --num-shards for parallel CI runsscripts/merge_primer_shards.py merges shard outputs back together"CHECKER_TIMEOUT" (not plain "timeout").github/workflows/issue_ranking.yml)compare_typecheckers.pymerge_primer_shards.py# Primer (needs pyrefly binary — use --pyrefly if no cargo) python3 scripts/compare_typecheckers.py --output /tmp/primer.json \ --pyrefly /path/to/pyrefly # Collect issues (needs GITHUB_TOKEN) python3 -m scripts.issue_ranker --mode collect \ --pyrefly /path/to/pyrefly --output /tmp/issues.json # Rank (needs ANTHROPIC_API_KEY) python3 -m scripts.issue_ranker --mode rank \ --primer-data /tmp/primer.json --issue-data /tmp/issues.json \ --output /tmp/ranking.md --output-json /tmp/ranking.json
scripts/issue_ranker/tests/scripts/issue_ranker/llm_tests/buck test pyrefly:issue_ranker_tests