git

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package git collects development-work events from local git repositories: one devx.change.committed event per commit, with AI co-author attribution detected from Co-authored-by trailers.

Repository discovery and log parsing come from github.com/grokify/gogit; this package adds the DevX semantics (canonical events, the known-AI-tool registry, provenance).

Only metadata is extracted — hashes, timestamps, author identities, change stats, and AI-tool attribution. Commit subjects and bodies are never read into events.

Index

Constants

View Source
const DefaultConfidence = 0.95

DefaultConfidence is the provenance confidence for events reconstructed from git history. Commits are authoritative records; AI attribution rests on co-author trailers, which understate AI involvement when tools do not sign their work.

View Source
const DefaultMaxDepth = 3

DefaultMaxDepth is how many directory levels below each root are searched for repositories, matching a GOPATH-style host/org/repo layout.

Variables

View Source
var KnownAITools = []KnownAITool{
	{
		Name:   "Claude Code",
		Emails: []string{"noreply@anthropic.com"},
	},
	{
		Name:   "GitHub Copilot",
		Emails: []string{"noreply@github.com", "copilot@github.com"},
	},
	{
		Name: "Gemini CLI",
		Emails: []string{
			"218195315+gemini-cli@users.noreply.github.com",
			"176961590+gemini-code-assist[bot]@users.noreply.github.com",
			"gemini-cli-agent@google.com",
			"gemini@google.com",
		},
	},
	{
		Name:   "Cursor",
		Emails: []string{"ai@cursor.sh", "cursor@cursor.sh"},
	},
	{
		Name:   "Aider",
		Emails: []string{"aider@aider.chat"},
	},
}

KnownAITools lists recognized AI coding assistants and their co-author signatures. Ported from devfolio's contributor package, which this registry supersedes as the canonical copy.

Functions

func AIToolByEmail

func AIToolByEmail(email string) string

AIToolByEmail returns the AI tool matching a co-author email, or "" when the email is not a known AI signature. Matching is case-insensitive and supports GitHub noreply suffix forms with variable user-ID prefixes.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector emits devx.change.committed events from local git history.

func New

func New(opts Options) (*Collector, error)

New returns a Collector for the given options.

func (*Collector) Collect

Collect implements omnidevx.Collector. Repositories that fail to read become diagnostics; only discovery errors abort the run.

func (*Collector) Source

func (c *Collector) Source() omnidevx.Source

Source implements omnidevx.Collector.

type KnownAITool

type KnownAITool struct {
	// Name is the display name, e.g. "Claude Code".
	Name string
	// Emails are known co-author addresses. Entries of the form
	// "<id>+<slug>@users.noreply.github.com" also match any address with
	// the same "+<slug>@users.noreply.github.com" suffix.
	Emails []string
}

KnownAITool is an AI coding assistant recognizable by its co-author commit-trailer email.

type Options

type Options struct {
	// Roots are directories to search for repositories. A root may itself
	// be a repository. Required.
	Roots []string
	// MaxDepth bounds discovery below each root. Defaults to
	// DefaultMaxDepth.
	MaxDepth int
	// NoMerges excludes merge commits.
	NoMerges bool
}

Options configures the collector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL