Skip to content

fix(roborev): gate fixer reminders on approval - #2277

Merged
shunkakinoki merged 5 commits into
mainfrom
codex/roborev-fixer-approval-gate
Aug 6, 2026
Merged

fix(roborev): gate fixer reminders on approval#2277
shunkakinoki merged 5 commits into
mainfrom
codex/roborev-fixer-approval-gate

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • rename the shared repository input to ROBOREV_REPOS, with a temporary compatibility fallback for ROBOREV_CI_REPOS
  • hydrate an approval-gated agent-hook policy that only surfaces failed reviews for read-only triage
  • install RoboRev native Git hooks in each configured local checkout after the policy is written
  • preserve the existing shared agent-hook passthrough unchanged

Review flow

This is the host-side half of the two-speed setup. A paired application config PR maps native post-commit hooks to the quick panel and PR polling to the full panel. The result is a fast local review after commits and one synthesized full-panel GitHub comment on the PR.

Fixer actions remain approval gated: the agent may inspect and propose changes, but must ask before editing, running a fixer, committing, or closing findings.

Validation

  • shellspec spec/roborev_hydrate_spec.sh (12 examples, 0 failures)
  • shellcheck config/roborev/hydrate.sh spec/roborev_hydrate_spec.sh
  • taplo check config/roborev/config.template.toml
  • git diff --check

Surface failed reviews for read-only triage while disabling automatic turn and commit triggers. Require explicit approval before any fixer, edit, commit, or review closure.

Refs shunkakinokisoftware-qnpv
@indent-zero

indent-zero Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Turns the RoboRev config template into an approval-gated agent-hook policy and, on hydration, also installs the RoboRev post-commit git hook into each configured local checkout so newly-tracked repos start enqueueing reviews automatically. Renames the repo list variable/placeholder from the CI-scoped name to a generic one (with a deprecation fallback) and validates each entry before it's written into the config or used to install a hook.

  • config/roborev/config.template.toml: adds [agent_hook] with turn_threshold=0, commit_threshold=0 (kept explicit; comment now notes both triggers are intentionally disabled), failed_review_threshold=1 (comment now says "any open failed review"), and a custom instruction telling the agent to inspect findings read-only and ask for explicit approval before editing / fixing / committing / closing reviews. repos placeholder renamed to __ROBOREV_REPOS__.
  • config/roborev/hydrate.sh: reads ROBOREV_REPOS (falls back to deprecated ROBOREV_CI_REPOS with a warning), validates each entry against ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$, skips hydration when no valid repos remain, then for each valid repo runs roborev install-hook --binary $ROBOREV_BIN inside ~/ghq/github.com/<repo> (best-effort: warns if the binary is missing, the checkout is absent, or the install fails).
  • spec/roborev_hydrate_spec.sh: renames the existing input/placeholder tests to the new variable name, drops the earlier template-only greps in favor of asserting the rendered ~/.roborev/config.toml for the exact [agent_hook] values and full approval instruction, and adds a fixture (.local/bin/roborev stub + ghq/github.com/org/{repo1,repo2} directories) that verifies install-hook --binary <path> is invoked in each configured checkout after hydration.
  • .env.example: not updated in this PR — still exports the deprecated ROBOREV_CI_REPOS.

Issues

1 potential issue found:

  • .env.example still exports ROBOREV_CI_REPOS=org/repo1,org/repo2; after this rename any fresh onboard who copies the example will immediately trip the "ROBOREV_CI_REPOS is deprecated" warning path. Rename the example to ROBOREV_REPOS=... so new users land on the canonical variable. → Autofix
4 issues already resolved
  • Repo validation regex ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ accepts entries like ../foo or foo/.. because . is inside the character class, so a stray .env value would resolve ${HOME}/ghq/github.com/<repo> outside the ghq root before roborev install-hook is invoked. Reject .. / leading-dot segments (e.g., add [[ "$repo" == *".."* ]] guard or tighten the regex) for defense-in-depth. (fixed by commit 5d1f33c)
  • The threshold grep in the new spec isn't anchored, so a future value like failed_review_threshold = 10 would match the = 1 regex; the should include assertions still catch the exact substring today so the test is safe, but anchoring the pattern (e.g. = 1$) would make the check more robust. (fixed by commit 1f84225)
  • Comment says "Surface the first failed review" but failed_review_threshold = 1 fires whenever there is ≥1 open failed review on the branch, so the reminder can re-fire on subsequent hook invocations, not just the first — reword to reflect the "any open failed review" semantics. (fixed by commit 1edd888)
  • commit_threshold = 0 is redundant with the upstream default (already 0 = disabled); keeping it is fine for explicitness but a short comment noting that would make the intent clearer. (fixed by commit 1edd888)

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@shunkakinoki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09f46e9e-f4ac-497c-8f03-b1e9be248d5c

