refactor(site-runtime): excise vestigial site-side notification-list surface — repo, DI registration, dead write paths (arch-review 08 §1.3/#23)

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
Joseph Doherty
2026-07-10 06:59:45 -04:00
parent 7ff1263ac0
commit d61881ffaf
7 changed files with 73 additions and 433 deletions
@@ -799,6 +799,12 @@ public class SiteStorageService
/// idempotent and is invoked on every artifact apply / deploy so existing exposure
/// is cleared, not just future writes. The tables themselves are retained (the
/// schema is harmless once empty); only their contents are removed.
///
/// The site-side write paths (<c>StoreNotificationListAsync</c>/<c>StoreSmtpConfigurationAsync</c>)
/// and the <c>SiteNotificationRepository</c> were removed 2026-07-10 (arch-review 08 §1.3/#23)
/// because notification config is central-only and must never be written to a site — this
/// purge is the sole remaining touchpoint, kept only to scrub DBs written by older builds;
/// do not reintroduce site-side notification writes.
/// </summary>
/// <returns>A task that completes when both tables have been emptied.</returns>
public async Task PurgeCentralOnlyNotificationConfigAsync()
@@ -813,80 +819,6 @@ public class SiteStorageService
await command.ExecuteNonQueryAsync();
}
/// <summary>
/// Stores or updates a notification list.
/// </summary>
/// <param name="name">The name of the notification list.</param>
/// <param name="recipientEmails">List of recipient email addresses.</param>
/// <returns>A task that completes when the notification list has been stored or updated.</returns>
public async Task StoreNotificationListAsync(string name, IReadOnlyList<string> recipientEmails)
{
await using var connection = new SqliteConnection(_connectionString);
await connection.OpenAsync();
await using var command = connection.CreateCommand();
command.CommandText = @"
INSERT INTO notification_lists (name, recipient_emails, updated_at)
VALUES (@name, @emails, @updatedAt)
ON CONFLICT(name) DO UPDATE SET
recipient_emails = excluded.recipient_emails,
updated_at = excluded.updated_at";
command.Parameters.AddWithValue("@name", name);
command.Parameters.AddWithValue("@emails", System.Text.Json.JsonSerializer.Serialize(recipientEmails));
command.Parameters.AddWithValue("@updatedAt", DateTimeOffset.UtcNow.ToString("O"));
await command.ExecuteNonQueryAsync();
}
// ── SMTP Configuration CRUD ──
/// <summary>
/// Stores or updates an SMTP configuration.
/// </summary>
/// <param name="name">The name of the SMTP configuration.</param>
/// <param name="server">SMTP server hostname.</param>
/// <param name="port">SMTP server port.</param>
/// <param name="authMode">Authentication mode ('None', 'BasicAuth', 'OAuth2').</param>
/// <param name="fromAddress">Email address used as the sender.</param>
/// <param name="username">Username for authentication, if applicable.</param>
/// <param name="password">Password for authentication, if applicable.</param>
/// <param name="oauthConfig">OAuth2 configuration JSON, if applicable.</param>
/// <returns>A task that completes when the SMTP configuration has been stored or updated.</returns>
public async Task StoreSmtpConfigurationAsync(
string name, string server, int port, string authMode, string fromAddress,
string? username, string? password, string? oauthConfig)
{
await using var connection = new SqliteConnection(_connectionString);
await connection.OpenAsync();
await using var command = connection.CreateCommand();
command.CommandText = @"
INSERT INTO smtp_configurations (name, server, port, auth_mode, from_address, username, password, oauth_config, updated_at)
VALUES (@name, @server, @port, @authMode, @fromAddress, @username, @password, @oauthConfig, @updatedAt)
ON CONFLICT(name) DO UPDATE SET
server = excluded.server,
port = excluded.port,
auth_mode = excluded.auth_mode,
from_address = excluded.from_address,
username = excluded.username,
password = excluded.password,
oauth_config = excluded.oauth_config,
updated_at = excluded.updated_at";
command.Parameters.AddWithValue("@name", name);
command.Parameters.AddWithValue("@server", server);
command.Parameters.AddWithValue("@port", port);
command.Parameters.AddWithValue("@authMode", authMode);
command.Parameters.AddWithValue("@fromAddress", fromAddress);
command.Parameters.AddWithValue("@username", (object?)username ?? DBNull.Value);
command.Parameters.AddWithValue("@password", (object?)password ?? DBNull.Value);
command.Parameters.AddWithValue("@oauthConfig", (object?)oauthConfig ?? DBNull.Value);
command.Parameters.AddWithValue("@updatedAt", DateTimeOffset.UtcNow.ToString("O"));
await command.ExecuteNonQueryAsync();
}
// ── Data Connection Definition CRUD ──
/// <summary>