
    eNjr              	          d Z ddlZddlZddlZddlZddlmZ ej                  j                  d e
 ee      j                               ddlZej                  dz  Zej                   dz  ZdZej                   dz  dz  d	z  Zd
\  ZZg dZdj/                  g d      Zdj/                  g d      Zdj/                  g d      Zd Zdj/                  g d      Zdj/                  g d      Zdddiddiddiddiddiddidg dddZdddeddddidddidg dddddeddddidddidg ddddddgddZd  Z d! Z!d" Z"d# Z#d$ Z$d% Z%d& Z&eD  cg c]*  \  } } }||jO                  d'd(      jO                  d)d(      f, c}} Z(d* Z)d+Z*d,Z+d- Z,dj/                  g d.      Z-dj/                  g d/      Z.d0 Z/d1 Z0d2 Z1d3 Z2d4 Z3d5 Z4d6 Z5e6d7k(  r ejn                         Z8e8js                  d8d9g d:;       e8ju                         Z;ejy                  d<d<=       e;jz                  d>v r e         e;jz                  d?v r e$        e;jz                  d@v r e%        e;jz                  dAv r e)        e;jz                  dBk(  r e4        e;jz                  dCk(  r e3        e;jz                  dDv r e5        yyyc c}} w )Eu  s27 — 숲 지도 + 중요 영역 상세화 스케치 (TASK 2, 2026-07-08, 커밋 금지).

사용자 지시:
  ① 씬 정보(공간 단서 그래프) 취합 → LLM 이 '숲(전체 포괄) 지도' 저작 —
     구글지도에서 촬영지를 부분 캡쳐한 형태, 꼭 필요한 주변 물체 포함.
     스타일 = TASK 1 산출 '경찰서' FP 도면 스타일 그대로 (육안 확인 완료:
     흰 배경·얇은 검정 윤곽·파스텔 존 채색·원형 마커·존 영문 라벨·N 나침반).
     마커 = 알파벳+한자리 숫자 (A–F 사용).
  ② 그 지도 기반 샷 중요 영역(옥탑방·건물·진입로 등) 상세화 스케치 —
     마커 = 알파벳+한자리 숫자, ①과 완전 상이 (P–W 사용).
  구성(사용자 확정): ①지도 i2/nb2 2장 + ②상세 = 지도 계보 × 엔진 교차 4장.
규칙: 시나리오 중립(코드에 작품 고유명사·ID 없음, 씬 사실=데이터 주입) ·
     ID-free 서술 · 육안 판정=사용자 · 갤러리 8897.
