[chore] solution,admin,ontology: 코드 주석을 한 줄로 — 히스토리 주석 삭제

여러 줄 주석이 설명보다 경위(예전·실측·지적)를 적고 있어 읽는 사람이 결론을 찾기 어려웠다.

- ts·tsx·js·mjs·css·py 478개: 여러 줄 주석은 첫 문장 한 줄로, 과거형·날짜 문장은 삭제
- 주석 위치는 TypeScript 파서·파이썬 tokenize/ast 로 찾는다 — 문자열 안의 # · /* 는 건드리지 않는다
- eslint·ts·noqa·type: ignore 같은 지시 주석은 그대로 둔다

파이썬 275개 정리 전후 AST 동일, TS 298개 주석 뺀 토큰 동일(빈 JSX 주석 10곳만 차이).
site·frontend·admin tsc, site vitest 105 passed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 5.5 committed 2026-09-28 16:05:19 +09:00
1 parent c6908629f3
commit 11d30bb3d1
479 files changed
+3337 -13091

No files matched your search

+12 -45
View File
@@ -1,12 +1,4 @@
"""수집 파이프라인 e2e — 잡이 실제로 돌아 fact·사진이 후보로 쌓이는지.
상호명 → (URL 발견) → 확정 → 크롤링 → fact/사진 적재
★ 이 파이프라인이 절대 하면 안 되는 것:
- 검증 안 된 사업장을 긁는 것
- 수집값을 바로 사이트에 노출시키는 것 (전부 후보로 들어가야 한다)
- 사장님 정정본을 덮어쓰는 것
"""
"""수집 파이프라인 e2e — 잡이 실제로 돌아 fact·사진이 후보로 쌓이는지."""
import uuid
from common.enums import FactStatus, JobStatus, JobType, LinkChannel, MediaStatus, PlaceCategory, SourceType
@@ -29,13 +21,7 @@ async def _ready_place(client, h, category=PlaceCategory.LODGING, kakao="k1"):
async def _run_worker(job_id=None):
"""워커를 돌려 큐를 비운다. `job_id` 를 주면 그 잡이 끝날 때까지 돈다.
★ 1틱만 돌리면 안 된다. 수집이 끝나면 **지역 이야기 잡(LOCAL_SYNC)이 뒤따라 들어온다** —
한 틱은 그걸 집어 가고, 정작 기다리던 수집 잡은 PENDING 인 채로 남는다. 테스트는
`job["result"]` 를 읽다가 KeyError 로 죽는데, 화면에는 "그냥 안 끝난 것" 으로 보인다.
큐에 뒤따르는 잡이 생길 때마다 이 헬퍼가 조용히 어긋나므로 개수를 세지 않고 비운다.
"""
"""워커를 돌려 큐를 비운다."""
worker = Worker("test-worker", JobQueue(), build_handler(), job_deadline_sec=60)
ran = 0
for _ in range(10):
@@ -46,13 +32,7 @@ async def _run_worker(job_id=None):
async def test_pipeline_publishes_collected_facts(auth_headers, client):
"""검증: 수집 잡을 끝까지 돌린다.
기대결과: 빈 자리에 들어온 수집값이 **바로 노출값**이 된다(2026-09-14 결정).
★ 예전에는 전부 UNVERIFIED 후보였다. 그러면 수집 직후 발행이 '확인된 사실 0건' 으로
막혀, 사장님이 한 건씩 승인하기 전에는 사이트가 만들어지지 않았다.
★ 사람이 넣은 값·정정본을 덮지 않는다는 보호는 그대로다 —
test_recollect_cannot_overwrite_corrected_value 가 그 자리를 지킨다."""
"""검증: 수집 잡을 끝까지 돌린다."""
h = await auth_headers("u1")
pid = await _ready_place(client, h)
@@ -73,8 +53,7 @@ async def test_pipeline_publishes_collected_facts(auth_headers, client):
async def test_pipeline_records_source_on_every_fact(auth_headers, client):
"""검증: 수집된 fact 의 출처.
기대결과: 전부 source_type=crawl + source_url 이 붙어 있다 — 출처 없는 사실은 없다."""
"""검증: 수집된 fact 의 출처."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k2")
await client.post(f"/v1/place/{pid}/collect", headers=h, json={})
@@ -87,8 +66,7 @@ async def test_pipeline_records_source_on_every_fact(auth_headers, client):
async def test_pipeline_creates_units_and_unit_scoped_facts(auth_headers, client):
"""검증: 숙박 수집 결과의 객실 단위 fact.
기대결과: units 가 생기고 객실별 fact 가 각자 붙는다(A동·B동이 각자 기준인원을 갖는다)."""
"""검증: 숙박 수집 결과의 객실 단위 fact."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k3")
await client.post(f"/v1/place/{pid}/collect", headers=h, json={})
@@ -105,9 +83,7 @@ async def test_pipeline_creates_units_and_unit_scoped_facts(auth_headers, client
async def test_pipeline_stores_media_with_origin_and_pending_review(auth_headers, client):
"""검증: 수집된 사진.
기대결과: origin_url·source_type=crawl 이 남고 PENDING_REVIEW 다 —
★ 재게시 권리 결론에 따라 통째로 걸러낼 수 있어야 하고, Vision 전이라 사람 확인 큐다."""
"""검증: 수집된 사진."""
from sqlalchemy import text
h = await auth_headers("u1")
@@ -120,8 +96,7 @@ async def test_pipeline_stores_media_with_origin_and_pending_review(auth_headers
async def test_recollect_skips_crawl_when_already_enough(auth_headers, client):
"""검증: 필수 항목이 이미 다 찬 사업장에 다시 수집을 건다.
기대결과: ★ 크롤링을 아예 하지 않는다 — 사이트를 만들 정보가 충분하면 여분의 크롤링은 낭비다."""
"""검증: 필수 항목이 이미 다 찬 사업장에 다시 수집을 건다."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k5")
@@ -142,8 +117,7 @@ async def test_recollect_skips_crawl_when_already_enough(auth_headers, client):
async def test_forced_recollect_is_idempotent(auth_headers, client):
"""검증: force=true 로 강제 재수집한다(항목이 이미 차 있어도).
기대결과: 다시 긁되 fact 는 REFRESHED, 사진은 중복 스킵 — 데이터가 부풀지 않는다."""
"""검증: force=true 로 강제 재수집한다(항목이 이미 차 있어도)."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k5f")
@@ -164,8 +138,7 @@ async def test_forced_recollect_is_idempotent(auth_headers, client):
async def test_coverage_reports_missing_required_fields(auth_headers, client):
"""검증: 수집 후 필수 항목 충족도.
기대결과: coverage 에 required/covered/missing 이 담긴다 — UI 가 '뭐가 비었나'를 보여줄 수 있다."""
"""검증: 수집 후 필수 항목 충족도."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k5c")
@@ -180,11 +153,7 @@ async def test_coverage_reports_missing_required_fields(auth_headers, client):
async def test_recollect_does_not_touch_verified_value(auth_headers, client):
"""검증: 수집을 두 번 돌린다(같은 목데이터라 값이 같다).
기대결과: 값이 같으므로 REFRESHED — ★ 사이트에 나가던 사실이 사라지지 않고 늘지도 않는다.
★ 재수집이 같은 값을 후보로 또 쌓으면 확인 큐가 중복으로 넘치고, 노출값을 지웠다
다시 넣으면 그 사이에 사이트에서 사실이 사라진다. 둘 다 안 일어나야 한다."""
"""검증: 수집을 두 번 돌린다(같은 목데이터라 값이 같다)."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k6")
await client.post(f"/v1/place/{pid}/collect", headers=h, json={})
@@ -205,8 +174,7 @@ async def test_recollect_does_not_touch_verified_value(auth_headers, client):
async def test_recollect_cannot_overwrite_corrected_value(auth_headers, client):
"""검증: 사장님이 정정한 값에 재수집이 다른 값을 들고 온다.
기대결과: 노출값은 정정본 그대로, 크롤링 값은 후보로만 남는다 — ★ 절대규칙 6."""
"""검증: 사장님이 정정한 값에 재수집이 다른 값을 들고 온다."""
h = await auth_headers("u1")
pid = await _ready_place(client, h, kakao="k7")
await client.post(f"/v1/place/{pid}/collect", headers=h, json={})
@@ -230,8 +198,7 @@ async def test_recollect_cannot_overwrite_corrected_value(auth_headers, client):
async def test_pipeline_refuses_unverified_place(db_engine, owner_id):
"""검증: 검증 안 된 사업장의 수집 잡이 큐에 직접 들어간 경우(잡 적재 후 검증이 취소된 상황).
기대결과: 잡이 실패한다 — ★ 잡 실행 시점에도 게이트를 다시 확인한다."""
"""검증: 검증 안 된 사업장의 수집 잡이 큐에 직접 들어간 경우(잡 적재 후 검증이 취소된 상황)."""
from sqlalchemy import text
pid = uuid.uuid4()