diff --git a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor
index 6504d3c..27aadc1 100644
--- a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor
+++ b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor
@@ -15,7 +15,7 @@
- All assets and animations flagged as AI-generated across the card catalog.
+ All catalog assets, animation bindings, and generic CDN uploads flagged as AI-generated.
@if (_loading)
@@ -24,6 +24,54 @@
}
else
{
+
+
+
+
+ @if (_cdnUploads.Count == 0)
+ {
+
No AI-generated generic CDN uploads.
+ }
+ else
+ {
+
+
+
+ Prefix
+ Object Key
+ MIME
+ CDN URL
+ Uploaded
+
+
+
+ @foreach (var item in _cdnUploads)
+ {
+
+ @(!string.IsNullOrWhiteSpace(item.Prefix) ? item.Prefix : "/")
+ @item.ObjectKey
+ @(!string.IsNullOrWhiteSpace(item.ContentType) ? item.ContentType : "—")
+
+
+ @TruncateUrl(item.PublicUrl)
+
+
+
+ @item.UploadedAt.ToString("yyyy-MM-dd")
+
+ }
+
+
+ }
+
+
+
+
+
+ AI-generated
+
@if (_uploading)
{
@@ -118,6 +125,10 @@
Target Key
@_replaceTarget.Key
+
+
+ AI-generated
+
@if (_replacing)
@@ -165,6 +176,7 @@
Key
+ AI
Size
Modified
Actions
@@ -176,6 +188,16 @@
var row = item;
@row.Key
+
+ @if (row.IsAiGenerated)
+ {
+ AI
+ }
+ else
+ {
+ No
+ }
+
@FormatBytes(row.Size)
@row.LastModified.ToString("yyyy-MM-dd HH:mm UTC")
@@ -251,6 +273,8 @@
private bool _loading;
private bool _uploading;
private bool _replacing;
+ private bool _uploadIsAiGenerated;
+ private bool _replaceIsAiGenerated;
private bool _hasMore;
private CdnObjectRow? _replaceTarget;
@@ -317,6 +341,17 @@
};
var response = await S3.ListObjectsV2Async(request);
+ var keys = response.S3Objects
+ .Where(o => !string.IsNullOrWhiteSpace(o.Key) && !o.Key.EndsWith('/'))
+ .Select(o => o.Key)
+ .ToList();
+
+ var aiFlags = keys.Count == 0
+ ? new Dictionary(StringComparer.Ordinal)
+ : await Db.CdnUploadRecords
+ .Where(r => keys.Contains(r.ObjectKey))
+ .ToDictionaryAsync(r => r.ObjectKey, r => r.IsAiGenerated);
+
foreach (var obj in response.S3Objects)
{
if (string.IsNullOrWhiteSpace(obj.Key) || obj.Key.EndsWith('/'))
@@ -328,6 +363,7 @@
Size = obj.Size,
LastModified = obj.LastModified.ToUniversalTime(),
PublicUrl = BuildPublicUrl(obj.Key),
+ IsAiGenerated = aiFlags.GetValueOrDefault(obj.Key, false),
});
}
@@ -358,6 +394,7 @@
{
var key = $"{_activePrefix}{file.Name}";
await UploadFileToKeyAsync(key, file);
+ await UpsertUploadRecordAsync(key, file.ContentType, _uploadIsAiGenerated);
_message = $"Uploaded {file.Name}.";
_isError = false;
await LoadAsync(reset: true);
@@ -385,6 +422,7 @@
try
{
await UploadFileToKeyAsync(_replaceTarget.Key, file);
+ await UpsertUploadRecordAsync(_replaceTarget.Key, file.ContentType, _replaceIsAiGenerated);
_message = $"Replaced {_replaceTarget.Key}.";
_isError = false;
await LoadAsync(reset: true);
@@ -410,6 +448,13 @@
var options = CdnOptionsAccessor.Value;
await S3.DeleteObjectAsync(options.BucketName, item.Key);
+ var record = await Db.CdnUploadRecords.FirstOrDefaultAsync(r => r.ObjectKey == item.Key);
+ if (record is not null)
+ {
+ Db.CdnUploadRecords.Remove(record);
+ await Db.SaveChangesAsync();
+ }
+
_items.Remove(item);
if (_replaceTarget?.Key == item.Key)
_replaceTarget = null;
@@ -446,12 +491,14 @@
private void SelectReplaceTarget(CdnObjectRow item)
{
_replaceTarget = item;
+ _replaceIsAiGenerated = item.IsAiGenerated;
_message = null;
}
private void ClearReplaceTarget()
{
_replaceTarget = null;
+ _replaceIsAiGenerated = false;
}
private async Task UploadFileToKeyAsync(string key, IBrowserFile file)
@@ -476,6 +523,28 @@
await S3.PutObjectAsync(request);
}
+ private async Task UpsertUploadRecordAsync(string key, string? contentType, bool isAiGenerated)
+ {
+ var record = await Db.CdnUploadRecords.FirstOrDefaultAsync(r => r.ObjectKey == key);
+ if (record is null)
+ {
+ record = new SOR.Database.Entities.Catalog.CdnUploadRecord
+ {
+ Id = Guid.NewGuid(),
+ ObjectKey = key,
+ };
+ Db.CdnUploadRecords.Add(record);
+ }
+
+ record.Prefix = ExtractPrefix(key);
+ record.PublicUrl = BuildPublicUrl(key);
+ record.ContentType = string.IsNullOrWhiteSpace(contentType) ? null : contentType;
+ record.IsAiGenerated = isAiGenerated;
+ record.UploadedAt = DateTimeOffset.UtcNow;
+
+ await Db.SaveChangesAsync();
+ }
+
private string NormalizePrefix(string raw)
{
var prefix = raw.Trim().Trim('/');
@@ -486,7 +555,20 @@
private string BuildPublicUrl(string key)
{
- return $"{CdnOptionsAccessor.Value.PublicBaseUrl.TrimEnd('/')}/{key}";
+ var options = CdnOptionsAccessor.Value;
+ var baseUrl = options.PublicBaseUrl.TrimEnd('/');
+ var bucketSegment = options.BucketName.Trim('/');
+
+ if (baseUrl.EndsWith("/" + bucketSegment, StringComparison.OrdinalIgnoreCase))
+ return $"{baseUrl}/{key}";
+
+ return $"{baseUrl}/{bucketSegment}/{key}";
+ }
+
+ private string ExtractPrefix(string key)
+ {
+ var slash = key.LastIndexOf('/');
+ return slash <= 0 ? string.Empty : key[..slash];
}
private string FormatBytes(long bytes)
@@ -506,5 +588,6 @@
public long Size { get; set; }
public DateTime LastModified { get; set; }
public string PublicUrl { get; set; } = string.Empty;
+ public bool IsAiGenerated { get; set; }
}
}
diff --git a/Server/src/SOR.Database/Contexts/CatalogDbContext.cs b/Server/src/SOR.Database/Contexts/CatalogDbContext.cs
index 2b7b486..04b4984 100644
--- a/Server/src/SOR.Database/Contexts/CatalogDbContext.cs
+++ b/Server/src/SOR.Database/Contexts/CatalogDbContext.cs
@@ -25,6 +25,7 @@ public sealed class CatalogDbContext : DbContext
public DbSet CardDefinitions => Set();
public DbSet CardAssets => Set();
public DbSet AnimationBindings => Set();
+ public DbSet CdnUploadRecords => Set();
protected override void OnModelCreating(ModelBuilder builder)
{
@@ -114,5 +115,17 @@ public sealed class CatalogDbContext : DbContext
// One action name per card — no duplicate "attack" bindings.
e.HasIndex(a => new { a.CardDefinitionId, a.ActionName }).IsUnique();
});
+
+ builder.Entity(e =>
+ {
+ e.ToTable("cdn_upload_records");
+ e.HasKey(r => r.Id);
+ e.Property(r => r.ObjectKey).IsRequired();
+ e.Property(r => r.Prefix).IsRequired();
+ e.Property(r => r.PublicUrl).IsRequired();
+ e.HasIndex(r => r.ObjectKey).IsUnique();
+ e.HasIndex(r => r.Prefix);
+ e.HasIndex(r => r.IsAiGenerated);
+ });
}
}
diff --git a/Server/src/SOR.Database/Entities/Catalog/CdnUploadRecord.cs b/Server/src/SOR.Database/Entities/Catalog/CdnUploadRecord.cs
new file mode 100644
index 0000000..4c565f6
--- /dev/null
+++ b/Server/src/SOR.Database/Entities/Catalog/CdnUploadRecord.cs
@@ -0,0 +1,29 @@
+namespace SOR.Database.Entities.Catalog;
+
+///
+/// Tracks generic CDN uploads made through the admin portal.
+/// This is separate from card-linked asset records so arbitrary files
+/// (UI graphics, config data, music, SFX, models, etc.) can still carry
+/// provenance metadata such as whether they were AI-generated.
+///
+public sealed class CdnUploadRecord
+{
+ public Guid Id { get; set; } = Guid.NewGuid();
+
+ /// S3 object key within the configured bucket.
+ public string ObjectKey { get; set; } = string.Empty;
+
+ /// Logical top-level or nested folder prefix, e.g. "graphics" or "models/ui".
+ public string Prefix { get; set; } = string.Empty;
+
+ /// Publicly accessible CDN URL for the uploaded object.
+ public string PublicUrl { get; set; } = string.Empty;
+
+ /// Best-known MIME type for the object.
+ public string? ContentType { get; set; }
+
+ /// Whether the object was AI-generated.
+ public bool IsAiGenerated { get; set; }
+
+ public DateTimeOffset UploadedAt { get; set; }
+}
diff --git a/Server/src/SOR.Database/Enums/Affinity.cs b/Server/src/SOR.Database/Enums/Affinity.cs
index 6a6c5e0..523fe24 100644
--- a/Server/src/SOR.Database/Enums/Affinity.cs
+++ b/Server/src/SOR.Database/Enums/Affinity.cs
@@ -23,14 +23,14 @@ public enum Affinity
// ── Standard non-basic (two-basic combinations) ───────────────────────
Ocean, // Lake + Lake
Island, // Lake + Hill
- Marsh, // Lake + Forest
- Swamp, // Lake + Field
+ Marsh, // Lake + Field
+ Swamp, // Lake + Forest
Mountain, // Hill + Hill
- Steppe, // Hill + Forest
- Fort, // Hill + Field
- Plains, // Forest + Field
- Grove, // Forest + Forest
- Jungle, // Field + Field
+ Steppe, // Field + Forest
+ Fort, // Hill + forest
+ Plains, // Field + Field
+ Grove, // Field + Forest
+ Jungle, // Forest + Forest
// ── Aether combinations ───────────────────────────────────────────────
UnstableAether, // Aether + any non-Aether (tile-only, cannot appear on cards)
diff --git a/Server/src/SOR.Database/Migrations/Catalog/20260303221500_AddCdnUploadRecords.cs b/Server/src/SOR.Database/Migrations/Catalog/20260303221500_AddCdnUploadRecords.cs
new file mode 100644
index 0000000..79e37de
--- /dev/null
+++ b/Server/src/SOR.Database/Migrations/Catalog/20260303221500_AddCdnUploadRecords.cs
@@ -0,0 +1,60 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace SOR.Database.Migrations.Catalog
+{
+ ///
+ public partial class AddCdnUploadRecords : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "cdn_upload_records",
+ schema: "catalog",
+ columns: table => new
+ {
+ Id = table.Column(type: "uuid", nullable: false),
+ ObjectKey = table.Column(type: "text", nullable: false),
+ Prefix = table.Column(type: "text", nullable: false),
+ PublicUrl = table.Column(type: "text", nullable: false),
+ ContentType = table.Column(type: "text", nullable: true),
+ IsAiGenerated = table.Column(type: "boolean", nullable: false),
+ UploadedAt = table.Column(type: "timestamp with time zone", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_cdn_upload_records", x => x.Id);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_cdn_upload_records_IsAiGenerated",
+ schema: "catalog",
+ table: "cdn_upload_records",
+ column: "IsAiGenerated");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_cdn_upload_records_ObjectKey",
+ schema: "catalog",
+ table: "cdn_upload_records",
+ column: "ObjectKey",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_cdn_upload_records_Prefix",
+ schema: "catalog",
+ table: "cdn_upload_records",
+ column: "Prefix");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "cdn_upload_records",
+ schema: "catalog");
+ }
+ }
+}
diff --git a/Server/src/SOR.Database/Migrations/Catalog/CatalogDbContextModelSnapshot.cs b/Server/src/SOR.Database/Migrations/Catalog/CatalogDbContextModelSnapshot.cs
index 51642a1..bcfdca7 100644
--- a/Server/src/SOR.Database/Migrations/Catalog/CatalogDbContextModelSnapshot.cs
+++ b/Server/src/SOR.Database/Migrations/Catalog/CatalogDbContextModelSnapshot.cs
@@ -244,6 +244,45 @@ namespace SOR.Database.Migrations.Catalog
b.ToTable("card_definitions", "catalog");
});
+ modelBuilder.Entity("SOR.Database.Entities.Catalog.CdnUploadRecord", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ContentType")
+ .HasColumnType("text");
+
+ b.Property("IsAiGenerated")
+ .HasColumnType("boolean");
+
+ b.Property("ObjectKey")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Prefix")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("PublicUrl")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UploadedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IsAiGenerated");
+
+ b.HasIndex("ObjectKey")
+ .IsUnique();
+
+ b.HasIndex("Prefix");
+
+ b.ToTable("cdn_upload_records", "catalog");
+ });
+
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
{
b.Property("Id")
diff --git a/Server/src/SOR.Game/Grid/AffinitySystem.cs b/Server/src/SOR.Game/Grid/AffinitySystem.cs
index 111852e..a58505b 100644
--- a/Server/src/SOR.Game/Grid/AffinitySystem.cs
+++ b/Server/src/SOR.Game/Grid/AffinitySystem.cs
@@ -55,12 +55,12 @@ public static class AffinitySystem
// ── Hill pairings ─────────────────────────────────────────────────
(Affinity.Hill, Affinity.Hill) => Affinity.Mountain,
- (Affinity.Hill, Affinity.Field) or (Affinity.Field, Affinity.Hill) => Affinity.Steppe,
+ (Affinity.Hill, Affinity.Field) or (Affinity.Field, Affinity.Hill) => Affinity.Grove,
(Affinity.Hill, Affinity.Forest) or (Affinity.Forest, Affinity.Hill) => Affinity.Fort,
// ── Field pairings ────────────────────────────────────────────────
(Affinity.Field, Affinity.Field) => Affinity.Plains,
- (Affinity.Field, Affinity.Forest) or (Affinity.Forest, Affinity.Field) => Affinity.Grove,
+ (Affinity.Field, Affinity.Forest) or (Affinity.Forest, Affinity.Field) => Affinity.Steppe,
// ── Forest pairings ───────────────────────────────────────────────
(Affinity.Forest, Affinity.Forest) => Affinity.Jungle,