W21B-w5 — BG 공간분할 production 승격 설계 brief (A + B + C)

DOC-ONLY USER-GO 필요 L05 visual 검증 완료 Codex APPROVE 방향 + Claude 검증 2026-05-31 · branch feat/w19-w20-bg-planning-cleanup · commit/push 0

이 문서의 지위

설계 brief일 뿐 구현 아님. SCHEMA bump / checkpoint(cp) re-run / 전체 BG 이미지 재생성을 유발하는 대량 변경이라 사용자 GO 전까지 doc/dry only. 실제 코드/commit/push 없음. /tmp canary 프롬프트는 PoC 증거물이지 production 템플릿이 아니다 (§2). 정확한 현재 signature/SCHEMA 버전은 구현 착수 시점에 코드로 재확인할 것 (이 brief는 메모리/설계 합의 기반, "verify@impl" 표시).

§0 TL;DR

W21B-w5에서 BG 공간분할 재설계 4요소를 L05에서 visual 검증 완료했다 (갤러리 8801~8805, 사용자 "훨씬 좋음" + "공간분류 맞다"). 이제 이 4요소를 generic하게 production 파이프라인에 승격한다. 핵심:

§0.5 Codex 리뷰 결과 & 잠금 결정 (2026-05-31, Claude 검증 완료)

Codex가 brief + 현재 step order/code 경계를 확인해 APPROVE 방향 + 5개 권고. 각 항목을 Claude가 직접 검증한 결과(맹신 안 함, [[feedback-verify-codex-not-blindly]]):

#Codex 권고Claude 검증 / 결정
D1§3 화해: geometry/band partition은 production SOT 금지 → candidate-edge generator + diagnostic floor로 demote. 최종 SOT는 edge_judgements → bg_space_partition.build_space_partition_plan → space_partition_plan 단 하나. legacy PLATE_PARTITION/REFERENCE_DAG fields는 diagnostic mirror로만 남기고 downstream이 최종 판단에 신뢰 금지.✓ 채택. 내 제안과 일치, dual-SOT 회피. 단 현 consumer(background_render_step/substrate)가 PLATE_PARTITION/REFERENCE_DAG fields를 직접 읽으면 space_partition_plan으로 rewire 필요 — 구현 시 consumer 재배선 범위 확인.
D2edge-judge 위치 = card 이후/plan 이전. 별도 "edge_judge step" 대신 신규 step bg_space_partition 하나에 candidate edge 생성 + edge judge LLM + partition assembly 통합. checkpoint에 candidate_edges/edge_judgements/space_partition_plan/diagnostics 전부. order 예 21.594. hard deps = shot_projection_card/base_location_dossier/floor_plan_overlay_payload/floor_plan_render.✓ 통합 채택. ★Claude 추가 caveat(검증 catch): w5 dry는 candidate 신호를 shot_aware_bg_render_plan 출력(plan 가공물)에서 뽑았는데, 새 step이 plan(21.595) 이전 21.594면 plan 출력을 못 쓴다 → candidate-edge 신호는 반드시 upstream(base_location_dossier 마커 + floor_plan_geometry + projection cards)에서 재유도. ★정정: per_bg_render_facts_by_bg_id는 base_location_dossier(:378)가 생산하는 production 출력(=upstream)이라 신규 21.594 step이 dossier checkpoint에서 직접 소비 가능 — 재유도 불필요(초기 "dry 전용/키 부재" 주장은 첫 grep 빈결과 오신뢰 오류, 정정). hard deps는 실제 소비분만(card+dossier+geometry)으로 최소화, FP/overlay는 shot_projection_card 통한 transitive — 구현 시 확정.
D3SCHEMA = 신규 step output. 기존 plate_partition 필드 확장 금지(wave4=geometry mirror, w5=LLM SOT 의미 다름→충돌/마이그레이션 불투명). shot_aware_bg_render_plan은 bg_space_partition checkpoint 소비해 node에 audit/mirror fields stamp 가능하나 SOT 아님. bump 2단계: 신규 bg_space_partition SCHEMA 1 + 소비자 shot_aware_bg_render_plan 별도 bump.✓ 채택(Codex가 꼽은 핵심 수정). LLM-SOT와 geometry-mirror 의미 분리 타당. brief §10 Q3 open → 이 결정으로 잠금.
D4AC2 후보: 현 에피소드 8 fp 중 L05만 강한 interior multi-room. 대안 L04_rooftop(exterior 성격)/L13_police(work+storage 2BG)/L20(wheelhouse confined, true multi-room 아님). "현 에피소드 안에서만" 강제는 약함 → best surrogate=L04/L13 명시하되, strict interior door-separated multi-zone 필요하면 다른 에피소드/프로젝트 샘플 사용. L05 단독 승격 금지는 유지.✓ 채택(정직성 강점). 사용자 결정 = L04/L13 surrogate로 진행(부분 검증, strict multi-zone은 추후 별도 샘플 보강). §8 반영.
D5C 기본 = positive-first. must-not-show는 LLM 입력의 permission/gate로만 유용, 최종 t2i_prompt에 긴 negative object list 흘리면 backfire. vNext는 primary/must-show/adjacent-glimpse 긍정 묘사 중심 + different_space exclusion은 LLM이 final prompt 생성 시 지키는 hidden constraint. 최종 prompt negative는 짧은 generic rule만("do not continue into another full room"). A/B는 둘 다, default positive-only.✓ 채택. 내 backfire caveat + 절대규칙(열거 negative=시나리오 element leak 위험) 둘 다와 정합. §6 갱신.

추가 Required (Codex, 검증 후 채택):

§1 문제 & 검증된 해법

근본 결함 (코드 grounded)

기존 참조 로직은 집(fp) 단위로 공간을 묶었다. _corroborates_same_space(shot_aware_bg_render_plan.py)가 같은 floor의 camera_unit + look_at/target overlap만 보고, LLM selected_refs(same_physical_space_view)도 집 전체를 한 공간으로 인식 → cross-zone bleed(욕실이 거실 plate를 부모로 상속, 멀티존 fp에서 욕실 렌더에 거실·식탁·TV가 떠다님). zone(방) 단위 데이터는 존재하지 않았음: base_marker_inventory는 layer-flat, 10×10 VLM readback은 synthetic placeholder, 텍스트 라벨 파싱은 절대규칙 위반.

검증된 4요소 해법 (L05, $0 dry + 카드 12 VLM + edge judge 20 LLM + 이미지 9장 ~$2)

요소무엇L05 검증 결과
A 파티션candidate graph(signature+IDF+hub 격리) → edge judge(card evidence 위 text LLM) → anchor-centered constrained clustering(transitive closure 금지)욕실 L05B10 ~ 거실/침실 전부 different_space(0.84~0.91), B10~B09만 adjacent(거실서 욕실문 보임). same_space는 거실{B03,B09} / 침실{B02,B05}만. 욕실이 독립 plate (parent 없음).
B 단순 FPCV-readable partition diagram: 두꺼운 벽 enclosed cell, 큰 sparse 번호, 영어 라벨·색존·장식가구 제거, room envelope+openings+essential fixtures만#5 욕실 닫힌 독립칸, #6/#7 침실 각각 닫힘, #3 거실주방 오픈. I2I가 enclosed 방을 읽음. 사용자 "훨씬 좋음".
C zone 프롬프트4-block(primary zone / must-show / may-show doorway glimpse만 / must-not-show)욕실 BG가 사방 타일 벽으로 닫힘, 거실 bleed 0. 3-layer canary로 BG 프롬프트가 가장 직접적 원인임을 결정적 실증 (OLD 프롬프트+새 FP도 여전히 bleed → 프롬프트가 결정타).
+ ref DAG같은 그룹 멤버 → anchor PNG 참조거실 B09(anchor)↔B03, 침실 B05↔B02가 같은 공간으로 일관되게 렌더 (사용자 "참조 안 들어갔지" 지적 반영).

§2 ★ GENERIC 절대 명령 (시나리오 하드코딩 금지)

절대규칙 ([[feedback-no-scenario-specific-coding]] + [[feedback-no-literal-substring-meaning]]): 특정 시나리오(L05/욕실/거실/식탁/TV 등 어떤 방·prop·문구)를 기반으로 한 일반 rule/prompt/code 금지. 글자/substring/조사/lexicon literal/word-boundary 패턴으로 의미 판단·추출·필터 금지.

§3 아키텍처: A/B/C 합성 + wave4와의 화해

★ 핵심 설계 결정 (Codex 의논 필요): wave4(W21B-w4)에서 이미 commit된 geometry/band 기반 mirror_plate_partition + build_reference_dag (PLATE_PARTITION_FIELDS / REFERENCE_DAG_FIELDS, SCHEMA 9)와, w5의 edge-judge 기반 bg_space_partition.py를 어떻게 화해시키는가?

결정 (D1/D3 잠금 — Codex APPROVE + Claude 검증):

production 파이프라인 (제안):

base_location_dossier ─┐
shot_aware geometry    ├─▶ ① candidate edges (signature+IDF+hub, deterministic floor, diagnostic)
projection card (VLM)  ─┘            │
                                     ▼
                          ② edge-judge step (신규, LLM text over card visible_items)
                                     │  → edge_judgements{state,conf,evidence,shared_distinctive}
                                     ▼
                          ③ bg_space_partition.build_space_partition_plan (w5 module, SOT)
                                     │  → plate_groups / anchor / ref_tree_parents(max2) / render_actions
                                     ▼
              ┌──────────────────────┼──────────────────────┐
              ▼                      ▼                       ▼
   A: render plan 배선        C: background_prompt       + reference DAG
   (selected_refs demote)    vNext (4-block permission)   (anchor PNG 참조)
                                     ▲
                          B: 단순 FP pack vNext (CV-readable substrate)

§4 A track — 파티션 production 배선

module: backend/app/modules/pipeline/bg_space_partition.py (구현 완료, 9 test green, inert) · verify@impl signature

§5 B track — 단순 FP pack vNext (GENERIC)

★ Codex caveat (필수 명시): 단순화된 FP가 projection-card substrate로 들어가는 순간, card visible_items는 FP/render substrate를 VLM이 읽어서 만들어지므로 FP 디테일이 바뀌면 card를 재생성해야 한다. card가 바뀌면 그 위에 얹힌 edge judge → space_partition_plan도 재실행 필요. 즉 B(단순 FP) 변경은 A(파티션)의 입력을 바꾼다 → 순서: B FP pack 확정 → card 재생성 → edge judge 재실행 → partition. 현 w5 edge judge / card JSON fixture는 module TDD·설계검증용이지 최종 품질 SOT가 아니다.

§6 C track — background_prompt vNext (GENERIC, DECISIVE)

§7 빌드 순서 (의존성)

  1. B FP pack vNext 확정 (render_role LLM 분류 + CV-readable contract). ← card substrate가 바뀌므로 먼저.
  2. projection card 재생성 (새 FP substrate 위에서). card/edge judge regen caveat §5.
  3. 신규 bg_space_partition step 구현 (candidate edge[upstream 신호] → edge judge LLM → space_partition_plan, SCHEMA 1, order 21.594).
  4. A 배선: shot_aware_bg_render_plan이 bg_space_partition checkpoint 소비 → space_partition_plan SOT, selected_refs + legacy plate_partition/ref_dag fields demote(diagnostic), 소비자 별도 SCHEMA bump, substrate 트리 소스 교체.
  5. C background_prompt vNext: 4-block permission 소비 + reference DAG(anchor PNG 참조).
  6. full visual gate (Claude + 사용자): L05 + §8의 2nd multi-zone fp.

설계는 A/B/C를 함께 본 brief로 잠그되, 구현·검증은 위 순서. C가 visual 결정타라 실험을 넓게.

§8 ★ Acceptance criteria

★ Codex 보완 ① — 2nd multi-zone FP generality check (필수): L05 한 케이스만으로 production 승격 금지. 최소 하나 더 multi-zone / door-separated FP에서 A 파티션 + C zone permission + B CV-readable FP가 generic하게(같은 코드, per-scenario 튜닝 0) 작동하는지 dry/canary 기준을 통과해야 한다.
#기준검증 방법
AC1L05 재현: 욕실 독립 plate(cross-zone parent 0), 같은 그룹 일관(ref DAG), 벽만 안 나옴이미 통과 (갤러리 8801~8805)
AC22nd multi-zone fp: 문으로 분리된 ≥2 zone fp에서 ① A 파티션이 올바른 zone 그룹 생성(cross-zone parent 0) ② C가 cross-zone bleed 0 ③ B가 enclosed 방 렌더 — 전부 같은 generic 코드로D4(Codex read-only scan, Claude 검증): 현 에피소드 8 fp 중 L05만 강한 interior multi-room. surrogate = L04_rooftop(deck+room+door, exterior 성격) 또는 L13_police(work+storage, 2 BG). L20(wheelhouse, confined·true multi-room 아님). ★사용자 결정(2026-05-31) = L04 또는 L13 surrogate로 진행. strict interior door-separated가 더 필요하면 다른 에피소드/프로젝트 샘플은 후속 옵션. L05 단독 승격은 금지 유지. caveat: L04/L13은 완전한 interior multi-room이 아니므로 generic 작동의 부분 검증 — 통과해도 strict multi-zone 일반성은 별도 샘플로 추후 보강 권장.
AC3good reuse 보존: single-zone/소형 fp(L13/L20/L04류)의 정상 reuse가 깨지지 않음w5에서 L13/L20/L04 same_space 보존 실증됨 → 2nd fp에도 회귀 없음 확인
AC4generic 감사: 시나리오 하드코딩 leak 0 (canary 문구·element 리스트 코드 유입 없음)완료 보고 별도 섹션 (절대규칙 증명)
AC5OFF byte-identical: 신규 step/pack default OFF 시 기존 출력 불변(drift 0)focused test + real-data no-op E2E

§9 비용 / 리스크 / GO gate

§10 open questions → 해소됨 (Codex 리뷰 2026-05-31, §0.5 결정)

  1. §3 화해D1: geometry partition demote(candidate+diagnostic), edge-judge SOT 단일. ✓
  2. step 위치D2: 신규 통합 bg_space_partition step, card 뒤/plan 앞(21.594). + signal-provenance caveat(upstream 재유도). ✓
  3. SCHEMA 전략D3: 신규 step output(SCHEMA 1), plate_partition 확장 금지, 소비자 별도 bump. ✓
  4. AC2 2nd fpD4: 현 에피소드 L05만 강한 interior multi-room. surrogate L04/L13, strict check는 별도 에피소드/프로젝트 샘플. ✓
  5. C negationD5: default positive-only, different_space는 hidden constraint, 최종 prompt negative는 짧은 generic rule만. ✓

남은 진짜 open = (a) 구현 시 legacy fields(PLATE_PARTITION/REFERENCE_DAG) consumer rewire 범위 확정 (b) AC2 샘플사용자 결정: L04 또는 L13 surrogate로 진행(D4). candidate-edge 신호 키는 확정됨(dossier per_bg_render_facts_by_bg_id).


관련 메모리: session-20260531-w21b-w5-bg-space-partition-design-dry · next-session-bg-space-partition-redesign · feedback-no-scenario-specific-coding · feedback-fp-scene-driven-simple-elements · feedback-verify-codex-not-blindly.
갤러리 증거: 8801(파티션) · 8802(단순 FP) · 8803(욕실 3-layer) · 8804(zone 6bg) · 8805(ref DAG 일관성).

§11 Codex 후속 권고 (2026-05-31 2차, Claude 검증 채택)

Codex가 정정을 수용하고 brief를 "설계 합의 문서로 닫아도 된다" 판정 + 남은 open 3건에 구현 가이드:

brief 상태 = 설계 합의 완료(closed). 다음은 사용자 GO 시 빌드 순서(§7) 착수. 그 전까지 doc/dry only, commit/push 0.