Files
ngit-grasp/tests/lifecycle
DanConwayDev 6e9bf5981b fix(lifecycle): preserve NIP-01 ordering through deletion and rollback
Same-second lower-ID replacements could be ignored by served-repository
de-listing and superseded-history capture. Rollback's active-state lookup
and post-deletion alignment instead preferred higher IDs, while history
selection let capture time override the original event's replacement order.

Share the later-timestamp/lower-ID comparator across these lifecycle paths
and the existing purgatory decisions. Archive a same-second predecessor only
when the incoming event wins, and only apply de-list deletion for a winning
replacement. Select active and authorized alignment states with the same
ordering. Rank history records by original timestamp and original event ID
before capture metadata; keep timestamp cutoffs and author checks intact.

Extract the authorized-state selection used by realignment to exercise both
arrival orders with different authorized authors and an unauthorized newer
state. Add served de-list, history-capture and history-candidate regressions.
All four new regressions fail before the fixes and pass afterward. Extend the
LMDB restart scenario to delete the same-second winner and observe its
archived predecessor restored, with a bounded deadline and no new sleeps.

This changes replacement preference, not deletion request ownership,
coordinate cutoff semantics, repository membership or archive format.
Existing capture metadata remains readable. Update the changelog and
repository lifecycle documentation.

Validation: focused ordering regressions and LMDB restart/rollback test;
full ngit-grasp suite, all-target workspace Clippy with warnings denied,
formatting and diff checks pass.

Assisted-by: GPT-6
2026-09-17 15:38:24 +00:00
..