XBX-2 완료: overflow 프로세스 정상 동작

- slide_measurer: data URI → 임시파일 방식 (대용량 HTML 측정 가능)
- pipeline: Type B zone 간 재배분 (top↔bottom 공간 이전)
- pipeline: overflow 분기에 top/bottom zone 추가
- kei_client: 에스컬레이션 prompt 개선
  - 텍스트 원문 보존 원칙 명시 (삭제/요약/압축 금지)
  - action을 popup만으로 제한
  - 실제 역할명 목록을 prompt에 전달
- block_assembler: Kei popup 결정 반영 (해당 역할 콘텐츠 → 팝업 링크)

결과: 02번 상단 카드 3개 모두 표시, 하단 우측 표 → 팝업 분리

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 07:39:02 +09:00
parent 028f611070
commit 095abdf9af
4 changed files with 95 additions and 39 deletions

View File

@@ -479,6 +479,13 @@ def _assemble_slide_html_type_b(ctx: "PipelineContext", title_text: str = "") ->
slide_images = ctx.slide_images or []
norm_sections = ctx.normalized.sections or []
# Kei 에스컬레이션 결정: popup 대상 역할 수집
kei_decisions = enh.get("kei_decisions", [])
popup_roles = set()
for d in kei_decisions:
if d.get("action") == "popup":
popup_roles.add(d.get("role", ""))
# ── zone별 역할 분류 ──
top_role = None
bottom_left_role = None
@@ -748,26 +755,35 @@ def _assemble_slide_html_type_b(ctx: "PipelineContext", title_text: str = "") ->
f'<span style="color:#2563eb;font-size:{font_size-2}px;cursor:pointer;">[{popup_link_title} →]</span></div>'
)
# 불릿
table_summaries = enh.get("table_summaries", {})
bul = ""
if not table_summaries:
for line in sub_content_br.split("\n"):
stripped = line.strip()
if not stripped:
continue
depth = 1
dm = re.match(r'^D(\d+):\s*', stripped)
if dm:
depth = int(dm.group(1))
stripped = re.sub(r'^D\d+:\s*', '', stripped)
clean = stripped.lstrip("- ").lstrip("")
if clean:
clean = _bold(clean, rn)
pad = bl_indent * depth
fs = font_size if depth == 1 else font_size - 1
weight = "font-weight:600;" if depth == 1 else ""
bul += f'<div style="padding-left:{pad}px;font-size:{fs}px;margin-bottom:2px;{weight}">• {clean}</div>\n'
# Kei가 이 역할을 popup 대상으로 결정했으면 → 콘텐츠 대신 팝업 링크만
if rn in popup_roles:
bul = (
f'<div style="padding:{gap_small}px;text-align:center;color:#64748b;'
f'font-size:{font_size}px;margin-top:{gap_small*2}px;">'
f'상세 내용은 팝업에서 확인</div>'
)
table_summaries = {} # 표도 팝업으로 이동
else:
# 불릿
table_summaries = enh.get("table_summaries", {})
bul = ""
if not table_summaries:
for line in sub_content_br.split("\n"):
stripped = line.strip()
if not stripped:
continue
depth = 1
dm = re.match(r'^D(\d+):\s*', stripped)
if dm:
depth = int(dm.group(1))
stripped = re.sub(r'^D\d+:\s*', '', stripped)
clean = stripped.lstrip("- ").lstrip("")
if clean:
clean = _bold(clean, rn)
_pad = bl_indent * depth
fs = font_size if depth == 1 else font_size - 1
weight = "font-weight:600;" if depth == 1 else ""
bul += f'<div style="padding-left:{_pad}px;font-size:{fs}px;margin-bottom:2px;{weight}">• {clean}</div>\n'
# 표 요약 HTML
table_html_br = ""