Skip to main content

Module time_anchor

Module time_anchor 

Source
Expand description

Calendar-date → earliest-instant anchoring (ADR-169 D1), shared by every surface that accepts a date-only value against the configured display timezone. Moved verbatim from khive-pack-gtd’s handlers when brain.event_counts gained the same date-only semantics — packs do not depend on packs, so the shared rule lives here beside the display_timezone config it interprets.

Functions§

anchor_date_to_earliest_instant
Resolve a calendar date to the earliest instant that belongs to it in tz (ADR-169 D1). Midnight is not a total function of date and zone: on a zone’s own transition date local midnight can fail to exist (the clock jumps over it) or occur twice (the clock repeats it). Both are one rule — take the least instant whose local date, in tz, is date — not two exceptions to it; neither case may be resolved by unwrapping to UTC, which would silently reintroduce the defect ADR-169 exists to remove.