Skip to content

fix(review): run AI review for every PR author by default, not just confirmed contributors - #5732

Merged
JSONbored merged 1 commit into
mainfrom
fix/ai-review-confirmed-contributors-only
Jul 14, 2026
Merged

fix(review): run AI review for every PR author by default, not just confirmed contributors#5732
JSONbored merged 1 commit into
mainfrom
fix/ai-review-confirmed-contributors-only

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • AI review was silently skipped by default for any PR author who wasn't a confirmed Gittensor contributor, leaving new/unconfirmed contributors with LESS scrutiny than established ones -- backwards from the intended security posture.
  • AI review now runs for every author once a repo has aiReviewMode set to something other than off. A new opt-in aiReviewConfirmedContributorsOnly setting lets a self-hoster deliberately narrow back down to confirmed-contributors-only (to bound AI spend); aiReviewAllAuthors still widens back out within that narrowed mode, unchanged.
  • Extracted the eligibility check into a single shared resolveAiReviewableAuthor helper used by both the "should we start a review" gate and the execution-time guard, so the two can no longer drift out of sync.

Test plan

  • npx tsc --noEmit
  • npx tsx scripts/check-docs-drift.mjs
  • npm run ui:openapi:settings-parity / npm run ui:openapi:check
  • npm run test:ci (full local gate, green)
  • New invariant tests for resolveAiReviewableAuthor (default-runs-for-everyone + opt-in-narrows) in test/unit/ai-review-advisory.test.ts
  • Updated two queue-3.test.ts tests whose aiCalls === 0 assertion was only ever true as a side effect of the bug being fixed (verified the deterministic screenshot-table/contributor-cap gates were never actually wired to suppress AI review -- only authorBlacklisted is, and that test still passes unaffected)
  • Added a settings-preview.test.ts case covering both branches of the new field's nullish fallback

…onfirmed contributors

The confirmedContributor gate on AI review (originally #644, about not applying
miner-specific gate rules to non-miner PRs) had been reused to skip the AI-driven
defect scan entirely for unconfirmed/new contributors by default -- leaving a new
contributor's PR with LESS scrutiny than an established one's, backwards from the
intended security posture. AI review now runs for every author once a repo has
opted into aiReviewMode, with an explicit opt-in aiReviewConfirmedContributorsOnly
setting for self-hosters who deliberately want to bound AI spend to registered
miners (aiReviewAllAuthors still widens back out within that narrowed mode).
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 56c4742 Commit Preview URL

Branch Preview URL
Jul 14 2026, 09:35 AM

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.06%. Comparing base (634e121) to head (56c4742).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5732   +/-   ##
=======================================
  Coverage   95.06%   95.06%           
=======================================
  Files         581      581           
  Lines       46179    46181    +2     
  Branches    14811    14811           
=======================================
+ Hits        43902    43904    +2     
  Misses       1516     1516           
  Partials      761      761           
Flag Coverage Δ
shard-1 43.95% <42.85%> (-0.01%) ⬇️
shard-2 35.71% <42.85%> (-0.01%) ⬇️
shard-3 32.27% <42.85%> (+<0.01%) ⬆️
shard-4 33.01% <42.85%> (+<0.01%) ⬆️
shard-5 31.76% <100.00%> (+<0.01%) ⬆️
shard-6 44.63% <57.14%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-engine/src/focus-manifest.ts 99.10% <100.00%> (ø)
src/openapi/schemas.ts 100.00% <ø> (ø)
src/queue/ai-review-orchestration.ts 100.00% <100.00%> (ø)
src/signals/settings-preview.ts 98.64% <100.00%> (+<0.01%) ⬆️
src/types.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 14, 2026
@JSONbored JSONbored self-assigned this Jul 14, 2026
@JSONbored
JSONbored merged commit 09a60f0 into main Jul 14, 2026
19 checks passed
@JSONbored
JSONbored deleted the fix/ai-review-confirmed-contributors-only branch July 14, 2026 09:39
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant