BG 파이프라인 #4 — render-input substrate policy

TheRoad Scene Lab · W21B-wave-4 · 2026-05-31 · Claude 초안 → Codex cross-review (Required 1 + Q1/Q4 v0 decided 반영) (doc-only)

v0.2 — doc-only · Required 반영 코드/DB/prompt/render 변경 0 design brief = contract SOT

이 문서의 목적 — 사용자 4단계 BG 아키텍처 비전 중 #4(C) = render-input substrate policy를 설계한다. 3a/3b(plate partition + reference DAG)가 방금 lock+APPROVE되어 plan 노드마다 어떤 plate를 새로 그리는가 / 어떤 plate를 재사용하는가 / 어떤 부모 plate를 어떤 역할로 참조하는가 / 어떤 순서로 렌더하는가가 결정됐다. #4는 그 계약을 입력으로 받아, 각 노드를 실제 image 렌더에 넣을 때 무엇을(FP PNG / 부모 plate PNG / projection card prose) 어떤 경계로 합성 입력에 넣는지를 정의한다.
★ 상태 명시 (Codex 요청) — 본 brief가 입력으로 삼는 C3/3a/3b wiring은 구현+테스트+Codex APPROVE 완료이나 아직 미커밋(approved but uncommitted) 상태다. 이 문서는 설계 계약일 뿐 어떤 implementation commit도 함의하지 않는다. commit/push는 사용자 명시 gate(commit/push 0)를 그대로 따른다. 본 brief 자체도 코드/DB/prompt/render 변경 0.

목차

§1 4단계 비전과 #4의 위치
§2 substrate 입력 계약 (3a/3b/projection이 stamp한 SOT)
§3 node-class별 substrate policy
§4 parent ref role handling
§5 fail-closed behavior
§6 prompt / render boundary
§7 절대 보존 계약
§8 acceptance matrix
§9 미결 / open questions
§10 빌드 시퀀스

§1 4단계 비전과 #4의 위치

단계내용상태
#1 (A)FP 결정 격상 (background_master_plan 휴리스틱 → LLM)future wave 보류
#2FP 생성 (floor_plan_render self-fidelity)완료
#3 (B)plate partition (3a) + reference DAG (3b) — card-aware완료 · APPROVE · 미커밋
#4 (C)render-input substrate policy — node별 무엇을 렌더 입력에 넣나이 brief

#4는 3b reference DAG 계약이 먼저 lock돼야 의미가 분명해진다(어떤 ref를 어떤 역할로 넣을지가 DAG에서 나옴). 그 전제가 방금 충족됐으므로 #4를 doc-only로 설계한다. 실제 render input을 구성/소비하는 코드(background_prompt / background_render)는 이 brief 단계에서 건드리지 않는다.

§2 substrate 입력 계약 — 3a/3b/projection이 stamp한 SOT

substrate는 새 진실을 만들지 않는다. 아래 이미 stamp된 필드만 읽어 render input을 조립한다.

출처필드substrate에서의 의미
router (④)render_action (render_new_plate / reuse_existing_plate), reuse_target_bg_idcanonical SOT — 픽셀을 새로 그리나 / 재사용 alias인가
3a (⑥)plate_group_id, plate_anchor_bg_id, plate_anchor_shot_id, plate_shareability, needs_new_plateplate 소유/공유 — 어느 bg가 픽셀을 생산하나, 공유 가능 등급
3b (⑦)ref_tree_parents (rendered-plate anchor로 canonicalize됨), ref_role_per_parent (space_continuity / style), render_order_index, max_refs=2부모 plate 참조 트리 + 렌더 순서
projection (C3/C4)projection_card_state (pass/needs_review/blocked/not_available/not_applicable), projection_card_id(==hash), anchor_shot_id, projection_card_inherited, card_withhold_reasonplate prose 주입 자격 (pass만), withhold 흔적
SOT 우선순위: substrate의 진실 원천 = plate partition + reference DAG + projection card pass-guard. camera_decisiondemoted compat field로만 남아 있고(삭제 X), substrate 결정에 권위를 갖지 않는다.

§3 node-class별 substrate policy

