Conversation
Introduces an end-to-end AI-assisted pull request review workflow, spanning a new `jp_attachment_github` crate, extensions to `jp_github`, new project tooling, and a dedicated `pr-reviewer` persona. **New `jp_attachment_github` crate** Adds a `gh://` URI attachment handler with two resource types: - `gh:pull/N/diff` — fetches a PR's title, description, and unified diff as a single text attachment. The diff is filtered through a configurable exclusion list (snapshots, lockfiles, minified JS, …) so generated noise is kept out of the LLM context. Override via `?exclude=glob1,glob2` or disable the defaults with `?no_defaults=true`. - `gh:pull/N/reviews` — fetches all reviews and inline comments on a PR, rendered as structured Markdown grouped by file and anchor line. Pending (draft) reviews and comments are attributed to "you" rather than exposing the reviewer's login. Both resource types accept a shortform (`gh:pull/N/diff`) that is project-rooted to `dcdpr/jp`, or a canonical form (`gh://owner/repo/pull/N/diff`) for any repository. **`jp_github` extensions** Added new models (`Side`, `ReviewState`, `Review`, `DraftReviewComment`, `GitRef`) and new `PullsHandler` methods: - `list_reviews` — lists all reviews on a PR. - `create_review` — builder API that creates a draft (`PENDING`) review. - `delete_review` — deletes a pending review. - `add_review_thread` — appends a single inline comment to an existing pending review via the GraphQL `addPullRequestReviewThread` mutation, since the REST API does not support appending to an existing draft. `PullRequest` gains `node_id`, `head`, and `base` fields required for fetching file content at the correct SHA. **`github_pr_review_add_comment` tool** A new project tool that queues one inline comment at a time to the authenticated user's pending review. Before each comment is posted, the tool renders a syntax-highlighted snippet from the PR's HEAD file plus the proposed comment body for user approval. The review remains in `PENDING` state until the user submits it from the GitHub UI. **`github_read_file` line range support** `github_read_file` now accepts `start_line` and `end_line` parameters. Files larger than 2,000 lines require an explicit range — the tool refuses to dump oversized files in one call. **`pr-reviewer` persona** A new persona at `.jp/config/personas/pr-reviewer.toml` bundles the review-specific system prompt, instructions for anchoring inline comments correctly (hunk-header arithmetic, LEFT vs RIGHT side), and evaluation criteria (correctness, failure modes, architectural fit, tests, public surface, naming, scope). **`just pr-review NNN` recipe** `just pr-review 161` starts a review session for PR #161. It attaches both the diff and the reviews resources, uses the `pr-reviewer` persona, and resumes an existing conversation (or archives it and starts fresh) when one with the matching title already exists. Signed-off-by: Jean Mertz <git@jeanmertz.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.
Introduces an end-to-end AI-assisted pull request review workflow, spanning a new
jp_attachment_githubcrate, extensions tojp_github, new project tooling, and a dedicatedpr-reviewerpersona.New
jp_attachment_githubcrateAdds a
gh://URI attachment handler with two resource types:gh:pull/N/diff— fetches a PR's title, description, and unified diff as a single text attachment. The diff is filtered through a configurable exclusion list (snapshots, lockfiles, minified JS, …) so generated noise is kept out of the LLM context. Override via?exclude=glob1,glob2or disable the defaults with?no_defaults=true.gh:pull/N/reviews— fetches all reviews and inline comments on a PR, rendered as structured Markdown grouped by file and anchor line. Pending (draft) reviews and comments are attributed to "you" rather than exposing the reviewer's login.Both resource types accept a shortform (
gh:pull/N/diff) that is project-rooted todcdpr/jp, or a canonical form(
gh://owner/repo/pull/N/diff) for any repository.jp_githubextensionsAdded new models (
Side,ReviewState,Review,DraftReviewComment,GitRef) and newPullsHandlermethods:list_reviews— lists all reviews on a PR.create_review— builder API that creates a draft (PENDING) review.delete_review— deletes a pending review.add_review_thread— appends a single inline comment to an existing pending review via the GraphQLaddPullRequestReviewThreadmutation, since the REST API does not support appending to an existing draft.PullRequestgainsnode_id,head, andbasefields required for fetching file content at the correct SHA.github_pr_review_add_commenttoolA new project tool that queues one inline comment at a time to the authenticated user's pending review. Before each comment is posted, the tool renders a syntax-highlighted snippet from the PR's HEAD file plus the proposed comment body for user approval. The review remains in
PENDINGstate until the user submits it from the GitHub UI.github_read_fileline range supportgithub_read_filenow acceptsstart_lineandend_lineparameters. Files larger than 2,000 lines require an explicit range — the tool refuses to dump oversized files in one call.pr-reviewerpersonaA new persona at
.jp/config/personas/pr-reviewer.tomlbundles the review-specific system prompt, instructions for anchoring inline comments correctly (hunk-header arithmetic, LEFT vs RIGHT side), and evaluation criteria (correctness, failure modes, architectural fit, tests, public surface, naming, scope).just pr-review NNNrecipejust pr-review 161starts a review session for PR #161. It attaches both the diff and the reviews resources, uses thepr-reviewerpersona, and resumes an existing conversation (or archives it and starts fresh) when one with the matching title already exists.