Files
DanConwayDev 19dd74c610 fix(purgatory): guard repository deletion during announcement expiry
Expired replacements and restored checkpoints can refer to repository views
that already serve admitted announcements. Expiry must protect those views
while still removing abandoned directories regardless of who created them.

Take the repository lifecycle lock and try an identifier activity writer,
query admission for the complete owner/identifier coordinate, then recheck
the candidate ID and deadline under its entry lock. Admission, uploads,
fetching and promotion hold shared activity guards through their mutations.
A nonblocking writer permits nested processing without lock inversion.

In both expiry phases, delete views only when no announcement is admitted.
Retain pending entries for retry on query or deletion failures. Checkpoint
age and historical creation ownership do not exempt directories from expiry.
Retire already admitted or superseded candidates without marking them expired.
Promotion rechecks view existence after acquiring its guard so queued work
cannot advertise a directory removed by expiry.

Explicit deletion handling, repair of already missing admitted views, and
scanning directories without pending entries are outside this change. The
reported deployment incident's cause remains unconfirmed.

Validation: 14 focused expiry regressions pass, including legacy checkpoints,
preexisting views, both-phase retries, changing admission, concurrent lifecycle
activity and queued promotion. Formatting and git diff --check pass. Earlier
revision passed full local suites and CI; these were not rerun for this policy
correction. No fixed sleeps were added.

Assisted-by: GPT-6
2026-10-28 21:28:17 +00:00
..