Skip to content

feat(review): size-cap eligibility guard for auto-review via review.auto_review.max_added_lines / max_files #2065

Description

@JSONbored

Part of #1954. Add review.auto_review.max_added_lines and max_files (ints, 0 = off) so operators skip AI review of oversized PRs (which spend disproportionate review budget). Deterministic thresholds computed from the diff via addedLineCount (src/review/review-diff.ts:25) and changed-file count. Default 0/0 ⇒ no cap (today). Does NOT touch the size GATE — only the AI review path.

Deliverables

  • Parse max_added_lines and max_files as non-negative ints in parseReviewConfig (src/signals/focus-manifest.ts:653); serialize in reviewConfigToJson (src/signals/focus-manifest.ts:835)
  • Add a size-cap branch to decideReviewEligibility (src/review/review-eligibility.ts): skipReason="too_large" when a cap is >0 and the PR exceeds it; 0 ⇒ that cap disabled
  • Compute added-line total from the review diff using addedLineCount (src/review/review-diff.ts:25); thread the total + file count into the eligibility call at maybePublishPrPublicSurface (src/queue/processors.ts:4533)
  • Unit tests: over max_added_lines ⇒ skip, over max_files ⇒ skip, exactly-at-threshold boundary, 0 ⇒ disabled, both caps off ⇒ eligible; 97% branch

References

  • src/review/review-diff.ts:25
  • src/queue/processors.ts:4533
  • src/review/review-eligibility.ts
  • #1954

Part of #1954.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions