Skip to content

Kan/fvm claude reviewer - #8614

Merged
Kay-Zee merged 4 commits into
masterfrom
kan/fvm-claude-reviewer
Jul 27, 2026
Merged

Kan/fvm claude reviewer#8614
Kay-Zee merged 4 commits into
masterfrom
kan/fvm-claude-reviewer

Conversation

@Kay-Zee

@Kay-Zee Kay-Zee commented Jul 20, 2026

Copy link
Copy Markdown
Member

Adds a workflow that runs Claude Code on every PR touching fvm/** and posts its findings as a PR comment. Companion to the branch-protection ruleset PR — that one makes room for an AI reviewer to eventually count as one of the two
required approvals on FVM-only changes; this one is the reviewer.

It starts in trial mode, deliberately. Claude posts a single findings comment per run (grouped by severity, file:line citations, capped nits) and cannot approve or request changes — not just by prompt, but structurally: the tool
allowlist doesn't include gh pr review, so an approval is impossible regardless of what the model decides. Once we've watched it on enough real FVM PRs to trust the signal, promoting it is a two-line change (add Bash(gh pr review:*) to
the allowlist, swap the submission stanza of the prompt) — documented in a comment at the top of the workflow.

The review prompt is specialized for this codebase rather than generic. It points Claude at AGENTS.md, fvm/README.md, and the fvm/errors taxonomy (CodedError vs CodedFailure — fvm does not use the sentinel model the rest of the
repo does), and names the bug classes that have actually bitten us: execution-result determinism and HCU discipline, warm/cold cache-state independence in derived-data metering, RunWithMeteringDisabled boundary semantics and
nested-transaction merge/unwind pairing, error-code stability, transaction pipeline phase invariants, service-account exemptions, and SPoCK sensitivity. It diffs against the PR's base ref rather than master, since FVM PRs are frequently
stacked. Style and formatting are explicitly out of scope — CI and CodeRabbit already cover those.

Authentication uses Workload Identity Federation: the workflow exchanges its GitHub OIDC token for a short-lived Anthropic token at runtime, so there is no ANTHROPIC_API_KEY secret to store or rotate. The IDs in the workflow file are
identifiers, not credentials. The federation rule (scoped to repo:onflow/flow-go:) and the Claude GitHub App installation are already in place, so this should work on the first FVM PR after merge.

Cost controls: runs are capped at 30 minutes and 30 turns, a new push cancels the in-flight review for that PR, and draft PRs are skipped until marked ready.

Summary by CodeRabbit

  • New Features
    • Added automated pull request reviews for changes in the FVM area.
    • Reviews run only on eligible (non-draft) pull request updates and post a single, severity-grouped comment with findings.
    • Review guidance focuses on consensus-critical determinism and metering/transaction invariants, including strict guidance on error classifications and CI “trial” reporting behavior.

@Kay-Zee
Kay-Zee requested a review from a team as a code owner July 20, 2026 23:00
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/claude-review-fvm.yml

PackageVersionLicenseIssue Type
actions/checkout4.*.*NullUnknown License
anthropics/claude-code-action1.*.*NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 4.*.* 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1024 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
actions/anthropics/claude-code-action 1.*.* UnknownUnknown

Scanned Files

  • .github/workflows/claude-review-fvm.yml

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 10e95860-b5fc-4c70-948f-5433393a67d7

📥 Commits

Reviewing files that changed from the base of the PR and between 836f49b and bd0a2ed.

📒 Files selected for processing (2)
  • .claude/skills/fvm-review/SKILL.md
  • .github/workflows/claude-review-fvm.yml

📝 Walkthrough

Walkthrough

Changes

FVM Claude review automation

Layer / File(s) Summary
Workflow execution and authentication
.github/workflows/claude-review-fvm.yml
Adds fvm/** pull-request triggers, non-draft filtering, per-PR concurrency, required permissions, repository checkout, OIDC authentication, and Claude Code execution with an explicit tool allowlist.
FVM review policy and output format
.claude/skills/fvm-review/SKILL.md, .github/workflows/claude-review-fvm.yml
Defines FVM-specific checks for determinism, metering, errors, transaction invariants, and SPoCK sensitivity, then constrains Claude to one severity-grouped PR comment without approvals or change requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant ClaudeCode
  participant PullRequestComment
  PullRequest->>GitHubActions: FVM pull-request event
  GitHubActions->>ClaudeCode: run fvm-review skill with repository context
  ClaudeCode->>PullRequestComment: submit one formatted review comment
Loading
🚥 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 is related to the main change: adding an FVM-specific Claude reviewer workflow and skill.
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 kan/fvm-claude-reviewer

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.

@codecov-commenter

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
Contributor

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-review-fvm.yml:
- Around line 45-47: Update the actions/checkout step to disable credential
persistence by setting persist-credentials to false alongside fetch-depth,
ensuring the GitHub token is not stored in local Git configuration.
- Around line 51-54: Move the Workload Identity Federation settings from the
action inputs into the workflow step’s env block using the required uppercase
variable names, and add GH_TOKEN there sourced from the GitHub token. Remove the
corresponding lowercase action inputs while preserving the existing Claude
action configuration.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8db275f2-07da-46b9-ad0e-db5e1e9cd1e8

📥 Commits

Reviewing files that changed from the base of the PR and between ad55d25 and 836f49b.

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

Comment thread .github/workflows/claude-review-fvm.yml
Comment on lines +51 to +54
# Workload Identity Federation — no static credentials.
anthropic_federation_rule_id: fdrl_01UXEriP26j1qgPvpAvVyYoE
anthropic_service_account_id: svac_01RutNzF7FBxds8FhTHZ2BTY
anthropic_organization_id: 23ff619e-5bf0-4e8d-936b-87274460531a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Move Workload Identity Federation variables to the env block and provide a GitHub token.

The anthropics/claude-code-action@v1 action does not accept WIF variables as inputs, meaning they will be ignored and authentication will fail. They must be exported as uppercase environment variables for the CLI to pick them up.

Additionally, since Claude is instructed to execute gh pr commands via allowed tools, the gh CLI requires a GH_TOKEN to authenticate.

🐛 Proposed fix
-          # Workload Identity Federation — no static credentials.
-          anthropic_federation_rule_id: fdrl_01UXEriP26j1qgPvpAvVyYoE
-          anthropic_service_account_id: svac_01RutNzF7FBxds8FhTHZ2BTY
-          anthropic_organization_id: 23ff619e-5bf0-4e8d-936b-87274460531a
+          github_token: ${{ github.token }}
+        env:
+          # Workload Identity Federation — no static credentials.
+          ANTHROPIC_FEDERATION_RULE_ID: fdrl_01UXEriP26j1qgPvpAvVyYoE
+          ANTHROPIC_SERVICE_ACCOUNT_ID: svac_01RutNzF7FBxds8FhTHZ2BTY
+          ANTHROPIC_ORGANIZATION_ID: 23ff619e-5bf0-4e8d-936b-87274460531a
+          GH_TOKEN: ${{ github.token }}
📝 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
# Workload Identity Federation — no static credentials.
anthropic_federation_rule_id: fdrl_01UXEriP26j1qgPvpAvVyYoE
anthropic_service_account_id: svac_01RutNzF7FBxds8FhTHZ2BTY
anthropic_organization_id: 23ff619e-5bf0-4e8d-936b-87274460531a
github_token: ${{ github.token }}
env:
# Workload Identity Federation — no static credentials.
ANTHROPIC_FEDERATION_RULE_ID: fdrl_01UXEriP26j1qgPvpAvVyYoE
ANTHROPIC_SERVICE_ACCOUNT_ID: svac_01RutNzF7FBxds8FhTHZ2BTY
ANTHROPIC_ORGANIZATION_ID: 23ff619e-5bf0-4e8d-936b-87274460531a
GH_TOKEN: ${{ github.token }}
🧰 Tools
🪛 actionlint (1.7.12)

[error] 52-52: input "anthropic_federation_rule_id" is not defined in action "anthropics/claude-code-action@v1". available inputs are "additional_permissions", "allowed_bots", "allowed_non_write_users", "anthropic_api_key", "assignee_trigger", "base_branch", "bot_id", "bot_name", "branch_name_template", "branch_prefix", "classify_inline_comments", "claude_args", "claude_code_oauth_token", "display_report", "exclude_comments_by_actor", "github_token", "include_comments_by_actor", "include_fix_links", "label_trigger", "path_to_bun_executable", "path_to_claude_code_executable", "plugin_marketplaces", "plugins", "prompt", "settings", "show_full_output", "ssh_signing_key", "track_progress", "trigger_phrase", "use_bedrock", "use_commit_signing", "use_foundry", "use_sticky_comment", "use_vertex"

(action)


[error] 53-53: input "anthropic_service_account_id" is not defined in action "anthropics/claude-code-action@v1". available inputs are "additional_permissions", "allowed_bots", "allowed_non_write_users", "anthropic_api_key", "assignee_trigger", "base_branch", "bot_id", "bot_name", "branch_name_template", "branch_prefix", "classify_inline_comments", "claude_args", "claude_code_oauth_token", "display_report", "exclude_comments_by_actor", "github_token", "include_comments_by_actor", "include_fix_links", "label_trigger", "path_to_bun_executable", "path_to_claude_code_executable", "plugin_marketplaces", "plugins", "prompt", "settings", "show_full_output", "ssh_signing_key", "track_progress", "trigger_phrase", "use_bedrock", "use_commit_signing", "use_foundry", "use_sticky_comment", "use_vertex"

(action)


[error] 54-54: input "anthropic_organization_id" is not defined in action "anthropics/claude-code-action@v1". available inputs are "additional_permissions", "allowed_bots", "allowed_non_write_users", "anthropic_api_key", "assignee_trigger", "base_branch", "bot_id", "bot_name", "branch_name_template", "branch_prefix", "classify_inline_comments", "claude_args", "claude_code_oauth_token", "display_report", "exclude_comments_by_actor", "github_token", "include_comments_by_actor", "include_fix_links", "label_trigger", "path_to_bun_executable", "path_to_claude_code_executable", "plugin_marketplaces", "plugins", "prompt", "settings", "show_full_output", "ssh_signing_key", "track_progress", "trigger_phrase", "use_bedrock", "use_commit_signing", "use_foundry", "use_sticky_comment", "use_vertex"

(action)

🤖 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-review-fvm.yml around lines 51 - 54, Move the
Workload Identity Federation settings from the action inputs into the workflow
step’s env block using the required uppercase variable names, and add GH_TOKEN
there sourced from the GitHub token. Remove the corresponding lowercase action
inputs while preserving the existing Claude action configuration.

Source: Linters/SAST tools

@janezpodhostnik

Copy link
Copy Markdown
Contributor

Should the review prompt not just be a skill. the github workflow would just invoke that skill, but we could also use it locally.

@Kay-Zee
Kay-Zee added this pull request to the merge queue Jul 27, 2026
Merged via the queue into master with commit 73f2c26 Jul 27, 2026
61 checks passed
@Kay-Zee
Kay-Zee deleted the kan/fvm-claude-reviewer branch July 27, 2026 20:13
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.

4 participants