Repository navigation
[CI] Add incremental diffs, isolated threads, check annotations, and static checks to Gemini review context (Stack 3/5) - #41853
Closed
damccorm wants to merge 1 commit into
Conversation
…static checks to Gemini review context
This was referenced Dec 1, 2026
Contributor
Author
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.
Context: I found I was getting much better results from my local agent than I was from the review bot. This tries to fix the problem, but I expect we'll want to do more hill climbing from here
Overall Change (Gemini Code Review Overhaul)
Splits draft PR #41844 into 5 small, focused, independently valid stacked PRs that replace the single-pass
web_fetch-based review workflow with a hardened, two-pass Hunter → Verifier review agent operating over read-only local context (repo/+pr_context/):web_fetchon the PR URL with no checkout, nogrep_searchacross callers/subclasses, no diff-hunk orcommit_idvalidation, nodry_runtesting mode, and single-pass JSON output — leading to missed bugs on non-trivial PRs and occasional hallucinated false positives.pr.diff, exact 1-basedpr.numbered.diff,valid_lines.json, boundedhead_files/,incremental.diff,checks.json, git log/static checks, and$RUNNER_TEMP-isolatedthreads.json), pin.github/gemini_review_guide.mdin system memory under a random per-run filename, run Pass 1 (high-recall Adversarial Hunter) → Pass 2 (high-precision Skeptical Verifier & JSON Formatter) → optional Pass 2b (JSON syntax repair), validate single-/multi-line same-hunk placement pinned tohead_sha, and add aworkflow_dispatchdry_runmode.workflow_dispatchwithdry_run=trueacross a representative sample of 10 open Java, Python, Go, YAML, runner, and I/O PRs—comparing the bot's output against independent blind reviews without posting comments—including a clean PR check to verify precision (0 false positives). Also verified workflow lint, license, whitespace, and security checks (beam_PreCommit_GHA,beam_PreCommit_RAT,beam_PreCommit_Whitespace, andzizmor).What This PR Changes (
3/5)Enriches the pre-fetched read-only context in
.github/workflows/gemini_code_review.yml(+306 / -5) with historical, review-thread, CI, and non-executing static-check signals:checks: read(minimal scope for check-run and annotation metadata).pr_context/incremental.diff): Finds the most recent priorgithub-actions[bot]Gemini review commit (last_gemini_review_sha) and fetcheslast_gemini_review_sha...head_shawhen new commits have been pushed.$RUNNER_TEMP/gemini_review_threads.json):reviewThreadsresolution metadata (isResolved/isOutdated).body: nullfor priorgithub-actions[bot]summary reviews so re-reviews cannot parrot earlier bot prose.threads.jsonoutside the workspace root (to$RUNNER_TEMP, cleaned up inif: always()) so Pass 1 in PR 5/5 physically cannot read or anchor on prior threads before finishing its independent bug hunt.pr_context/checks.json): Summarizes check-run totals and fetches up to 20 annotations for up to 5 failing check runs onhead_sha(pure metadata API, no artifact extraction).pulls.getonce after the other API calls finish if GitHub initially returnedmergeable: null, mergeable_state: "unknown".Collect recent history and non-executing static checks):pr_context/recent_history.txt(git -C repo -c core.hooksPath=/dev/null log -n 10 --onelineper touched path, truncated via temp file to avoidSIGPIPEunderpipefail).yapf,ruff,gofmt, andgoogle-java-formatwhen available on the runner (never importing or executing PR code), falling back topr_context/java_line_length.txtwhengoogle-java-formatis absent.Standalone safety: Populates additional read-only files only; leaves the agent invocation and posting steps unchanged until PRs 4–5.