feat(git): extend agent-provenance detection channels#731
Merged
Conversation
Add three deterministic AI-authorship channels to the git indexer, all zero-LLM and local-history only, layered onto the existing precision-first classifier without changing the shared commit-record format. - git-ai authorship notes (refs/notes/ai, git-ai standard v3.0.0): read out of band via a ref-gated pass, so the 99.9% of repos without the ref do a single for-each-ref and add no git pass; only repos actually using git-ai walk the notes. Each note resolves to the dominant agent for that commit (git_ai_note channel, tier 2). A tie between tools stays unlabelled. - Assisted-by / Generated-by attribution trailers (Fedora/OpenInfra and Apache standards): fire only when the value maps to a recognized agent, so a bare human name in a misused trailer never mints a phantom agent. Generated-by is tier 2, Assisted-by tier 3. - Cursor commit-local markers (HTML comment, "Generated with Cursor") and the gemini-code-assist bot login. Validated on the git-ai project's own history: 335 commits carry real ai notes (codex/claude/devin/cursor) and the new channel attributes them correctly, with no false positives on a repo that carries none.
|
✅ Health: 7.7 (unchanged) 📋 At a glance Files & modules (2)
🔎 More signals (2)🔥 Hotspots touched (3)
🔗 Hidden coupling (1 file)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-08 11:37 UTC |
swati510
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the deterministic agent-provenance classifier in the git indexer with three new AI-authorship detection channels. All are zero-LLM, local-history only, and layered onto the existing precision-first tier model without changing the shared commit-record format.
1. git-ai authorship notes (
refs/notes/ai)Reads the git-ai standard v3.0.0 authorship notes attached to commits. The note's
sessions.<id>.agent_id.toolmetadata resolves to the dominant agent for that commit (git_ai_notechannel, tier 2). A tie between distinct tools stays unlabelled.Read out of band via a ref-gated pass: repos without the ref do a single
for-each-refand add no git pass, so the common case pays nothing. Only repos that actually use git-ai walk the notes.2. Assisted-by / Generated-by attribution trailers
Matches the Fedora/OpenInfra
Assisted-by:and ApacheGenerated-by:commit trailers. The trailer key is a standardized AI marker, but the agent identity comes from the value, so these fire only when the value maps to a recognized agent. A bare human name in a misused trailer never mints a phantom agent.Generated-byis tier 2,Assisted-bytier 3.3. Cursor commit-local markers + registry refresh
Adds the Cursor HTML-comment marker and "Generated with Cursor" footer, plus the
gemini-code-assistbot login.Validation
Ran the classifier over two real histories:
Co-authored-by; 0 git-ai notes; no false positivesgit_ai_notechannel attributes 326, the rest deferring correctly to higher-precedence bot-identity channelsAgent breakdown on the git-ai repo: claude 1286, devin 206, codex 107, copilot 29, cursor 24. Note tools present: codex 107, claude 196, devin 11, cursor 21.
Tests
Adds coverage for the note parser (single tool, alias mapping, dominant-tool, tie ambiguity, malformed input), the two trailer channels, the bare-human-name precision guard, Cursor markers, tier precedence, and the ref-gated notes loader (absent ref never spawns the walk). Full git-indexer suites pass.