Skip to content

fix(commands): limit miner review reruns to cached path - #4382

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-vulnerability-allowing-force-re-review
Jul 9, 2026
Merged

fix(commands): limit miner review reruns to cached path#4382
JSONbored merged 1 commit into
mainfrom
codex/fix-vulnerability-allowing-force-re-review

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent low-privilege confirmed_miner authors from repeatedly forcing uncached AI re-reviews and exhausting AI/BYOK budget or re-rolling AI-driven gate outcomes.
  • Preserve the intended usability: confirmed miners remain authorized to request a re-review of their own PRs, but should not bypass caching that is reserved for higher-privilege invocations.

Description

  • Change maybeProcessReviewCommand in src/queue/processors.ts so the reReviewStoredPullRequest(..., { force: true }) call is only used when the actor is a maintainer; author/confirmed-miner self-runs now dispatch without force so they hit the normal cached review path.
  • Update the handler comment to document the deliberate choice that author/miner self-runs reuse the cached path while maintainers/collaborators keep the explicit fresh-review behavior.
  • Add regression assertion in test/unit/queue.test.ts to confirm a confirmed miner remains authorized but does not produce an github_app.ai_review_force_bypass audit event.

Testing

  • Ran the targeted test subset with npx vitest run test/unit/queue.test.ts -t "review:", and the modified review tests passed.
  • Ran npm run typecheck (tsc --noEmit) and it passed with no type errors.
  • Attempted the full CI locally (npm run test:ci) but the run stopped on unrelated pre-existing drift (cf-typegen / worker-configuration.d.ts) outside the scope of this change.
  • Ran npm run test:coverage and the broader suite encountered existing unrelated failures in this environment; the focused review tests used to validate the fix passed.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (c823f9c) to head (73b6689).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4382   +/-   ##
=======================================
  Coverage   93.95%   93.95%           
=======================================
  Files         400      400           
  Lines       36817    36818    +1     
  Branches    13451    13452    +1     
=======================================
+ Hits        34592    34593    +1     
  Misses       1569     1569           
  Partials      656      656           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.39% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 9, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 9, 2026
@JSONbored
JSONbored merged commit 89e6394 into main Jul 9, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-vulnerability-allowing-force-re-review branch July 9, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Development

Successfully merging this pull request may close these issues.

1 participant