Phase H 보완 구현: 1단계 A/B 분리 + 정밀 검토 8개 반영

H-1a: KEI_PROMPT에 제목 중복 방지 지시 추가
H-1b: KEI_PROMPT_B (컨셉 구체화) + refine_concepts() 신규 함수
  - 각 꼭지의 relation_type, expression_hint, source_data 판단
  - 1회 호출로 전체 꼭지 처리
  - session_id: "design-agent-refine" (별도)
  - 실패 시 1단계-A 결과 그대로 반환 (pipeline 안 멈춤)
H-5: 팀장에게 relation_type + expression_hint + source_data 전달
  - 꼭지 요약에 관계/표현/원본데이터 포함
section-title-with-bg body 금지:
  - STEP_B_PROMPT에 규칙 추가
  - BODY_FORBIDDEN_MAP + _validate_height_budget에서 코드 레벨 교체
manual_classify fallback 동기화:
  - core_message, purpose, source_hint 기본값 추가

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 07:57:39 +09:00
parent f4548413c8
commit 5d8706172c
3 changed files with 141 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ from typing import Any, AsyncIterator
import anthropic
from src.kei_client import classify_content, manual_classify
from src.kei_client import classify_content, manual_classify, refine_concepts
from src.design_director import create_layout_concept, LAYOUT_PRESETS, select_preset
from src.content_editor import fill_content
from src.renderer import render_slide
@@ -48,7 +48,12 @@ async def generate_slide(
topic_count = len(analysis.get("topics", []))
page_count = analysis.get("total_pages", 1)
logger.info(f"1단계 완료: {topic_count}개 꼭지, {page_count}페이지")
logger.info(f"1단계-A 완료: {topic_count}개 꼭지, {page_count}페이지")
# 1단계-B: 각 꼭지 컨셉 구체화
yield {"event": "progress", "data": "1.5/5 Kei 실장이 각 꼭지의 컨셉을 구체화 중..."}
analysis = await refine_concepts(content, analysis)
logger.info("1단계-B 완료: 컨셉 구체화")
# 이미지 크기 측정 (base_path 있을 때만)
image_sizes = get_image_sizes(content, base_path)