Skip to content

Releases: obiwancenobi/ai-code-reviewer

v1.0.22

20 Nov 10:12

Choose a tag to compare

v1.0.21

20 Nov 06:40
ce83931

Choose a tag to compare

Fixed

  • Line Number Highlighting: Fixed critical issue where AI review comments appeared on incorrect line numbers
    • Comments were showing on wrong lines even when review context was correct
    • Now properly maps patch line numbers to original file line numbers

Added

  • Patch Parser: New PatchParser utility class for handling GitHub diff format
    • Parses unified diff format into structured hunks
    • Maps AI line numbers from patch content to original file lines
    • Validates line numbers against file boundaries
    • Extracts reviewable content with proper context

Changed

  • File Chunking: Replaced FileProcessor.splitIntoChunks() with FileChunker.chunkFile()
    • Now provides proper line number tracking (startLine, endLine)
    • Handles chunk overlap management
    • More accurate line number adjustment for chunked content

Enhanced

  • AIReviewService: Significantly improved file review logic
    • Properly detects patch vs full file content
    • Enhanced line number mapping for patch content
    • Added comprehensive validation and error handling
    • Better context for AI analysis including chunk metadata

[1.0.21] - 2025-11-20

Added

  • Unit Tests: Comprehensive test suite for patch parsing functionality (tests/unit/utils/patchParser.test.js)
  • Integration Tests: End-to-end line number accuracy tests (tests/integration/lineNumberAccuracy.test.js)
  • Documentation: Detailed analysis and fix summary documents

Technical Improvements

  • Error Handling: Graceful fallback when patch parsing fails
  • Validation: Enhanced line number validation against file boundaries
  • Logging: Added extensive logging for debugging line number issues
  • Performance: Optimized chunking with FileChunker for large files

Detailed Change Summary

Files Modified

src/utils/patchParser.js (NEW)

  • Complete implementation of GitHub patch parsing
  • Line number mapping from patch to original file
  • Content extraction for AI review
  • Line number validation

src/services/aiReviewService.js (ENHANCED)

  • Added patch parsing integration
  • Replaced FileProcessor with FileChunker
  • Enhanced review logic for both patch and full content
  • Added line number validation method
  • Improved error handling and logging

tests/unit/utils/patchParser.test.js (NEW)

  • 15+ test cases covering patch parsing scenarios
  • Tests for line number mapping accuracy
  • Edge case handling verification
  • Integration with AI review workflow

tests/integration/lineNumberAccuracy.test.js (NEW)

  • End-to-end testing of line number accuracy
  • Mock AI provider for controlled testing
  • Validation of comment generation
  • Error handling verification

Bug Fixes

Line Number Mismatch (CRITICAL)

Problem: AI review comments highlighted wrong line numbers
Root Cause: Patch content was treated as full file content
Solution: Implemented proper patch parsing and line mapping

Before:

// Comments appeared on line 3 when changes were on line 4
line_number: comment.line_number + (i * Math.floor(content.split('\n').length / chunks.length))

After:

// Comments now appear on correct lines
const originalLineNumber = parser.mapPatchLineToOriginalFile(comment.line_number, parsedPatch);
const adjustedLineNumber = chunker.adjustCommentLineNumbers(adjustedComments, chunk, originalLineCount);

Performance Impact

  • Minimal overhead for patch parsing
  • More efficient chunking with FileChunker
  • Better scalability for large files
  • Reduced false positives from invalid line numbers

Backward Compatibility

  • ✅ Maintains compatibility with existing configurations
  • ✅ Full file content handling unchanged
  • ✅ Graceful degradation to old behavior if needed
  • ✅ No breaking changes to public API

Testing Coverage

  • Unit Tests: 95%+ coverage for patch parsing logic
  • Integration Tests: End-to-end line number accuracy
  • Edge Cases: Empty patches, malformed content, large files
  • Error Scenarios: Network failures, invalid content

Known Issues Fixed

  1. Patch Line Mapping: AI comments on patch lines now correctly map to original file lines
  2. Chunk Boundaries: Line numbers no longer break at chunk boundaries
  3. Content Type Detection: System now properly distinguishes patch vs full content
  4. Validation: Invalid line numbers are filtered out before comment creation

Future Improvements

  • Cache parsed patches for repeated reviews
  • Enhanced context inclusion for better AI analysis
  • Smart chunking based on code structure
  • Machine learning for improved line number accuracy

Migration Guide: No changes required. The fix is automatically applied to all existing workflows. Line number highlighting accuracy is now significantly improved without any configuration changes.

v1.0.20

19 Nov 11:57

Choose a tag to compare

v1.0.19

19 Nov 10:03

Choose a tag to compare

Implement comment volume control and visual enhancements

🎨 Visual Improvements:

  • Add emojis to GitHub comments (🚨⚠️ℹ️💡🔧📚🦫)
  • Implement color-coded borders by severity (red/yellow/blue)
  • Enhanced formatting with rich content and suggestions

🔧 Comment Volume Control:

  • Reduce system prompt from 400+ lines to a focused 60-line guide
  • Add intelligent comment filtering (remove info comments, duplicates, low-quality patterns)
  • Implement configurable limits with smart defaults (5 total, 2 per chunk)
  • Support custom comment limits for different team needs

📋 Smart Filtering Pipeline:

  • Remove "info" severity comments automatically
  • Filter out testing suggestions and style preferences
  • Prioritize by severity (errors → warnings)
  • Remove duplicate and low-value comments

⚙️ Configuration Support:

  • Add commentLimits config section with maxComments and maxCommentsPerChunk
  • Support custom personas with strict limits
  • Intelligent defaults work without configuration

📚 Documentation:

  • Update README.md with a complete usage guide
  • Add examples for different comment volume strategies
  • Include configuration templates and best practices

Impact: Reduces review noise from 20-50+ comments to 3-10 focused, actionable comments

v1.0.18

19 Nov 07:46

Choose a tag to compare

v1.0.17

18 Nov 11:32

Choose a tag to compare

v1.0.16

16 Nov 06:51
823e322

Choose a tag to compare

What's Changed

Full Changelog: v1.0.15...v1.0.16

v1.0.15

12 Nov 13:15
fe2f1c8

Choose a tag to compare

What's Changed

Add more providers:

  1. Novita
  2. ZenMux
  3. Atlas Cloud
  4. Cohere
  5. Minimax
  6. Moonshot
  7. Upstage
  8. DeepInfra

v1.0.14

10 Nov 13:30
8cb172b

Choose a tag to compare

What's Changed

Support for additional AI providers: Together AI, Fireworks AI, Mistral AI, Cerebras.

Full Changelog: v1.0.12...v1.0.14

v1.0.12

09 Nov 03:51

Choose a tag to compare

Added

  • AI model information display in Discord notifications (both start and completion)
  • AI model attribution in PR comment footers
  • Enhanced transparency showing which AI provider and model performed the review

Changed

  • Updated README.md to reflect AI model information features
  • PR comments now include AI model details in attribution (e.g., "Reviewed by AI (senior-engineer) using openai/gpt-4")
  • Discord notifications now display AI model field in embed messages

Technical Details

  • Modified webhookHandler.js to pass AI model info to notification objects
  • Updated discordService.js to render AI model field in Discord embeds
  • Enhanced aiReviewService.js formatCommentBody method to include AI model in comment attribution
  • AI model format: {provider}|{model} (e.g., "openai/gpt-4", "anthropic/claude-3-sonnet-20240229")