v0.2 — doc-only · Required 반영코드/DB/prompt/render 변경 0design 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.
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을 조립한다.
SOT 우선순위: substrate의 진실 원천 = plate partition + reference DAG + projection card pass-guard.
camera_decision은 demoted 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.
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 합의)
정책 판단은 한 deterministic resolver core(예: resolve_render_substrate pure helper)에서 한 번만 한다. fallback_reason/hash/order를 한 곳에서 산출.
prompt와 image ref가 같은 fallback_reason/hash/order를 공유해야 하므로, 두 단계가 각자 정책을 재판단하면 안 됨. background_prompt에 PNG ref 정책을 넣거나 background_render가 card prose 정책을 다시 판단하면 C4 guard와 중복/분기 drift 발생 → 금지.
render_action / reuse_target_bg_id 재정의 금지 — substrate는 이 canonical SOT를 읽기만, 다시 쓰지 않음.
byte-identical 경계 (정밀) — byte-identical 보장은 substrate consumer selector/flag가 OFF일 때 또는 effective v10 fallback path일 때만 성립한다. projection card가 OFF여도 substrate consumer가 ON이면ref_tree_parents 기반 부모 PNG 입력은 여전히 달라질 수 있다. 또한 projection_card_state ≠ pass이면 plate prose만 미주입이고, parent PNG substrate는 render_action/ref_tree policy에 따라 별도로 적용 여부가 결정된다(prose 미주입 ≠ PNG substrate 미적용).
§8 acceptance matrix
케이스
대상
검증
fresh + pass card
L05 / L09 anchor 2장
FP + plate prose + 부모 PNG 조립, controlled A/B (v10 vs substrate)
reuse alias
L20 (reuse 3쌍 중)
render input 0, copy-less alias 유지, provenance만
fp-less / direct
fp-less 1 케이스
projection not_applicable, direct path, prose 미주입
card-withheld fresh
synthetic withheld 노드 1
deterministic 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
Q1(v0 decided — §4) 부모 plate PNG 다중참조 = ordered separate refs(FP first→space_continuity→style, max 2), 합성 sheet는 last resort. 남은 실측: 현 background_render reference 채널 수 한계(read-only 확인) — 부족 시 style ref text-only degrade.
Q2 space_continuity vs style 참조 강도 = image ref order(강) + prompt wording 약보강(둘 다). 세부 wording은 구현 단계 calibrate.
④ (사용자 GO 시) real-provider canary — pass card 있는 reuse/fresh로 A/B image gate
⑤ 사용자 visual review로 완성도 판정 → prompt/role 미세조정 반복
현재 진행안: #4(C) doc-only brief 작성(이 문서) → Codex review → 그 다음 사용자 명시가 있을 때만 commit grouping(C3/3a/3b approved-uncommitted) 또는 small E2E canary.
본 brief는 code/commit/push 0.