사용: backend/.venv/bin/python s27_forest_map.py [--only spec|maps|details|html|all]
산출: out/forest_map/*.png + plans/forest_map_spec_v1.json + forest_map.html
    N)Path
forest_mapzforest_map.htmlforest_map_spec_v1out
fp_v16corrzfp_l14_police_front.png)z
map_i2.pngzmap_nb2.png))i2r   zdetail_mapi2_i2.png)r   nb2detail_mapi2_nb2.png)r	   r   zdetail_mapnb2_i2.png)r	   r	   zdetail_mapnb2_nb2.png
)zDDrawing style: a clean flat 2D architectural site map, straight-downuG   orthographic view — the exact drafting language of the attached stylezEreference: pure white page background, thin dark outlines, flat mutedzFpastel colour fills per zone (pale yellow, pale cyan, pale blue, lightz?tan, soft green, light grey), heavier dark strokes for buildingzEouter walls, simple flat plan symbols. NO 3D, no axonometric tilt, noz?perspective, no shadows, no photo textures, no people, no storyzprops.uB   Markers: ONLY the circled markers listed below — each is a smallz@white circle with a thin black ring containing a short code (onezDcapital letter + one digit). Place each circle exactly on its listedzAtarget. Besides these circles, the only text allowed is the shortzCEnglish zone labels listed below and a small 'N' north arrow at thez;top-right corner. No other words, numbers, legend or title.)uC   The LAST attached image is a site plan from the same production —z@use it ONLY as the DRAFTING-STYLE reference (line weight, pastelzDfill language, circled-marker look, label typography). Its place anduC   layout have NOTHING to do with this map — never copy its content.)zCFormat: like a partial screen capture from an online map app of onezDsmall neighbourhood block, but redrawn as an architectural site map.zAStreets run off the frame edges; unmarked neighbour buildings arezCsimple flat grey blocks; the filming property is highlighted with azCdashed orange boundary and slightly warmer fills so it reads as thezsubject of the capture.c                  l    t        j                  d      } t        j                  | d   | d   dd      S )Nspatial_evidence_graph_v1claimschain)r   r   F)ensure_ascii)F	load_planjsondumps)gs    R/Users/manta/Documents/Projects/TheRoad-I1/scratchpad/forest_exp/s27_forest_map.py_evidence_payloadr   K   s4    	/0A::8qzB#(* *    )z;You are a location scout and drafting supervisor for a filmzBproduction. From the given spatial-evidence graph (verbatim quoteszCfrom the screenplay with evidence ids), you author the CONTENT SPECz7for two drawings of the single filming location and itszDsurroundings. Evidence-bound: every item must restate a cue from thezBgraph (cite evidence_id) or be a directly-derived necessity of onezB(mark inferred=true). Do not invent weather, atmosphere, materialszDor measurements beyond the cues. Where cues are silent, stay silent.z@All names/descriptions in English, fully ID-free and neutral: nou>   character codes, no proper nouns from the work — use genericz<descriptors ('the rooftop-room building', 'the alley', ...).)zAuthor two specs:uC   1) NEIGHBOURHOOD MAP ('the forest') — one small-town block aroundz<   the filming property, like a partial map-app capture: thez>   surrounding street/alley network, the filming property (thezC   building that carries the rooftop room, its yard, gate, externalzA   stair position), and only the surrounding objects the evidencezB   makes necessary (e.g. neighbour low-rise blocks, the spot wherezC   a car can stop on the alley, a low wall across, sea/harbour edgezB   only if evidence supports proximity). Assign each marked item az?   code = one capital letter A-F + one digit 1-9 (e.g. A1, B2).zB   Also list 2-4 short English zone labels (like 'Alley', 'Yard').uE   2) DETAIL SKETCH of the shot-critical areas ('the tree') — a zoomedzC   plan of the filming property itself: the building footprint withzD   the rooftop deck contents (water tank, clothesline, wooden bench,z>   iron door, rooftop-room unit with its window), the externalzA   stair run with its landing, the yard with its secluded corner,zC   the gate, the approach from the alley. Assign each marked item auE      code = one capital letter P-W + one digit 1-9 — codes must sharez   NOTHING with the map codes.zAFor each spec also write layout_narration_en: 6-10 sentences thatzBwalk a draftsman through the whole drawing top-to-bottom (relativez7positions only, no coordinates, no invented distances).objecttypestringboolean)codename_enkindplacement_enevidence_idinferredF)r   
propertiesrequiredadditionalPropertiesarray)r   items)r'   zone_labels_enlayout_narration_en)mapdetailr*   r+   c            	      6   dj                  t        dt               g      } t        j                  dt
        | t              }dd l}dD ]:  \  }}||   d   D ]*  }|j                  d| d|d	         rJ | d
|d	            < |d   d   D ch c]  }|d	   	 }}|d   d   D ch c]  }|d	   	 }}||z  rJ d       t        j                  t        |       t        dt        |d   d          dt        |d   d          dt                y c c}w c c}w )N

z(SPATIAL EVIDENCE GRAPH (verbatim, full):s27_map_specr   ))r*   ABCDEF)r+   PQRSTUVWr'   [z][1-9]r   u    코드 계약 위반: r*   r+   u   ①/② 마커 코드 중복z[spec] map items=z detail items=u    → plans/)join	SPEC_TASKr   r   llmSPEC_SYSTEMSPEC_SCHEMAre	fullmatch	save_planSPECprintlen)	userspecr7   partlettersiti	codes_map	codes_dets	            r   
stage_specrE      sM   ;;2 D
 55dK@DDgt*W%B<<1WIV 4bjA =&/6
|<=A & E %)K$89$8q6$8I9$(N7$;<$;q6$;I<I%F(FF&KKd	c$u+g"678 9d8nW567{4&J K	 :<s   D&Dc                 2    dj                  d | D              S )Nr   c              3   D   K   | ]  }d |d    d|d    d|d      yw)- (r   z) r       — r    N .0rA   s     r   	<genexpr>z _marker_block.<locals>.<genexpr>   s9      B bj\ByM?%>0B/CD    r2   )r'   s    r   _marker_blockrP      s     99   r   c                     | d   }dj                  dt        d|d   z   dt        |d         z   dd	j                  |d
         z   t        t        g      S )Nr*   r-   z6Draw ONE neighbourhood site map of a filming location.z#LAYOUT (the content ground truth):
r)   z-CIRCLED MARKERS (all of them, nothing else):
r'   Allowed zone labels: , r(   )r2   MAP_FORMrP   	STYLE_MAPSTYLE_REF_NOTE)r>   ms     r   _map_promptrX      sf    UA;;@.3H1II8
'

#	$$))A.>,?"@@	 	 	r   c                     | d   }dj                  ddddddd	d
|d   z   ddt        |d         z   ddj                  |d         z   t        t        g      S )Nr+   r-   z>Draw ONE detailed top-down architectural sketch of the filmingz?property shown inside the dashed boundary of the FIRST attachedz;image (a neighbourhood map). Zoom into that property so thez@building, its rooftop deck, the external stair, the yard and thez>approach fill the frame; keep every block's relative position,z@proportion and opening exactly where the map draws them. This isz8a zoomed REDRAW of that map area, not a copy of the map.*LAYOUT DETAIL (the content ground truth):
r)   uB   CIRCLED MARKERS (all of them, nothing else — these codes replacezthe map's codes entirely):
r'   rR   rS   r(   )r2   rP   rU   rV   r>   ds     r   _detail_promptr]      sx    XA;;HIEJHJB5
!
"	#L&qz)BB$))A.>,?"@@  r   c                     t        j                  t              } t        |       }t        j                  d|t
        gdt        t        z         t        j                  d|dt
        fgdt        t        z         t        dt               y )	N
s27_map_i2	1024x1024refssizeout_paths27_map_nb2V   DRAFTING-STYLE REFERENCE ONLY — copy line/fill/marker/label style, never the content1:1labeled_refsaspect_ratiord   u   [maps] 2장 완료 →)r   r   r:   rX   img_gptSTYLE_FPOUTMAP_GPTimg_nb2MAP_NB2r;   )r>   prompts     r   
stage_mapsrr      sq    ;;tDFIIlF(+W}&IImV
$%-	/30 S7]4 

"C(r   c            	         t        j                  t              } t        |       }t        t
        z  t        dz  d}t        D ]o  \  }}}||   }|dk(  r.t        j                  d| d| ||t        gdt        |z         ?t        j                  d| d| |d|fd	t        fgd
t        |z         q t        dt               y )Nzmap_nb2_r2.png)r   r	   r   s27_detail__r`   ra   uc   NEIGHBOURHOOD MAP — the layout source of truth; zoom into the dashed filming property of THIS maprf   rg   rh   u   [details] 4장 완료 →)r   r   r:   r]   rm   rn   DETAILSrk   rl   ro   r;   )r>   rq   mapslineageenginefnamesrcs          r   stage_detailsr|      s    ;;tDD!F-.>(>?D")7mT>IIG9AfX6?"U{, IIG9AfX6<=@B23;=N>
 #S5[: #* 

%s+r   c                     | d   }dj                  g ddddddd	d
dddddddddddddddddddddd d!d"|d#   z   d$d%d&t        |d'         z   d(d)d*d+d,d-      S ).Nr+   r-   z;Convert the attached top-down architectural plan (the FIRSTuA   attached image — the layout source of truth) into ONE 45-degreez8high-angle aerial PERSPECTIVE SKETCH of the same filming	property.z>Camera: elevated three-quarter aerial view from the alley sideuA   (the plan's bottom edge), high enough that the whole property —zAalley approach, gate, yard, external stair, the building mass anduB   its rooftop deck with the rooftop-room unit — fits in one frame,z,looking across the yard toward the building.z@Geometry: keep every structure's position, footprint, proportionu@   and opening exactly where the plan draws them — the plan fixesz?the LAYOUT only; the VERTICAL SCALE comes from the block below.z.SCALE & MASSING (evidence-bound ground truth):z?- The main building is an aged MULTI-FAMILY VILLA of THREE fullu?     storeys — its roof deck sits roughly 8-10 m above the yard.z  NOT a single-storey building.z;- The rooftop-room unit stands on that roof deck as a smallz=  fourth-level volume, clearly smaller than the floors below.z?- The exterior stair is a later-added steel retrofit stair thatz=  climbs the FULL three storeys along the outer wall from theuA     yard to the rooftop landing — a long multi-flight zig-zag runz?  with intermediate landings, never a short single flight. Openz9  treads, thin steel plate stringers, support posts, pipez$  railings (creator-confirmed fact).z@- Each of the three facade storeys shows a few modest windows ofz>  the regional multi-family-villa type; the rooftop room keepsz8  its own small windows exactly as the plan places them.z;- Surrounding neighbour blocks stay dense low-rise context,z/  generally lower than or similar to the villa.z<Do not invent weather, atmosphere, materials or measurementszbeyond this.rZ   r)   z>CIRCLED MARKERS: reproduce EVERY circled code below as a smallzAwhite circle with a thin black ring, attached to the same elementzin the sketch:
r'   u9   Media: clean monochrome concept sketch — confident dark:ink/pencil linework, light hatching for shade, plain whitez=background. No colour fills, no photo textures, no people, nouB   vehicles. Besides the circled codes there is NO text at all — noz,zone labels, no notes, no compass, no title.uA   The result must be a PERSPECTIVE drawing — not a top-down plan.)r2   rP   r[   s     r   _sketch_promptr     s   XA;; +E+K+ 	C+ 		+
 	I+ 	L+ 	L+ 	M+ 	7+ 	K+ 	K+ 	J+ 	9+ 	J+ 	J+  	*!+" 	F#+$ 	H%+& 	J'+( 	H)+* 	L++, 	J-+. 	D/+0 	/1+2 	K3+4 	I5+6 	C7+8 	F9+: 	:;+< 	G=+> 	?+@ 	6
!
"	#A+D 	IE+F 	LG+H 	]1W:66I+J 	DK+L 	EM+N 	HO+P 	MQ+R 	7S+T 	LU+ + +r   detail_ z.pngc                  F   t        j                  t              } t        |       }t        D ]d  \  }}t
        |z  }t        j                  d| d||gdt
        d| dz         t        j                  d| d|d|fgd	t
        d| d
z         f t        dt
               y )Ns27_sketch__i2r`   sketch_
_by_i2.pngra   _nb2uL   ARCHITECTURAL PLAN — the layout source of truth for the perspective sketchrg   _by_nb2.pngrh   u   [sketches] 8장 완료 →)	r   r   r:   r   SKETCHESrm   rk   ro   r;   )r>   rq   src_namekeyr{   s        r   stage_sketchesr   7  s    ;;tDD!F!#Hn			KuC(&u"SWSE3L-L	N			KuD)6#$')A* [/I)I	K	 " 

&,r   zsketch_mapi2_nb2_by_nb2.pngr
   c                 >    dj                  d | d   d   D              S )Nr   c              3   D   K   | ]  }d |d    d|d    d|d      yw)rH   r   z) = r   rI   r    NrJ   rK   s     r   rM   z_legend.<locals>.<genexpr>J  s9      +)B bj\bm_E"^2D1EF)rN   r+   r'   rO   r>   s    r   _legendr   I  s)    99 +x.)+ + +r   )uA   The output image must contain ZERO annotations — no circles, noz@codes, no letters, no numbers, no text, no signage lettering, nozarrows, no dashed lines.)
z@Real-world rendering facts (creator-confirmed / evidence-bound):z?- The main building is an aged MULTI-FAMILY VILLA of three fullzB  storeys (roof deck roughly 8-10 m above the yard) with the smalluF     rooftop-room unit on its roof deck — regional vernacular materialsz  with varied lived-in aging.zC- The exterior stair is a later-added STEEL retrofit stair climbingzB  the full three storeys: open treads, thin steel plate stringers,z;  support posts, pipe railings. It is NOT a concrete stair.z<Lighting: plain neutral daytime light. Do NOT add fog, rain,zBdramatic weather, colour-grade moods, or people. No text overlays.c                 t    dj                  dddddddd	d
ddddddddt        |       z   t        t        dg      S )Nr-   z;Create ONE PHOTOREALISTIC location still using the attachedz7perspective SKETCH as reference. The sketch is ONLY thez=STRUCTURAL SKELETON: it fixes the camera (same 45-degree highzAaerial view), and each structure's position, size and proportion.z;Everything else must be FLESHED OUT as the real world: realu@   surfaces, real materials, real weathering — and the SIMPLIFIEDz?SURROUNDINGS in the sketch (bare neighbour blocks, empty roofs,z<blank walls, plain ground) must be AUGMENTED into fully realz:buildings and streets: real neighbouring houses of a densez;low-rise Korean town with their own windows, doors, rooftopu?   clutter, awnings, utility poles and wires, pavement texture —z;nothing in the frame may look like an untextured model or azsimplified block.z:MARKER LEGEND (annotations on the sketch only): the sketchz:carries small circled codes identifying elements. Use thisz9legend to know what each element is, then render the realzthing:
z@The parked bicycle from the sketch stays; add no other vehicles.r2   r   NO_ANNOTATION
REAL_FACTSr   s    r   _photo_promptr   c  s]    ;;EAGKEJIFDEIEDDCWT]"J)  r   c                     | d   }dj                  ddddd|d   z   d	t        |       z   d
dddddddt        t        g      S )Nr+   r-   z<Create ONE PHOTOREALISTIC aerial location still of a filmingz@property, from a 45-degree high aerial camera looking across thez@yard toward the building (whole property in frame). No referenceu;   image is attached — build the scene from this text alone.zLAYOUT (ground truth):
r)   z?ELEMENTS (render each as the real thing, in its listed place):
z9SCALE & MASSING: the main building is a three-storey agedz<multi-family villa, roof deck roughly 8-10 m above the yard,z@with the small rooftop-room unit as a fourth-level volume on thez?deck; the steel retrofit stair climbs the full three storeys asz;a multi-flight zig-zag run with intermediate landings; eachz8facade storey shows a few modest windows of the regionalz:multi-family type; surrounding blocks are a dense low-risez:Korean town, fully real (windows, roofs, wires, pavement).r   r[   s     r   	_x_promptr   |  sh    XA;;FJJE"Q'<%==J
$-	CFJIEBDD#  r   c                 D    dj                  dddddddd	d
ddt        g      S )Nr-   z;Draw ONE monochrome perspective CONCEPT SKETCH from the twozattached images.Reference roles:u<   - The PHOTO is the reality reference — what the place, itsz4  materials and its surroundings actually look like.u>   - The SKETCH is the structural skeleton — camera, positions,z>  proportions and openings. On conflict the SKETCH's structurez*  wins; the photo only fleshes out detail.u@   Output media: clean monochrome concept sketch — confident darkr   z)background. No colour, no photo textures.)r2   r   r   s    r   _xsketch_promptr     s<    ;;EF>HH4JD3  r   c                 h    dj                  dddddddd	d
dddt        |       z   t        t        g      S )Nr-   z>Create ONE PHOTOREALISTIC location still from the two attachedzimages.r   uB   - The PHOTO is the look source of truth — materials, weathering,z+  lighting, the reality of the town around.z@- The FLOOR PLAN (flat top-down diagram) is the LAYOUT source ofu>     truth — where every structure, opening and object sits. Onz  conflict the floor plan wins.z@Camera: keep the photo's 45-degree high aerial view of the wholer~   uA   MARKER LEGEND (annotations on the floor plan only — never drawnzin the photo):
r   r   s    r   _xphoto_promptr     sK    ;;HL5JH)JKWT]*  r   c                     t        j                  t              } t        |       }t        j                  d|d dt
        dz         t        j                  d|g dt
        dz         t
        t        z  }t        |       }t        j                  d	|t
        dz  |gdt
        d
z         t        j                  d|dt
        dz  fd|fgdt
        dz         t
        t        z  }t        |       }t        j                  d|t
        dz  |gdt
        dz         t        j                  d|dt
        dz  fd|fgdt
        dz         t        dt
               y )Ns27_x_i2r`   zx_by_i2.pngra   	s27_x_nb2rg   zx_by_nb2.pngrh   s27_xsketch_i2zxsketch_by_i2.pngs27_xsketch_nb2u5   PHOTO — reality reference (materials, surroundings)uQ   SKETCH — structural skeleton (camera, positions, proportions; wins on conflict)zxsketch_by_nb2.pngs27_xphoto_i2zxphoto_by_i2.pngs27_xphoto_nb2u   PHOTO — look source of truthu8   FLOOR PLAN — layout source of truth (wins on conflict)zxphoto_by_nb2.pngu   [x] 6장 완료 →)r   r   r:   r   rk   rm   ro   	PHOTO_SRCr   FP_SRCr   r;   )r>   xpskspfppps         r   stage_xr     sU   ;;tD	4BIIj"4k]*,IIk2B 3+?A 
yB		BII#*=r)B/B)BDII	@	~		
!	#3$
 S+?%?A 
vB		BIIor})<b(A/A)ACII	)3+?@	CRH2J S+>%>@ 

%r   c                     t        j                  t              } t        |       }t        t
        z  }t        j                  d||gdt        dz         t        j                  d|d|fgdt        dz  	       t        d
t               y )Ns27_photo_i2r`   zphoto_by_i2.pngra   s27_photo_nb2uU   PERSPECTIVE SKETCH — the camera+layout source of truth to render photorealisticallyrg   zphoto_by_nb2.pngrh   u   [photos] 2장 완료 →)	r   r   r:   r   rm   r   rk   ro   r;   )r>   rq   r{   s      r   stage_photosr     s~    ;;tD4 F
	/CIInfC5{..0IIov
 #	%5& S+=%=? 

$c*r   c                  v   t        j                  t              } t        |       t	        |       }}d fdfd}ddj                  g d  dt         d       d	  d
d       d	  dt         d       d || d   d          d |       d  dd       d	  dd       d	  dd       d	  dd       d || d   d          d |       ddj                  fdt        D               d t        |              d t         d!  dt         d"       d	  d#d$       d	  d%d&       d	  d'd(       d) t        |              d*  d+d,       d	  d-d.       d/  d0d1       d	  d2d3       d	  d4d5       d6 t        |              d7  d8d9       d	  d:d;       d< t        |              d=  dt         d>       d	  d?d@       d	  dAdB       dC t        |              dDdj                  fdEt        D               dF      }t         j#                  |dGH       t%        dIt                 y )JNc                 ,    t        j                  |       S )N)_htmlescape)ts    r   esczstage_html.<locals>.esc  s    ||Ar   c                 (    d|  d|  d |       dS )Nz<figure><a href='z'><img src='z!' loading='lazy'></a><figcaption>z</figcaption></figure>rJ   )relcapr   s     r   figzstage_html.<locals>.fig  s-    #C5SE :##&s8*,BD 	Er   c                 D    dj                  fd| D              }d| dS )Nr   c              3      K   | ]L  }d  |d          d |d          d |d          d |d          d |d          |d   rd	nd
 d N yw)z<tr><td><b>r   z</b></td><td>r   z	</td><td>r   r    r!   r"   z <i>(inferred)</i>r   z
</td></tr>NrJ   )rL   rB   r   s     r   rM   z2stage_html.<locals>.items_table.<locals>.<genexpr>  s      
 	 #ai.)s1Y<7H6IAfI'yQ~5F1G0HAm,-.'(}#"=ZI s   AAzZ<table><tr><th>code</th><th>name</th><th>kind</th><th>placement</th><th>evidence</th></tr>z</table>rO   )r'   rowsr   s     r   items_tablezstage_html.<locals>.items_table  s8    ww 
  ;;?&J 	Kr   zout/forest_mapr   u7  <!doctype html><html lang=ko><head><meta charset=utf-8>
<title>s27 숲 지도 + 상세화 스케치</title><style>
body{font-family:'Apple SD Gothic Neo',sans-serif;margin:24px;max-width:1500px}
figure{display:inline-block;width:44%;margin:1%;vertical-align:top}
img{width:100%;border:1px solid #ccc} figcaption{font-size:13px;text-align:center}
pre{font-size:11px;background:#f7f7f7;border:1px solid #ddd;padding:8px;
white-space:pre-wrap;max-height:340px;overflow:auto}
table{border-collapse:collapse;font-size:12px;width:100%}
td,th{border:1px solid #ccc;padding:4px 6px;text-align:left}
h2{border-bottom:2px solid #333;padding-bottom:4px;margin-top:36px}
.thumb{height:110px;width:auto;border:1px solid #ccc;margin-right:6px}</style>
</head><body>
<h1>s27 — 숲 지도 + 중요 영역 상세화 (2026-07-08)</h1>
<p>스타일 SOT=경찰서 FP(TASK 1 산출, 아래 썸네일) · 콘텐츠 SOT=공간 단서
그래프 v1(evidence-bound 저작) · 마커: 지도=A–F+숫자 / 상세=P–W+숫자(완전
상이) · 구성=지도 i2/nb2 2장 + 상세(지도 계보×엔진 교차) 4장.</p>
<p><b>스타일 참조:</b><br><img class=thumb src='out/fp_v16corr/fp_l14_police_front.png'>
<img class=thumb src='out/fp_v16corr/fp_l13_police_office.png'></p>

<h2>① 숲(전체 포괄) 지도 — 구글지도 부분 캡쳐 형태</h2>
/u   지도 · i2(gpt-image-2)r   z/map_nb2_r2.pnguN   지도 · nb2 r2 (평면 강제 재시도 — ★채택, 상세 계보 소스)uM   지도 · nb2 r1 (대체됨 — 3D화+텍스트 발명, nb2 습성 기록용)u<   
<h3>지도 마커 스펙 (LLM 저작, evidence-bound)</h3>
r*   r'   u^   
<details><summary>실전송 프롬프트(지도, 양 엔진 공통 텍스트)</summary>
<pre>ud   </pre></details>

<h2>② 중요 영역 상세화 스케치 — 지도 계보 × 엔진 교차</h2>
z/detail_mapi2_i2.pngu   i2지도 → i2 상세z/detail_mapi2_nb2.pngu   i2지도 → nb2 상세z/detail_mapnb2_i2.pngu   nb2지도 → i2 상세z/detail_mapnb2_nb2.pngu   nb2지도 → nb2 상세u   
<h3>상세 마커 스펙</h3>
r+   uw   
<details><summary>실전송 프롬프트(상세, 4장 공통 텍스트 — 참조만 계보별 상이)</summary>
<pre>up   </pre></details>

<h2>③ 45° 시점 스케치 — 상세 FP 4장 × i2/nb2 (실사 前 기하 확정용)</h2>
c              3      K   | ]F  \  }}d | d  d| d| d      z     d| d| d      z     d| d| d	      z    H y
w)u   <h3>소스 FP: z</h3>r   u   소스 상세 FP ()z/sketch_r   u    → i2 스케치r   u    → nb2 스케치NrJ   )rL   r{   r   r   os      r   rM   zstage_html.<locals>.<genexpr>   s      	
 S	 cU% 	QCq,,SE345	QCxuJ
'C50A)BCD 
QCxuK
(SE1C*DEF s   AAus   
<details><summary>실전송 프롬프트(스케치, 8장 공통 텍스트 — 참조 FP만 상이)</summary>
<pre>ub   </pre></details>

<h2>④ 실사화 v2 — 스케치=뼈대, 살(실물 표면+주변 증강) — u    × i2/nb2</h2>
u   소스 스케치 (nb2)z/photo_by_i2.pngu   실사 v2 · i2z/photo_by_nb2.pngu*   실사 v2 · nb2 r1 (마커 전사 실패)z/photo_by_nb2_r2.pnguZ   실사 v2 · nb2 r2 (마커 제거+ID-free — 마커 0, 화풍은 일러스트풍 잔존)uW   
<details><summary>실전송 프롬프트(실사 v2, 양 엔진 공통)</summary>
<pre>u   </pre></details>
<details><summary>대체됨 — 실사 r1 (뼈대/살 구분 조항 前: 주변이 스케치의 간략 블록 그대로)</summary>
z/photo_r1_by_i2.pngu   r1 · i2z/photo_r1_by_nb2.pngu	   r1 · nb2u   
</details>

<h2>⑤ X 실험 — 무참조 T2I 실사(X) → X+스케치→스케치 / X+FP→실사 (lane 독립)</h2>
<h3>X — 참조 0, fp 스펙 변형 텍스트만(층수·높이 포함)</h3>
z/x_by_i2.pngu   X · i2z/x_by_nb2.pngu)   X · nb2 r1 (범례 코드 작도 실패)z/x_by_nb2_r2.pngu4   X · nb2 r2 (ID-free 범례 — ★성공, 코드 0)u;   
<details><summary>실전송 프롬프트(X)</summary><pre>ue   </pre></details>
<h3>X + 스케치 → 스케치 형태 (스케치=구조 SOT, X=실물 참조)</h3>
z/xsketch_by_i2.pngu   X_i2+스케치 → i2 스케치z/xsketch_by_nb2.pngu!   X_nb2+스케치 → nb2 스케치uE   
<details><summary>실전송 프롬프트(X+스케치)</summary><pre>uf   </pre></details>
<h3>X + FP → 실사 (FP=배치 SOT, X=룩 SOT — ⓪-5 관할 분리 계약)</h3>
u   배치 SOT · 상세 FPz/xphoto_by_i2.pngu   X_i2+FP → i2 실사z/xphoto_by_nb2.pngu   X_nb2+FP → nb2 실사u>   
<details><summary>실전송 프롬프트(X+FP)</summary><pre>u   </pre></details>
<details><summary>대체됨 — r1 스케치 8장 (스케일 블록 前: FP에 층수/규모 부재 →
전부 1층 붕괴, 사용자 지적으로 SCALE &amp; MASSING 주입 후 재생성)</summary>
c              3   r   K   | ].  \  }}  d | dd| d        d | dd| d      z    0 yw)z/r1_flat/sketch_r   u   r1 · u    → i2r   u    → nb2NrJ   )rL   ru   r   r   r   s      r   rM   zstage_html.<locals>.<genexpr>F  sd      	 3 1#cU*-uG/DE	QCuK
0F3%x2HIJs   47z
</details>
</body></html>zutf-8)encodingz[html] )r   r   r:   rX   r]   r2   rn   rp   r   r   r   r   r   r   r   r   PAGE
write_textr;   )r>   map_pdet_pr   docr   r   r   s        @@@r   
stage_htmlr     s   ;;tDt$nT&:5EEK 	AR R  R( s!G923 4)R(5)R* s/lm n+R*o+R, s!G9fg h-R,i-R0 T%[!" #1R0$1R4 
%j\5R45R: s
!9: ;;R:<;R< s
 ";< ==R<>=R> s
 ";< =?R>>?R@ s
 !#=> ?AR@@ARD T(^G$% &ERD'ERH 
%j\IRHIRN  	
 	  ORXYR\ 
.
 ]R\!Q]R` R[P[aR`\aRb s!I;12 3cRb4cRd s
./ 0eRd1eRf s
JK LgRfMgRh s
!}~ iRh@iRl 
-
mRl mRp s

+ ,qRp-qRr s
- .sRr/sR| s,# $}R|%}R~ s-EF GR~HR@ s
ST UAR@V;ARB <?y;O:PCRBQCRF s
@A BGRFCGRH s
 CD EIRHFEIRJ FIY]I^E_D`KRJaKRN s!F8_/0 1ORN2ORP s
56 7QRP8QRR s
89 :SRR;>SRT ?B.QUBV>W=XURTYURZ  	 	  [R`aRCf 	OOC'O*	GD6
r   __main__z--onlyall)r>   rw   detailssketchesphotosxhtmlr   )defaultchoicesT)parentsexist_ok)r>   r   )rw   r   )r   r   )r   r   r   r   )r   r   )>__doc__argparser   r   r   syspathlibr   pathinsertstr__file__parent
forest_libr   rm   EXPr   r:   rl   rn   rp   rv   r2   rU   rV   rT   r   r5   r3   ITEMr6   rE   rP   rX   r]   rr   r|   r   replacer   r   r   r   r   r   r   r   r   r   r   r   r   r   __name__ArgumentParserapadd_argument
parse_argsamkdironly)ru   rz   s   00r   <module>r      sw       
  3tH~,,- . eeluu  555=<'*CC.  II  	"    99  * ii   II  	4 "H%"*)Y'!  ")D9+2-3X,>#@(.'9	 K$)

 ")D9+2-3X,>#@(.'9	 K$)

0 !!7>K*(	),(-b  '(&1e EMM)R088DE&(- *		+ 		   YY  
2."&&>
+jZ z	 	 	 	"BOOHe1  2 	AIIdTI*vv vv vv##vv$$vvvv}	vv  !' {(s   /J: