Export oldest boundary when dice %10==0

Allow an oldest-boundary timestamp group to be exported when its dice-only record count is a positive multiple of 10. This adds a dice_complete check in the boundary annotation logic so a proved-finished pull set on a full final page is exported (unseen continuation rows can only be non-dice tails that sort after seen rows, keeping ordinals/UIDs stable). Docs and README updated to explain the rule, and tests updated/expanded to cover dice-complete, partial, and newest-boundary behaviors.
This commit is contained in:
Golumpa 2026-06-11 11:21:42 +01:00
parent 354b0e9232
commit 30dc4e4831
4 changed files with 64 additions and 7 deletions

View file

@ -114,13 +114,17 @@ def annotate_groups(
at_oldest_boundary = group_index == len(groups) - 1
dice_records_in_group = [row for row in group if is_dice_record(row)]
dice_record_count = len(dice_records_in_group)
# A complete multiple of 10 dice rolls proves the pull set is finished.
# Unseen continuation rows can only be non-dice tails that sort after the
# seen rows, so exported ordinals (and UIDs) stay stable.
dice_complete = dice_record_count > 0 and dice_record_count % 10 == 0
group_status = "stable"
skip_reason = ""
if at_newest_boundary and not starts_from_page_1:
group_status = "dropped_boundary_group"
skip_reason = "newest timestamp group may be partial because scan did not start from page 1"
elif at_oldest_boundary and not final_page_is_partial:
elif at_oldest_boundary and not final_page_is_partial and not dice_complete:
group_status = "dropped_boundary_group"
skip_reason = "oldest timestamp group may continue onto the next uncaptured page"