사건 파일: 새 사건 10개(후보 30개 중 점수로 고름)로 사건 13개, 방 설정은 난이도별 고르기 상자 + 한 줄 소개
- 후보 30개와 점수표·고른 까닭(docs/games/case-file-candidates.md), 사건 쓰는 법(case-file-writing-guide.md). 예스노 탐정·퀴즈 사립탐정·바다거북 수프에서 이상한 첫 장면, 퀴즈 한 방, 관점 바꾸기, 억지 금지(결정적 단서 두 겹)를 빌림 - 새 사건 c4~c13: 사진 속 그 문 앞 / 장날이 아닌 날 / 반짝이는 것만 사라진 집 (쉬움), 여름밤의 오리온 / 돌아온 두부 / 웬지 익숙한 시 / 건반 하나가 빠진 녹턴 (보통), 눈 그친 뒤의 발자국 / 틀린 답을 맞힌 우승자 / 시계방에서 사라진 7분 (어려움) - 사건마다 checks/<id>.ts(빠듯한 길·점검표)와 데이터에서 만든 설계 문서(case-file-cases/<id>.md, bun scripts/case-file-doc.ts). cases.test.ts가 새 사건 기준·빠듯한 길·문서 일치를 검사 - 정답 모르는 검토자 풀이(빠듯한 길만 / 전체)로 모순·다른 답·이른 노출을 찾아 고침 - CASE_IDS 13개, random은 13개 중 하나, 사건별 무작위 판 테스트, e2e에서 사건 고르기 상자 확인 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
import { SeededRng, checkNoLeak, playoutSeeds, randomPlayout, seedN, type PlayerId } from '@bg/engine';
|
||||
import { CASES } from './cases';
|
||||
import { BRIEFING_MS, caseFile, type CaseFileAction, type CaseFileOptions, type CaseFileState } from './index';
|
||||
import { BRIEFING_MS, CASE_IDS, caseFile, type CaseFileAction, type CaseFileOptions, type CaseFileState } from './index';
|
||||
|
||||
const T0 = 1_000_000;
|
||||
const rng = SeededRng.fromSeed([9, 9, 9, 9]);
|
||||
@@ -37,10 +37,10 @@ const text = (id: string) => CASES.c1.leads.find((l) => l.id === id)!.text;
|
||||
const c1 = CASES.c1;
|
||||
|
||||
describe('준비와 의뢰', () => {
|
||||
test('사건 고르기: random은 시드 난수로 셋 중 하나, 의뢰 단계는 모두 누르거나 60초 뒤 시작', () => {
|
||||
test('사건 고르기: random은 시드 난수로 모든 사건 중 하나, 의뢰 단계는 모두 누르거나 60초 뒤 시작', () => {
|
||||
const seen = new Set<string>();
|
||||
for (let i = 1; i <= 30; i++) seen.add(caseFile.setup({ players: ['A'], options: opts({ caseId: 'random' }), rng: SeededRng.fromSeed(seedN(i)), now: T0 }).caseId);
|
||||
expect([...seen].sort()).toEqual(['c1', 'c2', 'c3']);
|
||||
for (let i = 1; i <= 300; i++) seen.add(caseFile.setup({ players: ['A'], options: opts({ caseId: 'random' }), rng: SeededRng.fromSeed(seedN(i)), now: T0 }).caseId);
|
||||
expect([...seen].sort()).toEqual([...CASE_IDS].sort());
|
||||
let s = rig(2, {}, false);
|
||||
expect(s.phase).toBe('briefing');
|
||||
expect(s.deadlineAt).toBe(T0 + BRIEFING_MS);
|
||||
@@ -456,6 +456,15 @@ describe('무작위 판', () => {
|
||||
}
|
||||
}, 60_000);
|
||||
|
||||
test('사건마다(13개) 무작위 판이 예외·유출 없이 끝까지 가요', () => {
|
||||
for (const [ci, caseId] of CASE_IDS.entries()) {
|
||||
for (const n of [1, 3]) {
|
||||
const r = randomPlayout(caseFile, { players: ids(n), options: opts({ caseId, readMode: n > 1 ? 'reader' : 'all' }), seed: seedN(ci * 11 + n), maxSteps: 4000, maxApplyMs: 20 });
|
||||
expect(r.finished).toBe(true);
|
||||
}
|
||||
}
|
||||
}, 60_000);
|
||||
|
||||
test('결정성: 같은 시드·같은 행동이면 같은 상태', () => {
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
const a = randomPlayout(caseFile, { players: ids(3), options: opts({ caseId: 'random', decision: 'vote' }), seed: seedN(i), maxSteps: 4000, maxApplyMs: 20 });
|
||||
|
||||
Reference in New Issue
Block a user