Skip to main content

Module bots

Module bots 

Expand description

Bot pattern matching + AI attribution.

Bot detection is plain substring containment (case-insensitive after a single lowercasing pass on the inputs). AI-assistance detection is the same idea: lowercase the commit message once, then check for any of the published 2024+ assistant signatures.

Structs§

BotPatterns
User-extensible bot-pattern set. Merges built-in DEFAULT_BOT_PATTERNS with any patterns from a project-level .codelorebots file at the repo root. File format mirrors .codeloreignore:

Constants§

DEFAULT_BOT_PATTERNS
Default bot identifiers (case-insensitive substring match in email or name; the comparison lowercases both sides).

Functions§

ai_attribution
Classifies commit attribution as one of "ai-authored", "ai-assisted", or "human". Bot authors → ai-authored; commits with a recognized AI-assistant signature in the message → ai-assisted; otherwise → human.
ai_attribution_with
User-extensible variant of ai_attribution: routes the bot check through a BotPatterns instance so a project-level .codelorebots file participates. AI-assist message-pattern detection is unchanged (the assist patterns are not user-extensible by design).
is_bot
True if the email or name matches any default bot pattern. Comparison is case-insensitive — Dependabot[Bot]@noreply.github.com matches.