Skip to content

refactor: unify workspace exclusions and reduce service duplication - #5

Merged
cursor[bot] merged 2 commits into
masterfrom
cursor/maintainability-dedup-6196
Jun 29, 2026
Merged

refactor: unify workspace exclusions and reduce service duplication#5
cursor[bot] merged 2 commits into
masterfrom
cursor/maintainability-dedup-6196

Conversation

@qkal

@qkal qkal commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Reduces duplicated logic and aligns workspace handling across copy and inspection paths.

Findings addressed

  • Shadow copy and workspace inspection used different exclusion rules, causing inconsistent Python file counts and metadata
  • apply_safe_fixes rejection logic was duplicated in two places in validate_patch_service
  • Patch-size risk thresholds were hardcoded while max_patch_bytes is configurable

Changes

  • New exclusions.py module with shared is_workspace_path_excluded and secret-file matching
  • shadow.py and workspace.py now use the shared exclusion helper
  • Extracted _reject_apply_safe_fixes helper in service.py
  • Risk scoring thresholds derived from config.max_patch_bytes
  • Unit tests for exclusion rules

Test plan

  • pytest tests/unit/test_exclusions.py
  • Full unit suite passes (338 tests)
Open in Web Open in Cursor 

- Extract shared workspace exclusion rules used by shadow copy and inspection
- Consolidate apply_safe_fixes rejection into a single helper
- Derive patch-size risk thresholds from configured max_patch_bytes

Co-authored-by: Qkal <qkal@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7f2d06e2-6b1b-4252-bb7d-530511dd3af6

📥 Commits

Reviewing files that changed from the base of the PR and between 773290f and 9878287.

📒 Files selected for processing (6)
  • src/agent_quality_mcp/exclusions.py
  • src/agent_quality_mcp/risk.py
  • src/agent_quality_mcp/service.py
  • src/agent_quality_mcp/shadow.py
  • src/agent_quality_mcp/workspace.py
  • tests/unit/test_exclusions.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/maintainability-dedup-6196

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor
cursor Bot marked this pull request as ready for review June 29, 2026 22:15

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Co-authored-by: Qkal <qkal@users.noreply.github.com>
@cursor
cursor Bot merged commit 5b998f6 into master Jun 29, 2026
1 check passed
@cursor
cursor Bot deleted the cursor/maintainability-dedup-6196 branch June 29, 2026 22:20
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.

2 participants