[feat] solution: 지역 이야기 생성 · 발행본 섹션 손질 · 마이그레이션 주석 축약

- 지역 이야기(가요·인물·연표·엽서·퀴즈) 생성 경로: story_service · grounding/story ·
  section_prompts. 지금까지 만들 자리가 없어 시안에만 손으로 넣은 3만 자였다
- 발행본 섹션: ItinerarySection · Carousel 레일 자동재생(use-rail-autoplay) ·
  Festival · LocalGuide · Weather · Gallery · Header/Footer
- 목업 payload 를 payloads-mockup/ 으로 분리 — 발행 대상과 섞이지 않게
- DB 새 구조 후속: site_payload · local_content_crud 조인 정리 · 테스트
- 마이그레이션 주석 축약: 9개 파일 합계 주석 비율 48% → 25%.
  실측과 밟은 함정만 남기고 논증은 커밋 메시지로 옮겼다

검증: site·frontend 빌드 통과

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-09-10 14:36:00 +09:00
1 parent 3910feddfb
commit 328d9e18ee
58 files changed
+5625 -412

No files matched your search

@@ -7,7 +7,7 @@ import os
os.environ.setdefault("APP_ENV", "test")
from common.enums import LocalContentType # noqa: E402
from common.enums import STORY_KINDS, LocalContentType # noqa: E402
from services.grounding import story as grounding # noqa: E402
from services.prompts import story as prompts # noqa: E402
from services.site_payload import _local # noqa: E402
@@ -22,8 +22,8 @@ def _reply(content: str, search_results=None) -> dict:
# ── 프롬프트 ────────────────────────────────────────────────────────────
def test_프롬프트는_shared_산출물에서_온다():
"""다섯 종이 모두 있고, 지역명이 빈칸 없이 박힌다."""
assert set(prompts.kinds()) == {"songs", "people", "chronicle", "postcard", "quiz"}
"""여섯 종이 모두 있고, 지역명이 빈칸 없이 박힌다."""
assert set(prompts.kinds()) == {"songs", "daily", "people", "chronicle", "postcard", "quiz"}
text = prompts.build_prompt("songs", "전북 군산시")
assert "[지역] 전북 군산시" in text
assert "[지역]을 노래한 대중가요" in text # task 원문
@@ -37,6 +37,25 @@ def test_지역_생성은_업소를_가리키지_않는다():
assert "업소가 지정되지 않았으므로" in prompts.build_prompt("songs", "전북 군산시")
def test_생성_목록과_읽는_목록이_같다():
"""산출물(section_prompts.json) · 파이썬 상수 · 항목 이름칸 셋이 어긋나면 조용히 틀린다.
★ `daily` 가 실제로 이렇게 빠져 있었다 — 프롬프트가 빌더에만 손으로 적혀 있어서
서버는 그 종류를 몰랐고, 렌더러의 탭 자리는 영영 빈칸이었다(2026-09-10).
"""
assert tuple(prompts.kinds()) == STORY_KINDS
assert set(grounding._TITLE_KEY) == set(STORY_KINDS)
def test_일력_프롬프트가_붙는다():
"""'옛 항구' 설명이 약속한 일력 — MM-DD 스키마와 연도 금지 규칙까지 실려야 한다."""
text = prompts.build_prompt("daily", "전북 군산시")
assert "[지역] 전북 군산시" in text
assert '"kind":"daily"' in text
assert "연도를 넣지 않는다" in text
assert prompts.max_items("daily") == 30
# ── 응답 해석 ────────────────────────────────────────────────────────────
def test_출처가_없으면_항목을_버린다():
payload = _reply('{"kind":"songs","items":[{"title":"금강 나그네"}]}')