test live sortie full log parity

This commit is contained in:
2026-07-26 13:13:15 +00:00
parent 6dec59430a
commit 6d642bb759
4 changed files with 50 additions and 7 deletions
@@ -7,6 +7,7 @@ export interface TurnSnapshotSelector {
logAfterId?: number;
messageAfterId?: number;
includeNationHistoryLogs?: boolean;
includeGlobalHistoryLogs?: boolean;
}
export interface CanonicalTurnSnapshot {
@@ -24,6 +25,7 @@ export interface CanonicalTurnSnapshot {
messages: Array<Record<string, unknown>>;
watermarks: {
logId: number;
historyLogId: number;
messageId: number;
};
}
@@ -259,6 +261,7 @@ export const projectCoreDatabaseSnapshot = (rows: {
messages: [],
watermarks: {
logId: logs.reduce((max, row) => Math.max(max, Number(row.id) || 0), 0),
historyLogId: logs.reduce((max, row) => Math.max(max, Number(row.id) || 0), 0),
messageId: 0,
},
};
@@ -68,6 +68,7 @@ export interface TurnCommandFixtureRequest {
logAfterId?: number;
messageAfterId?: number;
includeNationHistoryLogs?: boolean;
includeGlobalHistoryLogs?: boolean;
generalCooldowns?: GeneralCooldownSelector[];
nationCooldowns?: NationCooldownSelector[];
diplomacyPairs?: Array<{ fromNationId: number; toNationId: number }>;
@@ -469,7 +470,7 @@ const buildWorldInput = (
lastTurnTime: turnTime,
meta: {
hiddenSeed: request.setup?.world?.hiddenSeed ?? 'turn-command-differential-seed',
killturn: 24,
killturn: readNumber(referenceBefore.world, 'killTurn', 24),
isUnited: readNumber(referenceBefore.world, 'isUnited'),
scenarioId: readNumber(referenceBefore.world, 'scenarioId'),
initYear: readNumber(
@@ -661,7 +662,7 @@ const projectWorld = (
),
logs,
messages,
watermarks: { logId: logs.length, messageId: messages.length },
watermarks: { logId: logs.length, historyLogId: logs.length, messageId: messages.length },
};
};
@@ -785,8 +786,8 @@ export const runCoreTurnCommandTrace = async (
id: index + 1,
scope: log.scope,
category: log.category,
generalId: log.generalId ?? actor.id,
nationId: log.nationId ?? actor.nationId,
generalId: log.generalId ?? (log.scope === 'GENERAL' ? actor.id : undefined),
nationId: log.nationId ?? (log.scope === 'NATION' ? actor.nationId : undefined),
year: state.currentYear,
month: state.currentMonth,
text: log.text,