fix: Ref 게임 로직과 시나리오 풀 호환을 보정

월 경계, 전투 기술 상한, 연감과 베팅·설문·경매 정산 순서를 Ref 계약에 맞춘다.\n\n시나리오 일반 풀을 ENGINE mutation과 logical tick 기반으로 직렬화하고 914·915 catalog 및 조건부 100기 pool 실행 경계를 추가한다.\n\n경매 worker는 세대별 durable event만 만들고 ENGINE이 row lock 후 상태 전이와 정산을 단일 transaction으로 소유한다.
This commit is contained in:
2026-08-23 16:26:14 +00:00
parent bf6b7be7b0
commit 85591c68ad
114 changed files with 13327 additions and 901 deletions
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import { LEGACY_RANK_DATA_TYPES } from '@sammo-ts/common';
import type { TurnSchedule } from '@sammo-ts/logic';
import { finalizeLogEntry, type TurnSchedule } from '@sammo-ts/logic';
import { rankMetaKey } from '../src/turn/rankData.js';
import type { TurnGeneral, TurnWorldSnapshot, TurnWorldState } from '../src/turn/types.js';
@@ -159,7 +159,7 @@ const makeState = (meta: Record<string, unknown> = {}): TurnWorldState => ({
});
describe('legacy general turn lifecycle', () => {
it('timestamps action logs with the executing general turn instead of the shared flush cursor', async () => {
it('timestamps action logs with the executing turn before the same run advances the month', async () => {
const flushCursor = new Date('0200-01-01T00:35:00.000Z');
const generalTurnTime = new Date('0200-01-01T00:37:43.000Z');
const harness = await createTurnTestHarness({
@@ -175,7 +175,28 @@ describe('legacy general turn lifecycle', () => {
const actionLog = harness.world
.peekDirtyState()
.logs.find((log) => log.text.includes('아무것도 실행하지 않았습니다.'));
expect(actionLog?.occurredAt).toEqual(generalTurnTime);
expect(harness.world.getState()).toMatchObject({ currentYear: 200, currentMonth: 2 });
expect(actionLog).toMatchObject({
year: 200,
month: 1,
occurredAt: generalTurnTime,
});
if (!actionLog) {
throw new Error('expected the rest action log');
}
const finalState = harness.world.getState();
expect(
finalizeLogEntry(actionLog, {
year: finalState.currentYear,
month: finalState.currentMonth,
at: finalState.lastTurnTime,
})
).toMatchObject({
year: 200,
month: 1,
text: '<C>●</>1월:아무것도 실행하지 않았습니다.',
createdAt: generalTurnTime,
});
});
it('emits legacy plain logs when command gains cross experience and dedication levels', async () => {