node class판별render input substrate
fresh plate needs_new_plate=true (render_new_plate) ① FP PNG (해당 fp_id) ② anchor card bg_plate_visible_description prose — projection_card_state=pass일 때만ref_tree_parents의 부모 plate PNG들 (이미 rendered-plate anchor로 canonicalize됨). 순서 분리: node는 render_order_index 순서로 렌더하고, 각 node의 parent refs는 ref_tree_parents order로 attach(§4 = FP first → space_continuity → style)
reuse alias reuse_existing_plate (needs_new_plate=false) render input 없음 — W21B-w3 copy-less alias만(image 0, status=ok, is_reuse=true, reuse_target_bg_id + provenance). substrate는 이 노드에 어떤 prompt/PNG도 조립하지 않는다.
card-withheld fresh card_withhold_reason 보유 (reuse였다가 D5 horizontal-band 충돌로 fresh 강등) fresh plate와 동일(needs_new_plate=true). ref policy는 DAG 기준. withhold는 plate 재사용만 닫은 것 — render substrate는 정상 fresh.
fp-less / direct projection_card_state ∈ {not_applicable, not_available} + fp-less surface existing/direct path(현 v10 surface), projection prose 미주입. 실패 아님 — card subsystem 무관 경로.

§4 parent ref role handling

role→참조 강도 매핑은 render input 조립 정책이지 새 LLM 판단이 아니다. role은 3b가 node mode에서 deterministic하게 도출한 enum이고, substrate는 그 enum을 PNG 참조 가중치/배치로 번역만 한다.

parent PNG 다중참조 방식 (Q1 → v0 decided, Codex 합의)

§5 fail-closed behavior

조건처리
부모 plate PNG 부재 / hash mismatchimage render 전 block 또는 v10/current path fallback — 깨진 참조로 렌더 진입 금지
render_order 위반 (부모가 아직 안 그려짐)block — DAG topological order 보장 실패는 silent 진행 금지
projection_card_state ≠ passplate prose 미주입(pass-only). needs_review/blocked 카드는 BG render substrate에 넣지 않음 — fp-less와 동일 경로로 fallback
projection_card_id ≠ hash (자기일관성 깨짐)stale 처리 → 미주입 (C4 part1 resolve_projection_plate_injection 경계 재사용)
원칙: substrate는 image render 호출 전에 모든 참조 무결성을 확정한다. 부족하면 block 또는 명시적 fallback이지, 부분 입력으로 렌더하지 않는다(silent degrade 금지).

§6 prompt / render boundary

입력채널금지
anchor card bg_plate_visible_description prose (pass-only)prompt surface (text)
FP PNG + 부모 plate PNG들image references
structured card fields / marker_number / band enum / marker_layer literal어디에도 노출 금지prompt에 구조화 필드/번호/enum/layer literal 절대 넣지 않음 — prose만
★ 절대 규칙 연동 — 한국어 prose는 미파싱·미터치. 의미 판단은 LLM/VLM semantic structured extraction이 이미 만든 prose만 surface로 전달. 글자/substring/조사/enum literal 패턴으로 prompt를 조립하지 않는다. camera_decision은 demoted compat field로 보존하되 substrate SOT 아님.

substrate 위치 — single resolver core + split 소비 (Q4 → v0 decided, Codex 합의)

§7 절대 보존 계약

§8 acceptance matrix

케이스대상검증
fresh + pass cardL05 / L09 anchor 2장FP + plate prose + 부모 PNG 조립, controlled A/B (v10 vs substrate)
reuse aliasL20 (reuse 3쌍 중)render input 0, copy-less alias 유지, provenance만
fp-less / directfp-less 1 케이스projection not_applicable, direct path, prose 미주입
card-withheld freshsynthetic withheld 노드 1deterministic substrate test(image gate 불요): substrate가 fresh와 동일 입력(FP+ref policy)을 조립하는지, target을 ref로 안 넣는지 assert

이 smoke matrix면 4 node-class를 모두 커버한다(card-withheld fresh는 image gate 기준 fresh와 동일이라 visual smoke는 불요하나, deterministic substrate test row 하나는 둔다 — withhold 자체는 3a route_v2에서 검증됨). 완성도는 visual review — substrate가 BG↔FP 정합을 실제 개선하는지는 image gate(사용자 육안)로만 판정(TDD는 deterministic 조립 로직까지만).

§9 미결 / open questions

§10 빌드 시퀀스

현재 진행안: #4(C) doc-only brief 작성(이 문서) → Codex review → 그 다음 사용자 명시가 있을 때만 commit grouping(C3/3a/3b approved-uncommitted) 또는 small E2E canary. 본 brief는 code/commit/push 0.