fix: 특수 유저 커맨드의 Ref 호환 경계를 보강한다

수뇌 국가 설정과 NPC 정책을 actor-bound ENGINE mutation으로 옮기고, 추방·등용·점령·멸망·아이템 폐기의 특수 분기를 Ref와 맞춘다.

요청 ID를 사용자·프로필별로 격리하고 토너먼트 손상 projection을 fail-closed하며 실제 DB 및 Ref 차등 회귀를 보강한다.
This commit is contained in:
2026-08-24 12:10:57 +00:00
parent 5389f8ed94
commit 630bc29100
74 changed files with 3893 additions and 1141 deletions
@@ -9,6 +9,11 @@ const readNumber = (value: unknown): number => {
const readTextArray = (value: unknown): string[] =>
Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === 'string') : [];
const readArchiveText = (values: readonly unknown[], fallback: string | null): string | null => {
const value = values.find((candidate) => candidate !== undefined && candidate !== null);
return value === undefined ? fallback : String(value);
};
export const buildOldNationArchiveData = (options: {
nation: Nation;
generalIds: readonly number[];
@@ -22,6 +27,7 @@ export const buildOldNationArchiveData = (options: {
...maxPower,
};
const maxCities = readTextArray(maxPower.maxCities);
const nationNotice = asRecord(meta.nationNotice);
return {
...nation,
@@ -34,5 +40,7 @@ export const buildOldNationArchiveData = (options: {
aux,
generals: [...options.generalIds],
history: [...options.history],
msg: readArchiveText([meta.notice, nationNotice.msg, meta.msg], ''),
scout_msg: readArchiveText([meta.infoText, meta.scout_msg], null),
};
};