fix(registry): pulledWithin kept everything; count pulls instead #53

Merged
binjovi-bot merged 1 commit from sean/zot-retention-pulledwithin into trunk 2026-09-09 20:35:16 +00:00 AGit
Owner

The dry run caught it on the first pass: build/binjovi kept 663 of 663 tags. pulledWithin ORs pull time with PUSH time (rules.go:41), so on a repo taking several pushes a day it retains everything inside the window regardless of pull history -- 308 of those tags had never been pulled. Replaced with mostRecentlyPulledCount, a plain top-N on pull time. The guard now refuses pulledWithin outright. https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76

The dry run caught it on the first pass: build/binjovi kept 663 of 663 tags. pulledWithin ORs pull time with PUSH time (rules.go:41), so on a repo taking several pushes a day it retains everything inside the window regardless of pull history -- 308 of those tags had never been pulled. Replaced with mostRecentlyPulledCount, a plain top-N on pull time. The guard now refuses pulledWithin outright. https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76
fix(registry): pulledWithin kept everything; count pulls instead
Some checks failed
binjovi/ci Binjovi failed the frozen plan
0e05d4e0dc
The dry run did its job on its first pass. build/binjovi kept 663 of 663
tags, every one "retained by pulledWithin". The policy read as "keep ten" and
behaved as "keep everything" -- a prune that would have reclaimed nothing from
the largest repository in the registry, 44.71 GiB, and looked successful.

pulledWithin IS NOT A PULL WINDOW. Its rule ORs the pull timestamp with the
PUSH timestamp (pkg/retention/rules.go:41), and upstream says why in a comment
on the line above: "we don't want to delete tags pushed after timestamp".
That is reasonable for a slow repository and wrong for a busy one. build/binjovi
takes several pushes a day, so all 662 releases fell inside a 30-day window and
the rule retained the lot. 308 of them had never been pulled at all --
lastPullTimestamp 1970-01-01 -- and were retained anyway.

mostRecentlyPulledCount is the rule that means what pulledWithin looks like it
means: a plain top-N sort on pull time (rules.go:90), where a tag never pulled
sorts to the epoch and loses. Every pulledWithin is now one of those.
pushedWithin stays where a genuine time floor is wanted -- quarantine's 14 days
and the kernel repositories' 180 -- because that one checks push time alone
(rules.go:62) and is not affected.

build/binjovi keeps 20 by push instead of 10. Each binjovi release image is
about 300 MB with heavily shared layers, so ten more tags cost little and buy
twenty releases of rollback headroom on the project that publishes the control
plane itself.

The guard now refuses pulledWithin outright, with the measurement in the
comment, because nothing about the name suggests this behaviour and the failure
is silent: the log says "retained", the numbers look plausible, and the store
does not shrink.

Claude-Session: https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76
sean force-pushed sean/zot-retention-pulledwithin from 0e05d4e0dc
Some checks failed
binjovi/ci Binjovi failed the frozen plan
to c02131ad2c
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-09-09 20:34:54 +00:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/zot!53
No description provided.