refactor(logic): 과도한 수치 호환 보정을 제거한다

Core 수치 상태는 JavaScript와 PostgreSQL의 자연 정밀도를 유지한다. 정수 상태 경계와 절삭, 수입 배분 및 사망자 분할 순서는 보존한다.
This commit is contained in:
2026-08-24 19:17:06 +00:00
parent fc9fa0c9a6
commit 60dcf815ea
32 changed files with 148 additions and 522 deletions
@@ -1,12 +1,10 @@
import { GameClock, LiteHashDRBG, RandUtil, type RNG } from '@sammo-ts/common';
import { readLegacyStoredFloat } from '@sammo-ts/logic/compat/legacyFloat.js';
import {
GENERAL_TURN_COMMAND_KEYS,
isSelectableGeneralTurnCommandKey,
LogFormat,
NATION_TURN_COMMAND_KEYS,
normalizeScenarioEffect,
readLegacyCityTrust,
sendMessage,
type MapDefinition,
type MessageDraft,
@@ -928,10 +926,7 @@ const projectWorld = (
conflict: city.conflict ?? {},
state: city.state,
term: readNumber(city.meta, 'term'),
// The reference snapshot observes MariaDB FLOAT through its text
// protocol. Project the in-memory binary32 value at that same
// read boundary before comparing state deltas.
trust: readLegacyCityTrust(readNumber(city.meta, 'trust')),
trust: readNumber(city.meta, 'trust'),
trade: readNumber(city.meta, 'trade'),
officerSet: readNumber(city.meta, 'officer_set'),
})),
@@ -944,7 +939,7 @@ const projectWorld = (
capitalCityId: nation.capitalCityId,
gold: toDatabaseInt(nation.gold),
rice: toDatabaseInt(nation.rice),
tech: readLegacyStoredFloat(readNumber(nation.meta, 'tech')),
tech: readNumber(nation.meta, 'tech'),
level: nation.level,
typeCode: nation.typeCode,
generalCount: readNumber(