Skip to content

feat: sync AI attribution governance from commit-check v2.11.0#16

Merged
shenxianpeng merged 2 commits into
mainfrom
feature/sync-ai-attribution-to-mcp
Jul 6, 2026
Merged

feat: sync AI attribution governance from commit-check v2.11.0#16
shenxianpeng merged 2 commits into
mainfrom
feature/sync-ai-attribution-to-mcp

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Sync the AI attribution governance feature from commit-check v2.11.0 to the MCP server.

What changed

  1. pyproject.toml: Bump commit-check minimum version from >=2.7.0 to >=2.11.0
  2. server.py: Added "ai_attribution" to the check list in both _validate_message and _validate_all functions, so the AI attribution rule is actually executed when configured
  3. README.md: Added documentation about AI attribution governance support

Why

commit-check v2.11.0 added AI attribution governance (PR #456) — a new [commit] ai_attribution = "forbid" config option that rejects commits containing known AI tool signatures (Claude Code, GitHub Copilot, Cursor, etc.).

Although the library provides the rule, the MCP server was not executing it because the check name "ai_attribution" was missing from the explicit check lists in _validate_message and _validate_all.

Testing

  • All 65 existing tests pass
  • Manually verified:
    • Normal commit + ai_attribution = "forbid" → pass ✅
    • Commit with AI signature + ai_attribution = "forbid" → fail ✅
    • AI signature detection works for all known patterns (Claude, Copilot, Codex, Gemini, etc.)

Other features already synced automatically

The following commit-check features from v2.8.0–v2.10.1 are automatically inherited by the MCP server via RuleBuilder and require no code changes:

  • AI agent branch prefixes (ai/, claude/, copilot/, etc.) — v2.9.0
  • Dependabot/Renovate as default branch types — v2.10.0
  • WIP case-insensitivity and special character support — v2.10.1

Summary by CodeRabbit

  • New Features

    • Added support for AI attribution governance in commit checks, letting teams reject commits co-authored by AI coding agents.
  • Documentation

    • Updated the README with setup guidance for enabling this check and a link to more details.
  • Bug Fixes

    • Commit validation now includes the new AI attribution check in all relevant review paths, so it affects pass/fail results consistently.
  • Chores

    • Updated the required commit-check version to include the new capability.

Sync the new AI attribution governance feature from commit-check v2.11.0:
- Bump minimum commit-check dependency to >=2.11.0
- Add 'ai_attribution' to validate_commit_message and validate_commit_context
  check lists so the rule is actually executed
- Update README with AI attribution governance documentation

When config [commit] ai_attribution = "forbid" is set, commits containing
known AI tool signatures (Claude Code, GitHub Copilot, etc.) will be rejected.
@codecov-commenter

codecov-commenter commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (48ea465) to head (64bd00f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #16   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          209       209           
=========================================
  Hits           209       209           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 180824e3-1210-457f-936c-c4fe8d6ca847

📥 Commits

Reviewing files that changed from the base of the PR and between 48ea465 and b85cb40.

📒 Files selected for processing (3)
  • README.md
  • pyproject.toml
  • src/commit_check_mcp/server.py

📝 Walkthrough

Walkthrough

This PR bumps the commit-check dependency to >=2.11.0, adds the ai_attribution rule to the message validation rule sets in the MCP server's _validate_message and _validate_all functions, and documents the new AI attribution governance feature in README.

Changes

AI Attribution Check Integration

Layer / File(s) Summary
Dependency bump
pyproject.toml
Updates commit-check version constraint to >=2.11.0,<3.
Enable ai_attribution rule in validation
src/commit_check_mcp/server.py
Adds ai_attribution to the message rule sets used by _validate_message and _validate_all, so its result appears in per-check output.
Documentation update
README.md
Adds a note about v2.11.0+ AI attribution governance, describing the [commit] ai_attribution = "forbid" config option.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Poem

  • A rabbit hops through code so neat,
  • Adds a rule for AI to greet,
  • Version bumped, docs made clear,
  • Attribution governance now sits here,
  • Hop, commit, check — complete!
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: syncing AI attribution governance from commit-check v2.11.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sync-ai-attribution-to-mcp

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

Added information about AI attribution governance in v2.11.0+.
@shenxianpeng shenxianpeng merged commit 3793d9d into main Jul 6, 2026
6 checks passed
@shenxianpeng shenxianpeng deleted the feature/sync-ai-attribution-to-mcp branch July 6, 2026 19:17
@shenxianpeng shenxianpeng added the enhancement New feature or request label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants