From 859ecad83a26e141419f75a682a600e79a573d89 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 14:39:44 +0200 Subject: [PATCH] verse-grammar apply: the grammar update builds a new record instead of editing the cached one; replace test compares fields The command mutated the cache's own VerseGrammar before the batch upsert, so the upsert was redundant and two Soul mutants (update branch dropped; Same ignoring description or render path) survived: the replace test judged the result with the same Same() the command uses. The test now reads the fields. Unrun until the full job. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/VerseGrammarTests.cs | 5 ++++- tools/AetherDb/VerseGrammarCommand.cs | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs b/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs index 60db6b2e3..ec6af3701 100644 --- a/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs +++ b/tests/Aetheria.Shared.Tests/VerseGrammarTests.cs @@ -278,7 +278,10 @@ public sealed class VerseGrammarTests : IDisposable using var cache = OpenScoped(CatalogOf(root), true); Assert.Equal(1, cache.GetAll().Count(verb => verb.Name == "haul")); - Assert.True(VerseGrammarCommand.Same(starter, cache.GetByName("haul"))); + var landed = cache.GetByName("haul"); + Assert.Equal(starter.Description, landed.Description); + Assert.Equal(VerseRenderPath.ShipAction, landed.RenderPath); + Assert.Equal(new[] { "cargo:Cargo", "destination:Place" }, landed.Roles.Select(r => $"{r.Name}:{r.Binds}")); } // The grammar global is updated in place (one record) when its revision or its description is not the starter's. diff --git a/tools/AetherDb/VerseGrammarCommand.cs b/tools/AetherDb/VerseGrammarCommand.cs index 1a5638b3f..e997b87fe 100644 --- a/tools/AetherDb/VerseGrammarCommand.cs +++ b/tools/AetherDb/VerseGrammarCommand.cs @@ -90,9 +90,7 @@ public static class VerseGrammarCommand { if (!grammarCurrent) { - var record = grammar ?? new VerseGrammar(); - record.Revision = StarterRevision; - record.Description = StarterDescription; + var record = new VerseGrammar { Revision = StarterRevision, Description = StarterDescription }; if (grammar == null) batch.Upsert(typeof(VerseGrammar), record); else batch.Upsert(typeof(VerseGrammar), record, cache.RefOf(grammar).Key); }