📥 Commits

Reviewing files that changed from the base of the PR and between aa78dc4 and cb13fd9.

📒 Files selected for processing (3)
  • config/roborev/config.template.toml
  • config/roborev/hydrate.sh
  • spec/roborev_hydrate_spec.sh
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added configurable agent-hook thresholds to surface the first failed review.
    • Added safeguards requiring explicit approval before edits, fixes, commits, or review closure.
    • Failed reviews no longer automatically trigger turn or commit actions.
  • Tests

    • Added coverage verifying approval is required and automatic fix actions are not invoked.

Walkthrough

Adds RoboRev agent-hook settings that surface the first failed review and require explicit approval before edits, fixer runs, commits, or review closure. Adds hydration tests for the thresholds and approval instruction.

Changes

Agent hook approval

Layer / File(s) Summary
Approval gate configuration and validation
config/roborev/config.template.toml, spec/roborev_hydrate_spec.sh
The template adds agent-hook thresholds and an approval instruction. Hydration tests verify that automatic turn and commit triggers remain disabled, failed reviews are surfaced, and approval is required without invoking roborev-fix.

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

Possibly related PRs

Poem

A rabbit checks the failed review,
Then waits for approval, true.
No fixer hops, no commit flies,
No edits pass beneath watchful eyes.
The gate stands firm; the burrow cheers.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the approval gate for RoboRev fixer reminders, which matches the main change.
Description check ✅ Passed The description directly explains the approval-gated RoboRev workflow and related validation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/roborev-fixer-approval-gate

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.

Comment thread config/roborev/config.template.toml Outdated
Comment thread config/roborev/config.template.toml
Comment thread spec/roborev_hydrate_spec.sh Outdated

@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 `@spec/roborev_hydrate_spec.sh`:
- Around line 52-58: Update the “agent hook approval gate” test to call
setup_hydrate, add the [agent_hook] values to template.toml, execute
config/roborev/hydrate.sh, and assert turn_threshold, commit_threshold, and
failed_review_threshold from the rendered ~/.roborev/config.toml rather than
reading the template directly.
- Around line 60-63: Strengthen the test named “requires explicit approval
without invoking the fixer skill” to assert the complete approval instruction,
including “ask the user for explicit approval,” “Do not edit files,” “run a
fixer,” “commit,” “close reviews,” and “before approval,” while retaining the
assertion that “roborev-fix” is absent.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f250096-5213-435d-8677-de75ee609ab7

📥 Commits

Reviewing files that changed from the base of the PR and between 5eac42a and aa78dc4.

📒 Files selected for processing (2)
  • config/roborev/config.template.toml
  • spec/roborev_hydrate_spec.sh

Comment thread spec/roborev_hydrate_spec.sh Outdated
Comment thread spec/roborev_hydrate_spec.sh Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread spec/roborev_hydrate_spec.sh Outdated
Comment thread spec/roborev_hydrate_spec.sh Outdated
Comment thread spec/roborev_hydrate_spec.sh Outdated
Rename the shared repository input and install RoboRev's native hooks after hydrating the approval-gated config.

Refs shunkakinokisoftware-qnpv
Remove redundant template-only checks in favor of the complete rendered-config assertion.

Refs shunkakinokisoftware-qnpv
Comment thread config/roborev/hydrate.sh
Prevent dot path segments from escaping the configured ghq repository root before installing native hooks.

Refs shunkakinokisoftware-qnpv
Match the repository shfmt output so Nix format, flake, and test checks can evaluate the functional change.

Refs shunkakinokisoftware-qnpv
@shunkakinoki
shunkakinoki merged commit b9b53b9 into main Aug 6, 2026
29 of 30 checks passed
@shunkakinoki
shunkakinoki deleted the codex/roborev-fixer-approval-gate branch August 6, 2026 08:52
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