Specify PRs via --pr and --pr-file in addition to the DB - #9
Merged
Merged
Conversation
The analyze command now accepts PRs from any combination of three sources: the outlier database (--db-path, now optional), specific PR numbers (--pr, repeatable), and a file of PR numbers (--pr-file). At least one source is required. Sources are merged and deduplicated by number, with DB records keeping their statistical metadata. Manually selected PRs have no z-score, so the report/console output and the prompt are generalized to read naturally for both flagged outliers and hand-picked PRs. Adds pr_sources.py with tests and updates the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets
analyzetake PRs from any combination of three sources instead of only the outlier database:--db-path— outlier PRs from the SQLite DB (now optional)--pr— a specific PR number, repeatable (--pr 1234 --pr 1240)--pr-file— a file of PR numbers (one per line; leading#and comma/space separated values also accepted)At least one source is required; the command errors clearly if none is given. Sources are merged and deduplicated by PR number, with DB records taking precedence so they keep their statistical metadata.
How
pr_sources.py:parse_pr_numbers/load_pr_numbers_from_file,manual_pr_record(same key shape asget_outliers), andmerge_records.main.py: new options, source validation, record merging. Manual PRs have no z-score, so the console/report output tolerates a missingmax_abs_z_score(renamed the loop var to avoid shadowing the new--proption).prompts.py: generalized the system prompt and per-PR prompt so they read naturally for both statistically-flagged outliers and hand-picked PRs.Tests
New
tests/test_pr_sources.pycovers parsing (one-per-line,#prefix, comma/space separated, blank lines, invalid-token error), file loading, manual record shape, and merge/dedup/precedence/order. Full suite: 20 passed,ruffclean,mypyclean.Notes
--from-datecontinues to apply only to the DB source.uv run review-agent --repo owner/repo --pr 1234 --pr-file ./prs.txt🤖 Generated with Claude Code