Skip to content

fix(review): honor all-authors AI preflight#1576

Open
JSONbored wants to merge 1 commit into
mainfrom
codex/propose-fix-for-aireviewallauthors-issue
Open

fix(review): honor all-authors AI preflight#1576
JSONbored wants to merge 1 commit into
mainfrom
codex/propose-fix-for-aireviewallauthors-issue

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • A recent refactor introduced a preflight helper that accidentally omitted the aiReviewAllAuthors path when deciding whether to start an AI review, which let non-confirmed authors bypass a repo-configured all-authors AI review.
  • The intent is to ensure the preflight gate and the actual runAiReviewForAdvisory entry conditions match so configured per-repo opt-ins are honored.

Description

  • Updated shouldStartAiReviewForAdvisory in src/queue/processors.ts to compute reviewableAuthor as args.confirmedContributor || packAllowsAnyAuthorBlockingReview || args.settings.aiReviewAllAuthors and use that in the eligibility if guard.
  • Reformatted the guard for readability and preserved the existing reputation/RAG skip logic at the end of the function.
  • Added a regression unit test in test/unit/ai-review-advisory.test.ts that asserts a non-confirmed contributor triggers the preflight when aiReviewAllAuthors is enabled.

Testing

  • Ran the focused unit suite with npx vitest run test/unit/ai-review-advisory.test.ts, which passed (22 tests passed).
  • Verified git diff --check produced no issues locally.
  • Attempted the full local gate with npm run test:ci, but the run was blocked by actionlint setup issues in this environment and its WASM fallback not recognizing the custom self-host runner label.
  • Attempted npm run typecheck and npm audit --audit-level=moderate, both of which were impeded by local dependency/network conditions (@sentry/node types missing and npm audit endpoint 403 respectively).

Codex Task

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 27, 2026
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (e81c5bc) to head (60f4b10).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1576   +/-   ##
=======================================
  Coverage   95.43%   95.43%           
=======================================
  Files         202      202           
  Lines       21751    21754    +3     
  Branches     7860     7862    +2     
=======================================
+ Hits        20757    20760    +3     
  Misses        416      416           
  Partials      578      578           
Files with missing lines Coverage Δ
src/queue/processors.ts 87.72% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb

gittensory-orb Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review — held for maintainer review

2 files · 1 AI reviewers · no blockers · readiness 66/100 · CI green · clean

⏸️ Held for maintainer review

Review summary
Targeted bug fix that closes the gap where repos with `aiReviewAllAuthors: true` were not triggering the AI preflight for non-confirmed contributors. The new `reviewableAuthor` variable (`confirmedContributor || packAllowsAnyAuthorBlockingReview || aiReviewAllAuthors`) correctly extends the prior two-way guard to a three-way OR, matching the described intent. The multi-line reformatting is a net readability improvement, and the regression test directly exercises the previously-missing code path. No logic regressions are visible.

Signal Result Evidence
Code review ✅ No blockers 1 reviewers, synthesized
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels; size label size:S.
Validation evidence ❌ 5/25 Cached preflight status is hold.
Open PR queue ❌ 3/10 21 open PR(s), 9 likely reviewable, 12 unlinked.
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 80 PR(s), 312 issue(s).
Gate result ✅ Passing No configured blocker found.
Nits — 4 non-blocking
  • The test's negative companion — `aiReviewAllAuthors: false, confirmedContributor: false` returning `false` — is only implicitly covered if `base` in `ai-review-advisory.test.ts` leaves `aiReviewAllAuthors` unset/falsy; an explicit assertion would make the contract clearer.
  • Folding `packAllowsAnyAuthorBlockingReview` into `reviewableAuthor` is semantically slightly off — that variable is about pack policy, not author identity — a one-line comment in `processors.ts` explaining why it implies author eligibility would help future readers.
  • In `processors.ts` around the `reviewableAuthor` assignment, add a short comment that `packAllowsAnyAuthorBlockingReview` is treated as author-level eligibility because that pack/mode combination opts all authors in — the grouping is non-obvious without PR context.
  • Confirm that `runAiReviewForAdvisory` (not in the diff) applies the same three-way author condition; if its entry guard still uses only the original two-way check, the preflight and runner remain mismatched and the bypass reappears downstream.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 80 PR(s), 312 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Fix blocker.
  • Expect slower review.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

Targeted bug fix that closes the gap where repos with `aiReviewAllAuthors: true` were not triggering the AI preflight for non-confirmed contributors. The new `reviewableAuthor` variable (`confirmedContributor || packAllowsAnyAuthorBlockingReview || aiReviewAllAuthors`) correctly extends the prior two-way guard to a three-way OR, matching the described intent. The multi-line reformatting is a net readability improvement, and the regression test directly exercises the previously-missing code path. No logic regressions are visible.

Nits (4)

  • The test's negative companion — `aiReviewAllAuthors: false, confirmedContributor: false` returning `false` — is only implicitly covered if `base` in `ai-review-advisory.test.ts` leaves `aiReviewAllAuthors` unset/falsy; an explicit assertion would make the contract clearer.
  • Folding `packAllowsAnyAuthorBlockingReview` into `reviewableAuthor` is semantically slightly off — that variable is about pack policy, not author identity — a one-line comment in `processors.ts` explaining why it implies author eligibility would help future readers.
  • In `processors.ts` around the `reviewableAuthor` assignment, add a short comment that `packAllowsAnyAuthorBlockingReview` is treated as author-level eligibility because that pack/mode combination opts all authors in — the grouping is non-obvious without PR context.
  • Confirm that `runAiReviewForAdvisory` (not in the diff) applies the same three-way author condition; if its entry guard still uses only the original two-way check, the preflight and runner remain mismatched and the bypass reappears downstream.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot added gittensor Gittensor contributor context gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark codex gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. gittensor Gittensor contributor context size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant