You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add --assume-untagged AGENT_NAME for projects with stripped/missing trailers
Real-world git histories have systematic trailer gaps:
- GitHub squash-merges strip Co-Authored-By trailers from individual
branch commits and replace them with a synthesized merge message.
- Some Claude Code workflows commit via shell after the AI helps draft,
without invoking the trailer-adding commit flow.
- Projects often started before the trailer convention existed; older
commits look manual by inspection but were AI-paired by intent.
Without a flag, the analyzer can only report what it can prove from
trailers — so a project the developer "knows was end-to-end AI-assisted"
might show 21% AI commits because the other 79% were squash-merged or
pre-trailer. The 21% is technically correct but isn't the question the
user wanted answered.
The new flag closes that gap. `--assume-untagged "Claude Opus"`
re-attributes every untagged non-merge commit to that agent (which must
exist in the registry; merge commits are excluded because they almost
never represent direct authorship). Also configurable in YAML at
`agents.assume_untagged`.
Implementation:
- agent_detector.attribute_untagged() does the post-pass over the
commits DataFrame, looking up the named agent in the registry and
appending it to `agents`/`primary_agent`/`agent_vendors`.
- git_extractor now records each commit's parent SHAs and an
`is_merge` boolean so the post-pass can skip merges.
- Config gains `agents.assume_untagged: str | None`.
- CLI gains `--assume-untagged AGENT_NAME` with help text pointing
users at `list-agents` for valid names.
- Tests cover the happy path and the unknown-agent error.
Verified: on a 3-commit fixture with one Claude trailer, baseline
detection finds 1 AI commit; with `--assume-untagged "Claude Opus"`,
all 3 are attributed to Claude Opus.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments