fix: 통일 완료 뒤 턴 실행을 중단

Ref처럼 isunited 2/3에서 예약 스케줄을 멈추고 processor 직접 호출도 no-op 처리한다. 이미 기본값으로 내려간 종료 게임의 refreshLimit만 식별해 복구하는 마이그레이션과 회귀 테스트를 추가한다.
This commit is contained in:
2026-08-20 06:13:28 +00:00
parent 107b433d85
commit 92ad49db45
9 changed files with 83 additions and 2 deletions
@@ -152,6 +152,12 @@ export class TurnDaemonLifecycle {
this.status.state = 'idle';
}
if ((await this.stateStore.shouldHaltScheduledRuns?.()) ?? false) {
this.status.nextTurnTime = undefined;
await this.clock.sleepMs(500);
continue;
}
if (this.pendingRun) {
await this.runOnce(this.pendingRun);
this.pendingRun = null;
+1
View File
@@ -52,6 +52,7 @@ export interface TurnStateStore {
saveLastTurnTime(turnTime: Date): Promise<void>;
loadCheckpoint(): Promise<TurnCheckpoint | undefined>;
saveCheckpoint(checkpoint?: TurnCheckpoint): Promise<void>;
shouldHaltScheduledRuns?(): Promise<boolean>;
loadGameClock?(wallNow?: Date): Promise<{ mode: GameClockMode; now: Date }>;
advanceGameClockTo?(target: Date, wallNow: Date): Promise<void>;
}