Skip to content

feat(review): integrate auto-chunker into review command - #236

Merged
ajianaz merged 3 commits into
developfrom
feat/228-auto-chunk-integration
Jun 9, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/228-auto-chunk-integration

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #228

Integrates the existing chunker module (src/engine/chunker.rs) into the review command so that large diffs exceeding max_diff_size are automatically split and reviewed in pieces.

Changes

  • Auto-chunk enabled by default — diffs exceeding max_diff_size are automatically split. Use --no-auto-chunk to disable and hard-fail instead.
  • execute_chunked_review() in review.rs:
    • Splits diff via chunker::chunk_diff()
    • Reviews each chunk independently (full pipeline: cache, stream, rules, secrets scanner)
    • Merges findings and deduplicates by `(file, line, title)` tuple
    • Accumulates token usage across chunks
    • Graceful partial results on chunk failure (warns, continues)
    • Returns EXIT_BLOCKED when ALL chunks fail (no silent pass)
    • Propagates should_block from any chunk to merged response
    • Progress events emitted per chunk when --progress is set
    • Quality gate evaluated on merged results
  • Fixed pre-existing borrow lifetime issues in chunker.rs tests
  • Registered chunker module in engine/mod.rs
  • Updated error messages to suggest auto-chunk and --no-auto-chunk

Checklist

  • Add auto-chunk flag to cora review CLI (as --no-auto-chunk, default on)
  • Integrate chunker in execute_review() when diff > max_diff_size
  • Progress reporting: "Reviewing chunk 3/10 (src/config/*)…"
  • Merge findings from multiple chunks
  • Deduplicate findings by `(file, line, title)`
  • Unit tests for chunked review flow (chunker tests already existed, fixed borrow issues)

Test Results

  • 384 unit tests ✅
  • 16 CLI tests ✅
  • 6 config loading tests ✅

ajianaz added 3 commits June 9, 2026 22:40
- Add --no-auto-chunk flag (auto-chunk enabled by default for large diffs)
- Add execute_chunked_review() that splits diffs via chunker::chunk_diff()
- Review each chunk independently with full pipeline (cache, stream, rules)
- Merge findings and deduplicate by (file, line, title) tuple
- Accumulate token usage across chunks for accurate reporting
- Graceful partial results on chunk failure (warns, continues)
- Progress events emitted per chunk when --progress is set
- Quality gate evaluated on merged results
- Fix pre-existing borrow lifetime issues in chunker tests
- Register chunker module in engine/mod.rs

Closes #228
…ailure

- Propagate should_block=true from any chunk to merged response
- Return EXIT_BLOCKED when all chunks fail instead of silent pass
- Addresses Cora self-review findings on chunked review flow
@ajianaz
ajianaz merged commit e43c495 into develop Jun 9, 2026
10 checks passed
@ajianaz
ajianaz deleted the feat/228-auto-chunk-integration branch June 9, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: integrate auto-chunker into review command

1 participant