---
title: Area #7b — Visual World Rules Downstream Prompt Cascade (Track B Tier 3 #2, v1)
date: 2026-05-19
status: closed (spec Codex iter 7 APPROVED_FOR_PLAN + plan Codex iter 3 APPROVED_FOR_EXECUTION + W1-W6 atomic execution + per-wave APPROVED; range review/push gate pending at W6 closure commit time — Codex APPROVED_FOR_PUSH 후 즉시 push origin main)
roadmap_ref: docs/superpowers/specs/2026-05-16-track-b-semantic-debt-roadmap-design.md §5.7 (Sub-area b cascade)
prerequisites:
  - Area #7a (visual_world_rules SOT v1 + scene_director A047 absorption, closed 2026-05-19, push `d0410eb`) — producer VWR v7 schema (rules_schema.json `rule_type` 10-enum strict + director_notes description small fix) + producer VWR v7 system.md (10-token canonical list 본문 보존, line 51) + STEP_MANIFEST `visual_world_rules.schema_version=1` + scene_director v9 system.md A047 3 site principle-only rewrite. 본 Area #7b = 그 producer SOT 의 downstream 11-site cascade (Sub-A 외 잔여 분산 도메인 list site)
  - Area #3 (Visibility / physical presence SOT, closed 2026-05-18, commit `97c4471`) — boundary preserved (shot_director.py mutation 폐기 + Path 1/2 분리). 본 area = prompt-only cascade 이며 shot_director consumer 본체 영향 0
  - Area #5 (Reference phrase / phantom guard, closed 2026-05-18+, commit `fe300bf`) — boundary preserved (`reference_phrase_kinds` sidecar). 본 area cross-cut 0
  - Hygiene v1 (closed 2026-05-15, commit `91d1dfd`) — P-1 ~ P-6 fix 보존
non_supersedes:
  - Area #7c (t2i_review v6 placeholder example abstraction — `scene_system.md:31/36/39/60-61` + `entity_system.md:33-34`) — 별도 small area
  - Area #7d (cinematography closed-list SOT dual-site — `variation_recommender/v2/system.md` + `scene_extractor_v2/19.../turn_scene_detail.md:87-91`) — 별도 area, cinematography 도메인 별개
  - Carry-A099 resolved by W1/W2 + W3 closure-docs (2026-05-19+) — director_notes prose hard-prime examples abstracted; Area #7a 정합 보존
  - Carry-A100 (VWR system.md t2i_context demonym redesign V8+) — Area #7a 정합 보존
  - Carry-P021 (scene_consistency 7 enumeration broad — source unresolved low-priority) — Area #7a 정합 보존
---

# Area #7b — Visual World Rules Downstream Prompt Cascade (v1)

## 1. Purpose + Scope

### 1.1 Purpose

Area #7a (closed `d0410eb`) 가 visual_world_rules (VWR) v7 schema (rules_schema.json `rule_type` 10-enum strict 화 + director_notes description small fix) + system.md v7 (10-token canonical list 보존) + STEP_MANIFEST `schema_version=1` 신설 + scene_director v9 (A047 3 site principle-only rewrite) — **producer SOT + 1 consumer (scene_director)** 만 처리. 잔여 11 downstream consumer site = audit 02 §11.2 line 240-254 에 분산 도메인-specific Korean fantasy/supernatural 리스트로 LLM 에게 instruction (`인간↔요괴 / 인간↔괴물 / 본체↔변신체 / 빙의/합체 / 이무기 / 구미호 / 요괴화 / 뱀파이어 / 메카 / 파워드슈트 / 강화복 / 갑옷 로봇 / 인간형 요괴/괴물 / 좀비 / 원격접속/빙의 / 평상복 → 전신 갑옷 / 빙의/정신 전환/몸을 빌리는 설정 / 원격 접속/조종/빙의/텔레파시 / 빙의/영혼 상태 / 원격 조종/접속 / 빙의로 얼굴이 바뀜 / 요괴로 변해도` 등 — Codex iter 4 F-3 흡수, audit §11.2 외 본 controller verify 발견 3 site 추가). 이 분산 site 자체 list 가:

1. **VWR SOT 우회 (consumer cascade gap)** — Area #7a producer 가 정합한 10-enum SOT (`possession / transformation / ghost / projection / superpower / body_deformation / time_period / costume / technology / other`) 가 있음에도, 각 consumer prompt 가 자체적으로 "변신/빙의/원격접속" 사례를 enumerate 하여 LLM 에게 분류 instruction. consumer 가 SOT 를 참조하지 않으면 producer 강제가 cascade 안 됨.
2. **도메인-specific Korean fantasy leak (G6 closed-list LLM instruction)** — `구미호 / 이무기 / 망령 / 요괴화 / 갑옷 로봇` 같은 한국 작품 도메인 specific term 이 generic prompt body 에 잔존. 시나리오 도메인 (한국 fantasy / supernatural / sci-fi) 의존성 코드/프롬프트 분리 원칙 (CLAUDE.md "작품 고유명사 코드/프롬프트에 넣지 말 것") 위반.
3. **Description / boundary drift (cross-consumer divergence)** — 같은 "비물리/매개 physical presence" 축에서 outlook_extractor / entity_extractor / scene_verify / scene_detail / shot_extract 가 서로 다른 enumeration 으로 같은 결정 boundary 를 가르침. consumer 사이 wording drift → LLM emit 시 일관성 결손.

