feat: 게임 시계 reconciliation 권위 기반 추가

This commit is contained in:
2026-09-03 08:44:43 +00:00
parent b91dcbcaaa
commit ae7d55ef47
29 changed files with 1265 additions and 81 deletions
@@ -8,6 +8,8 @@ interface TryLockRow {
/** Serializes score/traffic writers whose table lock order otherwise differs by entry point. */
export const GENERAL_ACCESS_PERSISTENCE_LOCK = 'general-access:persistence';
/** Serializes phase/revision changes with every gameplay flush in one game schema. */
export const CLOCK_OPERATION_PERSISTENCE_LOCK = 'game-clock:operation';
const lockKeySql = (logicalKey: string): GamePrisma.Sql =>
GamePrisma.sql`hashtextextended(current_schema() || chr(31) || ${logicalKey}, 0)`;
+9
View File
@@ -16,6 +16,9 @@ export interface TurnEngineWorldStateRow {
clockMode: string;
clockWallAnchor: Date | null;
lastTurnTick: bigint | null;
clockPhase: string;
clockRevision: bigint;
deadlineGeneration: bigint;
config: JsonValue;
meta: JsonValue;
updatedAt?: Date | null;
@@ -181,6 +184,9 @@ export interface TurnEngineWorldStateUpdateInput {
clockMode: string;
clockWallAnchor: Date;
lastTurnTick: bigint;
clockPhase: string;
clockRevision: bigint;
deadlineGeneration: bigint;
config: InputJsonValue;
meta: InputJsonValue;
}
@@ -195,6 +201,9 @@ export interface TurnEngineWorldStateCreateInput {
clockMode: string;
clockWallAnchor: Date;
lastTurnTick: bigint;
clockPhase: string;
clockRevision: bigint;
deadlineGeneration: bigint;
config: InputJsonValue;
meta: InputJsonValue;
}