Merge branch 'night/engine/preview-pool' into night/engine/v1-1

This commit is contained in:
2026-11-17 00:11:53 -05:00
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ export const RulesetSchema = z.object({
vanillaBonus: int(0, 10),
keywordsEnabled: z.array(z.enum(KEYWORD_IDS)).max(KEYWORD_IDS.length),
ownedCards: z.boolean(),
cultureKeyword: z.enum(['faction', 'home']),
cultureKeyword: z.enum(['faction', 'home']).default('faction'), // default keeps pre-v1.1 stored rulesets parseable
trendUp: z.number().finite().min(-1000).max(1000),
trendDown: z.number().finite().min(-1000).max(1000),
trendMinDaily: z.number().finite().min(0).max(1e9),
+8
View File
@@ -162,3 +162,11 @@ test('a full Ruleset works as DerivationRules (hosts can derive with the mode ru
const b = deriveCard(input({ attention: 81, depth: 71, reach: 61 }), TABLE);
assert.deepEqual(a, b, 'default derivation rules are DEFAULT_RULESET');
});
test('parseRuleset accepts a stored pre-v1.1 ruleset without cultureKeyword (defaults to faction)', async () => {
const { parseRuleset, RULESET_V1_0 } = await import('../shared/game/index.ts');
const { cultureKeyword: _omit, ...old } = structuredClone(RULESET_V1_0);
const parsed = parseRuleset(old);
assert.equal(parsed.cultureKeyword, 'faction');
assert.deepEqual(parsed, RULESET_V1_0);
});