본 area = **7 prompt module 의 new dir 신설** (`entity_all` site 1 / `entity_relation` site 3 / `entity_extractor_v2` site 6+7 / `outlook_extractor` site 4+5 + line 24 신규 / `scene_verify` site 9 / `scene_detail` site 10 / `shot_extract` site 11) — 자체 도메인 list 본체 폐기 + **canonical VWR SOT reference clause** (audit 02 §11.3 verbatim) 로 교체 + **D-2 carve-out** (`entity_character_list` site 2 = owner taxonomy `인간/요괴/동물/로봇/외계인` generic 분류, 변경 0 boundary 보존). v1 scope = prompt rewrite 만 — schema / code / STEP_MANIFEST 변경 0. helper 신설 0. cinematography (Area #7d) / t2i_review placeholder (Area #7c) / director_notes prose (Carry-A099) / t2i_context demonym (Carry-A100) / scene_consistency P021 = 모두 explicit non-claim carry.

**Canonical numbers (Codex iter 4 F-2 흡수)**: 7 new prompt dirs / 9 modified prompt files / 24 byte-identical sibling files / 10 STEP_MANIFEST entries. D-2 entity_character_list = boundary preserve (new dir 0, modified 0).

### 1.2 In-scope

**Prompt (3 surface group / 7 new prompt dirs / 9 modified prompt files / 24 byte-identical sibling files / 10 STEP_MANIFEST entries)** — Codex iter 4 F-2 canonical 흡수:

> `HHMM` placeholders are implementation-time timestamp placeholders; W1/W2/W3 wave entry 시 controller actual `YYYYMMDDHHMM` timestamp 으로 replace. 본 spec drafting date = 2026-05-19. **만약 execution 이 다른 날짜로 cross 하면 plan/spec amend 1 (narrow) 으로 date prefix 정정 후 W1 진입 의무** (Codex spec drafting strategy verdict, Q4 정합).

#### 1.2.1 Group E — entity_* (5 site, W1 single atomic commit)

| # | Surface | Path (current latest) | Lines | Action |
|---|---|---|---|---|
| 1 | `entity_all` character.md (변신/변형 enumeration) — **D-1 / audit §11.2 site 1** | `prompts/_base/entity_all/4.202603310100/character.md` | line 26 (`변신/변형: 인간↔요괴, 인간↔괴물, 본체↔변신체`) + line 29 (`빙의/합체: 다른 존재가 몸을 빌리거나 합체`) + line 30 (`**수식어 기반 분리** ... 이무기, 구미호, 요괴화, 뱀파이어`) | new `5.20260518HHMM/character.md` 신설: 3 bullet line 도메인-specific term (`인간↔요괴 / 인간↔괴물 / 이무기 / 구미호 / 요괴화 / 뱀파이어`) 본체 폐기 → **canonical VWR SOT reference clause** (§3.1 verbatim) 삽입 + 일반 `변신/변형 / 빙의/합체` principle wording 만 보존. local prefix/suffix site-specific 허용 (entity_all character extraction context wording 보존). location.md / prop.md / character_schema.json / location_schema.json / prop_schema.json / system.md = **byte-identical verbatim copy** (5.* dir 안 stem sibling 보존, prompt_loader latest version 활성 정합). |
| 2 | `entity_character_list` system.md (owner taxonomy) — **D-2 / audit §11.2 site 2 = no-change boundary** | `prompts/_base/entity_character_list/2.202605011057/system.md` | line 10 (`(인간, 요괴, 동물, 로봇, 외계인 등)`) | **변경 0** (D-2 carve-out). owner taxonomy 는 generic 5-element 분류 (인간/요괴/동물/로봇/외계인) — VWR rule_type SOT 와 다른 축 (인물 정의의 taxonomy boundary, presence/visibility 결정 X). new dir 신설 0. residue gate global-ban 0 (entity_character_list 본문 안 `요괴 / 로봇` 등 단어 = legitimate, gate forbidden 0). DB row override risk 검토 = `db=`-aware caller 만 본 module 에 존재 (audit §11.4) — 변경 0 이므로 DB row 영향 0. |
| 3 | `entity_relation` system.md (변형 관계 예시 + visual_similarity 예시) — **D-3 / audit §11.2 site 3** | `prompts/_base/entity_relation/2.202603301800/system.md` (sibling: `analyze.md` + `analyze_schema.json` — byte-identical copy 의무, production 안 `entity_relation.py:93-95` 가 3 file 모두 load) | line 11-13 audit-verbatim residue (`요괴/괴물 형태` / `유령/망령 형태` / `갑옷 착용 형태`) + line 30 **current-active-promoted residue** (`요괴로 변해도 원래 인물의 흔적이 있음 → true` visual_similarity 예시, audit verbatim 아님, controller verify 2026-05-19) | new `3.20260518HHMM/system.md` 신설: line 11-13 3 bullet 도메인-specific term 본체 폐기 → canonical VWR SOT reference clause 삽입 + 일반 `변신 / 사후 / 변장/장비` principle wording 만 보존. line 30 visual_similarity example 의 `요괴로 변해도 원래 인물의 흔적이 있음 → true` full phrase = generic placeholder (예: `이미지 형태가 달라져도 원래 인물의 흔적이 있음 → true`) 추상화. analyze.md / analyze_schema.json = **byte-identical verbatim copy** (3.* dir 안 sibling 보존, `prompt_loader._resolve_stem_in_pack:259-266` strict mode 안 latest pack stem miss 시 raise 차단). |
| 4 | `entity_extractor_v2` system.md (변형 허용 예시 + 빙의 section header) — **D-4 / audit §11.2 site 6** | `prompts/_base/entity_extractor_v2/9.202605130226/system.md` | line 22 (`평상복 → 전신 갑옷 (완전히 다른 실루엣)`) + line 32 (`### 빙의/정신 전환/몸을 빌리는 설정이 있는 경우`) section header | new `10.20260518HHMM/system.md` 신설: line 22 도메인-specific (`평상복 → 전신 갑옷`) → generic placeholder (`<costume rule_type 변형 = 완전히 다른 실루엣>` 또는 generic `의상이 완전히 다른 실루엣으로 변하는 경우`). line 32 section header `### 빙의/정신 전환/몸을 빌리는 설정` → canonical VWR SOT reference clause 삽입 + `### rule_type=possession / projection 시 처리` (또는 generic `### 비물리 / 매개 상태 처리`) section header rewrite. section body 안 `중요한 건 육체의 외형이지, 정신/영혼의 주인이 아님` principle wording 보존. |
| 5 | `entity_extractor_v2` turn0_style.md (visual_world_rules 정의 안 원격 접속/조종/빙의/텔레파시 enumeration) — **ADD-6 / audit §11.2 site 7** | `prompts/_base/entity_extractor_v2/9.202605130226/turn0_style.md` | line 13 (`원격 접속/조종/빙의/텔레파시 등 기술이 있다면: 접속자의 물리적 몸이 현장에 있는지 없는지`) | 같은 new `10.20260518HHMM/turn0_style.md` (#4 와 single atomic commit 안 동일 dir): line 13 도메인 enumeration (`원격 접속/조종/빙의/텔레파시`) 본체 폐기 → canonical VWR SOT reference clause 또는 generic `rule_type=projection / possession 등 비물리 매개 상태` wording. visual_world_rules section 의 본 turn0_style 자체 사용 의도 (LLM 이 VWR 정의 시 무엇을 emit 해야 하는지 instruction) 보존 — `포함 / 불필요` boundary section 자체 wording 변경 0. |

**Group E single atomic commit (W1)**: entity_extractor_v2 site 6 (system.md) + site 7 (turn0_style.md) **둘 다 modified + 나머지 stem byte-identical copy** (turn_entity_detail.md / turn0_style_schema.json / turn1_7_detail_batch_schema.json / turn1_7_detail_batch.md / turn1_review_schema.json / turn1.md / turn2.md / turn3.md / turn4.md = 9 file byte-identical copy in `10.20260518HHMM/`). entity_all site 1 (character.md) + 6 sibling byte-identical copy (character_schema.json / location.md / location_schema.json / prop.md / prop_schema.json / system.md). entity_relation site 3 (system.md) + 2 sibling byte-identical copy (analyze.md / analyze_schema.json — Codex F-1 흡수, production 안 `entity_relation.py:93-95` 가 3 file 모두 load). **D-2 entity_character_list = new dir 신설 0**. 5 site × 3 module new dir (entity_all `5.*` / entity_relation `3.*` / entity_extractor_v2 `10.*`) — **17 byte-identical sibling copy total (6+2+9) + 4 modified files** — single atomic commit.

#### 1.2.2 Group O — outlook_* (2 site, W2 single atomic commit)

| # | Surface | Path (current latest) | Lines | Action |
|---|---|---|---|---|
| 6 | `outlook_extractor` phase1.md (인간형 기계장치 enumeration + 사람 형상 분류 enumeration) — **ADD-8 audit §11.2 site 4 audit-verbatim** + **current-active-promoted line 24 (Codex iter 4 F-3 흡수)** | `prompts/_base/outlook_extractor/11.202603311724/phase1.md` | line 16 audit-verbatim (`사람이 탑승하거나 착용하는 인간형 기계장치(메카, 파워드슈트, 강화복, 갑옷 로봇 등)도 아웃룩으로 추출`) + line 24 **current-active-promoted** (`사람 형상인 캐릭터: 인간, 인간형 요괴/괴물, 뱀파이어, 좀비 등 (아웃룩 대상)` — audit §11.2 verbatim 아님, controller verify 2026-05-19, 같은 active prompt surface scope_creep_risk 차단 위해 본 area 흡수 권고 [Codex iter 4 F-3]) | new `12.20260518HHMM/phase1.md` 신설: line 16 도메인-specific (`메카 / 파워드슈트 / 강화복 / 갑옷 로봇`) parenthetical 폐기 → canonical VWR SOT reference clause + generic `costume / technology rule_type 의 인간형 기계장치 외형 (실루엣을 결정하는 wear/ride 형태)` wording. line 24 도메인-specific (`인간형 요괴/괴물, 뱀파이어, 좀비`) parenthetical 폐기 → canonical VWR SOT reference clause + generic `사람 형상인 캐릭터: 인간 + VWR rules[] 의 rule_type 이 humanoid 변형으로 가리키는 인물 (아웃룩 대상)` wording. 두 line 같은 wave (W2) 단일 file 안 동시 amend. |
| 7 | `outlook_extractor` phase2.md (원격접속/빙의 enumeration) — **ADD-9 / audit §11.2 site 5** | `prompts/_base/outlook_extractor/11.202603311724/phase2.md` | line 8 (`원격접속/빙의: 접속당한 몸이 있는 장소에만 배정`) | 같은 new `12.20260518HHMM/phase2.md` (#6 과 single atomic commit 안 동일 dir): line 8 `원격접속/빙의:` parenthetical 폐기 → canonical VWR SOT reference clause + generic `rule_type=possession / projection 의 경우: 접속당한 몸이 있는 장소에만 배정` 또는 generic `비물리 매개 상태 (VWR rules[] 결정 따름)` wording. principle 보존 ("접속당한 몸이 있는 장소"). |

**Group O single atomic commit (W2)**: outlook_extractor `12.20260518HHMM/` new dir — site 4 (phase1.md) + site 5 (phase2.md) **둘 다 modified + 나머지 stem byte-identical copy** (phase1_schema.json / phase2_schema.json / phase3_schema.json / phase3.md = 4 file byte-identical copy).

#### 1.2.3 Group S — scene_* (3 site, W3 single atomic commit)

| # | Surface | Path (current latest) | Lines | Action |
|---|---|---|---|---|
| 8 | `scene_verify` system.md (빙의/영혼 상태 boundary 분류) — **ADD-10 / audit §11.2 site 9** | `prompts/_base/scene_verify/1.202603231200/system.md` (sibling: `verify_schema.json` — byte-identical copy 의무, production 안 `detail_steps.py:3088-3089` 가 `load_schema("scene_verify", "verify_schema")` 호출) | line 7 (`3. **빙의/영혼 상태**: 다른 인물의 몸에 들어간 경우, 원래 몸은 visible=false, 빙의된 몸은 visible=true. reason에 상태를 명시`) | new `2.20260518HHMM/system.md` 신설: line 7 `3. **빙의/영혼 상태**:` 분류 본체 폐기 → canonical VWR SOT reference clause + generic `3. **rule_type=possession 등 비물리 매개 상태**: VWR director_notes 의 visible 결정을 따른다 (예: rule_type=possession 의 경우 원래 몸은 visible=false, 매개체 몸은 visible=true). reason 에 rule_type 명시.` 또는 generic principle wording. SOT field reference 강조. verify_schema.json = **byte-identical verbatim copy** (2.* dir 안 sibling 보존, `prompt_loader._resolve_stem_in_pack:259-266` strict mode 정합). |
| 9 | `scene_detail` system.md (원격 조종/접속 instruction) — **ADD-11 / audit §11.2 site 10** — **line drift verify** | `prompts/_base/scene_detail/26.202605181435/system.md` | **line 473** (`- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)`) — audit 시점 (`02-prompt-side-hygiene-audit.md` 작성 2026-05-14) 의 line 327 vs 현재 latest (26.*, 2026-05-18 작성) line 473 사이 line drift (scene_detail 매우 active, 26 version). controller verify 결과 line 473 = `- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)` 정합 | new `27.20260518HHMM/system.md` 신설: line 473 `- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)` parenthetical 폐기 → canonical VWR SOT reference clause + generic `- VWR rule_type=projection / remote 매개 상태 인물 제외 (조종자 몸이 다른 장소에 있음)` 또는 simply `- VWR SOT 가 비물리 매개로 분류한 인물 제외` wording. nearby section context 보존. **detail_schema.json = byte-identical verbatim copy** (27.* dir 안 stem sibling 보존). |
| 10 | `shot_extract` user.md (빙의로 얼굴이 바뀜 closed-list) — audit §11.2 site 11 — **line drift verify** | `prompts/_base/shot_extract/11.202604201230/user.md` | **line 49** (`- 얼굴이 크게 달라지는 변화: 나이 변화, 변장/성형 전후, 빙의로 얼굴이 바뀜`) — audit 시점 line 33 vs 현재 latest (11.*) line 49 line drift (shot_extract version drift). controller verify 결과 line 49 정합 | new `12.20260518HHMM/user.md` 신설: line 49 `빙의로 얼굴이 바뀜` parenthetical 본체 폐기 → canonical VWR SOT reference clause + generic `rule_type=possession 등 VWR SOT 가 가리키는 외형 변화 상태`. `나이 변화 / 변장/성형` 등 generic example 보존 (도메인-specific 아님). **system.md = byte-identical verbatim copy** (12.* dir 안 stem sibling 보존). |

**Group S single atomic commit (W3)**: scene_verify `2.20260518HHMM/system.md` (+ verify_schema.json byte-identical copy — Codex F-1 흡수) + scene_detail `27.20260518HHMM/system.md` (+ detail_schema.json byte-identical copy) + shot_extract `12.20260518HHMM/user.md` (+ system.md byte-identical copy) — 3 module new dir × 3 file modified + **3 sibling byte-identical copy total (1+1+1)**. 모두 single atomic commit.

#### 1.2.4 Code / STEP_MANIFEST 변경 0 (W3 narrow exemption: scene_detail 4-point sync — Codex amend 7 + amend 8 + amend 9 OPTION_A expanded scene_detail-pinned tests 5 files plural 흡수)

**현재 production STEP_MANIFEST `step_manifest.py:130-142, :130-180, :219-235` 의 `visual_world_rules.schema_version=1` (Area #7a W1 신설) 외 본 Area #7b 안 변경 0**. **7 new prompt dirs 신설 만** (D-2 entity_character_list = 변경 0) — prompt_loader (`backend/app/modules/prompt_loader.py:130-180, :219-235`) numeric-desc latest version 자동 활성 정합 + `_resolve_stem_in_pack:259-266` strict mode 의 sibling stem byte-identical copy 의무 정합 (Area #7a 정합 검증 + Codex iter 4 F-1 흡수). schema_version 변경 0 (W0 Q4=A 정합 — prompt text only change, cp invalidation 불필요). `prompt_version` field 신설 = **deferred decision 미수행 (Area #7a 정합 W0 S8 verdict 따라 본 area 도 신설 안 함)**. helper 신설 0. code constant pin 0 audit §11.4 baseline 정합 (단 scene_detail 만 narrow exemption — 아래 참조).

**W3 narrow exemption — scene_detail 4-point sync (Codex amend 7 + amend 8 + amend 9 OPTION_A expanded 흡수, NARROW_AMEND_FIRST_THEN_W3 verdict + scene_detail-pinned tests 5 files plural expansion 정합)**:

scene_detail 에만 hard-pinned defensive guards **scene_detail-pinned tests 5 files** (repo-wide grep gate via `grep -rnE 'assert.*"1\.26\.0"|"scene_detail/v26"|startswith\("26\."\)|latest_major.*"26"' backend/ --include='*.py'` + function name AST-scan):

1. `backend/tests/prompts/test_scene_detail_continuity_alignment.py` (Area #5 W1 4-point sync) — 4 assertion 갱신.
2. `backend/tests/prompts/test_scene_detail_spatial_alignment.py` (Area #5 W1 자매 4-point sync) — 5 assertion 갱신.
3. `backend/tests/test_prompt_versions.py` (Group E generic prompt version pin) — 2 assertion 갱신 + 1 function rename (`test_version_registry_scene_detail_composer_1_26_0` → `_1_27_0`).
4. `backend/tests/integration/test_g4_5a_spatial_integration.py` (G4.5a spatial 4-way sync + config_hash defensive) — 4 assertion 갱신 + 1 function rename (`test_4_way_alignment_post_g4_5a_bump` → `test_4_way_alignment_post_area7b_w3_bump`).
5. `backend/tests/integration/test_area_5_residue_gate.py` (Area #5 W3 active prompt residue canary) — 1 function rename (`test_active_prompt_residue_scene_detail_v26_no_closed_phrase_examples` → `_v27_*`) + glob `prompts/_base/scene_detail/26.*/` → `27.*/` (active prompt v27 로 이동, canary scope 도 v27 fresh, stale meaning carry 차단).

다른 module (entity_*/outlook_*/scene_verify/shot_extract) 비교 결과 ALL absent (`grep -rnE "(ENTITY|OUTLOOK|SCENE_VERIFY|SHOT_EXTRACT)_PROMPT.*VERSION" backend/app/` 0 hit). 다른 scene_detail test (`test_scene_detail_id_policy_alignment.py` + `test_scene_detail_v21_grep_gate.py` + `test_scene_detail_v21_rule_x2_semantic.py`) 4-point sync hardcoded assertion 0 (prompt body content gate only). 새 prompt directory `scene_detail/27.*` 추가만으로 5 file 14+ assertion 중 11+ trip + non-blocking 1 stale meaning carry → W3 atomic commit 동기화 필수.

**Repo-wide grep gate doctrine (Codex amend 9 함정 학습)** — 다음 prompt new-dir area Q0/W0 grep gate 확장 의무: `backend/tests/prompts/test_*_alignment.py` plural 만이 아니라 **repo-wide** `grep -rnE 'assert.*"1\.<MAJOR>\.0"|<module>/v<MAJOR>|<MODULE>_PROMPT_VERSION.*startswith\("<MAJOR>\."|latest_major.*"<MAJOR>"' backend/ --include='*.py'` + **function name AST-level scan** (test_*_<module>_*_1_<MAJOR>_0 / test_*_post_*_<MAJOR>_bump / test_*_<module>_v<MAJOR>_* etc., singular grep 으로 함정 missed).

본 narrow exemption W3 atomic boundary 안 포함 file (2 production + 5 test = 7 file 추가 modify, Codex amend 9 expanded):
- `backend/app/core/steps/detail_steps.py` — `SCENE_DETAIL_PROMPT_VERSION` `"26.202605181435"` → `"27.20260518HHMM"` (W3 actual UTC HHMM substitute, line 106). `SCENE_DETAIL_SCHEMA_VERSION = 11` 보존 (schema 변경 0, line 105).
- `backend/app/core/version_registry.py` — `MODULE_VERSIONS["scene_detail_composer"]` `"1.26.0"` → `"1.27.0"` (line 34) + `_MODULE_INFO["scene_detail_composer"]["prompt_dependency"]` `"scene_detail/v26"` → `"scene_detail/v27"` (line 126) + `updated_at` `"2026-05-18"` → `"2026-05-19"`.
- `backend/tests/prompts/test_scene_detail_continuity_alignment.py` — 4 assertion 갱신 (line 69 `"1.26.0"` → `"1.27.0"` + line 103 `"scene_detail/v26"` → `"scene_detail/v27"` + line 120 `startswith("26.")` → `startswith("27.")` + line 196 `latest_major == "26"` → `"27"`). line 168 `SCENE_DETAIL_SCHEMA_VERSION == 11` 보존.
- `backend/tests/prompts/test_scene_detail_spatial_alignment.py` — 5 assertion 갱신 plural (Codex amend 8 흡수, 자매 alignment test 동일 doctrine: line 72 + line 106 + line 127 + line 132 (duplicate sub-test) + line 207).
- `backend/tests/test_prompt_versions.py` — 2 assertion + 1 function rename (Codex amend 9 OPTION_A expanded: line 211 `startswith("26.")` → `"27."` + line 219 MODULE_VERSIONS `"1.26.0"` → `"1.27.0"` + line 214 function `test_version_registry_scene_detail_composer_1_26_0` → `_1_27_0`). history comment v25→v26 / 1.25.0→1.26.0 narrow sync.
- `backend/tests/integration/test_g4_5a_spatial_integration.py` — 4 assertion + 1 function rename (Codex amend 9 OPTION_A expanded: line 591 + line 598 + line 607 + line 769 (config_hash defensive 4 assertion 모두 갱신 27 series) + line 561 function `test_4_way_alignment_post_g4_5a_bump` → `test_4_way_alignment_post_area7b_w3_bump`). docstring 562-574 + error message narrow sync.
- `backend/tests/integration/test_area_5_residue_gate.py` — 1 function rename + glob (Codex amend 9 OPTION_A expanded, non-blocking 단 stale meaning carry 차단: line 172 function `v26` → `v27` + line 178 glob `26.*/` → `27.*/` + line 184 print message `v26` → `v27`). active prompt 가 v27 로 이동, canary scope 도 v27 fresh.
- Error message + docstring `v26`/`1.26.0` references 도 narrow sync (controller 자체 wording sync, 의미 보존).

본 narrow exemption boundary = scene_detail 4-point sync 만. 다른 module 의 production code 변경 0 doctrine + helper 신설 0 doctrine + STEP_MANIFEST 변경 0 doctrine + schema_version 변경 0 doctrine 모두 보존.

### 1.3 Out-of-scope (Non-claim, closure 미선언)

| Item | Reason | Carry destination |
|---|---|---|
| **D-2** `entity_character_list/2.202605011057/system.md:10` owner taxonomy (인간/요괴/동물/로봇/외계인) | generic 5-element taxonomy = 인물 정의의 owner boundary (presence/visibility 결정 X). VWR rule_type SOT 와 다른 축 (사용자 명시 + Codex iter 2 verdict Q3 carve-out). | **변경 0 boundary 보존** (residue gate global-ban 0 explicit, gate 4 exempt) |
| **Area #7c** t2i_review v6 placeholder example abstraction (`scene_system.md:31/36/39/60-61` + `entity_system.md:33-34`) | Area #6 v6 pack closure carry. 별도 small area. | Area #7c (Track B Tier 3 #3 후속) |
| **Area #7d** Cinematography closed-list SOT dual-site (`variation_recommender/v2/system.md` + `scene_extractor_v2/19.../turn_scene_detail.md:87-91`) | cinematography 도메인 별개 (각도/색감 7+7 closed-list) — visual_world_rules SOT 와 다른 축. | Area #7d (Track B Tier 3 #4 후속) |
| **Carry-A099** VWR system.md director_notes prose redesign (line 57-73 generic principle 5-line + bad-example 4-line) | director_notes prose = LLM-generate natural-language rule — 본 area 의 prompt text rewrite 와 다른 본질적 redesign 영역 (Area #7a 정합 보존). | Carry-A099 resolved by W1/W2 + W3 closure-docs (2026-05-19+) — director_notes prose hard-prime examples abstracted (R1-R9 9 strict residue 0 + canonical process wording EN+KR pair) |
| **Carry-A100** VWR system.md t2i_context demonym redesign (line 98 `<region-derived demonym>`) | t2i_context field 도메인 (이미지 prompt 시각 스타일 / 인종/국적 bias) — rule_type SOT 와 다른 축. Area #7a 정합 보존. | Carry-A100 (V8+ t2i_context redesign) |
| **Carry-P021** scene_consistency 7 enumeration broad (G6 closed-list `character_state / environment_state / persistent_prop`) | roadmap §5.4 carry 표현, audit file direct row source 0 hit — **source unresolved**. 본 area 의 SOT cascade boundary 와 별개. | Carry-P021 (audit row source verify 후 promotion) |
| 새 prompt module new dir 추가 (예: lvm_prompts / floor_plan_prompt / shot_director / shot_validator 등) | 본 area = audit 02 §11.2 line 240-254 의 11-site 정합 cascade 만 — 다른 module 의 도메인 leak (예: floor_plan_prompt 색깔 매핑 A001-A005) = Area #8 (background classifier) / Area #9 (action segment) 등 별개 area scope. | 변경 0 (audit §11.2 boundary 보존) |
| Code helper SOT 신설 (예: `vwr_reference_helper.py` 가 canonical clause string 을 제공) | v1 = prompt text rewrite only (Codex iter 2 verdict Q5 정합). 9 module prompt 안 verbatim copy 의 canonical clause (audit §11.3 verbatim) 정합 의무. helper 신설 = unused abstraction. | 변경 0 |
| STEP_MANIFEST schema_version bump (visual_world_rules 1 → 2 등) | 본 area = prompt text only change, schema 변경 0, cp invalidation 불필요. Area #7a W0 S8 verdict 정합 (W0 inventory deferred decision, prompt_version 신설 안함, STEP_MANIFEST entry-level 영향 0). | 변경 0 |
| Area #3 visibility/physical presence SOT (commit `97c4471`) closed area shot_director.py Path 1/2 분리 | Area #3 의 shot_director consumer 와 영향 0 (다른 step, 다른 SOT 축). | 변경 0 |
| Area #5 phantom guard SOT (`reference_phrase_kinds` sidecar) | scene_detail v26 producer 보존 + ref_contract_validator step 6 보존. 본 area 와 cross-cut 0. | 변경 0 |
| Hygiene v1 (P-1 ~ P-6 fix) | Hygiene v1 closure 보존. P-1 orphan 분리 + P-2 ~ P-6 fix 잔존 의무. | 변경 0 |

## 2. Audit Evidence

### 2.1 Roadmap §5.7 Sub-area (b) verbatim (post Area #7a closure)

```
Sub-area (b) — Area #7a (visual_world_rules SOT 일원화 + scene_director A047 흡수):
  closed (2026-05-19+, W1-W3c 5 commits: `54fe057` W1 producer / `b2765a7` W2 consumer
  / `e6c0f0f` W3a residue / `50cb85b` W3b canary / `0a2e2b4` W3c closure).
  In-scope = A047/A096/A097/A098.
  Carry follow-up = Area #7b (11-site cascade) + Area #7c (t2i_review placeholder)
  + Area #7d (cinematography dual-site) + Carry-A099 resolved by W1/W2 + W3 closure-docs (2026-05-19+) — director_notes prose hard-prime examples abstracted
  + Carry-A100 (t2i_context demonym) + Carry-P021 (scene_consistency, source unresolved).
```

본 Area #7b = roadmap §5.7 Sub-area (b) carry follow-up 의 **11-site VWR downstream prompt cascade** 첫 번째 area (D-2 entity_character_list carve-out 제외 → 10 site 분포, 단 audit §11.2 line 240-254 정합 의무로 11 site numbering 보존).

### 2.2 Audit 02 §11 본문 verbatim 발췌 (audit output 정확 mapping)

**Source**: `docs/visual-reliability-audit/2026-05-14-semantic-string-routing-debt-audit/02-prompt-side-hygiene-audit.md` §11 (line 232-269).

#### §11.1 현재 SOT (line 234-238) — Area #7a closure 후 갱신 상태

- **`visual_world_rules/7.202605181540/system.md:51`** — 10개 enum canonical list (Area #7a W1 신설). 본 area 의 cascade 가 reference 하는 producer SOT.
- **`visual_world_rules/7.202605181540/rules_schema.json:9`** — `enum` strict (10-token) + description 정합 (Area #7a W1).
- **drift fix**: Area #7a 안 완료 (commit `54fe057`).

#### §11.2 분산 site (11) 정확 verbatim (line 240-254)

| # | site | line (audit 시점, 2026-05-14) | 자체 list 인용 | 본 spec In-scope line (현재 latest verify) |
|---|---|---|---|---|
| 1 | `entity_all/.../character.md` | 26-30 | 인간↔요괴 / 인간↔괴물 / 본체↔변신체 / 빙의/합체 / 이무기 / 구미호 / 요괴화 / 뱀파이어 | line 26 + 29 + 30 (verify 정합, latest = 4.202603310100) |
| 2 | `entity_character_list/.../system.md` | 10 | 인간 / 요괴 / 동물 / 로봇 / 외계인 | line 10 (verify 정합, latest = 2.202605011057). **D-2 carve-out = 변경 0** |
| 3 | `entity_relation/.../system.md` | 11-13, 30 | 요괴/괴물 형태 / 유령/망령 형태 / 갑옷 착용 형태 | line 11 + 12 + 13 + 30 (verify 정합, latest = 2.202603301800) |
| 4 | `outlook_extractor/.../phase1.md` | 16 | 메카 / 파워드슈트 / 강화복 / 갑옷 로봇 | line 16 (verify 정합, latest = 11.202603311724) |
| 5 | `outlook_extractor/.../phase2.md` | 8 | 원격접속/빙의 | line 8 (verify 정합, latest = 11.202603311724) |
| 6 | `entity_extractor_v2/.../system.md` | 22, 32 | 평상복 → 전신 갑옷 / ### 빙의/정신 전환/몸을 빌리는 설정 | line 22 + 32 (verify 정합, latest = 9.202605130226) |
| 7 | `entity_extractor_v2/.../turn0_style.md` | 13 | 원격 접속/조종/빙의/텔레파시 | line 13 (verify 정합, latest = 9.202605130226) |
| 8 | `scene_director/.../system.md` | (Area #7a 처리 완료, 본 area 외) | — | scene_director v9 `9.202605181550/system.md` (Area #7a closed) — **본 area 외** |
| 9 | `scene_verify/.../system.md` | 7 | 빙의/영혼 상태 | line 7 (verify 정합, latest = 1.202603231200) |
| 10 | `scene_detail/.../system.md` | 327 | 원격 조종/접속 | **line drift: audit 시점 line 327 vs 현재 latest line 473** (scene_detail 26 version 매우 active, audit 시점 이후 21 version bump). controller grep verify 결과 = `line 473: - 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)` 정합 |
| 11 | `shot_extract/.../user.md` | 33 | 빙의로 얼굴이 바뀜 | **line drift: audit 시점 line 33 vs 현재 latest line 49** (shot_extract 11 version, audit 시점 이후 version bump). controller grep verify 결과 = `line 49: - 얼굴이 크게 달라지는 변화: 나이 변화, 변장/성형 전후, 빙의로 얼굴이 바뀜` 정합 |

**Line drift handling (W1/W2/W3 wave entry 시 의무)**: W3 진입 시 scene_detail / shot_extract 의 line drift = 2026-05-19 시점 정확 line number 재확인 (`grep -n` controller verify) 후 wave commit. 만약 wave 진입 전 새로운 prompt version 또 bump 되면 추가 narrow re-verify.

#### §11.3 일원화 방향 verbatim (line 256-268)

```
분산 site 자체 list 를 reference 한 줄로 교체:

    본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의
    rule_type ∈ {possession, transformation, ghost, projection, superpower,
    body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어
    있지 않으면 일반 인물로 처리.

보존:
- 한국 fantasy/supernatural 처리 능력 — visual_world_rules SOT 에서 rule 정의 능력 유지.
- D-2 의 generic 분류 (인간/요괴/동물/로봇/외계인) 는 그 자체로 유효 generic example — 사용자 명시 시 P2.

제거:
- 도메인-specific Korean fantasy term (`구미호 / 이무기 / 망령 / 요괴화 / 갑옷 로봇`) — 분산 site 에서 제거.
```

본 spec §3.1 의 canonical VWR SOT reference clause = audit §11.3 verbatim 의 7-token list (`possession, transformation, ghost, projection, superpower, body_deformation`) — VWR v7 schema 의 10-enum 의 subset (physical presence 결정에 직접 관련된 6-rule_type + audit verbatim 의 누락된 `superpower` 포함). 나머지 4 enum (`time_period, costume, technology, other`) 은 audit verbatim clause 안 reference 안 함 (audit §11.3 의 본 wording 정합 보존 의무). 단 §3.1 의 wave-specific local prefix/suffix 안 (예: outlook phase1 의 `costume / technology` 강조 wording) 4 enum reference 추가 가능 (audit §11.3 = canonical minimum, local 강조 wording 허용).

#### §11.4 Fix Cost verbatim (line 270-274)

```
- 11 prompt 새 버전 dir + version_registry sync + schema_version bump consideration (medium-large).
- DB row 영향 (Subagent D 위임 — `04-`): 11 module 중 1개 (`entity_character_list`) 만 `db=`-aware caller.
  다른 10개는 file fallback. file 새 dir 만들면 active.
- code 상수 pin 영향: 11 module 중 0개 — load-time pin 없음 (`04-` §4 grep 결과).
```

본 spec 정합 (Codex iter 4 F-2 canonical 흡수):
- new prompt dir 신설 = **7 new prompt dirs** (D-2 entity_character_list 제외 boundary preserve). entity_all `5.*` + entity_relation `3.*` + entity_extractor_v2 `10.*` + outlook_extractor `12.*` + scene_verify `2.*` + scene_detail `27.*` + shot_extract `12.*` = 7 dir. **9 modified prompt files + 24 byte-identical sibling files + 10 STEP_MANIFEST entries** (canonical).
- DB row 영향 = **0** (D-2 entity_character_list 변경 0 + 그 외 7 new-dir module 모두 file fallback only — `db=`-aware caller 없음).
- code 상수 pin 영향 = **0** (audit §11.4 grep 결과 정합 보존).
- version_registry sync = `04-` audit grep 결과 11 module 모두 code constant pin 0 → version_registry 변경 0.
- schema_version bump = **0** (W0 Q4=A 정합, prompt text only change).

#### §11.5 Hygiene v1 boundary 정합

Hygiene v1 (commit `91d1dfd`) 의 P-1 ~ P-6 fix = 본 area scope 외 (Area #7a 정합 보존). 본 area = Area #7a 후속 Sub-area (b) cascade.

### 2.3 Q0 Inventory verify trace (controller verify + Codex 2 round APPROVED 정합)

직전 brainstorming session (2026-05-19, push `d0410eb` 전후) 안 controller + Codex 가 verify 한 inventory:

1. **8 module latest version dir verify** (controller `ls prompts/_base/<module>` numeric-desc 정합):
   - entity_all = `4.202603310100` → new `5.20260518HHMM/` (site 1=character.md only).
   - entity_character_list = `2.202605011057` → **변경 0** (D-2 carve-out, no new dir).
   - entity_relation = `2.202603301800` → new `3.20260518HHMM/`.
   - entity_extractor_v2 = `9.202605130226` → new `10.20260518HHMM/` (site 6+7 둘 다 modified + 나머지 stem byte-identical).
   - outlook_extractor = `11.202603311724` → new `12.20260518HHMM/` (site 4+5 둘 다 modified + 나머지 stem byte-identical).
   - scene_verify = `1.202603231200` → new `2.20260518HHMM/`.
   - scene_detail = `26.202605181435` (21 version 매우 active) → new `27.20260518HHMM/` (site 10=system.md only, detail_schema.json byte-identical).
   - shot_extract = `11.202604201230` → new `12.20260518HHMM/` (site 11=user.md only, system.md byte-identical).

2. **prompt_loader latest version activation verify** (Area #7a 정합):
   - `backend/app/modules/prompt_loader.py:167-180` `_list_module_versions(module)` numeric-desc 정합 (자체 reverse=True sort).
   - `_resolve_stem_in_pack` (`prompt_loader.py:219-235`) — same dir 안 stem sibling lookup, byte-identical copy 의무 정합.
   - new dir 신설 시 자동 active (7 new-dir module 모두 file fallback only; D-2 entity_character_list 변경 0 boundary preserve, `db=`-aware caller path 영향 0).

3. **STEP_MANIFEST 매핑 (site → step entry)** verify:
   - site 1 → `entity_all_character` only (entity_all_location / entity_all_prop 변경 0, 단 byte-identical copy 의무).
   - site 2 → `entity_character_list` (변경 0).
   - site 3 → `entity_relation`.
   - site 4 → `outlook_phase1`.
   - site 5 → `outlook_phase2`.
   - site 6 + 7 → `entity_extract_character` / `entity_extract_location` / `entity_extract_prop` (3 entry, shared prompt module entity_extractor_v2). entity_extractor_v2 안 shared prompt module 의 system.md + turn0_style.md modified — 3 entry 모두 같은 module 사용.
   - site 9 → `scene_verify`.
   - site 10 → `scene_detail`.
   - site 11 → `shot_extract`.

4. **DB / hardcoded path risk** (audit §11.4 정합):
   - entity_character_list 만 `db=`-aware caller. **D-2 carve-out 으로 영향 0** (entity_character_list 변경 0).
   - 7 new-dir module (entity_all / entity_relation / entity_extractor_v2 / outlook_extractor / scene_verify / scene_detail / shot_extract) = file fallback only (D-2 제외 — D-2 db-aware 이지만 본 area 안 변경 0 이므로 DB row 영향 0).
   - code constant pin = 0 (audit §11.4 grep 결과 정합).
   - version_registry sync = 0.

### 2.4 Runtime prompt activation path (Area #7a 정합 보존)

```
backend/app/modules/prompt_loader.py:167-180  # _list_module_versions(module) numeric-desc latest (자체 reverse=True sort)
backend/app/modules/prompt_loader.py:219-235  # _resolve_stem_in_pack (sibling lookup, byte-identical copy 정합)
```

본 area 의 9 modified file new dir 신설 시 prompt_loader 가 numeric-desc latest version dir 으로 자동 활성. byte-identical sibling copy = `_resolve_stem_in_pack` 가 same dir 안 다른 stem 을 lookup 할 때 정합 의무 (Area #7a W1/W2 정합 보존).

**Validation chain**: 7 module new dir + D-2 변경 0 boundary 모두 free-form prose prompt → LLM emit (structured 또는 free). schema validation = 본 area 와 cross-cut 0 (prompt text only change, schema 변경 0). LLM client local validation (`llm_client.py:43-77`) = 본 area 의 schema 변경 0 으로 영향 0. **strict pack 의무**: `prompt_loader._resolve_stem_in_pack:259-266` 안 latest pack 의 stem 누락 시 raise — entity_relation `analyze.md / analyze_schema.json` 누락 + scene_verify `verify_schema.json` 누락 = production crash trigger. sibling byte-identical copy 필수 (Codex iter 4 F-1 흡수).

## 3. N-Layer Architecture

### 3.1 Canonical VWR SOT reference clause (audit §11.3 verbatim, 9 rewritten site 모두 verbatim 의무)

본 area 의 9 modified file (entity_all character.md / entity_relation system.md / entity_extractor_v2 system.md + turn0_style.md / outlook_extractor phase1.md + phase2.md / scene_verify system.md / scene_detail system.md / shot_extract user.md) 모두 **다음 canonical clause 를 verbatim 포함 의무** (residue gate Gate 2 의 글자-단위 exact-string membership 정합 — closed-world contract):

**4-Gate Boundary Doctrine (사용자 격분 흡수 2026-05-19, [[feedback_llm_based_judgment]] 정합)**:

본 spec 의 residue gate / canary / cleanup verify 모두 **closed-world contract 영역만** 사용. 4 강제 gate 적용:

- **Gate (1) Semantic Regex Ban**: open-world semantic 판단을 regex/substring 으로 절대 금지. 의미 분류 (예: "이 phrase 가 도메인-specific 인지 generic 인지") = LLM-produced structured SOT 만 가능, code regex/substring 0.
- **Gate (2) Prompt Closed-List Ban**: prompt 안 LLM-instructed closed-list domain term enumeration 금지. canonical VWR SOT reference clause (audit §11.3 verbatim) 는 closed-world contract reference (VWR rules_schema enum 정합) 이지 새 closed-list 가 아님.
- **Gate (3) Structured SOT Required**: open-world semantic 판단 시 LLM-produced structured emit 의무. code/test 는 enum/ID/bool/object/path 만 소비.
- **Gate (4) No Silent Fallback**: invalid input / missing field / typo signature = explicit reject + typed error. silent retry/추측 0.

본 area 의 residue gate (W4) = **exact residue phrase membership 만** verify (semantic 판단 X). closed-world cleanup contract = audit §11.2 row 의 verbatim phrase + controller-verified current active prompt line 의 verbatim phrase. **Generic 한국어 단어 (예: `요괴 / 빙의 / 변신`) 단독 forbidden 0**. forbidden = 완전 (글자-단위) exact phrase 만, source path+line 에 anchor 된 finite inventory 만.

```
본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의 rule_type ∈ {possession, transformation, ghost, projection, superpower, body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어 있지 않으면 일반 인물로 처리.
```

**Verbatim copy 의무 (Codex Q3=Hybrid 정합)**:
- 9 site 모두 위 clause **글자-단위 정확히 동일** (한국어 wording / 영어 rule_type token / 중괄호 `{}` / 6-rule_type list / 마지막 문장 `작품에 ... 일반 인물로 처리.` 까지 모두).
- residue gate (W4) 의 fixed-string / glyph-exact membership 으로 9 site 모두 canonical clause 1+ 존재 verify (semantic 판단 0, 4-Gate Boundary Doctrine 정합).
- W2 Site 1 paraphrase 격분 trigger ([[session_20260519_area_7a_w0_w2_execution_closure]] 함정 7 정합) 재발 차단 — **principle 만** + **SOT field reference 만** + **사례 enumeration 본문 absent**.

**Local prefix/suffix site-specific 허용 (Codex Q3=Hybrid 정합)**:
- 각 site 의 prompt context (예: entity_all character extraction / outlook phase 배정 / scene_detail T2I instruction / shot_extract beat extraction 등) 보존 의무.
- canonical clause 의 **앞** 또는 **뒤** 에 site-specific wording 추가 가능 (예: entity_all character.md → "변신/변형 결정 시 다음 규칙을 적용한다:" 같은 prefix, 또는 outlook phase2 → "씬 배정 시 다음 규칙 적용:" 같은 prefix).
- local prefix/suffix 안 4 누락 enum (`time_period, costume, technology, other`) reference 가능 (예: outlook phase1 = `costume / technology rule_type 강조`). canonical clause 본체는 6-rule_type 만 (audit §11.3 verbatim 보존 의무).

**예시 — outlook_extractor phase1.md (site 4) After draft (W2 본문 패치 시점 정확 wording 확정)**:

```
8. 사람이 탑승하거나 착용하는 인간형 기계장치도 아웃룩으로 추출 —
   본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의
   rule_type ∈ {possession, transformation, ghost, projection, superpower,
   body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어
   있지 않으면 일반 인물로 처리. 특히 costume / technology rule_type 의
   wear/ride 형태 (실루엣을 결정하는 wearable/ridable 외형) 는 아웃룩 으로 처리.
```

(정확 wording 은 W2 본문 패치 시점 controller 확정 — 본 spec 은 결정 boundary 만.)

### 3.2 Group E — entity_* (W1, 5 site, 3 new dir)

| Module | Modified file | Byte-identical sibling copy (same dir 안 보존) | Action 본질 |
|---|---|---|---|
| `entity_all` | `5.20260518HHMM/character.md` (site 1) | location.md / prop.md / character_schema.json / location_schema.json / prop_schema.json / system.md (6 file) | line 26 + 29 + 30 의 도메인-specific term (`인간↔요괴 / 인간↔괴물 / 이무기 / 구미호 / 요괴화 / 뱀파이어`) 본체 폐기 + canonical clause + 일반 `변신/변형 / 빙의/합체 / 수식어 기반 분리 (도메인-specific term enumeration 본체 없이 generic principle 만)` principle wording 보존 |
| `entity_character_list` (D-2 carve-out) | **변경 0** (new dir 없음) | (D-2 boundary 보존) | 변경 0. owner taxonomy 5-element 분류 = generic boundary, presence/visibility 결정 X |
| `entity_relation` | `3.20260518HHMM/system.md` (site 3) | analyze.md / analyze_schema.json (2 file, Codex iter 4 F-1 흡수 — production loadsite `entity_relation.py:93-95` 3 file 모두 load, strict pack 의무) | line 11 + 12 + 13 3 bullet 의 audit-verbatim residue (`요괴/괴물 형태` / `유령/망령 형태` / `갑옷 착용 형태`) 본체 폐기 + canonical clause + 일반 `변신 / 사후 / 변장/장비` principle wording + line 30 visual_similarity example 의 current-active-promoted residue (`요괴로 변해도 원래 인물의 흔적이 있음 → true` full phrase, controller verify 2026-05-19) → generic phrase 추상화 (예: `이미지 형태가 달라져도 원래 인물의 흔적이 있음 → true`) |
| `entity_extractor_v2` | `10.20260518HHMM/system.md` (site 6) + `10.20260518HHMM/turn0_style.md` (site 7) | turn_entity_detail.md / turn0_style_schema.json / turn1_7_detail_batch_schema.json / turn1_7_detail_batch.md / turn1_review_schema.json / turn1.md / turn2.md / turn3.md / turn4.md (9 file) | system.md line 22 (`평상복 → 전신 갑옷`) → generic placeholder + canonical clause; system.md line 32 (`### 빙의/정신 전환/몸을 빌리는 설정` section header) → canonical clause + `### rule_type=possession / projection 시 처리` section rewrite; turn0_style.md line 13 (`원격 접속/조종/빙의/텔레파시 등`) → canonical clause + generic `rule_type=projection / possession 등 비물리 매개 상태` wording |

**Single atomic commit (W1)**: 3 module × new dir (entity_all `5.*` + entity_relation `3.*` + entity_extractor_v2 `10.*`) — 4 modified file (entity_all character.md + entity_relation system.md + entity_extractor_v2 system.md + turn0_style.md) + **17 byte-identical sibling copy total** (entity_all 6 + entity_relation 2 + entity_extractor_v2 9, Codex iter 4 F-1 흡수 entity_relation +2).

### 3.3 Group O — outlook_* (W2, 2 site, 1 new dir)

| Module | Modified file | Byte-identical sibling copy | Action 본질 |
|---|---|---|---|
| `outlook_extractor` | `12.20260518HHMM/phase1.md` (site 4 + current-active-promoted line 24) + `12.20260518HHMM/phase2.md` (site 5) | phase1_schema.json / phase2_schema.json / phase3_schema.json / phase3.md (4 file) | phase1.md line 16 audit-verbatim (`메카 / 파워드슈트 / 강화복 / 갑옷 로봇` parenthetical) → canonical clause + generic `costume / technology rule_type 의 인간형 기계장치` wording 또는 parenthetical 자체 제거. phase1.md line 24 **current-active-promoted** (`인간형 요괴/괴물, 뱀파이어, 좀비` parenthetical, controller verify 2026-05-19, Codex iter 4 F-3 흡수) → canonical clause + generic `사람 형상인 캐릭터: 인간 + VWR rules[] humanoid 변형` wording. phase2.md line 8 audit-verbatim (`원격접속/빙의:` parenthetical) → canonical clause + generic `rule_type=possession / projection 의 경우: 접속당한 몸이 있는 장소에만 배정`. |

**Single atomic commit (W2)**: 1 module × 1 new dir (outlook_extractor `12.*`) — 2 modified file (phase1.md + phase2.md) + 4 byte-identical sibling copy.

### 3.4 Group S — scene_* (W3, 3 site, 3 new dir) — scene_detail 4-point sync narrow exemption (Codex amend 7 흡수)

| Module | Modified file | Byte-identical sibling copy | Action 본질 |
|---|---|---|---|
| `scene_verify` | `2.20260518HHMM/system.md` (site 9) | verify_schema.json (1 file, Codex iter 4 F-1 흡수 — production loadsite `detail_steps.py:3088-3089` 의 `load_schema("scene_verify", "verify_schema")`, strict pack 의무) | line 7 audit-verbatim (`3. **빙의/영혼 상태**: 다른 인물의 몸에 들어간 경우, 원래 몸은 visible=false, 빙의된 몸은 visible=true. reason에 상태를 명시`) → canonical clause + generic `3. **rule_type=possession 등 비물리 매개 상태**: VWR director_notes 의 visible 결정을 따른다 (예: rule_type=possession 의 경우 원래 몸은 visible=false, 매개체 몸은 visible=true). reason 에 rule_type 명시.` |
| `scene_detail` | `27.20260518HHMM/system.md` (site 10) — **line 473 verify 정합** | detail_schema.json (1 file) | line 473 (`- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)`) → canonical clause + generic `- VWR rule_type=projection / remote 매개 상태 인물 제외 (조종자 몸이 다른 장소에 있음)` 또는 `- VWR SOT 가 비물리 매개로 분류한 인물 제외`. nearby section context 보존 |
| `shot_extract` | `12.20260518HHMM/user.md` (site 11) — **line 49 verify 정합** | system.md (1 file) | line 49 (`빙의로 얼굴이 바뀜` parenthetical) → canonical clause + generic `rule_type=possession 등 VWR SOT 가 가리키는 외형 변화 상태`. `나이 변화 / 변장/성형` generic example 보존 |

**Single atomic commit (W3)**: 3 module × 3 new dir (scene_verify `2.*` + scene_detail `27.*` + shot_extract `12.*`) — 3 modified file (scene_verify system.md + scene_detail system.md + shot_extract user.md) + **3 byte-identical sibling copy total** (scene_verify 1 + scene_detail 1 + shot_extract 1, Codex iter 4 F-1 흡수 scene_verify +1).

### 3.5 D-2 carve-out (entity_character_list, no-change boundary)

`entity_character_list/2.202605011057/system.md:10` (`인간, 요괴, 동물, 로봇, 외계인 등`) = owner taxonomy 5-element 분류. **본 area 변경 0**.

**Rationale**:
- VWR rule_type SOT 의 축 = "비물리/매개 physical presence" (possession, transformation, ghost, projection, superpower, body_deformation 등 변화/비현실 상태).
- D-2 의 축 = "인물 정의의 owner taxonomy" (시각적으로 카메라에 찍히며 머리와 몸이 구분되는 모든 존재의 분류). presence/visibility 결정 X. VWR SOT 가 결정하는 boundary 와 다른 축.
- 사용자 명시 + Codex iter 2 verdict Q3 정합 (audit §11.3 보존 line 264-265).

**Residue gate boundary**:
- Gate global-ban 0 (entity_character_list `요괴 / 로봇` 등 본문 안 단어 = legitimate, gate forbidden 0).
- D-2 site (entity_character_list/2.202605011057/system.md) = residue gate scope **외**. 본문 단어 `요괴 / 로봇` 등 본 area 의 forbidden signature 안 포함 0.
- new dir 신설 X (변경 0 = `entity_character_list/2.202605011057/` 보존).

**DB row override risk**:
- audit §11.4 grep 결과 = entity_character_list 만 `db=`-aware caller. 변경 0 으로 영향 0.
- DB row override risk neutralized (canary 안 W5 verify 의무).

## 4. Q1-Q7 Brainstorming Closure (handoff session Codex 2-round APPROVED outline verbatim 흡수)

### 4.1 Q1. atomic boundary (D-2 carve-out)

**Decision (Q1=A)**: D-2 (entity_character_list site 2) = **explicit no-change boundary preserve**. residue gate global-ban 0. 본 area = 11-site 중 10 site (D-2 제외) cascade. wave grouping = Group E (entity_*, 5 site, W1) + Group O (outlook_*, 2 site, W2) + Group S (scene_*, 3 site, W3).

**Rationale**: 
- audit §11.3 line 264-265 verbatim (`D-2 의 generic 분류 ... 유효 generic example`) 정합.
- 5 site/2 site/3 site grouping = sub-wave atomic boundary 명확 (group 사이 producer-consumer dependency 0, parallel commit 가능하지만 sequential commit 가독성 우선).
- single mega-wave (10 site 1 commit) = wave commit diff hard-to-review + revert blast radius 광범위.

### 4.2 Q2. entity_extractor_v2 single new dir + verbatim copy

**Decision (Q2=A)**: entity_extractor_v2 = single new dir `10.20260518HHMM/` 안에 system.md + turn0_style.md 둘 다 modified + 나머지 9 stem file (turn_entity_detail.md / turn0_style_schema.json / turn1_7_detail_batch_schema.json / turn1_7_detail_batch.md / turn1_review_schema.json / turn1.md / turn2.md / turn3.md / turn4.md) byte-identical copy. **single atomic commit (W1 안 다른 module 포함)**.

**Rationale**:
- Area #7a 정합 보존 (Area #7a W1 안 visual_world_rules v7 dir 안 system.md + rules_schema.json 둘 다 modified + verbatim copy 의무).
- prompt_loader `_resolve_stem_in_pack` 가 same dir 안 sibling stem lookup — sibling byte-identical copy 의무.
- atomic boundary = single new dir = single revertable surface.

### 4.3 Q3. Hybrid canonical VWR SOT clause (audit §11.3 verbatim) + local prefix/suffix site-specific 허용

**Decision (Q3=Hybrid)**: 
- canonical clause = audit §11.3 verbatim ("본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의 rule_type ∈ {possession, transformation, ghost, projection, superpower, body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어 있지 않으면 일반 인물로 처리.") — **9 rewritten site 모두 verbatim** (residue gate substring exact-match 의무).
- local prefix/suffix site-specific 허용 — 각 prompt context 보존 (entity_all character extraction / outlook phase / scene_detail T2I / shot_extract beat).
- D-2 site exempt (entity_character_list 변경 0).

**Rationale**:
- W2 Site 1 paraphrase 격분 trigger ([[session_20260519_area_7a_w0_w2_execution_closure]] 함정 7) 재발 차단 — **principle 만** + **SOT field reference 만** + **사례 enumeration 본문 absent**.
- audit §11.3 verbatim 보존 = canonical reference (drift 0 guarantee).
- local prefix/suffix 허용 = each prompt context 보존 (예: outlook phase1 = costume/technology rule_type 강조 wording, scene_verify = visible=true/false 보존).

### 4.4 Q4. schema_version 변경 0

**Decision (Q4=A)**: STEP_MANIFEST schema_version (`visual_world_rules.schema_version=1` Area #7a W1 신설) **변경 0**. 본 area = prompt text only change, schema 변경 0, cp invalidation 불필요.

**Rationale**:
- Area #7a W0 S8 verdict 정합 (prompt_version 신설 안함, STEP_MANIFEST entry-level 변경 0).
- 본 area = prompt text only change, schema (rules_schema.json 등) 변경 0.
- cp invalidation flow 영향 0 (prompt text change 는 cp stamp 영향 0, schema_version 만 cp stamp 매핑).

### 4.5 Q5. Residue gate scope

**Decision (Q5=A, Codex iter 4 boundary verdict 정합)**:
- **per-modified-file exact residue phrase membership 0** — 각 9 rewritten file 의 exact residue phrase inventory (fixed-string / glyph-exact, source path + line + audit-or-current-active classification anchored) hit 0. inventory split: audit-verbatim (audit §11.2 line 240-254 본문 정확) + current-active-promoted (controller verify 2026-05-19, audit §11.2 미포함 same active prompt surface scope_creep_risk 차단 목적). 정확 phrase 목록 = §5.5 W4 Gate 1.1-1.9 + §7 inventory split 정합.
- **canonical VWR reference 1+ per 9 modified file** — fixed-string / glyph-exact membership, 9 file 모두 1+ 존재 (semantic 판단 0).
- **Generic Korean standalone ban 0** — 일반 단어 (`요괴 / 로봇 / 빙의 / 변신 / 캠코더 / VR` 등) standalone forbidden 절대 금지. legitimate use case 잔존 가능 (예: VWR rule_type enum 의 `possession / projection` 자체, entity_character_list `요괴 / 로봇` owner taxonomy, scene_detail 본문 camera 등). **단어 단독 standalone 검사 = semantic 판단 = Gate (1) Semantic Regex Ban 위반**.
- **D-2 taxonomy global-ban 금지** — entity_character_list `인간, 요괴, 동물, 로봇, 외계인` exempt (D-2 carve-out 정합).
- NO VLM, jsonschema/markdown/regex only.

**Rationale**:
- Codex Q0 권고 정합 — per-site forbidden + canonical reference 정합 + global ban 금지.
- Area #7a 정합 (Area #7a residue gate strict 4 항목 + global ban 0).
- false-positive 차단 의무 (legitimate use case 보존).

### 4.6 Q6. Canary scope

**Decision (Q6=A)**: 
- **prompt_loader latest activation verify** — 7 new-dir module 새 dir 신설 시 prompt_loader 가 numeric-desc latest 으로 자동 active (Area #7a 정합). D-2 entity_character_list = new dir 0 (변경 0 boundary preserve).
- **STEP_MANIFEST 변경 0 verify** — W1-W3 안 STEP_MANIFEST diff 0 (snapshot compare).
- **DB override risk 검토 / neutralize** — entity_character_list = 변경 0 → DB row 영향 0 (D-2 db-aware caller path scope 외 unchanged). 7 new-dir module = file fallback only 자동 active.
- **live LLM 0** + **VLM 0**.

**Rationale**:
- Area #7a 정합 (Area #7a W3b canary 8 항목 패턴).
- NO VLM hard constraint inline.
- live LLM 차단 = test 안 deterministic execution.

### 4.7 Q7. Closure verdict (Codex iter 2 verbatim, handoff session 안 fixed)

> Area #7b closes when the VWR downstream prompt cascade is converted from prompt-owned scenario/domain term lists to canonical visual_world_rules.rules[].rule_type SOT references across the rewritten entity/outlook/scene prompt sites; entity_character_list D-2 remains explicitly preserved as a generic owner-taxonomy boundary; active prompt residue gates verify site-specific exact residue phrases 0 (fixed-string / glyph-exact membership, audit-verbatim + current-active-promoted inventory split, no semantic judgment) and canonical VWR SOT references present in every rewritten site; canaries verify prompt_loader latest activation, STEP_MANIFEST schema_version unchanged, DB override risk neutralized, and no VLM validation is used.

## 5. Wave Outline

### 5.1 W0 — Inventory + Baseline Measurement (handoff session 안 완료)

**State**: W0 = handoff session (2026-05-19 Area #7a closure session) 안 brainstorming Q0 inventory 단계에서 **완료**. Codex 2-round APPROVED. 따라서 본 area execution wave 안 W0 별도 commit 없음.

**Q0 inventory 내용 정합**:
- 8 module latest version dir verify (§2.3 #1).
- prompt_loader latest activation verify (§2.3 #2).
- STEP_MANIFEST 매핑 (§2.3 #3).
- DB / hardcoded path risk (§2.3 #4).

**Output**: 본 spec §2.3 가 W0 inventory 보관 (별도 inventory memo 신설 X — Area #7a 의 W0 memo 패턴 (`docs/superpowers/specs/2026-05-18-area-7a-w0-inventory.md` 5.5kb) 보다 작은 inventory 라 별도 file 0).

### 5.2 W1 — Group E (entity_*) Cascade Atomic (signature-breaking)

**Goal**: 3 module new dir 신설 + 4 modified file (entity_all character.md + entity_relation system.md + entity_extractor_v2 system.md + entity_extractor_v2 turn0_style.md) + **17 byte-identical sibling copy total** (Codex iter 4 F-1 흡수 entity_relation +2). canonical VWR SOT clause verbatim 정합 + local prefix/suffix site-specific 허용. 4-Gate Boundary Doctrine 정합 (semantic regex ban, closed-world exact residue 만).

**Tasks (single commit, atomic transition)**:
1. `prompts/_base/entity_all/5.20260518HHMM/` 신설:
   - `character.md` modified — line 26 + 29 + 30 audit-verbatim residue (`인간↔요괴 / 인간↔괴물 / 본체↔변신체` + `빙의/합체` + `이무기, 구미호, 요괴화, 뱀파이어`) 본체 폐기 + canonical clause 삽입 + generic principle wording 보존.
   - location.md / prop.md / character_schema.json / location_schema.json / prop_schema.json / system.md = **byte-identical verbatim copy** from `4.202603310100/` (6 sibling).
2. `prompts/_base/entity_relation/3.20260518HHMM/` 신설:
   - `system.md` modified — line 11 + 12 + 13 audit-verbatim residue (`요괴/괴물 형태 / 유령/망령 형태 / 갑옷 착용 형태`) 폐기 + line 30 current-active-promoted residue (`요괴로 변해도 원래 인물의 흔적이 있음 → true` full phrase) generic 추상화 + canonical clause.
   - `analyze.md` + `analyze_schema.json` = **byte-identical verbatim copy** from `2.202603301800/` (2 sibling, Codex iter 4 F-1 흡수 — production `entity_relation.py:93-95` strict pack).
3. `prompts/_base/entity_extractor_v2/10.20260518HHMM/` 신설:
   - `system.md` modified — line 22 audit-verbatim (`평상복 → 전신 갑옷 (완전히 다른 실루엣)`) + line 32 audit-verbatim section header (`### 빙의/정신 전환/몸을 빌리는 설정이 있는 경우`) generic 추상화 + canonical clause.
   - `turn0_style.md` modified — line 13 audit-verbatim (`원격 접속/조종/빙의/텔레파시`) generic 추상화 + canonical clause.
   - turn_entity_detail.md / turn0_style_schema.json / turn1_7_detail_batch_schema.json / turn1_7_detail_batch.md / turn1_review_schema.json / turn1.md / turn2.md / turn3.md / turn4.md = **byte-identical verbatim copy** (9 sibling).

**Single atomic commit (signature-breaking)**: 3 module × new dir + 4 modified file + **17 sibling byte-identical copy**. plan literal wording 정합 의무 ([[feedback_codex_mcp_discussion_workflow]] Q5 정합).

**Pre-Commit Verification (controller 자체)**: 4 modified file 안 canonical clause **글자-단위 exact-string membership** verify (semantic 판단 X) + **W1 4 modified file 의 exact residue phrase inventory** (entity_all 4 audit-verbatim phrase + entity_relation 3 audit-verbatim phrase + 1 current-active phrase + entity_extractor_v2 system.md 2 audit-verbatim phrase + turn0_style.md 1 audit-verbatim phrase) hit 0 verify. 17 sibling file byte-identical (`diff -r` 정합).

**Codex review (per-wave)**: W1 commit 후 Codex external review 의뢰 (canonical clause verbatim + sibling copy 정합).

### 5.3 W2 — Group O (outlook_*) Cascade Atomic

**Goal**: 1 module new dir 신설 + 2 modified file (outlook phase1.md + phase2.md) + 4 byte-identical sibling copy.

**Tasks (single commit)**:
1. `prompts/_base/outlook_extractor/12.20260518HHMM/` 신설:
   - `phase1.md` modified — line 16 audit-verbatim residue (`메카, 파워드슈트, 강화복, 갑옷 로봇`) + line 24 current-active-promoted residue (`인간형 요괴/괴물, 뱀파이어, 좀비` — Codex iter 4 F-3 흡수, audit verbatim 아님 controller verify 2026-05-19) 폐기 + canonical clause + generic `costume / technology rule_type` wording.
   - `phase2.md` modified — line 8 audit-verbatim residue (`원격접속/빙의:`) 폐기 + canonical clause + generic `rule_type=possession / projection` wording.
   - phase1_schema.json / phase2_schema.json / phase3_schema.json / phase3.md = byte-identical verbatim copy (4 sibling).

**Pre-Commit Verification (controller 자체)**: 2 modified file 안 canonical clause **글자-단위 exact-string membership** verify (semantic 판단 X) + **W2 exact residue phrase inventory** (phase1.md 2 phrase: `메카, 파워드슈트, 강화복, 갑옷 로봇` audit-verbatim + `인간형 요괴/괴물, 뱀파이어, 좀비` current-active-promoted; phase2.md 1 phrase: `원격접속/빙의:` audit-verbatim) hit 0 verify. 4 sibling file byte-identical.

**Codex review**: W2 commit 후 Codex external review 의뢰.

### 5.4 W3 — Group S (scene_*) Cascade Atomic — **line drift verify 의무**

**Goal**: 3 module new dir 신설 + 3 modified file (scene_verify system.md + scene_detail system.md + shot_extract user.md) + **3 byte-identical sibling copy total** (Codex iter 4 F-1 흡수 scene_verify +1) + **scene_detail 4-point sync narrow exemption** (production code 2 file + scene_detail-pinned tests 5 file plural = 13 file total, Codex amend 7 + amend 8 + amend 9 OPTION_A expanded 흡수). scene_detail / shot_extract line drift = wave entry 시점 controller verify 의무.

**Tasks (single commit)**:
1. `prompts/_base/scene_verify/2.20260518HHMM/` 신설:
   - `system.md` modified — line 7 audit-verbatim residue (`3. **빙의/영혼 상태**: 다른 인물의 몸에 들어간 경우, 원래 몸은 visible=false, 빙의된 몸은 visible=true. reason에 상태를 명시`) 폐기 + canonical clause + generic principle wording.
   - `verify_schema.json` = byte-identical verbatim copy (1 sibling, Codex iter 4 F-1 흡수 — production `detail_steps.py:3088-3089` strict pack).
2. `prompts/_base/scene_detail/27.20260518HHMM/` 신설:
   - `system.md` modified — line 473 (또는 W3 entry 시 controller 재확인 line) audit-verbatim residue (`- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)`) 폐기 + canonical clause + generic wording. nearby section context 보존.
   - detail_schema.json = byte-identical verbatim copy (1 sibling).
3. `prompts/_base/shot_extract/12.20260518HHMM/` 신설:
   - `user.md` modified — line 49 (또는 W3 entry 시 controller 재확인 line) audit-verbatim residue (`- 얼굴이 크게 달라지는 변화: 나이 변화, 변장/성형 전후, 빙의로 얼굴이 바뀜` 안 `빙의로 얼굴이 바뀜` parenthetical) 폐기 + canonical clause + generic wording. `나이 변화 / 변장/성형` generic example 보존.
   - system.md = byte-identical verbatim copy (1 sibling).
4. **scene_detail 4-point sync narrow exemption (Codex amend 7 + amend 8 + amend 9 OPTION_A expanded 흡수, W3 atomic boundary 안 + plural scene_detail-pinned tests 5 files)** — Area #5 W1 (2026-05-18) defensive guards + Group E generic prompt version pin + G4.5a spatial 4-way sync + Area #5 W3 active prompt residue canary = **scene_detail-pinned tests 5 files** hard-pinned 의무 정합 (다른 module 비교 결과 ALL absent):
   - `backend/app/core/steps/detail_steps.py:106` — `SCENE_DETAIL_PROMPT_VERSION` `"26.202605181435"` → `"27.20260518HHMM"` (W3 actual UTC HHMM substitute). `SCENE_DETAIL_SCHEMA_VERSION = 11` 보존 (line 105, schema 변경 0).
   - `backend/app/core/version_registry.py:34` — `MODULE_VERSIONS["scene_detail_composer"]` `"1.26.0"` → `"1.27.0"`.
   - `backend/app/core/version_registry.py:126` — `_MODULE_INFO["scene_detail_composer"]["prompt_dependency"]` `"scene_detail/v26"` → `"scene_detail/v27"` + `updated_at` `"2026-05-18"` → `"2026-05-19"`.
   - `backend/tests/prompts/test_scene_detail_continuity_alignment.py` — 4 assertion 갱신 (line 69 MODULE_VERSIONS `"1.26.0"` → `"1.27.0"` + line 103 `"scene_detail/v26"` → `"scene_detail/v27"` + line 120 `startswith("26.")` → `startswith("27.")` + line 196 `latest_major == "26"` → `"27"`). line 168 `SCENE_DETAIL_SCHEMA_VERSION == 11` 보존. Error message + docstring `v26`/`1.26.0` references narrow sync.
   - `backend/tests/prompts/test_scene_detail_spatial_alignment.py` — 5 assertion 갱신 plural (Codex amend 8 흡수, 자매 alignment test 동일 doctrine: line 72 + line 106 + line 127 + line 132 (duplicate sub-test) + line 207).
   - `backend/tests/test_prompt_versions.py` — 2 assertion + 1 function rename (Codex amend 9 OPTION_A expanded: line 211 startswith + line 219 MODULE_VERSIONS + line 214 function `test_version_registry_scene_detail_composer_1_26_0` → `_1_27_0`). history comment v25→v26 / 1.25.0→1.26.0 narrow sync.
   - `backend/tests/integration/test_g4_5a_spatial_integration.py` — 4 assertion + 1 function rename (Codex amend 9 OPTION_A expanded: line 591 startswith + line 598 MODULE_VERSIONS + line 607 _MODULE_INFO + line 769 config_hash defensive 모두 27 series + line 561 function `test_4_way_alignment_post_g4_5a_bump` → `test_4_way_alignment_post_area7b_w3_bump`). docstring 562-574 + error message narrow sync.
   - `backend/tests/integration/test_area_5_residue_gate.py` — 1 function rename + glob (Codex amend 9 OPTION_A expanded, non-blocking 단 stale meaning carry 차단: line 172 function `v26` → `v27` + line 178 glob `26.*/` → `27.*/` + line 184 print message). active prompt 가 v27 로 이동, canary scope 도 v27 fresh.
   - 다른 scene_detail test (`test_scene_detail_id_policy_alignment.py` + `test_scene_detail_v21_grep_gate.py` + `test_scene_detail_v21_rule_x2_semantic.py`) 4-point sync hardcoded assertion 0 — 변경 0 (prompt body content gate only).
   - 다른 module (entity_*/outlook_*/scene_verify/shot_extract) production code 변경 0 doctrine + helper 신설 0 doctrine + STEP_MANIFEST 변경 0 doctrine 모두 보존.

**Line drift handling (W3 entry 의무)**: scene_detail / shot_extract 의 latest version dir + 정확 line number 재확인. 만약 본 spec drafting 시점 (2026-05-19) 과 W3 entry 시점 사이 새 prompt version bump 가 발생하면 plan amend (narrow) 으로 line number + dir version 정정 후 W3 진입.

**Pre-Commit Verification**: 3 modified file 안 canonical clause **글자-단위 exact-string membership** verify + **W3 exact residue phrase inventory** (scene_verify 1 phrase: `3. **빙의/영혼 상태**: 다른 인물의 몸에 들어간 경우, 원래 몸은 visible=false, 빙의된 몸은 visible=true. reason에 상태를 명시` audit-verbatim full sentence; scene_detail 1 phrase: `- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)` audit-verbatim full sentence; shot_extract 1 phrase: `빙의로 얼굴이 바뀜` audit-verbatim parenthetical) hit 0 verify. 3 sibling file byte-identical. **4-point sync narrow exemption verify (Codex amend 7 + amend 8 + amend 9 OPTION_A expanded 흡수, plural scene_detail-pinned tests 5 files)**: `SCENE_DETAIL_PROMPT_VERSION == "27.20260518HHMM"` (detail_steps.py:106) + `MODULE_VERSIONS["scene_detail_composer"] == "1.27.0"` (version_registry.py:34) + `_MODULE_INFO["scene_detail_composer"]["prompt_dependency"] == "scene_detail/v27"` (version_registry.py:126) + `SCENE_DETAIL_SCHEMA_VERSION == 11` 보존 (schema 변경 0) + `pytest backend/tests/prompts/test_scene_detail_continuity_alignment.py backend/tests/prompts/test_scene_detail_spatial_alignment.py backend/tests/test_prompt_versions.py backend/tests/integration/test_g4_5a_spatial_integration.py backend/tests/integration/test_area_5_residue_gate.py -v` ALL PASS (14+ assertion 갱신 + 3 function rename + schema_version 보존).

**Codex review**: W3 commit 후 Codex external review.

### 5.5 W4 — Residue Gate (closed-world exact residue phrase contract)

**Doctrine (사용자 격분 + Codex iter 4 boundary verdict 흡수)**: residue gate = **closed-world exact residue phrase verification 만** — `fixed-string membership` 형태 (regex alternation 회피, 글자-단위 exact match). semantic 판단 0 (도메인-specific 인지 generic 인지 LLM 판단 X). inventory = **finite phrase set anchored to (source path + line + audit-or-current-active classification)**. Generic 한국어 단어 (예: `요괴`, `빙의`, `변신`) 단독 forbidden 0. 4-Gate Boundary Doctrine (§3.1 정합) inline.

**Goal**: 9 rewritten file 안 **exact residue phrase** 0 + canonical VWR reference 1+ per 9 site + D-2 boundary preserve + archive exclusion + Generic Korean term standalone ban 0.

**Tasks**:
1. **Residue gate test 신설** (`backend/tests/integration/test_area_7b_residue_gate.py`):
   - **Gate 1 (exact residue phrase membership per modified file, 9 sub-gate)** — 각 9 rewritten file 안 exact residue phrase inventory hit 0 (fixed-string membership, source path + line + audit-or-current-active classification anchor):
     - **Gate 1.1 entity_all/5.*/character.md** (audit §11.2 site 1 line 244 verbatim):
       - audit-verbatim phrases: `인간↔요괴` (line 26) / `인간↔괴물` (line 26) / `본체↔변신체` (line 26) / `빙의/합체` (line 29) / `이무기` (line 30) / `구미호` (line 30) / `요괴화` (line 30) / `뱀파이어` (line 30)
       - canonical clause 안 같은 word substring (예: `transformation`) 은 exempt — exact phrase 단위 membership, semantic 판단 0.
     - **Gate 1.2 entity_relation/3.*/system.md** (audit §11.2 site 3 line 246 verbatim + current-active-promoted line 30):
       - audit-verbatim phrases: `요괴/괴물 형태` (line 11) / `유령/망령 형태` (line 12) / `갑옷 착용 형태` (line 13)
       - current-active-promoted phrase: `요괴로 변해도 원래 인물의 흔적이 있음 → true` (line 30 full phrase, controller verify 2026-05-19, audit §11.2 verbatim 아님)
     - **Gate 1.3 entity_extractor_v2/10.*/system.md** (audit §11.2 site 6 line 249 verbatim):
       - audit-verbatim phrases: `평상복 → 전신 갑옷` (line 22) / `### 빙의/정신 전환/몸을 빌리는 설정이 있는 경우` (line 32 full section header)
     - **Gate 1.4 entity_extractor_v2/10.*/turn0_style.md** (audit §11.2 site 7 line 250 verbatim):
       - audit-verbatim phrase: `원격 접속/조종/빙의/텔레파시` (line 13)
     - **Gate 1.5 outlook_extractor/12.*/phase1.md** (audit §11.2 site 4 line 247 verbatim + current-active-promoted line 24):
       - audit-verbatim phrase: `메카, 파워드슈트, 강화복, 갑옷 로봇` (line 16, single contiguous phrase)
       - current-active-promoted phrase: `인간형 요괴/괴물, 뱀파이어, 좀비` (line 24, single contiguous phrase, controller verify 2026-05-19, audit §11.2 verbatim 아님, Codex iter 4 F-3 흡수)
     - **Gate 1.6 outlook_extractor/12.*/phase2.md** (audit §11.2 site 5 line 248 verbatim):
       - audit-verbatim phrase: `원격접속/빙의:` (line 8)
     - **Gate 1.7 scene_verify/2.*/system.md** (audit §11.2 site 9 line 252 verbatim):
       - audit-verbatim phrase: `3. **빙의/영혼 상태**: 다른 인물의 몸에 들어간 경우, 원래 몸은 visible=false, 빙의된 몸은 visible=true. reason에 상태를 명시` (line 7 full sentence)
     - **Gate 1.8 scene_detail/27.*/system.md** (audit §11.2 site 10 line 253 verbatim, line drift verify 의무):
       - audit-verbatim phrase: `- 원격 조종/접속 인물 제외 (조종자 몸이 다른 장소에 있음)` (line 473, audit 시점 line 327 → controller verify line 473)
     - **Gate 1.9 shot_extract/12.*/user.md** (audit §11.2 site 11 line 254 verbatim, line drift verify 의무):
       - audit-verbatim phrase: `빙의로 얼굴이 바뀜` (line 49 parenthetical, audit 시점 line 33 → controller verify line 49)
   - **Gate 2 (canonical VWR reference glyph-exact membership, per 9 modified file)** — 각 9 rewritten file 의 new dir 안 canonical clause 본문 (audit §11.3 verbatim 의 글자-단위 정확 substring `본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의 rule_type ∈ {possession, transformation, ghost, projection, superpower, body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어 있지 않으면 일반 인물로 처리.`) hit ≥ 1. fixed-string membership, regex 0.
   - **Gate 3 (D-2 carve-out boundary verify, byte-identical)** — entity_character_list `2.202605011057/system.md` byte-identical (변경 0 verify, sha256 diff 0). file content semantic 판단 X — pure hash comparison.
   - **Gate 4 (archive directory exclusion, structural)** — 각 module 의 archive dir (예: entity_all 의 1.* / 2.* / 3.* / 4.* — `5.*` 외) 본문 안 residue phrase 잔존 = 허용 (Gate 1.x scope 외). path glob 패턴 (closed-world, file system contract).
2. **Pre-Commit Verification (W4)**: pytest `backend/.venv/bin/pytest backend/tests/integration/test_area_7b_residue_gate.py -v` PASS 의무.

**Codex review (per-wave)**: W4 commit 후 Codex external review 의뢰.

### 5.6 W5 — Canary

**Goal**: prompt_loader latest activation verify + STEP_MANIFEST 변경 0 verify + DB override risk neutralized verify + NO VLM hard constraint.

**Tasks**:
1. **Canary test 신설** (`backend/tests/integration/test_area_7b_no_drift.py`):
   - **C1 prompt_loader latest activation (7 sub-canary, 1 per new dir)** — Codex iter 4 F-2 흡수 (canonical 7 new prompt dirs): 7 module (entity_character_list 제외) 각각 `_list_module_versions(module)[0]` 가 새 dir version (entity_all `5.20260518HHMM` / entity_relation `3.20260518HHMM` / entity_extractor_v2 `10.20260518HHMM` / outlook_extractor `12.20260518HHMM` / scene_verify `2.20260518HHMM` / scene_detail `27.20260518HHMM` / shot_extract `12.20260518HHMM`) 정합 (자체 numeric-desc sort). fixed-string path comparison, semantic 판단 0.
   - **C2 byte-identical sibling copy (24 sub-canary)** — Codex iter 4 F-1/F-2 흡수: 7 new dir 안 sibling stem file (entity_all 6 + entity_relation 2 + entity_extractor_v2 9 + outlook_extractor 4 + scene_verify 1 + scene_detail 1 + shot_extract 1 = 24 file) `prompt_loader._resolve_stem_in_pack:259-266` 로 lookup 한 결과 = 직전 version dir 의 같은 file `sha256` digest 동일. closed-world hash comparison, semantic 판단 0.
   - **C3 STEP_MANIFEST 12 affected step entry presence verify (entry-existence contract, schema_version drift = C4 별도, W5 fix-up 1 narrow sync)** — Codex iter 4 F-2 흡수 (canonical 10 STEP entries spec metric) + Plan canonical (Codex iter 1/2 F-1 reconciliation = **12 affected STEP_MANIFEST entries = 10 modified-file-bound step entries + 2 sibling-only shared-module entries (`entity_all_location` / `entity_all_prop`)**) + W5 fix-up 1 narrow sync (commit `fe7e55e`, "snapshot diff 0" wording → "entry presence verify" + function rename `test_c3_step_manifest_snapshot_diff_zero` → `test_c3_step_manifest_entry_presence_verify`): `backend/app/core/step_manifest.py` 안 12 affected step entry (entity_all_character / entity_all_location / entity_all_prop / entity_relation / entity_extract_character / entity_extract_location / entity_extract_prop / outlook_phase1 / outlook_phase2 / scene_verify / scene_detail / shot_extract) presence verify from Area #7a closure (`d0410eb`). schema_version drift = C4 별도 verify (entry-existence contract 만, field-level snapshot diff 0 scope 외). closed-world struct comparison.
   - **C4 schema_version 변경 0**: `visual_world_rules.schema_version=1` (Area #7a W1 신설) 본 area 안 변경 0 verify. closed-world enum comparison.
   - **C5 D-2 DB override risk neutralized**: entity_character_list `db=`-aware caller path identify (audit §11.4 정합) + entity_character_list 본문 변경 0 sha256 verify → DB row 영향 0 결론. test 안 entity_character_list module prompt loader 호출 path snapshot verify (`db=` parameter accept 정합 보존). closed-world hash + path comparison.
   - **C6 canonical clause glyph-exact membership verify (9 modified file)**: 9 rewritten file 의 canonical clause substring = audit §11.3 verbatim string (글자-단위 동일, fixed-string membership) match. semantic 판단 0.
2. **No live LLM** — test 안 LLM API call 0. **No VLM** hard constraint inline.
3. **Pre-Commit Verification (W5)**: pytest `backend/.venv/bin/pytest backend/tests/integration/test_area_7b_no_drift.py -v` PASS 의무.

**Codex review (per-wave)**: W5 commit 후 Codex external review 의뢰.

### 5.7 W6 — Closure

**Goal**: 본 spec status: closed + roadmap §5.7 Sub-area (b) 11-site cascade closed mark + audit `02-` §13 (또는 §12 append) Area #7b Closure section + carry table 정합 보존.

**Tasks**:
1. **Closure memo**:
   - 본 spec frontmatter `status: drafting` → `status: closed`.
   - 본 spec 마지막에 §11 Closure section 추가 (Area #7a 패턴 정합) — wave commit hash + verdict verbatim + in-scope + carry + NO VLM.
2. **Roadmap update**: `docs/superpowers/specs/2026-05-16-track-b-semantic-debt-roadmap-design.md` §5.7 Sub-area (b) bullet `closed` mark 갱신 — Area #7a + Area #7b 11-site cascade 모두 closed.
3. **Audit update**: `docs/visual-reliability-audit/2026-05-14-semantic-string-routing-debt-audit/02-prompt-side-hygiene-audit.md` §13 Area #7b Closure section append — 9 site mapping (D-1 / D-3 / D-4 / ADD-6 / ADD-8 / ADD-9 / ADD-10 / ADD-11 / audit §11.2 site 11) closed status. D-2 boundary 명시 + carry table 명시.
4. **Codex iter (range review)**: W1-W6 range review APPROVED_FOR_PUSH 후 push.

**NO VLM** hard constraint inline — 모든 canary + residue gate = schema/text/manifest verification only.

## 6. Carry Table

| Carry ID | Surface | Source / Reason | Promotion Trigger |
|---|---|---|---|
| **D-2 boundary preserve** | `entity_character_list/2.202605011057/system.md:10` (인간 / 요괴 / 동물 / 로봇 / 외계인) | owner taxonomy 5-element 분류 = 인물 정의 boundary (presence/visibility 결정 X). VWR rule_type SOT 와 다른 축. 사용자 명시 + audit §11.3 line 264-265 + Codex iter 2 verdict Q3. | (없음 — explicit no-change boundary, 본 area 변경 0 영구 보존) |
| **Area #7c** | t2i_review v6 placeholder example abstraction (`scene_system.md:31/36/39/60-61` + `entity_system.md:33-34`) | Area #6 v6 pack closure carry. 별도 small area. | Area #7b closure 후 follow-up Tier 3 area |
| **Area #7d** | Cinematography closed-list SOT dual-site (`variation_recommender/v2/system.md` + `scene_extractor_v2/19.../turn_scene_detail.md:87-91` 카메라 구도/색감 7+7 closed-list) | A095 + 신규. cinematography 도메인 별개 — visual_world_rules SOT 와 다른 축. | Area #7b closure 후 follow-up |
| **Carry-A099** | VWR system.md director_notes prose redesign (line 57-73 generic principle 5-line + bad-example 4-line) | director_notes prose = LLM-generate natural-language rule 본질적 redesign 영역. Area #7a 정합 보존. | director_notes prose redesign decision: **추상화 채택** — Carry-A099 resolved by W1/W2 + W3 closure-docs (2026-05-19+), prose hard-prime examples abstracted |
| **Carry-A100** | VWR system.md t2i_context demonym (line 98 `<region-derived demonym>`) | t2i_context field 도메인 (이미지 prompt 시각 스타일 / 인종/국적 bias). rule_type SOT 와 다른 축. | t2i_context demonym redesign decision 후 follow-up area |
| **Carry-P021** | scene_consistency 7 `character_state / environment_state / persistent_prop` type list + generic example (G6 closed-list enumeration broad) | roadmap §5.4 carry 표현, audit file direct row source 0 hit → **source unresolved**. 본 area scope blocker X. | audit row direct source 확인 + active leak verify 후 promotion |

## 7. Residue Gate (closed-world exact residue phrase contract — 4-Gate Boundary Doctrine 정합)

**Doctrine clause (사용자 격분 흡수 2026-05-19, [[feedback_llm_based_judgment]] 정합 + Codex iter 4 boundary verdict 정합)**:

> Gate 1 is not semantic regex. It is closed-world exact residue verification for a finite phrase inventory captured from audit §11.2 verbatim plus controller-verified current active prompt lines. Generic Korean words such as 요괴/빙의/변신 are never standalone exact residue phrases (legacy term: forbidden signatures — replaced after 2026-05-19 user-anger / Codex iter 4 boundary verdict). fixed-string membership 형태 (regex alternation 회피), 글자-단위 exact match, source path + line + audit-or-current-active classification anchored.

**4-Gate Boundary Doctrine (semantic 판단 절대 금지)**:
1. **Semantic Regex Ban** — open-world semantic 판단을 regex/substring 으로 절대 금지. 의미 분류 (도메인-specific 인지 generic 인지) = LLM-produced structured SOT 만 가능, code regex 0.
2. **Prompt Closed-List Ban** — prompt 안 LLM-instructed closed-list domain term enumeration 금지. canonical VWR SOT reference clause = audit §11.3 verbatim 의 closed-world contract reference (VWR rules_schema enum 정합), 새 closed-list 아님.
3. **Structured SOT Required** — open-world semantic 판단 시 LLM-produced structured emit 의무. code/test 는 enum/ID/bool/object/path 만 소비.
4. **No Silent Fallback** — invalid input / missing field / typo signature = explicit reject + typed error. silent retry/추측 0.

**Scope**: production active prompt only — 9 rewritten file 의 new dir (Group E `entity_all/5.*/character.md` + `entity_relation/3.*/system.md` + `entity_extractor_v2/10.*/system.md` + `entity_extractor_v2/10.*/turn0_style.md` + Group O `outlook_extractor/12.*/phase1.md` + `outlook_extractor/12.*/phase2.md` + Group S `scene_verify/2.*/system.md` + `scene_detail/27.*/system.md` + `shot_extract/12.*/user.md`).

**Archive excluded**: 각 module 의 archive dir (예: entity_all `1.* ~ 4.*` / entity_relation `1.* ~ 2.*` / entity_extractor_v2 `1.* ~ 9.*` / outlook_extractor `1.* ~ 11.*` / scene_verify `1.*` (본 area `2.*` 신설 후 archive) / scene_detail `1.* ~ 26.*` / shot_extract `1.* ~ 11.*`) — residue gate scope **외**. path glob 패턴 (file system contract, closed-world).

**D-2 exempt**: `entity_character_list/2.202605011057/system.md` 본문 안 `요괴 / 로봇 / 동물 / 외계인` 등 generic taxonomy term = residue gate scope **외**. Gate 3 (D-2 boundary verify) 안 변경 0 sha256 diff 만 verify — 본문 word membership 검사 0.

**Generic Korean word standalone ban 0**: `projection / possession / ghost / camera / color / 변신 / 빙의 / 요괴 / 로봇 / 동물 / 외계인 / 인간 / 메카` 등 generic 단어 standalone forbidden 0. legitimate use case 잔존 가능 (VWR enum / canonical clause / generic example / owner taxonomy 등). **단어 단독 standalone 검사 = semantic 판단 = Gate (1) Semantic Regex Ban 위반**.

---

**Gate 1 (exact residue phrase membership per modified file, 9 sub-gate)** — fixed-string membership, glyph-exact match, **finite phrase inventory anchored to source path + line + audit-or-current-active classification**. §5.5 W4 Gate 1.1 ~ 1.9 본문 참조 — audit-verbatim + current-active-promoted split 정합:

**Inventory split**:
- **audit-verbatim phrases** — audit §11.2 line 240-254 본문에 명시된 정확 구문. cleanup contract = audit row hash anchor.
- **current-active-promoted phrases** — audit §11.2 미포함, controller verify 2026-05-19 시점 active prompt 안 발견된 정확 구문. classification 명시 의무. 본 area scope_creep_risk 차단 위해 같은 active prompt file surface 안 closure overclaim 차단 목적 흡수 (Codex iter 4 F-3 verdict).

**Canonical clause whole-phrase exempt**: canonical clause 본체 안 token (`possession / transformation / ghost / projection / superpower / body_deformation`) 은 Gate 1.x scope 외 (clause 본체 안 정합 token 보존 의무 — substring 안 standalone 검사 X, 클래스 1 = full phrase 만 검사).

**Gate 2 (canonical VWR reference glyph-exact membership, per 9 modified file, hit ≥ 1)**:
- target = audit §11.3 line 258-261 verbatim 의 글자-단위 정확 canonical clause (`본 prompt 의 변신/빙의/원격접속 판단 기준은 visual_world_rules.rules[] 의 rule_type ∈ {possession, transformation, ghost, projection, superpower, body_deformation} 을 따른다. 작품에 해당 rule_type rule 이 정의되어 있지 않으면 일반 인물로 처리.`).
- 9 modified file 모두 1+ hit (fixed-string membership, 줄바꿈 / 공백 normalization 0 — 글자-단위 정확).
- W2 Site 1 paraphrase 격분 trigger 재발 차단 ([[session_20260519_area_7a_w0_w2_execution_closure]] 함정 7 정합).

**Gate 3 (D-2 carve-out boundary verify, byte-identical)**:
- `prompts/_base/entity_character_list/2.202605011057/system.md` 본 area 안 변경 0 — sha256 digest 직전 push (`d0410eb`) 와 동일.
- entity_character_list 디렉토리 안 새 dir 신설 0 verify.
- closed-world hash + path comparison, semantic 판단 0.

**Gate 4 (archive directory exclusion, structural path glob)** — 각 module 의 archive dir (현재 latest 외) 본문 안 residue phrase 잔존 = 허용 (Gate 1.x scope 외). Gate 1.1-1.9 의 fixed-string scope = 새 dir (`5.*` / `3.*` / `10.*` / `12.*` / `2.*` / `27.*` / `12.*`) 만 포함, archive exclude (path glob, closed-world).

**Forbidden global ban (Codex iter 2 Q6 verdict 정합 + Q0 권고 + 본 area Q5=A)**: 일반 단어 global 0 금지. `projection / possession / ghost / camera / color / 변신 / 빙의 / 요괴 / 로봇 / 동물 / 외계인 / 인간 / 메카` 등 global ban 금지. legitimate use case 보존 의무.

## 8. Closure Verdict (Q7 verbatim, handoff session 안 Codex 2-round APPROVED, fixed)

> Area #7b closes when the VWR downstream prompt cascade is converted from prompt-owned scenario/domain term lists to canonical visual_world_rules.rules[].rule_type SOT references across the rewritten entity/outlook/scene prompt sites; entity_character_list D-2 remains explicitly preserved as a generic owner-taxonomy boundary; active prompt residue gates verify site-specific exact residue phrases 0 (fixed-string / glyph-exact membership, audit-verbatim + current-active-promoted inventory split, no semantic judgment) and canonical VWR SOT references present in every rewritten site; canaries verify prompt_loader latest activation, STEP_MANIFEST schema_version unchanged, DB override risk neutralized, and no VLM validation is used.

**Promotion condition (controller verify)**: W1-W6 atomic execution + Codex per-wave APPROVED + carry table 명시 + roadmap §5.7 update + audit `02-` §13 (또는 §12 append) Area #7b Closure section + range review APPROVED_FOR_PUSH 후 push 실행 + external memory 기록 (push 완료 status 는 W6 closure commit 시점 pre-claim 금지 — repo-local docs 안 push 보류 wording 유지, push 후 external memory `session_20260519_area_7b_v1_closure.md` 에 기록).

**NO VLM hard constraint** — 모든 canary + residue gate = schema/text/manifest verification only. VLM 의존 0 ([[feedback_no_vlm_dependency]] 정합).

## 9. References

- **Roadmap**: `docs/superpowers/specs/2026-05-16-track-b-semantic-debt-roadmap-design.md` §5.7 Sub-area (b) cascade (post Area #7a closure mark).
- **Audit (02-prompt)**: `docs/visual-reliability-audit/2026-05-14-semantic-string-routing-debt-audit/02-prompt-side-hygiene-audit.md` §11 (line 232-269 = §11.1 SOT / §11.2 11-site table / §11.3 일원화 방향 / §11.4 Fix Cost / §11.5 boundary) + §12 (Area #7a Closure section, Area #7a v1 closure 후 추가됨).
- **Audit findings (active row)**: `backend/tests/_audit_outputs/semantic_string_debt/full_20260516_0105/active_prompt_findings_with_snippets.md` (active prompt findings — D-1 / D-3 / D-4 / ADD-6 / ADD-8 / ADD-9 / ADD-10 / ADD-11 row 정합).
- **Area #7a spec (closed)**: `docs/superpowers/specs/2026-05-18-area-7a-visual-world-rules-sot-v1-design.md` (status: closed, §11 Closure section, push `d0410eb`).
- **Area #7a plan (closed)**: `docs/superpowers/plans/2026-05-18-area-7a-visual-world-rules-sot-v1-implementation.md` (HEAD `d0410eb`, 1587 line).
- **VWR v7 SOT (Area #7a producer)**: `prompts/_base/visual_world_rules/7.202605181540/{rules_schema.json, system.md}`.
- **scene_director v9 (Area #7a consumer)**: `prompts/_base/scene_director/9.202605181550/system.md`.
- **STEP_MANIFEST**: `backend/app/core/step_manifest.py:130-142` `visual_world_rules.schema_version=1` (Area #7a W1 신설).
- **prompt_loader**: `backend/app/modules/prompt_loader.py:130-180, :219-235` numeric-desc latest version 자동 활성.
- **Closed area boundary**: Area #3 (commit `97c4471`) / Area #5 (commit `fe300bf`) / Area #6 (commit `2845907`) / Hygiene v1 (commit `91d1dfd`) / Area #7a (commit `d0410eb`) — all preserved.
- **Memory**: [[next_session_area_7b_cascade_brainstorm]] (Q0+Q1-Q7 outline + closure verdict + spec drafting §1-§10 가이드) + [[session_20260519_area_7a_v1_closure]] (직전 phase closure 종합) + [[feedback_codex_mcp_discussion_workflow]] / [[feedback_no_vlm_dependency]] / [[feedback_push_no_user_ask]] / [[feedback_session_50pct_codex_close_check]] / [[feedback_subagent_model_opus]].

## 10. Codex Iter Trace

- **Codex iter 1 (handoff session, brainstorming Q0+Q1-Q7 outline review)**: APPROVED. Option C scope (single Area #7b with grouped waves) + D-2 carve-out (site 2 entity_character_list 변경 0 boundary) + Q1-Q7 outline (Q1=A D-2 carve-out / Q2=A entity_extractor_v2 single dir / Q3=Hybrid canonical VWR SOT clause / Q4=A schema_version 변경 0 / Q5=A residue gate scope / Q6=A canary scope / Q7 closure verdict draft). 6 grouped wave (W1 entity / W2 outlook / W3 scene / W4 residue / W5 canary / W6 closure). controller cross-analyze 수용.
- **Codex iter 2 (handoff session, refinement + Q7 closure verdict wording fixed)**: APPROVED_OUTLINE_WITH_REFINEMENTS. Q1-Q7 outline refinement + Q7 closure verdict wording fixed (위 §8 verbatim). handoff B verdict (CONTINUE_PARTIAL → fresh session spec drafting). controller 100% 수용.
- **Codex iter 3 (본 session, spec drafting strategy round 진입 시점)**: APPROVED_STRATEGY. 5 결정점 verdict — Q1=C (one spec v1 commit for §1-§10, then W6 closure appends §11 later) / Q2=A (defer §11 entirely, no placeholder skeleton that can go stale) / Q3=A (post-commit Codex iter review, matching Area #7a traceability) / Q4 (use implementation-time placeholders as `N.20260518HHMM`, HHMM substituted at wave entry, if execution crosses date boundary the actual `YYYYMMDDHHMM` must be used via plan/spec amend before W1; do not create new dir for preserved D-2 entity_character_list) / Q5 (target concise 650-750 lines; exact site tables, wave outline, residue/canary, carry/non-claim, no plan-level full test bodies; NO VLM).
- **Codex iter 4 (본 session, spec quality review post v1 commit `9c1f7d6`)**: NEEDS_REVISION_MINOR. 4 finding:
  - **F-1 IMPORTANT — prompt pack sibling-copy obligation incomplete**: entity_relation (analyze.md / analyze_schema.json sibling, production `entity_relation.py:93-95` strict pack) + scene_verify (verify_schema.json sibling, production `detail_steps.py:3088-3089` strict pack) 안 sibling byte-identical copy 의무 명시 누락. `prompt_loader._resolve_stem_in_pack:259-266` 안 latest pack stem miss 시 raise. W1 + W3 sibling list amend.
  - **F-2 IMPORTANT — module/dir/canary count drift**: 9 module / 8 module / 8 new dir / 7 dir / 8 module step / 10 entry / 16 sub-canary / 22 file 다중 count drift. canonical fix = **7 new prompt dirs / 9 modified prompt files / 24 byte-identical sibling files / 10 STEP entries**.
  - **F-3 IMPORTANT — residue/pre-commit gate misses signatures + W1 scope over-broad**: W1 pre-commit verify 안 9 site-specific scope 잘못 (W1 4 file scope 만). 누락 stale signature 3 phrase: `빙의/합체` (entity_all line 29 audit-verbatim) + `요괴로 변해도` (entity_relation line 30 current-active-promoted) + `인간형 요괴/괴물, 뱀파이어, 좀비` (outlook phase1 line 24 current-active-promoted). Codex Q1=b verdict (refined): closed-world exact residue phrase membership 만 ban, generic 한국어 단어 standalone ban 0. **사용자 격분 (verbatim "시나리오 의존적 프롬프트나 코딩은 절대 안되! 그리고 단어나 regex 기반도 안되고!!! 기억하지? 이미지 있어 메모리에!!!") 흡수 [[feedback_llm_based_judgment]] 4 강제 gate doctrine (Semantic Regex Ban / Prompt Closed-List Ban / Structured SOT Required / No Silent Fallback) explicit clause 추가.**
  - **F-4 MINOR — typo + trace order**: line 226 `gate 4` → `Gate 2` (canonical reference check) + §10 Q1-Q3 trace reorder.
  - **Verified OK**: canonical clause matches audit §11.3 line 260 exact (spec line 229/325/521) + D-2 carve-out preserved + line drift wording clear + byte-identical-copy doctrine exists + NO VLM explicit/consistent.
  - **scope_creep_risk**: MEDIUM until F-3 resolved, then LOW.
  - **amend strategy (Codex 별도 boundary round + Q1=b refined)**: closed-world residue phrase contract — fixed-string membership / glyph-exact / source path+line+audit-or-current-active classification anchor. 4-gate doctrine explicit. forbidden signature → exact residue phrase. inventory split audit-verbatim + current-active-promoted.

- **Codex iter 5 (본 session, narrow re-review post amend 1 commit `feeb3b5`)**: NEEDS_REVISION_MINOR — narrow wording residue 8 site. F-1 sibling-copy VERIFIED OK / F-2 count sync MOSTLY FIXED (line 167 / 194 / 209 / 439 잔여) / F-3 doctrine CONCEPTUALLY FIXED (wording residue line 247 / 359 / 385 + typo line 555 `Semantic Regue Regex Ban`) / F-4 OK / scope_creep_risk = LOW after wording cleanup. expected post-amend = APPROVED_FOR_PLAN.
- **Codex iter 6 (본 session, narrow re-review post amend 2 commit `dc07ea7`)**: NEEDS_REVISION_MINOR — narrow 3 wording residue + 1 minor cleanup. F-2 stale Q6 counts (line 373 `8 module 새 dir 신설` + line 375 `그 외 9 module = file fallback 자동 active`) + F-3 §8 Closure Verdict stale (line 583 `site-specific forbidden signatures 0`) + minor §7 Doctrine clause line 541 `standalone forbidden signatures` legacy term. scope_creep_risk = LOW. expected next narrow = APPROVED_FOR_PLAN.
- **Codex iter 7 (본 session, narrow re-review post amend 3 commit `8fafd03`)**: **APPROVED_FOR_PLAN**. 3 narrow + 1 minor fix 모두 정합 verify: F-2 Q6 count residue (line 373 7 new-dir module + D-2 boundary explicit / line 375 D-2 db-aware out-of-scope + 7 new-dir file fallback) / F-3 §8 Closure Verdict wording (line 583 exact residue phrases doctrine 정합 + §4.7 line 385 doctrine wording 정합) / §7 Doctrine clause line 541 legacy term annotation (historical context note 보존). Verified OK: canonical 7/9/24/10, sibling counts, fixed-string/glyph-exact doctrine, exact residue inventory split, typo fix, D-2 boundary, NO VLM, generic Korean standalone ban 0. Remaining old-term grep hits = historical Codex trace lines + explicit `legacy term` annotation 만, live doctrine residue 0. scope_creep_risk = LOW. **Plan drafting can proceed**.

**다음 step**: Plan drafting 진입 (별도 commit, fresh session 권고 per Codex next-step verdict). Push = plan + execute closure 와 함께 atomic (Area #7a 패턴 정합, APPROVED_FOR_PLAN ≠ APPROVED_FOR_PUSH). [[feedback_push_no_user_ask]] = APPROVED_FOR_PUSH 후 즉시 적용, 본 단계에는 미적용.

## 11. Closure (2026-05-19+)

**Status**: closed (spec Codex iter 7 APPROVED_FOR_PLAN + plan Codex iter 3 APPROVED_FOR_EXECUTION + W1-W6 atomic execution + per-wave APPROVED; range review/push gate pending at W6 closure commit time — Codex APPROVED_FOR_PUSH 후 즉시 `git push origin main` ([[feedback_push_no_user_ask]] 정합)).

**Unpushed commit count** (W6 closure commit 시점 기준): 25 pre-W6 commits since `d0410eb` (origin/main HEAD, Area #7a closed) + W6 closure commit `c92d460` = **26 commits through W6 closure** (excluding any post-closure range-review fix-up commits). Range through W6 closure = `d0410eb..c92d460`. **Final pushed range/count = recorded in external memory `session_20260519_area_7b_v1_closure.md` after push** (Codex W6 fix-up 1 narrow re-review 권고 정합, infinite self-reference 회피 — repo-local closure docs 는 exact final hash/count chase 하지 않음).

**Wave commits** (canonical sequence, W6 commit body 시점):

| Wave | Commit(s) | Scope |
|---|---|---|
| spec drafting | `9c1f7d6` (v1) + `feeb3b5` (amend 1) + `dc07ea7` (amend 2) + `8fafd03` (amend 3) + `90a8cea` (amend 4) | spec v1 + Codex iter 1-7 흡수, APPROVED_FOR_PLAN |
| plan drafting | `1f79d7c` (v1) + `e39db38` (amend 1) + `e853606` (amend 2) | plan v1 + Codex iter 0 strategy + iter 1 MAJOR + iter 2 narrow MINOR |
| plan + spec amend stack (date + W1 inventory + W1 review prompt + W1 API sync) | `479dcf8` (plan amend 3 + spec amend 5 date drift fix) + `5601005` (plan amend 4 narrow W1 S2.4 OPTION_C full phrase) + `ac22594` (plan amend 5 narrow) + `1fb1e57` (plan amend 6 narrow Codex verbatim) | UTC date drift + W1 S2.4 inventory + W1 review prompt §4 wording + amend 7 below |
| W1 execution | `95688d9` (Group E entity_all + entity_relation + entity_extractor_v2 atomic, 5 site / 4 modified file / 17 sibling) + `9967993` (plan amend 7 + spec amend 6 narrow `_list_module_versions` API sync) | Codex W1 per-wave APPROVED 9/9 |
| W2 execution + narrow stack | `50f15f0` (Group O outlook_extractor atomic, 2 site + line 24 / 2 modified file / 4 sibling) + `55c30b9` (plan amend 8 + spec amend 7 narrow scene_detail 4-point sync exemption singular) + `b31de67` (plan amend 9 + spec amend 8 narrow plural 2 files) + `2bd4a40` (plan amend 10 + spec amend 9 narrow plural 5 files + repo-wide grep gate doctrine) | Codex W2 per-wave APPROVED + amend 8 OPTION_A 3-phase narrow expansion (singular → plural 2 → plural 5 files) |
| W3 execution + fix-up | `5060254` (Group S scene_verify + scene_detail + shot_extract atomic, 3 site / 3 modified file / 3 sibling, line drift 327→473 / 33→49) + `75d4f3a` (W3 fix-up 1 narrow alignment tests 2 files current-contract docstring) + `403c5ef` (W3 fix-up 2 narrow spatial_alignment.py loader docstring v26→v27 sync) | Codex W3 per-wave NEEDS_REVISION_MINOR (current-contract docstring) → fix-up 1 narrow NEEDS_REVISION_MINOR (1 missed) → fix-up 2 narrow APPROVED |
| W4 execution + fix-up | `313f1b6` (residue gate test, Gate 1.1-1.9 + Gate 2 + Gate 3 + Gate 4 + Sanity, 21 PASS) + `844cde9` (W4 fix-up 1 narrow Gate 1.1 `빙의/합체` standalone → full legacy phrase form sync) | Codex W4 per-wave NEEDS_REVISION_MINOR (Generic Korean standalone ban 0 위반) → fix-up 1 narrow APPROVED |
| W5 execution + fix-up | `531e67f` (canary test, C1 7 + C2 24 + C3 1 + C4 1 + C5 2 + C6 9 = 44 PASS, no live LLM + NO VLM) + `fe7e55e` (W5 fix-up 1 narrow C3 "snapshot diff 0" → "12 affected step entry presence verify" wording + function rename) | Codex W5 per-wave NEEDS_REVISION_MINOR (C3 wording drift) → fix-up 1 narrow Option B APPROVED |
| W6 closure (본 commit) | `c92d460` | 본 §11 + spec §5.6 C3 wording sync (W5 fix-up 1 narrow cascade) + roadmap §5.7 Sub-area (b) Phase 2 mark + audit §13 Area #7b Closure + audit §11.2 row 11 Status column (path-limited 3 repo-local docs) |

**Closure verdict** (Q7 verbatim, handoff session 안 Codex 2-round APPROVED, fixed; §8 verbatim 재인용):

> Area #7b closes when the VWR downstream prompt cascade is converted from prompt-owned scenario/domain term lists to canonical visual_world_rules.rules[].rule_type SOT references across the rewritten entity/outlook/scene prompt sites; entity_character_list D-2 remains explicitly preserved as a generic owner-taxonomy boundary; active prompt residue gates verify site-specific exact residue phrases 0 (fixed-string / glyph-exact membership, audit-verbatim + current-active-promoted inventory split, no semantic judgment) and canonical VWR SOT references present in every rewritten site; canaries verify prompt_loader latest activation, STEP_MANIFEST schema_version unchanged, DB override risk neutralized, and no VLM validation is used.

**In-scope closed** (audit §11.2 row 9 site, row 1+3+4+5+6+7+9+10+11):

| audit §11.2 row | Module / new dir / file | Action |
|---|---|---|
| 1 (D-1) | `entity_all/5.20260518HHMM/character.md` | line 26+29+30 audit-verbatim 8 phrase 폐기 + canonical VWR SOT clause |
| 3 (D-3) | `entity_relation/3.20260518HHMM/system.md` | line 11-13 audit-verbatim 3 + line 30 current-active-promoted 1 phrase 폐기 + canonical clause |
| 6 (D-4) | `entity_extractor_v2/10.20260518HHMM/system.md` | line 22 + 32 audit-verbatim 2 phrase 폐기 + canonical clause + section header rewrite |
| 7 (ADD-6) | `entity_extractor_v2/10.20260518HHMM/turn0_style.md` | line 13 audit-verbatim 1 phrase 폐기 + canonical clause |
| 4 (ADD-8) | `outlook_extractor/12.20260518HHMM/phase1.md` | line 16 audit-verbatim + line 24 current-active-promoted 2 phrase 폐기 + canonical clause |
| 5 (ADD-9) | `outlook_extractor/12.20260518HHMM/phase2.md` | line 8 audit-verbatim 1 phrase 폐기 + canonical clause |
| 9 (ADD-10) | `scene_verify/2.20260518HHMM/system.md` | line 7 audit-verbatim 1 full sentence 폐기 + canonical clause |
| 10 (ADD-11) | `scene_detail/27.20260518HHMM/system.md` | line 473 audit-verbatim 1 full sentence 폐기 + canonical clause (line drift 327 → 473) |
| 11 | `shot_extract/12.20260518HHMM/user.md` | line 49 audit-verbatim 1 parenthetical 폐기 + canonical clause (line drift 33 → 49) |

**D-2 carve-out**: `entity_character_list/2.202605011057/system.md` (audit §11.2 row 2) = **변경 0 boundary preserve**. owner taxonomy 5-element 분류 = 인물 정의 boundary, presence/visibility 결정 X. sha256 anchor `4ca95ca996a5e1d649e92c9baf8963654a5f89537a794ab6ec04e86ce9971713` (W4 Gate 3 + W5 C5 hardcoded compare primary check).

**Area #7a boundary** (audit §11.2 row 8 scene_director, closed 2026-05-19 commit `d0410eb`): 변경 0 (선행 phase 정합).

**4-Gate Boundary Doctrine 적용 inline** (사용자 격분 흡수 2026-05-19): closed-world exact residue phrase contract (fixed-string / glyph-exact membership, audit-verbatim + current-active-promoted inventory split, source path + line + classification anchored, Generic Korean standalone ban 0). Gate (1) Semantic Regex Ban / Gate (2) Prompt Closed-List Ban / Gate (3) Structured SOT Required / Gate (4) No Silent Fallback. [[feedback_llm_based_judgment]] 정합.

**W3 narrow exemption history** (scene_detail 4-point sync hard-pinned guard, Codex amend 8 + amend 9 + amend 10 OPTION_A expanded 흡수, W2-W3 narrow stack `55c30b9` + `b31de67` + `2bd4a40`): scene_detail 4-point sync narrow exemption inside W3 atomic boundary — `detail_steps.py:106` SCENE_DETAIL_PROMPT_VERSION + `version_registry.py:34`/`:126` MODULE_VERSIONS/_MODULE_INFO + scene_detail-pinned tests 5 files (continuity_alignment 4 assertion + spatial_alignment 5 assertion + prompt_versions 2 assertion + 1 function rename + g4_5a_spatial_integration 4 assertion + 1 function rename + area_5_residue_gate function rename + glob) + `SCENE_DETAIL_SCHEMA_VERSION == 11` 보존 (schema 변경 0). 다른 module production code 변경 0 doctrine 유지.

**W4 + W5 fix-up history** (Codex per-wave narrow re-review 흡수):
- **W4 fix-up 1 narrow** (`844cde9`): Gate 1.1 line 106 `"빙의/합체"` standalone → `"빙의/합체: 다른 존재가 몸을 빌리거나 합체하여 외형이 변하는 경우"` full legacy phrase form sync. 7 ins / 2 del. Generic Korean standalone ban 0 doctrine + 4-Gate Boundary Doctrine Gate 2 (Prompt Closed-List Ban refined as full-phrase ban only) + Plan body Task 2 S2.4 W1 inventory boundary 정합.
- **W5 fix-up 1 narrow** (`fe7e55e`): C3 wording sync "snapshot diff 0" → "12 affected step entry presence verify" + function rename `test_c3_step_manifest_snapshot_diff_zero` → `test_c3_step_manifest_entry_presence_verify` + section header + docstring sync. 9 ins / 6 del. entry-existence contract + schema_version drift = C4 별도 (snapshot field-level diff 0 scope 외, Plan body Task 6 line 2186-2195 design intent 정합).

**NO VLM hard constraint** — 모든 canary + residue gate = schema/text/manifest verification only ([[feedback_no_vlm_dependency]] 정합).

**Carry follow-up** (non-claim, separate area):
- **Area #7c** (t2i_review v6 placeholder example abstraction — Track B Tier 3 #3 후속).
- **Area #7d** (cinematography closed-list SOT dual-site — Track B Tier 3 #4 후속).
- **Carry-A099** resolved by W1/W2 + W3 closure-docs (2026-05-19+) — director_notes prose hard-prime examples abstracted.
- **Carry-A100** resolved by W1-W4 (2026-05-19+) — V8+ VWR `system.md` t2i_context demonym redesign + `rules_schema.json:40` description abstraction (v9 prompt-pack `9.202605191334`).
- **Carry-P021** (scene_consistency 7 enumeration broad, source unresolved low-priority).

**Closure commit body (W6 atomic, path-limited 3 repo-local docs) + push gate**:
- W6 atomic commit = 본 spec + roadmap §5.7 Sub-area (b) + audit `02-` §13 + audit §11.2 9 site Status mark (path-limited git add scope).
- W6 commit 시점 push 보류 — Codex W1-W6 range review (`d0410eb..c92d460` 시점 26 commits 종합, 후속 range-review fix-up commit 가능 — final pushed range 는 external memory 에 기록) APPROVED_FOR_PUSH 후 즉시 `git push origin main` (사용자 ask 0, [[feedback_push_no_user_ask]] 정합). push 완료 status 는 본 repo-local docs 안 pre-claim 금지 — push 후 external memory `session_20260519_area_7b_v1_closure.md` 에 기록 (Codex W6 pre-execution Q3 B/C hybrid 권고 + W6 fix-up 1 narrow re-review infinite self-reference 회피 정합).
- 만약 Codex NEEDS_REVISION_* 시 narrow amend (path-limited git add scope) 후 narrow re-review 의뢰. APPROVED_FOR_PUSH 도달 시까지 반복.

**External memory** (repo 밖, non-git, controller `~/.claude/...`): `session_20260519_area_7b_v1_closure.md` (closure 종합) + `MEMORY.md` index 갱신 + 직전 진입점 `next_session_area_7b_w6_execution.md` 해소 mark. **git stage 절대 금지** (W6 commit `git status` 결과 modified = 3 repo-local docs only).
