product-lines apply lands on a catalog with older-schema records; refusal axes pinned; one maker-profile table

ExpectUnchanged compares the file's schema ids with the loaded ones, so master's blob (hulls written before
HullData lost GridOffset) made apply throw and write nothing. The batch now expects only that the keys it authors
are absent and lands onto the file as it is. Tests: older-schema replay, the design and maker match, case-insensitive
name conflict, a row name that is a design's, the dispatch word, and the sold-weapon floor replaced by "only Smoke
designs are unsold". LaunchSuppressorCatalogTests reads Program.MakerProfiles instead of spelling six profiles.

Not built or run yet; the catalog blob is regenerated in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-16 20:50:47 +02:00
commit ceb1a08edb
4 changed files with 98 additions and 13 deletions

View file

@ -112,11 +112,13 @@ public static class ProductLinesCommand
return 0;
}
// ExpectUnchanged lands the batch onto the file as it is: every other record keeps the bytes it has, where a plain
// commit would re-encode the whole catalog through today's types.
// The batch lands onto the file as it is: every other record keeps the bytes it has, where a plain commit would
// re-encode the whole catalog through today's types. What it expects is that each key it authors is still absent, the
// one condition the command's own validation rests on. ExpectUnchanged would compare the file's schema ids with the
// loaded ones and refuse any catalog that holds a record written on an older schema, whatever the batch is.
if (!db.Cache.Commit(batch =>
{
batch.ExpectUnchanged();
foreach (var (row, _, _, _) in missing) batch.Expect(KeyOf(row), null);
foreach (var (row, design, maker, _) in missing)
{
var (mean, dev) = Program.MakerProfiles[row.Maker];