Skip to content

feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드#7

Open
1989v wants to merge 2 commits into
mainfrom
worktree-web-game-arcade
Open

feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드#7
1989v wants to merge 2 commits into
mainfrom
worktree-web-game-arcade

Conversation

@1989v

@1989v 1989v commented Jun 30, 2026

Copy link
Copy Markdown
Owner

웹 게임 아케이드 (#23) — 첫 수직 슬라이스 (Snake)

로그인 없이 즐기는 캐주얼 게임을 commerce 모듈러 모놀리스에 폴드. 핵심은 랭킹 무결성: 같은 결정적 코어가 브라우저(플레이)와 서버(Tier B 리플레이 검증)에서 동일 실행되어 점수 위조를 잡는다.

모듈 (5 신규 + commerce:app 폴드)

  • game:sim (KMP jvm+js): 정수 결정적 엔진(mulberry32 PRNG·고정 timestep·SimRunner) + Snake. 같은 코어를 브라우저와 commerce:app JVM 이 공유.
  • game:domain: 도메인 + 포트 + Tier A(ScorePlausibility)·Tier B(ReplayVerifier).
  • game:feature: Redis 전용(세션·리플레이·리더보드 ZSET·플레이어·데일리) + HMAC 토큰 + 제출 오케스트레이션 + REST. commerce:app 폴드(추가 상시 프로세스 0, Tier B in-JVM).
  • game:web (Kotlin/JS): game:sim js 코어 소비 canvas 클라 → game.js 번들.

서빙

  • 게이트웨이 /api/v1/game/** → commerce:8085 (게스트 공개)
  • 클라(game.js+index.html)를 commerce:app static/game/ 패키징 → /game/

검증 (17 테스트 green)

sim 5 · domain 5 · feature 4 · 라이브 E2E 2(testcontainers Redis + 실 HTTP: 정직→CONFIRMED #1, 위조→Tier B REJECTED) · commerce 전체 컨텍스트 로드 1. 실 브라우저 플레이로도 확인(데일리 챌린지 포함).

설계 결정 (PRD #23 대비)

  • 호스팅: 별도 서비스 대신 commerce:app 폴드(리소스 최소화). Redis 전용이라 commerce DB/EMF 미접촉.
  • 무결성 코어 = KMP: 단일 런타임(V8/JVM 정수) 결정성. Tier B 가 commerce JVM 안에서 돌아 추가 프로세스 0.
  • 영속 = Redis 전용(MVP). 내구성 MySQL 은 후속.

잔여 (후속)

실 브라우저 정식 배포 · 2번째 게임 · 내구성 MySQL · 봇 입력타이밍 이상탐지 · FE 분리 배포(ingress).

PRD: ideabank/docs/23-web-game-arcade.md

🤖 Generated with Claude Code

1989v and others added 2 commits June 30, 2026 16:41
- game:sim (KMP jvm+js): 정수 결정적 엔진(mulberry32 PRNG·고정 timestep·SimRunner) + Snake.
  같은 코어를 브라우저(플레이)와 commerce:app JVM(Tier B 리플레이)이 공유.
- game:domain: 백엔드 도메인 + 포트 + Tier A(ScorePlausibility)·Tier B(ReplayVerifier).
- game:feature: Redis 전용 인프라(세션·리플레이·리더보드 ZSET·플레이어·데일리) + HMAC 토큰
  + 제출 오케스트레이션(Tier A→잠정등재→상위N Tier B) + REST. commerce:app 폴드(추가 프로세스 0).
- game:web (Kotlin/JS): game:sim js 코어 소비 canvas Snake 클라 → game.js 번들.
- 빌드: 루트 subprojects{} 에서 KMP 모듈 카브아웃 + 카탈로그 kotlin-multiplatform.
- 검증: 15 테스트(sim 5·domain 5·feature 4·commerce 컨텍스트 로드 1) green.

영속은 MVP Redis 전용(내구성 MySQL 후속). ADR-0058 commerce:app 폴드.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 게이트웨이: /api/v1/game/** → commerce:8085 (게스트 공개, app-level 닉네임 게이트)
- 정적 서빙: game:web 번들(game.js + index.html)을 commerce:app static/game/ 으로 패키징 → /game/ 서빙
- 라이브 E2E(game:feature): testcontainers Redis + 임베디드 Tomcat + JDK HttpClient
  · 세션 시작→결정적 플레이→제출→Tier A→Redis ZSET 리더보드→in-JVM Tier B 리플레이→CONFIRMED #1
  · 같은 리플레이 점수 위조 → Tier B REJECTED  (tests=2 green)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@1989v 1989v force-pushed the worktree-web-game-arcade branch from e934ec1 to 21864fa Compare June 30, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant