fix(worker): 상호를 브리프 고정값에서 먼저 읽는다 · 뷰·원진·오라클 고정값 추가

재빌드 검증 중에 홈 제목 추정이 슬로건을 상호로 삼는 것을 발견했다.
뷰는 '안전을 최우선하는 뷰성형외과', 원진은 '당신만 봅니다'가 상호가 됐다.
원진은 그 이름으로 네이버 지역검색을 해 주변 안내 기준 좌표까지 실패했다.

data 단계가 briefs/<clinic>/clinic.json 의 factSheet 상호를 --name 과 홈 제목 추정보다
먼저 읽게 했다. 상호를 쓰는 뒤 단계(discover·news·tourism)까지 올바른 값이 간다.
inputs 단계의 고정값 덮어쓰기만으로는 그 단계들이 이미 틀린 이름으로 돈 뒤였다.

브리프 고정값: 뷰(name·shortName·kind·areaLabel·founded·urlEn),
원진(name·shortName·kind), 오라클(name·shortName 추가).
근거를 확인하지 못한 값은 비워 두었다.

재빌드 결과(미배포): 세 사이트 모두 제목이 기존 배포본과 일치하고 잃은 경로가 없다.
뷰는 /plan·/en/plan·/stay·/en/stay·/en 5개, 원진·오라클은 /en 이 새로 생겼다.
원진 주변 안내 수집도 좌표를 다시 잡아 국문 123곳·영문 99곳으로 성공했다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 5 committed 2026-09-12 15:55:31 +09:00
1 parent 82aa56fa40
commit 4354d7fa6c
4 files changed
+30 -6

No files matched your search

+6 -2
View File
@@ -125,8 +125,12 @@ await phase('data', () => {
const fact = readJson(join(DATA, 'factSheet.json'));
const draft = existsSync(join(EV, 'facts.draft.json')) ? readJson(join(EV, 'facts.draft.json')).candidates ?? {} : {};
const first = (k) => Object.keys(draft[k] ?? {})[0] ?? '';
const name = opt('name') || (readJson(join(EV, 'index.json')).pages.find((p) => p.type === 'home')?.title ?? '').replace(/\s*[|·-].*$/, '').trim();
Object.assign(fact, { name: name || fact.name, shortName: name || fact.shortName, url: url.replace(/\/$/, ''), phone: first('phone').replace(/\./g, '-'), representative: /^[가-힣]{2,4}$/.test(first('representative')) ? first('representative') : '', businessNo: first('businessNo'), checkedAt: today, nextCheck: new Date(Date.now() + 30 * 864e5).toISOString().slice(0, 10) });
// 상호: 사람이 확정한 고정값(briefs/<clinic>/clinic.json 의 factSheet) > --name > 홈 제목 추정.
// 홈 제목 추정은 슬로건이 붙은 제목을 그대로 상호로 삼는다("안전을 최우선하는 뷰성형외과").
// 고정값을 여기서 먼저 읽어야 상호를 쓰는 뒤 단계(discover·news)까지 올바른 값이 간다.
const pinFact = (() => { const f = join(SUP, 'briefs', clinic, 'clinic.json'); return existsSync(f) ? (readJson(f).factSheet ?? {}) : {}; })();
const name = pinFact.shortName || pinFact.name || opt('name') || (readJson(join(EV, 'index.json')).pages.find((p) => p.type === 'home')?.title ?? '').replace(/\s*[|·-].*$/, '').trim();
Object.assign(fact, { name: pinFact.name || name || fact.name, shortName: pinFact.shortName || name || fact.shortName, url: url.replace(/\/$/, ''), phone: first('phone').replace(/\./g, '-'), representative: /^[가-힣]{2,4}$/.test(first('representative')) ? first('representative') : '', businessNo: first('businessNo'), checkedAt: today, nextCheck: new Date(Date.now() + 30 * 864e5).toISOString().slice(0, 10) });
const addr = first('address'); if (addr) { fact.address.full = addr; fact.address.street = addr.replace(/^(서울(특별시|시)?|경기도?|부산(광역시)?|인천(광역시)?|대구(광역시)?|대전(광역시)?|광주(광역시)?)\s*[가-힣]+구?\s*/, ''); fact.address.source = Object.values(draft.address ?? {})[0]?.[0] ?? ''; }
writeJson(join(DATA, 'factSheet.json'), fact);