feat: detect AI disclosure in branch name - #78
Merged
omkar-foss merged 2 commits intoAug 11, 2026
Conversation
Add a branchname detector that flags branches created by AI coding CLIs/agents using their conventional prefixes (codex/, claude/, cursor/, copilot/, devin/, cline/, aider/, gemini/), following the pattern noticed in chaoss/CollectOSS#397. The current branch is resolved once per scan via a new gitops.GetCurrentBranch and passed into detection.Input so all commits in the scan share it. Detached HEAD (common in CI checkouts) yields an empty branch name and no finding, rather than an error. Refs chaoss#50 Signed-off-by: Emirhankeles10 <muhanmet_emirhan10@hotmail.com>
omkar-foss
reviewed
Aug 10, 2026
omkar-foss
left a comment
Contributor
There was a problem hiding this comment.
PR looks good overall, could you also update the README to include this new detector?
Signed-off-by: Emirhankeles10 <muhanmet_emirhan10@hotmail.com>
omkar-foss
approved these changes
Aug 10, 2026
omkar-foss
left a comment
Contributor
There was a problem hiding this comment.
README changes look good to me, thank you.
andrew
approved these changes
Aug 10, 2026
andrew
left a comment
Contributor
There was a problem hiding this comment.
Nice first contribution, thanks for picking this up.
A couple of non-blocking notes for follow-up (not asking for changes here):
- The branch name is resolved once and stamped on every commit in the range, so a 10-commit PR on
codex/fooproduces 10 identicalbranchnamefindings. Might be worth deduping at the report level or only emitting on the tip commit at some point. - The finding is tied to whatever branch is currently checked out rather than to the commits themselves, so
ScanCommiton an arbitrary hash will flag it if you happen to be sitting on acodex/*branch, and it never fires under detached HEAD (most CI checkouts). Fine for the main use case of scanning a PR from its head branch, just something to keep in mind. - A few of the prefixes (
claude/,aider/,cline/,gemini/) I'm less sure actually auto-create branches with that convention the way Codex/Cursor/Copilot/Devin do. Medium confidence covers it though, and we can trim the map later if any turn out to be noise.
Contributor
|
I know I'm late to the party but it looks like this first contribution went smoothly, so congrats! I'd love to invite you to join the CHAOSS Slack in the #data-ai-disclosure-detection channel if youre interested in chatting with us more or getting help finding your next contribution |
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.
Description
Adds a
branchnamedetector that flags branches created by AI coding CLIs/agents using their conventional prefixes (codex/,claude/,cursor/,copilot/,devin/,cline/,aider/,gemini/), matching the pattern noticed in chaoss/CollectOSS#397.detection.Input.BranchNamefield +GetBranchName()accessorgitops.GetCurrentBranch(repoPath)resolving the checked-out branch once per scan (empty string, no error, on detached HEAD)detection/branchnamedetector, registered alongside the existing detectorsThis PR fixes #50
Notes for Reviewers
codex/fix-typobranch is flagged (medium confidence), a normalfeature/...branch is not.go test ./...andgo vet ./...pass.committerdetector; happy to extend/adjust the prefix map if there are other conventions to cover.Signed commits
Generative AI disclosure
Please select one option:
If AI tools were used, please provide details below:
go test ./...passes and that the CLI correctly flags acodex/*branch while leaving a normal branch untouched before opening this PR.