q.label.purging_metadata exports running label endpoints and the first safe observation after an optional bar embargo. It prepares canonical event-lifetime metadata; actual fold construction belongs in q.dataset.
The running maximum matters when a later event ends before an earlier, longer event.
max_end_time is cumulative across ordered events. next_safe_time skips the observation immediately after that endpoint when embargo=1; missing values mean the safe point lies beyond available data.