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

@ -55,12 +55,18 @@ public sealed class ApplicationBootstrapper(
}
/// <summary>
/// The one bootstrap-admin promotion, used at startup and at sign-in. A Suspended account is left exactly as it is (an admin's
/// The one bootstrap-admin promotion, used at startup and at sign-in. A Merged or Suspended account is left exactly as it is (an admin's
/// decision; only the suspension service lifts it) and the refusal is logged by account id. Returns whether it promoted.
/// </summary>
public static bool TryPromoteBootstrapAdmin(UserAccount account, DateTimeOffset now, ILogger logger)
{
var membership = account.Membership!;
if (membership.IsMerged)
{
logger.LogWarning("Bootstrap admin promotion skipped for merged account {UserAccountId}.", account.Id);
return false;
}
if (membership.Status == MembershipStatus.Suspended)
{
logger.LogWarning("Bootstrap admin promotion skipped for suspended account {UserAccountId}.", account.Id);