Skip to main content

Module clock

Module clock 

Source
Expand description

Run-scoped analysis clock.

Churn recency weighting, ownership staleness, and the churn window all need a “now”. Reading the system clock separately at each of those sites makes two runs over the same commit disagree: the recency decay is continuous, so weighted_commits moves every run, and stale_days flips fixed thresholds (owner-active, drift minimum file age) as the day rolls over. The clock here resolves once per churn analysis from HEAD’s committer timestamp, so one commit always yields the same churn-derived numbers on any machine.

FALLOW_CLOCK_EPOCH pins the reference epoch explicitly, for reproducible builds and for comparing two checkouts against a fixed instant.

Structs§

AnalysisClock
The single instant a run measures commit ages and staleness against.

Enums§

AnalysisClockSource
Where a run’s reference epoch came from.

Constants§

CLOCK_EPOCH_ENV
Environment override for the run’s reference epoch, in unix seconds.

Functions§

utc_date
The UTC calendar date of a unix epoch, as YYYY-MM-DD.
utc_midnight_epoch
Parse an ISO YYYY-MM-DD date into the epoch of its UTC midnight.
utc_timestamp
A unix epoch as an RFC 3339 UTC timestamp, YYYY-MM-DDTHH:MM:SSZ.