범인찾기 C4: 기록 점수 (OP.GG OP스코어 방식) + LOL.PS 라인전

- packages/shared/src/rating.ts: 발로란트(라운드 승률 · KAST · ACS · 피해 격차) · 롤(킬 관여 · 데스 · 딜/받은 피해/골드 비중 · CS · 레벨 · CC · 와드) 0~10 점수, 경기/팀 순위, MVP · ACE, 점수를 올리고 깎은 지표, 롤 15분 맞라인 비교
- 계수: OP.GG 공식 MCP 로 받은 실제 경기의 OP스코어에 맞춤 (tools/opscore-fit). 교차 검증 발로란트 상관 0.968 · 오차 0.49, 롤 상관 0.943 · 오차 0.60 · 팀 최하위 일치 85%
- 발로란트 경기 상세에 KAST 라운드 수(5초 트레이드) · 받은 피해 저장
- AI 자료에 '# 기록 점수' 칸, 참가자 줄에 KAST · 피해 격차, OP.GG 에서 경기를 찾을 정보(lookup), 참가자에 태그 · 기록 점수

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-15 15:29:59 +09:00
parent 685e6a7ebe
commit f8916829e1
21 changed files with 2053 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
import type { PlayerRating } from './rating.js';
// 앱 코어 · 사이트 서버 · 사이트 프런트엔드가 같이 쓰는 타입. docs/dev/ARCHITECTURE.md 4~6장.
export type GameType = 'valorant' | 'lol';
@@ -164,8 +166,11 @@ export interface PlayerStats {
plants?: number;
defuses?: number;
abilityCasts?: number;
// 롤
/** 발로란트: KAST(킬 · 어시 · 생존 · 트레이드)를 한 라운드 수 (v1.3~) */
kastRounds?: number;
/** 롤 · 발로란트(v1.3~): 받은 피해 */
damageTaken?: number;
// 롤
vision?: number;
wardsPlaced?: number;
wardsKilled?: number;
@@ -234,6 +239,12 @@ export interface CulpritPlayer {
userId: string | null;
/** 이 경기 음성 대화가 있는지 */
voice: boolean;
/** Riot ID 태그 (OP.GG 에서 경기를 찾을 때, v1.3~) */
tag?: string;
/** 기록 점수: OP.GG OP스코어 방식으로 우리 기록에서 계산 (v1.3~) */
rating?: PlayerRating;
/** OP.GG 에 이 경기가 있으면 그 사이트의 실제 OP스코어 (사이트 서버가 분석할 때 붙인다) */
opgg?: { score: number; rank: number | null };
}
/** 근거 번호가 가리키는 것 (사이트에서 누르면 그 순간으로 이동) */
export type CulpritRefTarget =
@@ -248,6 +259,8 @@ export interface CulpritInput {
refs: Record<string, CulpritRefTarget>;
players: CulpritPlayer[];
stats: { utterances: number; utterancesTotal: number; events: number; chats: number; rounds: number; basic: boolean };
/** OP.GG 에서 같은 경기를 찾을 정보 (v1.3~). riotMatchId = 발로란트 경기 UUID · 롤 gameId */
lookup?: { riotMatchId: string | null; startedAt: number; endedAt: number; durationSec: number };
}
export interface CulpritEvidence {
ref: string;
@@ -277,6 +290,8 @@ export interface CulpritAnalysis {
usage?: { input: number; output: number; cacheRead?: number; cacheWrite?: number };
inputStats?: CulpritInput['stats'];
fallback?: boolean;
/** OP.GG 실제 점수를 찾았는지 · 못 찾은 이유 */
opgg?: { found: boolean; note?: string };
};
}
export interface CulpritMatchItem {