feat(pr-review): let a PR comment trigger a reconcile round - #8
Merged
Conversation
Fix A of the open-question workflow. Before this, the reviewer only ran on `pull_request` events, so answering an open question in a PR comment did nothing until the next push (and even then #7 was needed for the answer to register). This lets a consumer opt a comment into driving a review round. - review_pipeline.py: - `prepare` accepts `--event-name`. On an `issue_comment` event a comment never adds code to review, so it can only run a reconcile-only incremental round — and only when the manifest still has an open question or finding (something a comment could answer, justify, or invalidate). Otherwise it skips, so routine chatter does not spend a review. - `manifest_has_open_items` is the gate. - When the head has not moved the delta is empty and the round exists purely to reconcile the new discussion; a comment that races a push reviews the new delta too. The round reuses the same sticky-comment manifest (full prior context) and runs on the cheaper incremental tier; if nothing changes the publisher posts nothing. - action.yml: pass `--event-name`, and fall back to `github.event.issue.number` for the PR number on comment events. - README: document the opt-in consumer snippet (issue_comment trigger, the human-only `if:` guard, and the issue.number concurrency fallback) and the cheap gating. - tests: cover the gate helper and the action wiring. Consumers opt in per repo by adding the `issue_comment` trigger to their `claude.yml`; without it, behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCc8MLBBAp5jAxc2x19swa
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.
Fix A — answering a question without a push
Follow-up to #7. Before this, the pr-review action only ran on
pull_requestevents, so answering an open question in a PR comment did nothing until the next push. This lets a repo opt a comment into driving a review round — while making sure routine chatter doesn't burn a review.How it works
prepareaccepts--event-name. On anissue_commentevent, a comment never adds code to review, so it can only ever produce a reconcile-only incremental round or a skip — never a full review.manifest_has_open_items): it skips unless the manifest still has an open question or open finding — something a comment could answer, justify, or invalidate (per the design discussion, findings count too, not just questions). Most comments skip for the cost of a few API calls; no Opus run.@claude(which starts fresh). Runs on the cheaper incremental tier.Consumer opt-in
Per-repo, in
claude.yml(documented inactions/README.md):Without the
issue_commenttrigger, behaviour is unchanged.Tests
Gate helper + action wiring covered; full suite green (80 tests). YAML valid, pipeline compiles.
Follow-up (separate PR)
Wiring the
issue_commenttrigger into grafana-dashboard'sclaude.yml(the repo where this was observed) so the flow is live there.🤖 Generated with Claude Code