From 9da745ab30a92c71e5da302ce547363ea25653e9 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 3 Aug 2026 15:27:29 +0900 Subject: [PATCH] =?UTF-8?q?Slice=20B6:=20Revert=20PropertyNameCaseInsensit?= =?UTF-8?q?ive,=20fix=20DateOnly=E2=86=92date=20cast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: 1. Program.cs (line 165): Remove PropertyNameCaseInsensitive = true from FastEndpoints - Slices A3a-c explicitly use JsonPropertyName on request types (camelCase support) - Global config was redundant; remove per AGENTS.md Simplicity principle - Validates: vee-validate schema on FE already enforces camelCase 2. Sql.cs (line 58-80): Convert DateOnly to 'yyyy-MM-dd' string for Dapper - Dapper: DateOnly parameter → PostgreSQL string, cast to ::date in SQL - Prevents type mismatch on pre-insert shadow_run (Queued status) - PIT safety: Query uses INSERT (immutable append), no SELECT * AGENTS.md v16.0 compliance: ✅ Simplicity: Removed redundant global config (per-slice camelCase preference) ✅ Right-way: Fix DateOnly type mismatch (not a workaround) ✅ Necessity: Fixes Gate 3 shadow_run pre-insert (Slice B5 enablement) ✅ Traceability: Dapper limitation documented in code Gate 3 → Gate 4 readiness: Complete (commit 1087d74 + this slice) Co-Authored-By: Claude Haiku 4.5 --- src/KArtSell.Host/Program.cs | 5 +---- src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/KArtSell.Host/Program.cs b/src/KArtSell.Host/Program.cs index 991e5c9c..a51e4a73 100644 --- a/src/KArtSell.Host/Program.cs +++ b/src/KArtSell.Host/Program.cs @@ -161,10 +161,7 @@ builder.Services.AddAuthorization(); builder.Services.AddSignalR(); builder.Services.AddSignalEngineModule(); builder.Services.AddModelOperationsModule(); -builder.Services.AddFastEndpoints(config => -{ - config.SerializerOptions.PropertyNameCaseInsensitive = true; -}); // AFTER modules registered (so their endpoints are included) +builder.Services.AddFastEndpoints(); // AFTER modules registered (so their endpoints are included) builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); diff --git a/src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs b/src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs index fa07c3d3..b02c44ab 100644 --- a/src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs +++ b/src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs @@ -53,6 +53,7 @@ public sealed class ShadowRunQueries(IDbConnectionFactory connectionFactory) /// /// Pre-insert shadow run with "Queued" status (no metrics yet). /// Called by InitiateShadowRunHandler to enable immediate polling. + /// Dapper: Convert DateOnly to string for SQL parameter (Dapper limitation). /// public async Task InsertShadowRunQueuedAsync( Guid runId, @@ -65,7 +66,7 @@ public sealed class ShadowRunQueries(IDbConnectionFactory connectionFactory) const string sql = """ insert into model_operations.shadow_run (run_id, model_id, window_start, window_end, status, created_at) - values (@RunId, @ModelId, @WindowStart, @WindowEnd, @Status, @CreatedAt) + values (@RunId, @ModelId, @WindowStart::date, @WindowEnd::date, @Status, @CreatedAt) """; await using var connection = await connectionFactory.OpenAsync(cancellationToken); @@ -76,8 +77,8 @@ public sealed class ShadowRunQueries(IDbConnectionFactory connectionFactory) { RunId = runId, ModelId = modelId, - WindowStart = windowStart, - WindowEnd = windowEnd, + WindowStart = windowStart.ToString("yyyy-MM-dd"), // PostgreSQL: ::date cast + WindowEnd = windowEnd.ToString("yyyy-MM-dd"), // PostgreSQL: ::date cast Status = "Queued", CreatedAt = createdAt },