Skip to content

ci: use Opus 5 for PR review and mount upstream ANTLR for comparison - #189

Merged
tinovyatkin merged 1 commit into
mainfrom
worktree-opus5
Jul 24, 2026
Merged

ci: use Opus 5 for PR review and mount upstream ANTLR for comparison#189
tinovyatkin merged 1 commit into
mainfrom
worktree-opus5

Conversation

@tinovyatkin

@tinovyatkin tinovyatkin commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Two enhancements to the automated Claude Code review workflow (.github/workflows/claude-code-review.yml):

  1. Model → Opus 5. --model "claude-opus-4-8[1m]""claude-opus-5[1m]". Opus 5 shipped today; Opus 4.8 is now legacy. The [1m] suffix (Claude Code's 1M-context selector) is preserved.

  2. Mount upstream ANTLR for comparison. A new actions/checkout step clones antlr/antlr4 at tag 4.13.2 into antlr-upstream/, and the review prompt now points the reviewer there.

Why

This crate is a Rust port of ANTLR's reference runtime + code generator. Most PRs touch ported logic — ATN/prediction, lexer/parser simulation, serialized-ATN decoding, generated-code shape — where a faithful review means checking the Rust behavior against the reference implementation.

  • Pinned to 4.13.2 (the version CLAUDE.md targets everywhere), not master — otherwise the reviewer would flag post-4.13.2 upstream changes as false divergence.
  • path: antlr-upstream keeps it out of the main checkout; fetch-depth: 1 since the reviewer reads source, not history.
  • Prompt guides the reviewer to catch unintended divergence while respecting documented deliberate deviations, and to cite the upstream file:line.

Verification

  • actionlint .github/workflows/claude-code-review.yml → clean
  • antlr/antlr4 tag 4.13.2 confirmed to exist; cited subpaths (runtime/Java/src/org/antlr/v4/runtime/, tool/) verified present at that tag.

Notes

  • This only touches the automated PR-review workflow. The @claude mention workflow (claude.yml) still uses the action's default model with no pin — let me know if it should get the same bump.

Summary by CodeRabbit

  • Chores
    • Updated automated code review workflows to compare implementation behavior against the ANTLR 4.13.2 reference source.
    • Enhanced review guidance to identify and document intentional differences from upstream semantics.
    • Updated the AI model used for automated reviews.

Switch the automated review model to `claude-opus-5[1m]` (Opus 5 was
released today; Opus 4.8 is now legacy) while keeping the `[1m]`
1M-context suffix.

Add an `actions/checkout` step that clones antlr/antlr4 at tag 4.13.2 —
the version this runtime targets — into `antlr-upstream/`, and update the
review prompt to point the reviewer there. Most PRs touch ported ATN /
prediction / codegen logic, and a faithful review needs to compare
against the reference implementation rather than upstream `master`
(which carries post-4.13.2 changes a reviewer could mis-flag as
divergence).
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Claude review workflow now checks out ANTLR 4.13.2 for comparison, uses Claude Opus 5, and adds prompt guidance for identifying and documenting differences from upstream ANTLR semantics.

Changes

Claude review workflow

Layer / File(s) Summary
Upstream reference and review configuration
.github/workflows/claude-code-review.yml
Checks out the ANTLR 4.13.2 source into antlr-upstream/, updates the Claude model to Opus 5, and instructs reviews to compare ported runtime and generator logic against the upstream reference.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the workflow update: switching to Opus 5 and adding upstream ANTLR comparison.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-opus5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tinovyatkin
tinovyatkin merged commit ecb245b into main Jul 24, 2026
8 of 9 checks passed
@tinovyatkin
tinovyatkin deleted the worktree-opus5 branch July 24, 2026 20:27
@github-actions

Copy link
Copy Markdown

📊 Source Code Metrics (this PR vs main)

No metric changes detected.

Generated by mehen v1.7.0 — the code quality watcher.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/claude-code-review.yml:
- Around line 52-58: Add persist-credentials: false to the actions/checkout step
named “Checkout upstream ANTLR (reference for review comparisons),” while
preserving its existing repository, ref, path, and fetch-depth settings.
- Line 53: Update the actions/checkout step in the workflow to reference the
desired v7 release using its full immutable commit SHA instead of the mutable
actions/checkout@v7 tag, and retain the version identifier in an inline comment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5bd06cf4-93f7-41bc-84be-65b04a88ab79

📥 Commits

Reviewing files that changed from the base of the PR and between bd7ed43 and 9230994.

📒 Files selected for processing (1)
  • .github/workflows/claude-code-review.yml

Comment on lines +52 to +58
- name: Checkout upstream ANTLR (reference for review comparisons)
uses: actions/checkout@v7
with:
repository: antlr/antlr4
ref: "4.13.2"
path: antlr-upstream
fetch-depth: 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable credential persistence for the reference checkout.

This checkout is read-only and public, so add persist-credentials: false. The following Claude step can inspect the workspace, making an unnecessary persisted token an avoidable exposure. The checkout action documents this input as the opt-out for persisted credentials. (github.com)

Proposed fix
         with:
           repository: antlr/antlr4
           ref: "4.13.2"
           path: antlr-upstream
           fetch-depth: 1
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout upstream ANTLR (reference for review comparisons)
uses: actions/checkout@v7
with:
repository: antlr/antlr4
ref: "4.13.2"
path: antlr-upstream
fetch-depth: 1
- name: Checkout upstream ANTLR (reference for review comparisons)
uses: actions/checkout@v7
with:
repository: antlr/antlr4
ref: "4.13.2"
path: antlr-upstream
fetch-depth: 1
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 52-58: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 53-53: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude-code-review.yml around lines 52 - 58, Add
persist-credentials: false to the actions/checkout step named “Checkout upstream
ANTLR (reference for review comparisons),” while preserving its existing
repository, ref, path, and fetch-depth settings.

Sources: MCP tools, Linters/SAST tools

# the reviewer reads source, not git history. The directory name is
# deliberately non-hidden so ripgrep-backed search (Grep) descends into it.
- name: Checkout upstream ANTLR (reference for review comparisons)
uses: actions/checkout@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files:"
git ls-files | rg '(^|/)(claude-code-review\.yml|policy|security|README|SECURITY|CODEOWNERS|zizmor|unpin|pinned|workflow)' || true

echo
echo "Workflow around checkout:"
if [ -f .github/workflows/claude-code-review.yml ]; then
  nl -ba .github/workflows/claude-code-review.yml | sed -n '1,140p'
fi

echo
echo "Search unpinned policy/terms:"
rg -n -i "unpin|pinned|pinned action|full commit sha|immutable|checkout|zizmor|actions/checkout|tag|sha" .github README.md SECURITY.md CODEOWNERS 2>/dev/null | head -200 || true

Repository: ophi-dev/antlr-rust-runtime

Length of output: 847


🌐 Web query:

actions checkout v7 release commit SHA

💡 Result:

The release v7.0.0 of actions/checkout was published on June 18, 2026 [1]. The commit SHA for this specific tag (v7.0.0) is 3d3c42e5aac5ba805825da76410c181273ba90b1 [2]. As of today, July 24, 2026, the latest release in the v7 series is v7.0.1, which was released on July 20, 2026 [3][4]. You can always verify the most current commit SHAs by checking the tags page in the official GitHub repository [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Workflows:"
for f in .github/workflows/*.yml; do
  printf '\n--- %s ---\n' "$f"
  awk '{printf "%5d  %s\n", NR, $0}' "$f" | sed -n '1,140p'
done

echo
echo "README/SECURITY/CODEOWNERS/policy files:"
for f in README.md SECURITY.md CODEOWNERS .github/dependabot.yml; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    awk '{printf "%5d  %s\n", NR, $0}' "$f" | sed -n '1,220p'
  else
    echo "missing: $f"
  fi
done

echo
echo "Policy-related text:"
rg -n -i "unpin|pinned|pinned action|full commit sha|immutable|checkout|zizmor|github actions security|actions/checkout|`@v`" README.md .github 2>/dev/null || true

Repository: ophi-dev/antlr-rust-runtime

Length of output: 50385


🌐 Web query:

GitHub actions checkout v7.0.1 commit SHA actions/checkout v7.0.1

💡 Result:

The GitHub Actions checkout action version v7.0.1 corresponds to the commit SHA 3d3c42e5aac5ba805825da76410c181273ba90b1 [1]. This release was published on July 20, 2026 [2][3]. The commit associated with this release, titled "prep v7.0.1 release (#2531)", finalized the version bump from v7.0.0 to v7.0.1 [4][1].

Citations:


Pin the checkout action to an immutable commit SHA.

actions/checkout@v7 is an unpinned branch/tag reference. Replace it with the current full-length commit SHA for the desired v7 commit and leave the version in a comment.

🧰 Tools
🪛 zizmor (1.26.1)

[error] 53-53: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude-code-review.yml at line 53, Update the
actions/checkout step in the workflow to reference the desired v7 release using
its full immutable commit SHA instead of the mutable actions/checkout@v7 tag,
and retain the version identifier in an inline comment.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant