Repository navigation
Credit agent-opened PRs to the person they name as co-author - #9
Merged
Merged
Conversation
- A PR whose git author is an agent (any GitHub App bot no-reply address, or Copilot's and Cursor's agent addresses) counts for the first Co-authored-by: trailer naming a person, read from the squash commit or the merge PR's branch tip, after .mailmap - Trailer identities go through one batched git check-mailmap per repo, and the branch tip call now reads messages too - PR rows gain agent_email, set whenever the git author is an agent - The no-match warning adds a hint for coding agents it lists, never for dependency bots - Spec, README, CLAUDE.md and the git pattern doc describe the rule, the field, the budget and the limits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pass check-mailmap contacts on stdin, so a long list of co-authors can't exceed the command-line limit and make git() throw, ending the scan. mapEmails now goes through the same mapIdentities call - Count a Co-authored-by: trailer only with a name, so a nameless one can't give a PR an empty author_name - Keep the hint's coding agents in their own constant, independent of the credit list - Say in the branch-tip warning that those PRs get no co-author credit - Test CRLF trailers (via a verbatim fixture commit option), a nameless trailer and a .mailmap entry keyed on name and email - README: the warning only appears when none of a repo's PRs match, and the no-reply address goes alongside your own --author - Spec known limits: unlisted agents' trailers, tip-only merge credit and backport bots. git.md describes the stdin batching and the branch-tip format The command-line limit fix has no test: reaching the limit needs a fixture message larger than the fixtures can pass to git commit -m. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- testing.md: a CRLF message test needs the verbatim commit option, since git's default cleanup strips trailing CRs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implements DHP-41
What changed
PRs that a coding agent opens under its own identity now count for the person the agent names as co-author, instead of for the agent.
.mailmapand ignoring case, that matches any GitHub App bot's no-reply address (<id>+<name>[bot]@users.noreply.github.com), or is one of three agent addresses that pattern misses: Copilot's coding agent and Cursor's two agent addresses. The pattern and list sit together at the top ofsrc/scan.jsCo-authored-by:trailer whose identity, after.mailmap, isn't an agent. Squash PRs read the squash commit's message, and merge PRs the branch tip's. Trailers are read from any line, ignoring case, CRLF and surrounding whitespace. They need a name and an email. Only the first person counts, so--all-authorscounts each PR once. Crediting runs before the author filter, so the filter, the no-match warning and the JSON all see the credited personagent_emailafterauthor_email. It holds the agent's email whenever the git author is an agent, whether or not a person took the credit, and isnullotherwise. Nothing in the repo reads it.claude/CLAUDE.md(budget line, PR attribution as a design decision) anddocs/patterns/git.mddescribe this as current stateAlso on this branch, from review:
check-mailmapcalls now pass contacts on stdin through one helper (mapIdentities). With arguments, a repo with many distinct co-authors could pass the command-line limit, andgit()throws on that, which would end the whole scan. That fix has no test, because the fixtures can't make a big enough messagetests/fixtures.jsgains averbatimcommit option, so a test can keep CRLF line endingsGit process budget
Throwaway
GIT_TRACEcount: two fixture repos, each with 15 agent squash PRs (with trailers), 15 human squash PRs, 15 agent merge PRs and 15 direct commits. Processes per repo:logcheck-mailmapcheck-attrconfigfor-each-ref--all-authors--author other@…That's the main log plus the branch-tip call, and at most two
check-mailmap(the author filter's and the trailers'). Nothing runs per commit or per PR. The counted PRs (25 / 45 / 20) matched the fixture.Verification
npm test(124 pass) andnpm run typecheck.mailmapmapping by name and email, merge PRs reading the tip, the list addresses, and coding-agent-only hintsHeld findings
None of these gate release.
--authorreplaces the default filter. Both are decisions on settled warning behaviour – DHP-42Claude <noreply@anthropic.com>) before the person's takes an agent PR's credit. Skipping it would reopen the groom's agent-identity scope, so it's recorded as a known limit – DHP-43agent_emailset on the failed-tip fallback when the merge commit's author is an agent: this matches the field's definition, so no changecheck-mailmapfails, and the per-entry comments onAGENT_EMAILS: both are as the ticket specifiescopilot-swe-agent[bot]in the coding-agent list never matches a known address: the ticket lists it, and it does no harm--authorcan miss it. This follows the ticket's mapped-name rule, as for squash merges recorded under another name\x1finside a tip message cuts it short, the same assumptionLOG_FORMATmakesReview
Cubic didn't review this branch. It isn't installed on this repo: none of PRs #1–#8 has a cubic review or check run, and #9 has none either. The branch had a structural review (spec and conventions) and a local
/code-reviewat xhigh, and their findings were applied or triaged above.Release readiness
Nothing beyond merging blocks release. The scan JSON gains
agent_email, which nothing in the repo reads. No follow-on actions.🤖 Generated with Claude Code