mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
Normal PR pushes created placeholders, but periodic expiry discarded only those records. The shutdown ref sweep could no longer discover expired IDs. This gap predates the January placeholder-registration fix; /prs/ expiry later gained its own filesystem cleanup without covering normal endpoints. Persist each normal destination and expected commit, including additional push destinations. Before expiry, acquire the shared repository lifecycle write locks, check for an already accepted event, and recheck the pending record. Compare-and-delete recorded refs only, retain failures for retry, and tolerate already absent refs after partial cleanup. Preserve /prs/ cleanup when both endpoint types have copies. Integrity checks recognize only the exact recorded owner/identifier as pending authority. Correctness relies on existing push lifecycle locks, serialized placeholder mutation, and Git's old-value check. Old unscoped records remain readable; retroactive deletion of orphan refs and unrelated integrity repair are excluded because their original destination records are missing. Validation: 964 library tests and 214 targeted integration tests passed; final focused tests include eight new regressions covering authorization scope, restart persistence, accepted-event checkpoints, refreshed pushes, event arrival, partial failure retry, replacement preservation, and mixed normal-/prs/ copies. Formatting, diff checks, and strict workspace all-target Clippy pass after the final changes. Assisted-by: GPT-6