Account merge ledger: fix the first Soul pass (suspension carried into a memberless survivor, merged status terminal, standing at the desk door, linked accounts and write time, journalled grace intake, survivor weight on moved votes, one-hop alias, State token and database guards for overlapping merges, live-Postgres tests)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-14 03:37:48 +00:00
commit f402eb13cc
23 changed files with 1273 additions and 97 deletions

View file

@ -29,6 +29,7 @@ public enum AccountMergeEntryAction
Moved,
Closed,
Suspended,
Created,
Restored,
KeptAfterUndo
}
@ -81,7 +82,7 @@ public sealed class AccountMergeEntry
public Guid? PriorUserAccountId { get; set; }
/// <summary>The prior status or prior voter key.</summary>
/// <summary>What the record held before: the prior status; for a moved vote its weight; for a moved appraisal its voter class and key (class|key).</summary>
public string? PriorText { get; set; }
/// <summary>The cast time of a moved vote or appraisal, so undo can tell whether the survivor re-cast it.</summary>

View file

@ -359,6 +359,10 @@ public sealed class Membership
public ICollection<TierSnapshot> TierSnapshots { get; set; } = [];
/// <summary>The folded membership of a landed merge. Terminal: only AccountMergeLedger writes it or leaves it, so every other status writer (sign-in sync, bootstrap, claim, approval, suspension) refuses a merged row.</summary>
[NotMapped]
public bool IsMerged => Status == MembershipStatus.Merged;
[NotMapped]
public decimal EffectiveVotingWeight =>
Status != MembershipStatus.Active