refactor(cb): 컨트롤러 횡단 관심사 모듈 분리 (이동·본문 무변경)
화면 전환·NPC·포지션 관심사를 state.mjs/render.mjs/runend.mjs에서 전용 모듈로 분리. 런타임은 단일 SlayDeckController codeblock 유지. - state.mjs → screens.mjs 개명 (화면 라우팅·버튼 바인딩) - npc.mjs 신규: OnLobbyNpcInteract - navigation.mjs 신규: GoLobbyMap·TeleportToActMap (월드 텔레포트) - layout.mjs 신규: PositionMonsterSlot (UI 슬롯 배치) - gen-slaydeck.mjs import·spread 갱신 검증: tools/verify/cbset.mjs (순서 무관 집합 비교) = 189/189 무손실, 본문/exec/params 변경 0. cbgap GAP 0, 테스트 93/93. 산출물 재생성(SlayDeckController.codeblock) 포함 — 메서드 순서만 바뀜. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
40
tools/verify/cbset.mjs
Normal file
40
tools/verify/cbset.mjs
Normal file
@@ -0,0 +1,40 @@
|
||||
// 순서 무관 codeblock 메서드 집합 비교. 본문 미출력 — 이름·차이 카운트만.
|
||||
// 메서드 이동 리팩터의 무손실 검증용: 워킹트리 codeblock vs ref(기본 HEAD).
|
||||
// 사용: node tools/verify/cbset.mjs [ref]
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const PATH = 'RootDesk/MyDesk/SlayDeckController.codeblock';
|
||||
const ref = process.argv[2] || 'HEAD';
|
||||
|
||||
function methodsOf(jsonText) {
|
||||
const obj = JSON.parse(jsonText);
|
||||
const arr = obj.ContentProto.Json.Methods;
|
||||
const map = new Map();
|
||||
for (const m of arr) {
|
||||
map.set(m.Name, { code: m.Code, exec: m.ExecSpace, params: JSON.stringify(m.Parameters || []) });
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
const work = methodsOf(readFileSync(PATH, 'utf8'));
|
||||
const base = methodsOf(execSync(`git show ${ref}:${PATH}`, { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 }));
|
||||
|
||||
const onlyWork = [...work.keys()].filter((k) => !base.has(k));
|
||||
const onlyBase = [...base.keys()].filter((k) => !work.has(k));
|
||||
const changed = [];
|
||||
for (const k of work.keys()) {
|
||||
if (!base.has(k)) continue;
|
||||
const a = work.get(k);
|
||||
const b = base.get(k);
|
||||
if (a.code !== b.code || a.exec !== b.exec || a.params !== b.params) changed.push(k);
|
||||
}
|
||||
|
||||
console.log(`ref=${ref} work=${work.size} base=${base.size}`);
|
||||
console.log(`only-in-work (${onlyWork.length}): ${onlyWork.join(', ') || '-'}`);
|
||||
console.log(`only-in-base (${onlyBase.length}): ${onlyBase.join(', ') || '-'}`);
|
||||
console.log(`body/exec/params changed (${changed.length}): ${changed.join(', ') || '-'}`);
|
||||
|
||||
const ok = onlyWork.length === 0 && onlyBase.length === 0 && changed.length === 0;
|
||||
console.log(ok ? 'RESULT: IDENTICAL SET (무손실)' : 'RESULT: DIFFERENCES ABOVE');
|
||||
process.exit(ok ? 0 : 1);
|
||||
Reference in New Issue
Block a user