Documentation
¶
Overview ¶
Package rollup provides rollup computation for commitgraph.
The rollup aggregates AI-tool-tagged commits by (user, repo, tool, day) while applying date quarantine filtering to exclude out-of-range commits from the rollup table while preserving them in the raw Parquet artifact.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
SHA string // Commit SHA
AuthorEmail string // Author email (for identity resolution)
AuthorName string // Author name
CommittedAt time.Time // Commit date (UTC)
Message string // Commit message
Tools []string // Detected AI tools (empty if no AI tool detected)
}
Commit represents a single commit for rollup computation.
type QuarantineBounds ¶
type QuarantineBounds struct {
// MinDate is the lower bound (inclusive): 2005-01-01 UTC
MinDate time.Time
// MaxDate is the upper bound (inclusive): today+1 UTC
MaxDate time.Time
}
QuarantineBounds defines the valid date range for rollup computation. Commits with committed_at outside this range are excluded from the rollup but preserved in the raw Parquet artifact.
func NewQuarantineBounds ¶
func NewQuarantineBounds(today time.Time) QuarantineBounds
NewQuarantineBounds creates bounds for the current date. MinDate is fixed at 2005-01-01 UTC. MaxDate is the current UTC date + 1 day.
func (QuarantineBounds) IsIncluded ¶
func (qb QuarantineBounds) IsIncluded(committedAt time.Time) bool
IsIncluded returns true if the given committed_at falls within the quarantine bounds [MinDate, MaxDate] (inclusive on both ends). MinDate includes the entire day starting at 2005-01-01 00:00:00 UTC. MaxDate includes the entire day ending at today+1 23:59:59.999999999 UTC.
type RollupRow ¶
type RollupRow struct {
UserEmail string // Author email (resolved to user_id later)
RepoID int64 // Repository ID
Tool string // AI tool name
Day time.Time // Day (UTC, midnight)
Count int // Number of commits
}
RollupRow represents a single rollup aggregation row.
func ComputeRollup ¶
func ComputeRollup(commits []Commit, repoID int64, bounds QuarantineBounds) []RollupRow
ComputeRollup computes (user, repo, tool, day, count) aggregations from the given commits, applying date quarantine filtering.
Commits with committed_at outside the quarantine bounds are excluded from the rollup entirely. The caller is responsible for preserving the raw commit data (including unclamped committed_at) in the Parquet artifact.
Parameters:
- commits: All commits for a repo (may include out-of-range dates)
- repoID: Repository ID for rollup rows
- bounds: Quarantine date bounds
Returns:
- Rollup rows for commits within the date bounds