---
title: C8 — Area #7 잔여 sub-area marathon (entity/outlook/location + shot_extract leftover + t2i/background scenario leak + code carry) v1 (fix-critical-1 Tier γ #9)
date: 2026-05-20+
status: closed — C8 v1 W1a-W5 closed (8-wave 10-commit, push range e23ae86..HEAD — W5 range review APPROVED_FOR_PUSH 후 push origin main, 실제 hash git log 기록). 25-site disposition: FIX 21 / KEEP 2 (Site 16,21) / SPLIT 1 (Site 20) / DEFER 1 (Site 19).
roadmap_ref: docs/superpowers/specs/2026-05-16-track-b-semantic-debt-roadmap-design.md §5.7 (Area #7 — Prompt hygiene v2, 잔여 sub-area (a)/(c)/(d) + code carry)
fix_critical_doc_ref: docs/fix-critical-1/index.html C8 section (lines 1180-1264)
audit_ref: docs/visual-reliability-audit/2026-05-14-semantic-string-routing-debt-audit/ (01-code-side-regex / 02-prompt-side-hygiene / 03-llm-side-heuristic) + backend/tests/_audit_outputs/semantic_string_debt/full_20260516_0105/triage_report.md — A069 (외모·연령 변화) + code carry P020/P025/P026/P028/P054/P059/P070
prerequisites:
  - C1/C2/C3/C7/C6/C9/C4/C5 — 모두 closed + pushed (origin/main HEAD `e23ae86`). HEAD anchor. 변경 0.
non_supersedes:
  - C10 future structured carries — 별도 area.
  - shot_schema.json OpenAI strict 위반 (`characters` properties 존재하나 required 부재) — C8 scope 제외, 별도 SchemaStrict carry (C10 또는 dedicated). §1.3 / §9 OQ-C8-7.
  - Closed area #7a/#7b/#7c/#7d / C4 / C5 의 기 추상화 내용 — C8 이 touch 하는 파일에 한해 byte-identical 보존. §8.
---

# C8 — Area #7 잔여 sub-area marathon v1

## 1. Purpose + Scope

### 1.1 Purpose

**roadmap §5.7 Area #7 (Prompt hygiene v2) 의 G5 본체 잔여분.** Hygiene v1 (P-1~P-6) + Area #7a/#7b (visual_world_rules SOT + downstream cascade) + #7c (t2i_review placeholder) + #7d (cinematography dual-site) closure 후 남은 **시나리오 leak (작품 고유명사·시나리오 의존 example)** + **닫힌 명사/카테고리 목록 (closed-list LLM instruction)** 잔여 site.

본 C8 = `docs/fix-critical-1/index.html` C8 section 의 4 그룹 = **25 site** (Q0-light direct-read 검증 완료, HEAD `e23ae86`):

| 그룹 | site 수 | 본질 |
|------|---------|------|
| sub-area (a) entity/outlook/location | 7 | entity/outlook/location 추출 prompt 의 의복·상태·환경 닫힌 목록 + 시나리오 example |
| sub-area (c) shot_extract leftover | 7 | shot 추출/선택 prompt 의 인종·변형·사건흔적·연결순간 닫힌 목록 + `<몽타주>` literal marker |
| sub-area (d) t2i/background scenario leak | 4 | t2i/background prompt 의 콘티형 시나리오 example + 특정 location ID example |
| code carry (production Python) | 7 | P020/P025/P026/P028/P054/P059/P070 — code 내 닫힌 상수 / 시나리오 leak prose |

**핵심 진단 (Codex C8 entry sanity 흡수)**: 본 C8 는 **신규 schema / 신규 producer / 신규 mechanism 도입 0** — C9/C6/C4/C5 와 동일하게 **닫힌 enumeration → generic semantic principle 추상화** + **시나리오 고유명사 → 범용 common noun / 순수 원칙** 치환의 narrow hygiene marathon 이다. code carry 중 일부 (`_SPATIAL_CAMERA_*` / `_ID_ETHNICITY_COMPONENTS` / `_ID_AGE_BANDS`) 는 **canary ground-truth / 기존 G4.x SOT** 이므로 단순 폐기 대상이 아니다 — §3 disposition 에서 FIX / KEEP / DEFER 를 site 별로 분리한다.

### 1.2 In-scope

index.html C8 의 25 site 중 §3 disposition table 의 **FIX** 판정 site. wave 분할 = §4. 각 prompt-pack edit = 신규 version 디렉토리 + byte-identical sibling + `STEP_MANIFEST` schema_version 보존 + **module W0 inventory 에 따른 activation/provenance sync (기존 registry/provenance/code 상수 보유 module 한정, 신규 registry entry 신설 금지)** (§6). 각 wave = C8 regression test + residue gate (§7).

### 1.3 Out-of-scope (Codex C8 entry sanity scope guard 흡수)

- **신규 structured schema / 신규 producer / 신규 mechanism — 0.** index.html C8 "수정 방법" 은 sub-area split 권고만 — 신규 필드 제안 없음. C4/C5 옵션 B narrow 선례.
- **shot_schema.json OpenAI strict 위반 (`characters` required 부재) — C8 scope 제외, 별도 carry** (§9 OQ-C8-7). 본질이 closed-list/scenario-leak hygiene 가 아니라 schema 구조 결함 — C5 W1 OQ blocker 로 `OPTION_1_APPROVED` (schema 미통합 유지). C8 의 어떤 prompt wave 도 `shot_schema.json` 을 `shot_extract` v14 pack 에 통합 재시도하지 않는다. plan §말미 `Known carry: shot_extract shot_schema strict compatibility` 기록.
- **Site 16 `background_chain_render/2.../system.md:11,21-22` (wall finish / floor / ceiling / lighting palette) — boundary-reviewed KEEP** (§3, OQ 없음 — Codex APPROVED KEEP). description-completeness checklist / deterministic rendering convention, semantic classifier 아님. C4 A031 (`floor_plan_prompt` 색/glyph) KEEP 선례 동일. C8 edit scope 제외 — closure 에 boundary-reviewed KEEP 로만 기록, closed-list fixed claim 금지.
- **canary ground-truth 상수 자체 — 폐기/축소 0.** `_SPATIAL_CAMERA_*_TOKENS` / `_SPATIAL_FRAME_EDGE_*` / `_ID_ETHNICITY_COMPONENTS` / `_ID_AGE_BANDS` 등 G4.x ground-truth tuple 은 canary/test contract source — C8 은 production-emit prose surface 만 다루고 canary truth list 는 보존/이전 (§3 Site 20/21).
- **C5 (#9 action-segment) / C4 (#8 background-classifier) 의 기 closure scope — 변경 0, 중복 closure claim 금지** (§8). C8 sub-area (c) 는 C5 와 동일 `shot_extract` 모듈이나 다른 line, sub-area (d) 는 C4 와 인접 background 모듈 — boundary 명시 의무.
- **closed area #7a/#7b/#7c/#7d / Hygiene v1 의 기 추상화 — byte-identical 보존** (§8).
- **VLM / live LLM / semantic regex (production routing)** — 모두 ban ([[feedback_no_vlm_dependency]] / [[feedback_llm_based_judgment]]).

## 2. W0 Live-Source Inventory (HEAD `e23ae86`, Q0-light direct-read 검증)

index.html C8 의 line number 는 stale — 아래가 SSOT. plan W0 가 각 wave 직전 재검증한다.

### 2.1 sub-area (a) — entity/outlook/location (7 site)

| # | live path (최신 version 디렉토리) | 현재 line (drift 정정) | 본질 |
|---|---|---|---|
| 1 | `prompts/_base/entity_all/5.202605181858/prop.md` | 21 / 22 / 25 (doc: 21,25) | 의복 닫힌 목록 (수트/우주복/갑옷/제복) + 배경장비 (모니터/TV/CCTV) + 시각효과 (피/물/불/연기/안개) |
| 2 | `prompts/_base/entity_extract_v4/8.202603290500/prop.md` | 22 / 23 / 26 | Site 1 과 동일 닫힌 목록 (parallel/legacy variant) |
| 3 | `prompts/_base/entity_filter/2.202603241900/system.md` | 12-13 | 동일 의복·배경장비 닫힌 목록 |
| 4 | `prompts/_base/entity_extractor_v2/10.202605181858/turn2.md` | 10-11 | 나이밴드 example (20대→60대) + 의상 닫힌 목록 (군복/정장/일상복) + 상태 닫힌 목록 (부상/결박/사망) |
| 5 | `prompts/_base/outlook_extractor/12.202605181928/phase2.md` | 15-17 (doc: line 미상) | 의상 변화 시나리오 example (평상복→전투복 / 정장→피의갑옷) |
| 6 | `prompts/_base/outlook_extractor/12.202605181928/phase3.md` | 6 (doc: line 미상) | 시나리오 example noun (`고급선비복1` vs `고급선비복2`) |
| 7 | `prompts/_base/location_consistency/2.202604201230/system.md` | 24-30 (doc: 23-37) + 41-57 (doc: 43-57) | 환경상태 닫힌 목록 (날씨/시간/조명/대기/순간상태) + 구체 example block (apartment wallpaper / utility pole) |

### 2.2 sub-area (c) — shot_extract leftover (7 site)

| # | live path | 현재 line (drift 정정) | 본질 |
|---|---|---|---|
| 8 | `prompts/_base/shot_extract/13.202605201049/user.md` | 65 (doc: 63) | 인종/국적 example noun (`한국인 경찰` / `동양인 노파`) |
| 9 | `prompts/_base/shot_extract/13.202605201049/system.md` | 32 (doc: 35) | 인간형 sub-type 닫힌 목록 (외계인/귀신/돌연변이) + 인종/국적 필수 instruction |
| 10 | `prompts/_base/shot_extract/13.202605201049/system.md` | 37-47 (doc: 42-50) | **A069** — 변형 판정 닫힌 목록 (나이변화/분장/부상/얼룩/창백/멍/화상). C5 closure 가 명시적으로 C8 carry 로 남긴 row |
| 11 | `prompts/_base/shot_essence_extraction/3.202605081814/system.md` | 13 (+ 56 반복) | 사건흔적 닫힌 목록 (혈흔/깨진유리/부상흔적) |
| 12 | `prompts/_base/shot_essence_extraction/3.202605081814/system.md` | 44-65 (doc: 44-66) | worked-example block (`거실 바닥에 엎어진` / `인형 백팩` 등 시나리오 example) |
| 13 | `prompts/_base/shot_selection/4.202604191600/system.md` | 54-64 (doc: 54-65) | 연결순간 카테고리 닫힌 목록 (이동/추격/교통/작업) |
| 14 | `prompts/_base/scene_extractor_v2/20.202605190631/system.md` | 47 | `<몽타주>` literal Korean marker 를 montage 분류 trigger 로 hardcode |

### 2.3 sub-area (d) — t2i/background scenario leak (4 site)

| # | live path | 현재 line (drift 정정) | 본질 / disposition 예고 |
|---|---|---|---|
| 15 | `prompts/_base/t2i_visual_converter/v4/system.md` | 46-49 | 콘티형 sci-fi 시나리오 example (지하 극저온 저장 시설 / 투명 원통형 캡슐). FIX |
| 16 | `prompts/_base/background_chain_render/2.202604282201/system.md` | 11 / 21-22 (doc: 11-43) | wall/floor/ceiling/lighting palette description-completeness checklist. **KEEP** (§1.3) |
| 17 | `prompts/_base/background_master_plan/3.202605092023/system.md` | 74-78 (doc: 74-79) | 구체 location ID example (`bg_large_mart` / L09/L10/L14). FIX |
| 18 | `prompts/_base/floor_plan_prompt/4.202605091200/system.md` | 16 | region-specific 가구 example (`ondol-friendly bed`). FIX (단 C4 A031 색/glyph `:10-13` 보존) |

### 2.4 code carry — production Python (7 site)

| # | live path | 현재 line (drift 정정) | audit id | 본질 |
|---|---|---|---|---|
| 19 | `backend/app/core/steps/scene_consistency_step.py` | 318-319 / 426-427 / 451-452 / 578-582 (doc: 317-319,422-427,452,579-582) | P020 | `analysis_summary.startswith("분석 실패"/"분석 차단")` backward-compat shim (옛 cp `status` 부재 시 prefix routing) |
| 20 | `backend/app/core/steps/render_prompt_card.py` | prose `applies_when` parenthetical 550-553 (doc: 584) / canary tuple `_SPATIAL_CAMERA_*` 309-332 | P025 | `camera_frame_rule.applies_when` 의 닫힌 camera-height token 목록 전체 (`low/hip-height/overhead/ground level/quay level/floor level/from above`) + 별도 canary ground-truth tuple |
| 21 | `backend/app/core/steps/render_prompt_card.py` | const 143-154 / 157-164, consume 1069/1071 (doc: 142-163,1068-1070) | P026 | `_ID_ETHNICITY_COMPONENTS` / `_ID_AGE_BANDS` — G4.3 R1-I1 ground-truth + `demographic_descriptor_policy` 에 emit |
| 22 | `backend/app/core/steps/entity_steps.py` | 453-461 (특히 460) | P028 | dedup prompt prose heuristic (`인물(character)은 다른 타입과 중복 거의 없음`) |
| 23 | `backend/app/modules/pipeline/outlook_dedup.py` | 136-145 (특히 140) | P054 | dedup prompt 시나리오 example (`검은정장1` vs `검은정장2`) |
| 24 | `backend/app/modules/pipeline/scene_validator.py` | 144 | P059 | validator prompt 에 작품 고유명사 character 이름 example (`동녘(강의원)`) hardcode |
| 25 | `backend/app/modules/reference_image_generator.py` | 63-98 (특히 66-67 / 84-85) | P070 | `_entity_type_reference_rules` dict value 에 작품 설정 hardcode (`현대 한국/근미래 한국` / `포박 상태`) |

## 3. Per-Site Disposition Table (FIX / KEEP / DEFER)

| # | site 요약 | disposition | 근거 |
|---|---|---|---|
| 1 | entity_all prop.md 의복/효과 목록 | **FIX** | 닫힌 명사 목록 → 범용 원칙. OQ-C8-A (live module 확인) |
| 2 | entity_extract_v4 prop.md 동일 목록 | **FIX** | 동일. OQ-C8-A |
| 3 | entity_filter system.md 동일 목록 | **FIX** | 닫힌 명사 목록 → 범용 원칙 |
| 4 | entity_extractor_v2 turn2.md 나이/의상/상태 목록 | **FIX** | 닫힌 목록 → generic principle |
| 5 | outlook_extractor phase2.md 의상변화 example | **FIX** | 시나리오 example → 범용 표현 |
| 6 | outlook_extractor phase3.md `고급선비복` example | **FIX** | 작품 고유명사 example → 범용 placeholder |
| 7 | location_consistency system.md 환경목록 + example | **FIX** | 닫힌 목록 → 원칙 + 구체 example → 범용 |
| 8 | shot_extract user.md 인종 example | **FIX** | 시나리오 example → 범용 |
| 9 | shot_extract system.md 인간형 sub-type 목록 | **FIX** | 닫힌 목록 → generic principle |
| 10 | shot_extract system.md A069 변형판정 목록 | **FIX** | A069 — Codex APPROVED C8 흡수. C5 중복 claim 금지 (§8) |
| 11 | shot_essence system.md 사건흔적 목록 | **FIX** | 닫힌 목록 → 원칙 |
| 12 | shot_essence system.md worked-example block | **FIX (narrow)** | 시나리오 example noun 만 범용화 — example 구조 보존. OQ-C8-B |
| 13 | shot_selection system.md 연결순간 카테고리 | **FIX** | 닫힌 카테고리 목록 → generic judgment principle |
| 14 | scene_extractor_v2 system.md `<몽타주>` marker | **FIX** | 작품 의존 literal token → 범용. OQ-C8-C |
| 15 | t2i_visual_converter system.md sci-fi example | **FIX** | 콘티형 시나리오 example → 범용 |
| 16 | background_chain_render system.md 마감 checklist | **KEEP** | description-completeness convention. Codex APPROVED KEEP (§1.3) |
| 17 | background_master_plan system.md location ID example | **FIX** | 구체 ID example → 범용 placeholder example |
| 18 | floor_plan_prompt system.md `ondol` 가구 example | **FIX** | region-specific 가구 example → 범용 (A031 `:10-13` 보존) |
| 19 | scene_consistency_step P020 prefix shim | **DEFER** | backward-compat shim — closed-world prefix contract. 폐기 = checkpoint-migration 설계 필요, C8 hygiene scope 외. OQ-C8-D |
| 20 | render_prompt_card P025 camera prose + canary tuple | **SPLIT: FIX(prose 전체) + KEEP(canary tuple)** | production `applies_when` parenthetical 의 닫힌 camera-height token 목록 **전체** (`low/hip-height/overhead/ground level/quay level/floor level/from above`) → generic principle 치환 + canary `_SPATIAL_CAMERA_*` tuple / `core_principles` substring assertion 보존. OQ-C8-E |
| 21 | render_prompt_card P026 `_ID_ETHNICITY`/`_ID_AGE_BANDS` | **KEEP / DEFER** | 기존 G4.3 ID-policy SOT (`scenario_dependency_ban` 명시, 작품 고유명사 0). hygiene-debt leak 아님 — boundary-reviewed KEEP. OQ-C8-F |
| 22 | entity_steps P028 dedup prompt heuristic | **FIX (narrow)** | prompt prose 한 줄 heuristic → 범용 표현 |
| 23 | outlook_dedup P054 `검은정장` example | **FIX** | 시나리오 example noun → 범용 placeholder |
| 24 | scene_validator P059 `동녘(강의원)` 고유명사 | **FIX** | 작품 character 이름 → 기존 `<visible_body_name>(<remote_identity_name>)` placeholder form (scene_extractor_v2 system.md:60-64 에 이미 존재) |
| 25 | reference_image_generator P070 `현대 한국` hardcode | **FIX** | dict value 작품 설정 hardcode → visual_world_rules region/era derive 지시로 치환 (carrier dict shape 보존) |

요약: **FIX 21 / KEEP 2 (Site 16, 21) / SPLIT 1 (Site 20 = FIX+KEEP) / DEFER 1 (Site 19)**. KEEP/DEFER site 는 C8 closure 에서 **boundary-reviewed / carry 로만 기록** — fixed claim 금지.

## 4. Wave Split (Codex 권고 — cost large 세분화)

spec = umbrella C8 하나. plan/execution 은 아래 세분 wave — 각 wave atomic commit + Codex per-wave review. NO VLM / no live LLM.

| wave | scope | site | 산출물 |
|------|-------|------|--------|
| **W1a** | sub-area (a) entity 계열 prompt-pack | 1,2,3,4 | entity_all / entity_extract_v4 / entity_filter / entity_extractor_v2 신규 version-pack + activation/provenance sync (해당 module 한정) + C8 test |
| **W1b** | sub-area (a) outlook/location 계열 prompt-pack | 5,6,7 | outlook_extractor / location_consistency 신규 version-pack + activation/provenance sync (해당 module 한정) + C8 test |
| **W2a** | sub-area (c) shot_extract + A069 cluster | 8,9,10 | shot_extract v14 prompt-pack + activation/provenance sync (해당 module 한정) + C8 test |
| **W2b** | sub-area (c) shot_essence / shot_selection / scene_extractor leftover | 11,12,13,14 | 3 prompt-pack 신규 version + activation/provenance sync (해당 module 한정) + C8 test |
| **W3a** | sub-area (d) t2i/background prompt hygiene | 15,17,18 | t2i_visual_converter / background_master_plan / floor_plan_prompt 신규 version-pack + C8 test |
| **W4a** | code carry — 시나리오 leak prose 그룹 | 22,23,24,25 | entity_steps / outlook_dedup / scene_validator / reference_image_generator narrow edit + C8 test |
| **W4b** | code carry — `camera_frame_rule.applies_when` 닫힌 token 목록 전체 추상화 (Site 20 FIX 부분) | 20 | render_prompt_card `camera_frame_rule.applies_when` parenthetical 전체 → generic principle + `_SPATIAL_CAMERA_*`/canary 회귀 확인 + C8 test |
| **W5** | integrated gate + closure docs atomic | — | cross-cutting residue/compat gate 재실행 + closure docs (spec/plan status + roadmap §5.7 + index.html C8 marker) |

- **W3b (boundary-reviewed KEEP)** 별도 wave 미신설 — Site 16 KEEP + Site 19 DEFER + Site 21 KEEP/DEFER 는 W5 closure docs 에서 boundary-reviewed 기록으로 흡수 (doc-only, code/prompt edit 0).
- code carry 는 **한 commit 에 7 site 묶지 않음** (Codex 지침) — W4a (prose leak 4 site) + W4b (camera narrow 1 site) 로 분리. Site 19/21 = no-edit.
- wave 간 의존 없음 (independent prompt-pack / file). 단 순차 실행 — 각 wave Codex per-wave review 후 다음 진입.

## 5. Invariants

- **5.1 No closed-list invariant**: FIX site 의 닫힌 enumeration (명사/카테고리/token 목록) 은 generic semantic principle 로 치환 — 닫힌 영문/한국어 토큰 목록 0. example 은 1-2개 범용 example 또는 순수 원칙.
- **5.2 Intent-preserve invariant**: 각 site 의 원래 의도 (무엇을 추출/제외/분류하라) 는 보존 — 추상화는 "어떻게 판단하라" 의 closed-list 만 제거.
- **5.3 No new field/schema invariant**: 신규 schema 필드 / enum / required / 신규 prompt 섹션 0. prompt-pack 의 schema sibling 은 byte-identical (sha256 동일).
- **5.4 Version artifact invariant**: 각 prompt-pack edit = 신규 version 디렉토리 (덮어쓰기 금지, CLAUDE.md) + `STEP_MANIFEST` schema_version 보존 + **module W0 inventory 에 따른 activation/provenance sync — 기존 registry/provenance/code 상수 보유 module 한정, 신규 registry entry 신설 금지** (§6).
- **5.5 Carrier shape invariant (code carry)**: Site 22/23/24/25 의 code edit 은 prompt 문자열 / dict value 의 **내용만** 치환 — 함수 signature / dict key / return shape / carrier type 불변. Site 20 = `camera_frame_rule` dict key set + canary tuple 불변.
- **5.6 Boundary preserve invariant**: §8 의 closed-area 기 추상화 + KEEP site 는 byte-for-byte 불변.
- **5.7 NO VLM / no live LLM invariant**: 모든 wave test = no live LLM call, no VLM, no semantic regex (production routing). canary 재실행도 no live LLM.

## 6. Version-bump / Stem Inventory Rules

각 prompt-pack FIX wave 의 의무 절차:

1. **신규 version 디렉토리 생성** — `cp -r` 최신 pack → 다음 major bump 디렉토리 (`N.<UTC>/` 또는 `t2i_visual_converter` 는 `vN`). 기존 디렉토리 변경 0.
2. **수정 대상 stem 만 edit** — 그 외 stem (schema.json 포함) byte-identical sibling. plan 이 wave 별 sha256 sibling 목록 고정.
3. **version-stamped header 갱신** — pack 내 stem 의 version 주석/`_MODULE_INFO` header 가 version 을 담으면 동기 (C4 함정 N-1 — cp 후 header 미갱신 방지).
4. **`version_registry` sync — 기존 provenance entry 가 있는 module 만** (Codex spec review NARROW 2). `version_registry.py` 는 sparse — `shot_extractor`/`shot_validator`/`shot_selector`/`location_consistency`/`scene_detail` 등 일부 module 만 provenance entry 보유. entity_all/entity_extract_v4/entity_filter/outlook_extractor/shot_essence_extraction/scene_extractor_v2/t2i_visual_converter/background_master_plan/floor_plan_prompt 는 동일 등록 방식이 아닐 수 있음. **기존 entry 가 있는 module 만 sync — 신규 registry entry 신설 금지** (기존 local pattern 이 확인되지 않는 한). 해당 module 만 entry (version / updated_at / prompt_dependency) 갱신 + comment 자기모순 점검 (C5 함정 N-5).
5. **`STEP_MANIFEST` schema_version 보존** — schema 구조 변경 0 이므로 schema_version 불변. lifecycle/applicability entry 불변.
6. **`PROMPT_VERSION` / `MODULE_VERSIONS` code 상수** — 존재하는 module 만 bump (scene_detail 류 4-point cascade). `shot_extract`/`shot_validator` 류 code 상수 부재 module 은 §C5 §3.5 선례대로 신규 mechanism 미도입.

plan W0 가 **module 별 activation mechanism (file-fallback / `version_registry` provenance / code `PROMPT_VERSION` 상수 / `STEP_MANIFEST`) 을 enumerate** 하고 (Codex spec review NARROW 2), wave 별로 위 6 항목의 정확한 파일·라인·상수를 고정한다 (file edit 전 SSOT 재고정 — Codex 지침).

## 7. Residue Gates (per wave)

각 wave (W1a~W4b) atomic commit 의 C8 regression test = 아래 gate. test 파일 = `backend/tests/.../test_c8_area7_residual_hygiene.py` (wave 별 append).

- **G-residue**: 해당 wave FIX site 의 닫힌 토큰 목록 / 시나리오 고유명사 가 신규 active pack / 수정 파일에 부재 (closed-world exact-phrase membership, no semantic regex).
- **G-sibling**: 신규 version-pack 의 미수정 stem (schema.json 등) 이 직전 pack 과 sha256 byte-identical.
- **G-activation**: `load_prompt` / `load_schema` 가 신규 version 디렉토리를 active 로 resolve (source-path proof — get_effective_source path substring).
- **G-manifest**: `STEP_MANIFEST` schema_version 보존.
- **G-registry** (기존 registry provenance entry 보유 module 한정): 해당 module 의 `version_registry` provenance entry 가 신규 version 과 일치. registry entry 미보유 module 은 본 gate 비적용 — G-activation 으로 대체.
- **G-intent**: 추상화된 문구가 원 의도 keyword 를 보존 (positive assertion).
- **G-canary (W4b)**: `g4_5a_camera_frame_consistency.py` canary 가 prose narrow edit 후에도 PASS (canary tuple 보존 확인) — no live LLM.
- **G-boundary (W5)**: §8 closed-area 기 추상화 + KEEP site byte-identical.

## 8. Boundary Preserve + Overlap (중복 closure 금지)

Codex 지침 — C8 은 **C5/C4 및 closed area #7a~#7d 와 동일/인접 모듈을 touch** 하므로 중복 closure claim 절대 금지.

- **C5 (#9 action-segment) — closed `e23ae86`**: `shot_extract` v13 의 시간연결어 (user.md / system.md) + `shot_validator` v6 + `scene_detail` v32 추상화. C8 W2a 는 `shot_extract` v13→v14 로 가되 **C5 가 추상화한 시간연결어 섹션 byte-identical 보존** — C8 은 system.md:32 (인종) / 37-47 (A069) / user.md:65 (인종 example) 만 touch. C8 closure 는 A069 만 closed claim, C5 action-segment 는 재-claim 금지.
- **C4 (#8 background-classifier) — closed `e23ae86`**: `background_classify` / `background_chain_planning` / `location_floor_plan` 추상화. C8 sub-area (d) 는 `background_master_plan` / `floor_plan_prompt` / `t2i_visual_converter` — C4 와 다른 stem. **`floor_plan_prompt` A031 (`:10-13` 색/glyph 매핑) = C4 boundary-reviewed KEEP — C8 Site 18 (`:16`) edit 시 A031 byte-identical 보존.**
- **#7b (visual_world_rules downstream cascade) — closed**: `entity_extractor_v2/system.md` + `turn0_style.md` + `outlook_extractor/phase1.md` + `phase2.md` + `shot_extract/user.md` 등 추상화. C8 이 touch 하는 `entity_extractor_v2` (Site 4 = turn2.md) / `outlook_extractor` (Site 5 = phase2.md) / `shot_extract` (Site 8 = user.md) 신규 version-pack 생성 시 **#7b 가 이미 추상화한 stem/섹션 byte-identical 보존** — C8 은 본 §2 의 C8 site line 만 touch.
- **Hygiene v1 (P-1~P-6, `91d1dfd`)**: 보존.
- KEEP site (16, 21) + DEFER site (19) = 변경 0. C8 closure 는 boundary-reviewed / carry 로만 기록.

## 9. OQ Resolution

- **OQ-C8-A — entity_all vs entity_extract_v4 live module**: Site 1 (`entity_all`) 과 Site 2 (`entity_extract_v4`) 가 동일 닫힌 목록을 담음. 둘 다 활성인지, 하나가 legacy 인지 plan W0 가 `STEP_MANIFEST` / `version_registry` 로 확정 — **활성 module 전부 FIX, deprecated/미활성은 active latest residue 만 좁게 처리** (C4 `background_chain_planning` 선례). spec 결정: 둘 다 FIX 대상으로 두되 plan W0 가 활성 여부 재확인.
- **OQ-C8-B — Site 12 worked-example block**: shot_essence 의 worked-example 은 pedagogical 구조 — example **구조는 보존**, 시나리오 고유 noun (`인형 백팩` 등) 만 범용 noun 으로 치환하는 **narrow FIX**. example 전폐 아님.
- **OQ-C8-C — Site 14 `<몽타주>` marker**: `<몽타주>` 는 작품/포맷 의존 Korean literal. montage 분류 의도는 보존하되 특정 한국어 marker token hardcode 제거 → "명시적 몽타주/장면전환 marker" 범용 표현. **FIX 확정** — Codex spec review 확인 요청 (closed-world author marker 로 KEEP 주장 가능성).
- **OQ-C8-D — Site 19 P020 prefix shim**: `analysis_summary.startswith()` 은 옛 cp (`status` 부재) backward-compat. 폐기 = checkpoint migration / `status` 백필 설계 필요 → C8 hygiene scope 외. **DEFER 확정** — closure 에 carry 기록. Codex review 확인 요청 (즉시 FIX 가능 여부).
- **OQ-C8-E — Site 20 P025 camera prose** (Codex spec review NARROW 1 정정): `_SPATIAL_CAMERA_*_TOKENS` canary tuple = KEEP. production `camera_frame_rule` dict 의 `applies_when` parenthetical 닫힌 camera-height token 목록 **전체** (`(low / hip-height / overhead / ground level / quay level / floor level / from above)`, `render_prompt_card.py:550-553`) 를 generic principle 로 치환 — 예: `"camera_direction expresses a vertical camera height or viewpoint position and the scene description includes frame-edge surfaces"`. **`quay level` 한 토큰만 제거하는 방식 금지.** `_SPATIAL_CAMERA_*_TOKENS` tuple + `core_principles` substring assertion 인덱스 (`[0] low / [1] overhead / [2] hip-height / [3] full body`) 와 결합된 canary/test coupling 보존 의무. residue gate 는 old parenthetical token 목록 **전체**를 잡는다. **W4b FIX**.
- **OQ-C8-F — Site 21 P026 `_ID_ETHNICITY`/`_ID_AGE_BANDS`**: code 주석상 "G4.3 R1-I1 ground-truth" + `demographic_descriptor_policy.scenario_dependency_ban` 명시 — 작품 고유명사 0 의 의도적 closed vocabulary (region/era 표기 일관성용 SOT). hygiene-debt leak 아님. **KEEP / boundary-reviewed DEFER 확정** — C8 fixed claim 금지. Codex review 확인 요청.
- **OQ-C8-G — schema-strict carry**: §1.3 — C8 scope 외, 별도 carry (C10 또는 dedicated). plan 말미 `Known carry` 기록.

## 10. Risk + Open Issues

- **광범위 version bump** — **최대 13 prompt-pack** 신규 version (entity_all / entity_extract_v4 / entity_filter / entity_extractor_v2 / outlook_extractor / location_consistency / shot_extract / shot_essence_extraction / shot_selection / scene_extractor_v2 / t2i_visual_converter / background_master_plan / floor_plan_prompt — disposition 상 13개 전부 FIX) (Codex spec review NARROW 2 산술 정정). module 별 activation mechanism 이 제각각 (file-fallback / `version_registry` provenance / code `PROMPT_VERSION` 상수 / `STEP_MANIFEST`) — plan W0 가 module 별 enumerate (§6). plan 이 wave 별 cascade 고정.
- **closed-area overlap** — §8. shot_extract / outlook_extractor / entity_extractor_v2 는 C5/#7b 와 동일 모듈 — byte-identical 보존 gate 의무.
- **code carry test coupling** — Site 20 camera prose 는 canary `g4_5a` + builder unit test 와 결합. W4b 는 narrow.
- **Site 12 / 14 / 19 / 20 / 21** = OQ — Codex spec review 가 disposition 최종 확정.

## 11. Doctrine references

- [[feedback_llm_based_judgment]] — 4-Gate (Semantic Regex Ban / Prompt Closed-List Ban / Structured SOT Required / No Silent Fallback). C8 은 Prompt Closed-List Ban + scenario-leak 제거 중심.
- [[feedback_no_vlm_dependency]] — NO VLM hard constraint.
- [[feedback_codex_mcp_discussion_workflow]] / [[feedback_no_user_ask_codex_only]] — 매 결정 Codex MCP 의논.
- roadmap §5.7 Area #7 / index.html C8 / [[project_fix_critical_1_persistent]].

## 12. Codex Consultation Log

- **C8 entry sanity** (2026-05-20+): `APPROVED_FOR_SPEC_DRAFTING_WITH_NARROW_GUARDS` — 6항목 verdict 흡수: (1) wave 세분 split (W1a/b · W2a/b · W3a · W4a/b · W5) (2) A069 → (c) 흡수, C5 중복 claim 금지 (3) schema-strict carry → C8 scope 외 별도 carry (4) Site 16 → boundary-reviewed KEEP (5) code carry 20/21 → prose-embedded vs canary-truth 분리, KEEP/DEFER 가능 (6) C5/C4 중복 closure 금지 boundary 명시 의무.
- **C8 spec review iter 1** (2026-05-20+): `NEEDS_REVISION_NARROW_2` — NARROW 1 Site 20 P025 scope 확대 (`quay level` 단독 → `applies_when` parenthetical 닫힌 token 목록 전체 추상화, residue gate 전체 포착) + NARROW 2 prompt-pack 산술 12→13 정정 + `version_registry` sync 를 기존 provenance entry 보유 module 한정 (신규 entry 신설 금지) + plan W0 module 별 activation mechanism enumerate. Site 12/14/19/21 disposition + §4 wave 8 구조 + §8 overlap = APPROVED. amend 1 (§2.4/§3 Site20 / §6 / §9 OQ-C8-E / §10) 반영 완료 → re-review 요청.
- **C8 spec review iter 2** (2026-05-20+): `NEEDS_REVISION_NARROW_1` — amend 1 의 NARROW 1 (Site 20) / NARROW 2 산술 = RESOLVED. 잔여 = blanket `version_registry sync` wording 4개소 (§1.2 / §4 wave table / §5.4 / §7 G-registry) 를 §6 item 4 처럼 조건부 (기존 provenance entry 보유 module 한정, 신규 entry 금지) 로 좁힐 것. Site 12/14/19/20/21 disposition + 8-wave + overlap + schema-strict out-of-scope = APPROVED. amend 2 반영 완료 → re-review 요청.
- **C8 spec review iter 3** (2026-05-20+): `APPROVED` — amend 2 narrow (blanket `version_registry sync` wording 4개소 조건부 좁힘) 반영 확인. spec v1 확정.
- **C8 plan v1 review** (2026-05-20+): plan-entry sanity + 4-round → `APPROVED_FOR_EXECUTION` (W1a 3-commit 분할 / W3a code-path constant readback literal / Site20 split-aware residue 등 narrow guard 흡수).
- **C8 per-wave review** (2026-05-20+): W1a-1~W4b 각 wave atomic commit + Codex per-wave `APPROVED_FOR_*_ENTRY`. W1a-2/W2a/W2b plan 미열거 test-pin blocker 3건 `APPROVED_TO_ABSORB` 흡수. W3a `test_floor_plan_prompt.py:22` historical v4 fixture 미수정 확정. W4a `outlook_extractor.py:44` docstring out-of-scope finding + `test_prompt_service` camera-angle prefix pre-existing failure carry. W4b G-test needle string-literal split 함정 → split-aware head/tail residue guard 흡수.
- **C8 W5 session health** (2026-05-20+): `CONTINUE_AND_FINISH_IN_CURRENT_SESSION` — W5 closure docs + range review + push 본 세션 완주.
