docs(#54): F-4 legacy annotation + F-5 fixture convention -- AUDIT-01 housekeeping
INTEGRATION-AUDIT-01 (#50) §10.4 / §10.5 housekeeping carry-over. F-4: annotate 14 remaining legacy Phase R'/Q sample-text hits across 10 src/ files with inline marker `# [legacy Phase R'/Q example -- INTEGRATION-AUDIT-01 §10.4]`. Comment-only. No string-literal / regex / sample dict value mutated. fit_verifier.py L612 marker keeps Phase Z partial-live import graph (FitAnalysis / RoleFit / redistribute / salvage) byte-precise. F-5: docs-only addendum -- §10.5.1 in INTEGRATION-AUDIT-01-REPORT.md + tests/CLAUDE.md fixture convention note. No root tests/fixtures/ dir created; existing tests/phase_z2/fixtures/ convention preserved. Documents test-only sample-reference allowance vs src/** runtime prohibition. Out of scope: Phase Z source 11 hits (phase_z2_content_extractor / failure_router / mapper / retry), production behavior change, #19 work. Verified: pytest -q tests/phase_z2/ = 157 PASS. git diff +210/-0 (35 src/docs lines + 175 new tests/CLAUDE.md). No behavioral delta. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- 블록 CSS의 글씨 크기를 font_hierarchy에 맞게 조정 (프로세스 내 조정)
|
||||
- 콘텐츠는 PipelineContext에서 가져옴 (하드코딩 아님)
|
||||
- 블록은 콘텐츠에 맞게 재구성 (items 수 동적)
|
||||
[legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ class TfidfBlockMatcher:
|
||||
text = text.replace("S/W", "SW 소프트웨어")
|
||||
text = text.replace("H/W", "HW 하드웨어")
|
||||
text = re.sub(r'\bDX\b', 'DX 디지털전환', text)
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
text = re.sub(r'\bBIM\b', 'BIM 건설정보모델링', text)
|
||||
text = text.replace("(", " ").replace(")", " ")
|
||||
text = text.replace("[", " ").replace("]", " ")
|
||||
|
||||
@@ -399,6 +399,7 @@ _SAMPLE_DATA: dict[str, dict[str, Any]] = {
|
||||
"center_label": "DX",
|
||||
"center_sub": "디지털 전환",
|
||||
"items": [
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
{"label": "BIM", "color": "#ff6b35"},
|
||||
{"label": "GIS", "color": "#00d4aa"},
|
||||
{"label": "DT", "color": "#ffd700"},
|
||||
@@ -406,6 +407,7 @@ _SAMPLE_DATA: dict[str, dict[str, Any]] = {
|
||||
},
|
||||
"keyword-circle-row": {
|
||||
"keywords": [
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
{"letter": "B", "label": "BIM", "description": "건물정보모델링"},
|
||||
{"letter": "G", "label": "GIS", "description": "지리정보시스템"},
|
||||
{"letter": "D", "label": "DX", "description": "디지털 전환"},
|
||||
@@ -432,6 +434,7 @@ _SAMPLE_DATA: dict[str, dict[str, Any]] = {
|
||||
"right_title": "개선",
|
||||
"rows": [
|
||||
{"left": "수작업", "center": "프로세스", "right": "자동화"},
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
{"left": "2D 도면", "center": "설계 도구", "right": "3D BIM"},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -22,6 +22,9 @@ from src.sse_utils import stream_sse_tokens
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# [legacy Phase R'/Q examples — INTEGRATION-AUDIT-01 §10.4]
|
||||
# (sample-text literals at L43-L44 / L67 inside the EDITOR_PROMPT string below
|
||||
# — "건설산업 디지털화", "BIM 전면 도입", "DX와 BIM 개념" preserved verbatim)
|
||||
EDITOR_PROMPT = """당신은 도메인 전문가이자 콘텐츠 편집자이다.
|
||||
원본 콘텐츠의 핵심 내용을 유지하면서 각 블록의 슬롯에 맞게 텍스트를 정리한다.
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ BLOCK_SLOTS = {
|
||||
"slot_desc": {
|
||||
"title_ko": "한글 메인 타이틀",
|
||||
"title_en": "영문 서브 타이틀 (없으면 생략)",
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
"breadcrumb": "상위 카테고리 경로 (예: 디지털전환 > BIM)",
|
||||
"bg_image": "배경 이미지 경로",
|
||||
},
|
||||
@@ -965,6 +966,7 @@ def _validate_height_budget(blocks: list[dict], preset: dict) -> list[dict]:
|
||||
for block in blocks_to_remove:
|
||||
blocks.remove(block)
|
||||
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
# 삭제 후 zone_blocks 재구성 (후속 pill-pair/높이 체크에 반영)
|
||||
zone_blocks.clear()
|
||||
for block in blocks:
|
||||
|
||||
@@ -84,6 +84,9 @@ border-radius: 8px, padding: 14px 30px, text-align: center
|
||||
|
||||
def get_layout_rules() -> str:
|
||||
"""Phase S 검증 결과 기반 레이아웃 규칙."""
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
# (sample-text literal "DX와 BIM의 상세 비교" at ~L109 inside the return
|
||||
# string below is preserved verbatim as a documented intentional example)
|
||||
return """
|
||||
## 레이아웃 규칙 (검증 결과 기반 — 반드시 따를 것)
|
||||
|
||||
|
||||
@@ -609,6 +609,7 @@ class SupplementBlock:
|
||||
role: str
|
||||
block_id: str
|
||||
variant: str
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
content_source: str # "popup:DX와 BIM의 구분" 등
|
||||
estimated_height_px: float
|
||||
available_px: float
|
||||
|
||||
@@ -164,6 +164,7 @@ def _preprocess_text(text: str) -> str:
|
||||
text = text.replace("S/W", "SW 소프트웨어")
|
||||
text = text.replace("H/W", "HW 하드웨어")
|
||||
text = re.sub(r'\bDX\b', 'DX 디지털전환', text)
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
text = re.sub(r'\bBIM\b', 'BIM 건설정보모델링', text)
|
||||
|
||||
# 괄호 내용 유지하되 괄호 제거
|
||||
|
||||
@@ -53,6 +53,7 @@ KEI_PROMPT = (
|
||||
" 문장을 재작성하지 마라. 원본 문장을 그대로 가져와라.\n"
|
||||
"- **결론 텍스트도 원본 그대로.** 임의로 만들지 마라.\n"
|
||||
"- 원본에 있는 내용을 임의로 제거하거나 다른 의미로 바꾸지 마라.\n"
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
"- 텍스트 재구성이 허용되는 경우는 **빈 공간에 채울 요약(표, 팝업 요약)만**.\n"
|
||||
"- 각 꼭지의 source_hint에 원본의 어떤 부분이 가는지 명시.\n\n"
|
||||
"## 배치 규칙\n"
|
||||
@@ -162,6 +163,7 @@ KEI_PROMPT_B = (
|
||||
" - 원본에 이미지가 참조되면 반드시 [이미지: 제목] 마커를 포함하라.\n"
|
||||
" - 출처가 있으면 포함하라.\n"
|
||||
" - '활용 필요', '구체화 필요' 같은 지시사항을 쓰지 마라. 실제 콘텐츠 항목만 쓰라.\n"
|
||||
# [legacy Phase R'/Q examples — INTEGRATION-AUDIT-01 §10.4]
|
||||
" - 예시: '건설산업(종합산업, 기술 통합 융합), BIM(정보관리 도구, 출처: 국토교통부 2020)'\n"
|
||||
" - 예시: '[이미지: DX와 핵심기술간 상호관계] 다이어그램, GIS 역할(공간 분석). [팝업: DX와 BIM의 구분] 비교표'\n\n"
|
||||
"## 출력 형식 (JSON만)\n"
|
||||
@@ -789,6 +791,10 @@ async def call_kei_final_review(
|
||||
# I-9: Kei 넘침 판단 호출
|
||||
# ──────────────────────────────────────
|
||||
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
# (sample-text literal "Option 2 (핵심 재구성 + 팝업 분리)" inside the
|
||||
# KEI_OVERFLOW_PROMPT triple-quoted string below is preserved verbatim
|
||||
# as a documented intentional example of overflow-judgment output)
|
||||
KEI_OVERFLOW_PROMPT = """당신은 슬라이드 콘텐츠 전문가이다.
|
||||
디자인 팀장이 배치한 블록들이 컨테이너(zone)의 높이 예산을 초과했다.
|
||||
콘텐츠의 중요도와 전달 메시지를 기준으로 어떻게 처리할지 판단하라.
|
||||
|
||||
@@ -1182,6 +1182,7 @@ async def generate_slide(
|
||||
yield {"event": "progress", "data": "3/7 슬라이드 HTML 생성 중..."}
|
||||
|
||||
async def stage_2(context: PipelineContext) -> dict:
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
# Phase X-BX': Type B는 code_assembled 직접 사용, Sonnet 재구성 스킵
|
||||
if context.analysis.layout_template in ("B", "B'", "B''"):
|
||||
from src.block_assembler import assemble_slide_html_final
|
||||
@@ -1190,6 +1191,7 @@ async def generate_slide(
|
||||
logger.info(f"[Stage 2] Type B: slide-base + 블록 (font_scale={fs:.1f})")
|
||||
return {"generated_html": generated}
|
||||
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
# Type A: 기존 Sonnet 재구성 코드 그대로
|
||||
from src.content_verifier import generate_with_retry
|
||||
|
||||
@@ -1998,6 +2000,7 @@ async def _apply_adjustments(
|
||||
block["detail_target"] = True
|
||||
if "data" in block:
|
||||
del block["data"]
|
||||
# [legacy Phase R'/Q example — INTEGRATION-AUDIT-01 §10.4]
|
||||
block["reason"] = f"재구성: {detail}"
|
||||
logger.info(
|
||||
f"조정: {area} → kei_restructure (detail_target)"
|
||||
|
||||
Reference in New Issue
Block a user