chore(pr-review): Prefer local tools when PR branch is checked out#809
Merged
Conversation
When running `just pr-review NNN` or `just pr-triage NNN`, the recipes now detect whether the local working tree is already at that PR's HEAD before building the prompt. A new `_pr-checkout-state` helper resolves the PR's head SHA via `git ls-remote` (no `gh` needed) and compares it to `HEAD`, reporting `LOCAL <sha>`, `DIRTY <sha>`, or `REMOTE`. When the tree matches, the assistant is told to prefer the local `fs_*` and `git_*` tools over the slower `github_*` API calls. When the tree is dirty, it is told to run `git status` first and confirm that local edits don't affect the read before trusting local output. Both personas (`pr-reviewer` and `pr-triager`) have updated instructions to act on this signal. `pr-triage` additionally offers an interactive prompt when the working tree is on the PR's branch, letting the caller continue in an existing session-bound conversation (via `jp conversation use '?session'`) rather than always opening a fresh, context-free one. Signed-off-by: Jean Mertz <git@jeanmertz.com>
3bdf215 to
b1d5078
Compare
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.
When running
just pr-review NNNorjust pr-triage NNN, the recipes now detect whether the local working tree is already at that PR's HEAD before building the prompt. A new_pr-checkout-statehelper resolves the PR's head SHA viagit ls-remote(noghneeded) and compares it toHEAD, reportingLOCAL <sha>,DIRTY <sha>, orREMOTE.When the tree matches, the assistant is told to prefer the local
fs_*andgit_*tools over the slowergithub_*API calls. When the tree is dirty, it is told to rungit statusfirst and confirm that local edits don't affect the read before trusting local output. Both personas (pr-reviewerandpr-triager) have updated instructions to act on this signal.pr-triageadditionally offers an interactive prompt when the working tree is on the PR's branch, letting the caller continue in an existing session-bound conversation (viajp conversation use '?session') rather than always opening a fresh, context-free one.