Skip to content

feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드 + 서브도메인 접근#7

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

feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드 + 서브도메인 접근#7
1989v wants to merge 3 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 리플레이 검증)에서 동일 실행되어 점수 위조를 잡는다.

최신 main(round 2 폴드: member/wishlist) 위로 리베이스됨 — commerce:app 은 이제 6도메인+game.

커밋 구성 (3)

  1. KMP 결정적 코어 + commerce:app 폴드game:sim(KMP jvm+js: 정수 PRNG·고정 timestep·SimRunner + Snake) / game:domain(Tier A ScorePlausibility·Tier B ReplayVerifier) / game:feature(Redis 전용: 리더보드 ZSET·세션·리플레이·HMAC 토큰 + 제출 오케스트레이션 + REST) / game:web(Kotlin/JS canvas 클라)
  2. 서빙 배선 + 라이브 E2E — gateway /api/v1/game/** 라우트, 클라 번들을 commerce static/game/ 패키징, testcontainers Redis + 실 HTTP E2E(정직→CONFIRMED docs(adr): ADR-0025 Latency Budget 표준 + 12번 학습 노트 #1, 위조→Tier B REJECTED)
  3. 서브도메인 접근game.<domain> host 라우팅 (아래)

서브도메인 설계 (netpol 무변경)

game.<DOMAIN> ── ingress(/ → gateway 단일 rule, api host 와 동일 형태)
                   └ gateway
                       ├ /api/**  → 표준 path 라우트 (인증 포함 — game host 로 우회 불가)
                       └ 정적 allowlist(/, /index.html, /*.js, /assets/**)
                            → game-client Host("game.**") 라우트 → prefixPath(/game) → commerce
  • ingress-nginx→gateway→commerce 경로 = 기존 netpol 02/03 재사용 (commerce 직행 없음, default-deny 유지)
  • /game·/game/ welcome forward → index.html (디렉토리 500 해소 + 서브도메인 루트 서빙)
  • oci-arm: commerce-proxiedgame.__DOMAIN__ host+TLS 추가 · k3s-lite: game.127.0.0.1.nip.io 로컬 ingress (oci-arm 상속 시 $patch: delete)
  • 신규 FE 디플로이 없음 — 클라는 commerce jar 번들 그대로

검증

  • 게임 테스트 16 green: sim 5(결정성) · domain 5(Tier A/B) · feature 6(오케스트레이션 + 라이브 E2E 2)
  • commerce 전체 컨텍스트 로드 green (6도메인+game, gameWebConfig 포함) — round 2 리베이스 정합 확인
  • kustomize 렌더: oci-arm 에 game.__DOMAIN__ 반영 + 로컬 ingress 정확히 제외, k3s-lite 에 로컬 host 존재
  • :commerce:app:bootJar 정상(main 의 jar 고유화 fix 반영), 실 브라우저 플레이 확인(데일리 챌린지 포함)

배포 시 체크리스트 (oci-arm)

① Cloudflare DNS A game → OCI IP (proxied) ② cf-origin-ca-tls*.<DOMAIN> wildcard 인지 확인 ③ game.security.hmac-secret env 주입 ④ Argo CD sync

잔여 (후속)

2번째 게임 · 내구성 MySQL · 봇 입력타이밍 이상탐지 · FE 분리 배포 리팩터

PRD: ideabank/docs/23-web-game-arcade.md · 서비스 문서: game/CLAUDE.md

🤖 Generated with Claude Code

@1989v 1989v force-pushed the worktree-web-game-arcade branch from e934ec1 to 21864fa Compare June 30, 2026 07:43
1989v and others added 3 commits July 4, 2026 18:15
- 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) <[email protected]>
- 게이트웨이: /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) <[email protected]>
… 무변경)

- gateway: game-client Host("game.**") 라우트 — 정적 엔트리 allowlist 만
  prefixPath(/game) 로 commerce 프록시. /api/** 는 표준 path 라우트(인증 포함)
  그대로 → game host 로 타 도메인 API 인증 우회 불가.
- game:feature: /game, /game/ welcome forward → index.html (디렉토리 500 해소,
  서브도메인 루트 서빙 담당). 컨텍스트 스펙에 gameWebConfig assertion 추가.
- oci-arm: commerce-proxied 에 game.__DOMAIN__ host + TLS 추가 (api host 와
  동일한 전체→gateway 형태). ingress-nginx→gateway→commerce 경로라 netpol
  02/03 재사용, 신규 정책 없음.
- k3s-lite: game.127.0.0.1.nip.io 로컬 서브도메인 ingress (oci-arm 상속 시
  $patch: delete 로 제외 — 기존 frontend/gateway delete 패턴 준수).
- game/CLAUDE.md: 모듈/커맨드/접근(서브도메인 3경로)/결정성 불변식 문서화.

검증: kustomize 렌더 2종(oci-arm 에 game host 2ref + 로컬 ingress 0ref),
gateway compileKotlin, 게임 테스트 16 green, commerce 컨텍스트 로드(6도메인
+game, gameWebConfig 포함) green.

Co-Authored-By: Claude Fable 5 <[email protected]>
@1989v 1989v force-pushed the worktree-web-game-arcade branch from 21864fa to dd1e050 Compare July 5, 2026 05:51
@1989v 1989v changed the title feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드 feat(game): 웹 게임 아케이드 #23 — KMP 결정적 코어 + commerce:app 폴드 + 서브도메인 접근 Jul 5, 2026
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