Skip to content

feat(review): deterministic per-PR review-effort/complexity estimator module (1-5 band + minutes) #2068

Description

@JSONbored

Core of #1955. A pure, deterministic estimator: given the changed files + patches, compute a 1-5 complexity band and a minutes estimate from files-touched, added lines (addedLineCount, src/review/review-diff.ts:25), file-type mix (classifyChangedFile, src/signals/path-matchers.ts:235), and hunk spread. No AI. This module is consumed by the ROI + unified-comment PRs; standalone + fully unit-testable.

Deliverables

  • New src/review/review-effort.ts exporting estimateReviewEffort(files): { band: 1|2|3|4|5; minutes: number } — pure, deterministic, documented weighting
  • Derive inputs from addedLineCount (src/review/review-diff.ts:25) and classifyChangedFile category weights (src/signals/path-matchers.ts:235); count hunks per patch for spread
  • Handle edge cases explicitly: zero files, docs-only, huge single-file, many-tiny-files (each a distinct band)
  • Unit tests covering every band boundary + each category weight + empty-input arm; 97% branch (test both sides of each threshold ternary)

References

  • src/review/review-diff.ts:25
  • src/signals/path-matchers.ts:235
  • #1955

Part of #1955.


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

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions