# Semantic String Routing Debt Audit — Index

Date: 2026-05-14 (audit 시작) / 2026-05-15 (작성)

> This audit supersedes neither prior Codex documents nor the routing roadmap.
> It consolidates them into a verified action inventory.
> Implementation must proceed one area at a time.

## 1. Audit Boundary + Scope

본 audit 는 TheRoad-I1 production code / prompt 안의 **open-world visual/story semantic 판단을 regex / substring matching / keyword list / closed phrase enum 으로 수행하는 결함** 의 전수조사.

### Included
- `backend/app/**/*.py` 의 code regex / substring / `.replace()` mutation
- `prompts/_base/<latest dir>/*.{md,txt,json}` active prompt 의 시나리오 leak / 도메인 nomenclature 분산
- LLM-facing classifier instruction (gaze pattern / verb whitelist / issue type phrase)
- `prompt_loader` DB-first / file-fallback 동작 + 운영 active source 매트릭스

### Excluded
- legacy prompt version 디렉터리 (file fallback 의 non-latest)
- closed-world technical regex (C##/P##/L##/path/hash/status enum)
- LLM-produced structured SOT (gate 3 모범)
- `frame_spatial_contract` / `keep_elements` / `semantic_contract_router` (closed area — 흔들지 말 것)

### 본 audit 의 본질
- **Boundary spec**, 코드 변경 0.
- 등급화 + dependency graph + first implementation 결정.
- 실제 fix 는 area 별 별도 spec/plan 으로 진입.

## 2. Input Sources

### 2.1 Codex 1차 audit (보존, 본 audit 의 input)
- `docs/visual-reliability-audit/2026-05-14-semantic-string-routing-debt-map.md` — Codex code-side audit (P0-1~P0-7 / P1-1~P1-6 / P2-1~P2-6)
- `docs/visual-reliability-audit/2026-05-14-prompt-hygiene-v1-spec.md` — Codex prompt audit (P0-1~P0-3 / P1-1~P1-3 / §6 domain centralization)

### 2.2 관련 문서 (cross-ref)
- `docs/visual-reliability-audit/2026-05-14-nine-case-remediation-roadmap.md` — 9 visual failure case remediation roadmap (별개 영역, cross-ref)
- `docs/superpowers/specs/2026-05-14-visual-reliability-routing-map.md` — Visual Reliability Routing Map (9 case routing boundary)

### 2.3 사용자 메모 (32 항목 기준선) — **external Claude memory system, repo 외부**
- `~/.claude/projects/-Users-manta-Documents-Projects-TheRoad-I1/memory/session_20260514_semantic_regex_prompt_pollution_pivot.md` (external) — 32 항목 인벤토리 + 함정 8 + 사용자 결론
- `~/.claude/projects/-Users-manta-Documents-Projects-TheRoad-I1/memory/next_session_semantic_string_routing_debt_audit.md` (external) — 본 audit 진입점

### 2.4 정책 메모 — **external Claude memory system, repo 외부**
- `~/.claude/projects/-Users-manta-Documents-Projects-TheRoad-I1/memory/feedback_llm_based_judgment.md` (external) — 4 강제 gate (Semantic Regex Ban / Prompt Closed-List Ban / Structured SOT Required / No Silent Fallback)
- `~/.claude/projects/-Users-manta-Documents-Projects-TheRoad-I1/memory/feedback_subagent_model_opus.md` (external) — subagent dispatch model=opus 강제

## 3. 흡수 / 보강 / 추가 정책

본 audit 의 Codex 1차 결과 처리 정책:

### 흡수 (Absorbed from Codex)
- file:line evidence (재검증 후 인용)
- fix direction (적절 시 그대로)
- "Do Not Do" 5 patterns (Routing Map §4 와 통합)

### 보강 (Augmented)
- 등급 schema 4-tuple — Codex 는 priority 만, 본 audit 은 Evidence (confirmed/plausible/unverified) + Fix Cost (small/medium/large) + Dependency 추가
- 추가 grep — `.lower() in (...)`, `in prompt_lower`, `_TOKENS/_KEYWORDS/_PHRASES/_PATTERNS` 전수
- DB row 실측 — Codex 는 caveat 만, 본 audit 은 actual `sqlite3` query
- Routing Map §6 cross-ref — Codex 는 미명시
- 변신/빙의 visual_world_rules SOT 별도 area boundary — Codex 는 P1-1 / §6 통합
- Hygiene v1 vs framing_scale enum 순서 — **사용자 결정** (Hygiene v1 즉시 → framing_scale enum 두 번째) — Codex 추천 (Area 1 = framing/focus SOT) 과 반전

### 추가 (Additional findings)
- code: #19 (`_classify_label` 9 inner substring routing partial migration)
- prompt: ADD-6 ~ ADD-11 (도메인 분산 6 신규 site, 사용자/Codex 인벤토리 외)
- LLM: L-4 ~ L-7 (scene_detail 4 신규 classifier instruction site, Codex P0-1/P0-6/P0-7 의 prompt-side counterpart + 단독 발견 1)
- DB row: module 1 `entity_extraction` 가능한 orphan status, module 1/3 hardcoded Path bypass, `PROMPT_VERSION`-family 11 hits (9 `PROMPT_VERSION` + 2 `_PROMPT_VERSION`) 모두 metadata stamp 만

### 정정 (Corrections to Codex)
- Codex `outlook_extractor/.../phase1.md:24` `humanoid monster, vampire, zombie` 인용 → **실제 phase1.md 는 line 19 까지 존재**. 실 도메인 분산은 phase1.md:16 (`메카 / 파워드슈트 / 강화복 / 갑옷 로봇`) + phase2.md:8 (`원격접속/빙의`).
- Codex P2-1 underspec — `_classify_label` 10-branch 의 9 inner substring 누락 (`02-` D-4 row, `01-` #19 row).
- prompt file 카운트 — Codex 177, 본 audit 178 (미세 차이, 항목 수 영향 없음).

## 4. 등급 Schema 정의 (4-tuple)

### Priority
- **P0** — runtime routing / fail-fast 변경 가능. Fix = 별도 implementation area. 본 audit 카운트.
- **P1** — diagnostic / LLM-facing hint / canary scope / secondary consumer. hard 승격 금지. 본 audit 카운트.
- **P2** — closed-world technical regex (ID/path/hash/status/schema). keep + boundary 명시 의무. 본 audit 카운트.
- **Excluded** — visual mutation 범위 외 generic helper (format / markdown / placeholder substitution / closed marker). **non-counted**.

### Evidence
- **confirmed** — file:line read 직접 검증.
- **plausible** — 가설, case review / canary 검증 필요.
- **unverified** — production 측정 / 별도 audit 필요 (DB row / 실 trigger 빈도 / cross-shot consistency 등).

### Fix Cost
- **small** — 단일 site / prompt 1 파일 또는 code 1 module, ~50 LOC.
- **medium** — 다중 site cascade / schema 1 field + consumer 2-3, ~200-500 LOC.
- **large** — cross-cutting / schema + prompt + consumer + test cascade 동시, ~500+ LOC.

### Dependency
- **prerequisite: [#N]** — 본 fix 가 다른 fix 의 prerequisite.
- **blocked-by: [#N]** — 본 fix 가 다른 fix 에 의해 blocked.
- **independent** — 의존성 없음.

## 5. 32 항목 + 추가 발견 매핑 표

### 5.1 Code-side (18 + 1 추가 = 19)

| # | Priority | Evidence | Fix Cost | Dependency | Codex 매핑 | 사용자 메모 매핑 | 파일 |
|---|---|---|---|---|---|---|---|
| #1 | P0 | confirmed | medium | prereq for #2, #16, #17, #18 | P0-1 | P0 #1 | `01-` §4 |
| #2 | P0 | confirmed | medium | depends-on #1 | P0-2 | P0 #2 | `01-` §4 |
| #3 | P0 | confirmed | large | independent (Area 2) | P0-3 | P0 #3 | `01-` §4 |
| #4 | P0 | confirmed | medium | independent (Area 3) | P0-4 | P0 #4 | `01-` §4 |
| #5 | P0 | confirmed | medium | independent (LLM-side, `03-` L-2) | P0-5 | P0 #5 | `01-` §4 |
| #16 | P0 | confirmed | medium | depends-on #1 | P0-6 | P0 #16 (보강) | `01-` §4 |
| #18 | P0 | confirmed | medium | depends-on representation_binding enum | P0-7 | P0 #18 (보강) | `01-` §4 |
| #6 | P1 | confirmed | medium | independent (`02-` D-1~D-5) | P1-1 + §6 | P1 #6 | `01-` §5 |
| #7 | P1 | confirmed | small (keep) | independent (closed) | P1-2 | P1 #7 | `01-` §5 |
| #8 | P1 | confirmed | small (keep+guard) | independent | P1-3 | P1 #8 | `01-` §5 |
| #9 | P1 | confirmed | small (keep) | independent | P1-4 | P1 #9 | `01-` §5 |
| #10 | P1 | confirmed | medium | independent (Area 5) | P1-5 | P1 #10 | `01-` §5 |
| #17 | P1 | confirmed | medium | depends-on #1 | P1-6 | P1 #17 (보강) | `01-` §5 |
| #11 | P2 | confirmed | small (keep) | independent | (미명시) | P2 #11 | `01-` §6 |
| #12 | P2 | confirmed | small (keep) | independent | (미명시) | P2 #12 | `01-` §6 |
| #13 | P2 | confirmed | small (keep) | independent | (미명시) | P2 #13 | `01-` §6 |
| #14 | P2 (boundary) | confirmed | medium | independent | P2-1 partial | P2 #14 | `01-` §6 |
| #15 | P2 | confirmed (closed) | n/a | independent | (미명시) | P2 #15 | `01-` §6 |
| **#19 신규** | P2 (boundary) | confirmed | medium | independent | P2-1 underspec | (인벤토리 외) | `01-` §8 |

### 5.2 Prompt-side (4 P0 leak rows + 3 P1 over-specific rows + 5 도메인 + 6 도메인 추가 = 18 rows / 17 unique sites)

P-3 + P-3b 는 같은 P-3 rule 의 2 file site (같은 unique rule, 다른 file). 사용자 메모의 "P-1 ~ P-6 leak 6" 은 unique site 기준 6.

| # | Priority | Evidence | Fix Cost | Dependency | Codex 매핑 | 사용자 메모 매핑 | 파일 |
|---|---|---|---|---|---|---|---|
| P-1 | P0 | confirmed | small | independent | P0-1 | P-1 | `02-` §4 |
| P-2 | P0 | confirmed | small | independent | P0-2 | P-2 | `02-` §4 |
| P-3 | P0 | confirmed | small | independent | P0-3 | P-3 | `02-` §4 |
| P-3b | P0 | confirmed | small | independent | P0-3 | P-3 | `02-` §4 |
| P-4 | P1 | confirmed | small | independent | P1-1 | P-4 | `02-` §5 |
| P-5 | P1 | confirmed | small | independent | P1-2 | P-5 | `02-` §5 |
| P-6 | P1 | confirmed | medium | independent (LLM-side `03-` L-3) | P1-3 | P-6 | `02-` §5 |
| D-1 | P1 | confirmed | medium | independent (별도 area) | §6 site 1 | 도메인 #1 | `02-` §6 |
| D-2 | P1 | confirmed | small | independent (별도 area) | §6 site 2 | 도메인 #2 | `02-` §6 |
| D-3 | P1 | confirmed | medium | independent (별도 area) | §6 site 3 | 도메인 #3 | `02-` §6 |
| D-4 | P1 | confirmed (Codex 인용 정정) | small | independent (별도 area) | §6 site 4 (정정) | 도메인 #4 | `02-` §6 |
| D-5 | P2 (SOT owner) | confirmed | n/a | (owner) | §6 site 5 | 도메인 #5 | `02-` §6 |
| **ADD-6 신규** | P1 | confirmed | small | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |
| **ADD-7 신규** | P1 | confirmed | medium | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |
| **ADD-8 신규** | P1 | confirmed | small | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |
| **ADD-9 신규** | P1 | confirmed | small | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |
| **ADD-10 신규** | P1 | confirmed | small | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |
| **ADD-11 신규** | P1 | confirmed | medium | independent (별도 area) | (미명시) | (인벤토리 외) | `02-` §6 |

### 5.3 LLM-side (3 + 4 추가 = 7)

| # | Priority | Evidence | Fix Cost | Dependency | Codex 매핑 | 사용자 메모 매핑 | 파일 |
|---|---|---|---|---|---|---|---|
| L-1 | P0 | confirmed | large | prereq: visibility/offscreen SOT | §4 P0-3 + §7.1 | LLM #1 | `03-` §4 |
| L-2 | P0 | confirmed | large | prereq: `owned_object_usage[]` schema | §4 P0-5 + §7.2 | LLM #2 | `03-` §4 |
| L-3 | P0 | confirmed | large | prereq: patch ID / span schema | §5 P1-5 + §7.3 | LLM #3 | `03-` §4 |
| **L-4 신규** | P0 | confirmed | large | prereq: framing_scale enum SOT | §4 P0-1 LLM-counterpart | (인벤토리 외) | `03-` §4 |
| **L-5 신규** | P1 | confirmed | medium | prereq: framing_scale + body_part_focus | §4 P0-6 LLM-counterpart | (인벤토리 외) | `03-` §4 |
| **L-6 신규** | P1 | confirmed | medium | prereq: perception_mode enum 통일 | §4 P0-7 LLM-counterpart | (인벤토리 외) | `03-` §4 |
| **L-7 신규** | P2 | plausible | small | independent | (미명시) | (인벤토리 외) | `03-` §4 |

### 5.4 DB row verification (11 module 매트릭스)

`04-` §3 참조. 11 module 중:
- 8개 pure file fallback (modules 2, 4, 5, 7, 8, 9, 10, 11)
- 1개 db-aware caller (module 6 `entity_character_list`) — **PENDING** production
- 2개 hardcoded Path bypass (modules 1, 3)

## 6. 등급별 종합

### 6.1 Priority 분포

| Priority | code-side | prompt-side | LLM-side | 합계 |
|---|---|---|---|---|
| P0 | 7 | 4 (P-1~P-3b) | 4 (L-1~L-4) | **15** |
| P1 | 6 | 12 (P-4~P-6 + D-1~D-4 + ADD-6~ADD-11) | 2 (L-5, L-6) | **20** |
| P2 | 5 + 1 신규 (#19) = 6 | 1 (D-5 SOT owner) | 1 (L-7) | **8** |
| Excluded | non-counted | non-counted | non-counted | n/a |

### 6.2 Evidence 분포

- **confirmed**: 32 (사용자 인벤토리 base) + 11 (신규 발견 ADD-6~11 + #19 + L-4~L-7) - 1 (정정 D-4 인용 오류) = **42 confirmed**
- **plausible**: 1 (L-7)
- **unverified**: 0 (본 audit 직접 검증 영역)
- **PENDING (DB row 영역)**: 2 항목 (`04-` §6 참조). 2 해소 (2026-05-15 follow-up): module 1 orphan 확정 + entity_extractor_v2 boundary 명확화.

### 6.3 Fix Cost 분포 (P0 + P1 main targets)

- **small**: P-2 / P-3 / P-3b / P-4 / P-5 / D-2 / D-4 / D-5 / ADD-6 / ADD-8 / ADD-9 / ADD-10 / #7 / #8 / #9 / L-7 (~16 small; P-1 = orphan cleanup 별도 area, Hygiene v1 외 — 2026-05-15 follow-up)
- **medium**: #1 / #2 / #4 / #5 / #10 / #16 / #17 / #18 / P-6 / D-1 / D-3 / ADD-7 / ADD-11 / L-5 / L-6 (~15 medium)
- **large**: #3 / L-1 / L-2 / L-3 / L-4 (~5 large)

## 7. Dependency Graph

```
[framing_scale enum SOT]  ← Second Implementation Candidate (사용자 결정 = 두 번째)
  shot_staging schema 1 field: enum["close", "medium", "wide", "insert"]
  │
  ├─→ #1 (close framing 3 site) — atomic patch, replaces _CLOSE_FRAMING_RE production SOT
  ├─→ #2 (close × ref_usage matrix) — fail-fast RefContractError
  ├─→ #16 (body-part/face exemption) — _FACE_CLOSE_UP_PATTERNS 폐기
  ├─→ #17 (scene_consistency element_scope enum)
  ├─→ L-4 (scene_detail framing_scale_keywords inject 폐기)
  └─→ L-5 (close_framing_face_phrasing inject 폐기)

[representation_binding enum SOT]
  shot_staging perception_mode schema description token list 정렬 (현재 type: string + description 7-token, non-enforced) + 가능하면 JSON schema `enum` 강제 ↔ prompt+code 4 align
  │
  ├─→ #18 (perception_mode .lower() in 폐기)
  └─→ L-6 (prompt 4-token 정렬)

[shot_visibility drift only — Area 2]  (independent)
  │
  ├─→ #3 fix: shot_director.py:188-190 mutation 폐기
  ├─→ shot_visibility.py 6 lexicon → drift diagnostic only
  ├─→ visibility_relation / offscreen_reason enum SOT
  └─→ L-1 (shot_director system.md classifier instruction 폐기)
        ↳ dual-sync gap (blocking 패턴 regex 부재) 동시 fix

[ref-contract phantom guard replacement — Area 3]  (independent)
  │
  └─→ #4 fix: classify_from_the_reference → warning OR attached metadata 비교

[scene_detail_owned_judge schema echo — Area 4]  (independent)
  │
  ├─→ #5 (LLM verdict consumer 유지)
  └─→ L-2 (owned_object_usage[] echo schema 신설)

[t2i_review mutation redesign — Area 5]  (independent)
  │
  ├─→ #10 (code blind .replace() 폐기)
  └─→ L-3 (prompt phrase enum + target/suggestion 폐기)
        ↳ dual-sync 의무

[visual_world_rules SOT 일원화 — Area VWR]  (independent, prompt-only)
  │
  ├─→ #6 (entity variant 5 prompt 명명 분산)
  ├─→ D-1 ~ D-4 + ADD-6 ~ ADD-11 (11 site)
  ├─→ rules_schema.json:9 schema description 6-token (`type: string + description`, non-enforced) → system.md:51 10-token 정렬 + 가능하면 JSON schema `enum` 강제
  └─→ visual_world_rules SOT (D-5) 본체는 owner — 보존

[Hygiene v1 — First Implementation Candidate]  (사용자 결정 = 즉시, 의존성 0)
  │
  ├─→ P-2 / P-3 / P-3b (scene_extractor_v2 새 dir)
  ├─→ P-4 (scene_extractor_v2 새 dir)
  ├─→ P-5 (t2i_visual_converter v4 새 dir + path string bump in code)
  └─→ P-6 (t2i_review 새 dir, LLM-side redesign 별도)

[Orphan cleanup — 별도 area]  (2026-05-15 follow-up 결정)
  │
  └─→ P-1 (entity_extractor_legacy.py + prompts/_base/entity_extraction/ archive 또는 삭제 검토)
```

## 8. First Implementation Candidates 2개 (사용자 결정)

### 8.1 Order

**(1) Prompt Hygiene v1** — 즉시. 의존성 0. P-1 ~ P-6 (6 site).
**(2) framing_scale enum SOT** — Hygiene v1 closure 후. #1 + #2 + #16 + #17 + L-4 + L-5 의 prerequisite (large blast radius).
**그 외 area** — 별도 진행:
- shot_visibility drift only (Area 2, #3 + L-1)
- ref-contract phantom guard replacement (Area 3, #4)
- representation_binding enum SOT (Area perception, #18 + L-6)
- scene_detail_owned_judge schema echo (Area 4, #5 + L-2)
- t2i_review mutation redesign (Area 5, #10 + L-3)
- visual_world_rules SOT 일원화 (Area VWR, #6 + D-1~D-4 + ADD-6~ADD-11)

### 8.2 Hygiene v1 — 즉시 가능 사유

- 의존성 0 — 다른 fix prerequisite 없음.
- 시나리오 leak fix — 코드 변경 ~최소 (module 3 만 path string bump, 다른 module 은 file 새 dir 만). **P-1 orphan 분리 (2026-05-15 follow-up) — Hygiene v1 affected = module 2, 3, 4**.
- DB row 영향 — 11 module 중 1개 (`entity_character_list`) 만 db-aware. Hygiene v1 affected module (2, 3, 4) 중 db-aware 없음. 단 module 3 (`t2i_visual_converter`) hardcoded Path bypass 의무.
- 즉시 적용 → 본 audit 의 다른 항목과 충돌 없음.

### 8.3 framing_scale enum SOT — Hygiene v1 다음 사유

- 4 P0 (#1, #2, #16, #17) + 2 LLM-side (L-4, L-5) 동시 unblock — 단일 area 최대 ROI.
- shot_staging schema 1 field 추가 + 6 consumer atomic patch.
- 사용자 명시: scope 폭발 위험 — 한 번에 다 고치지 말 것. 이 area 만 단일 진행.

### 8.4 Hygiene v1 vs framing_scale 순서 결정 근거

- Codex map §8 Area 1 = framing/focus SOT 추천 (code 우선).
- 사용자 결정 = **반전** — Hygiene v1 즉시 → framing_scale 두 번째.
- 근거: Hygiene v1 의존성 0 + 즉시 효과. framing_scale 은 cross-cutting cancer 다중 unblock 효과 — 천천히 atomic 으로.

## 9. Routing Map §6 Cross-ref

`docs/superpowers/specs/2026-05-14-visual-reliability-routing-map.md` §6 (First Implementation Candidate = close × ref_usage attach policy) 의 **prerequisite = framing_scale enum SOT** 명시 추가 의무.

본 진입점 메모 ([[next_session_semantic_string_routing_debt_audit]]) 의 함정 8 carry — close × ref_usage spec 진입 시 framing_scale enum SOT 가 prerequisite 임을 routing map §6 에 명시 안 됨. 본 audit closure 후 routing map §6 업데이트 의무.

## 10. Do Not Implement Here — 5 patterns

본 audit 의 fix 진입 시 절대 위반 금지:

1. **`frame_spatial_contract` scope 확장 금지** — Area frame-spatial-contract closed (commit 2885f8c). soft phrase diagnostic 유지, hard 승격 절대 금지.
2. **`keep_elements` character 재도입 금지** — Area D-next-min closed (commit 5f3da38). `KEEP_ELEMENT_KINDS = {environment, static_prop}` 외 확장 금지.
3. **`render_contracts` dimension 추가 신중** — Area B closed (commit e400e9c). `visual_identity` 외 dimension 추가는 별도 area spec 의무.
4. **9 case 동시 구현 금지** — Routing Map §4 carry. 9 visual failure case 를 한 번에 fix 시도 시 scope 폭발.
5. **regex semantic 판단 도입 금지** — 사용자 명시 정책 ([[feedback_llm_based_judgment]] gate 1). 새 `_NOUNS / _TOKENS / _KEYWORDS / _PHRASES` 식별자 추가 (open-world visual / story semantic classifier 목적) 금지.

추가:
6. **본 audit 의 다른 area fix 와 동시 진행 금지** — 사용자 명시 "한 번에 다 고치지 말 것 — scope 폭발 위험".
7. **Codex 두 input 문서 supersede 금지** — 본 audit 는 consolidates only. Codex 문서 보존 + cross-ref.

## 11. Verification Backlog

본 audit 가 production 측정 없이 결정 불가한 항목 (`04-` §6 PENDING 의 superset):

### 11.1 DB row 영역 (`04-` §6)
- production DB row state for 11 modules (특히 module 6 `entity_character_list` only db-aware)
- `prompt_template` table DDL (alembic migration 검토)
- ~~module 1 `entity_extraction` live-or-orphan status~~ — **해소 (2026-05-15 follow-up)**: orphan 확정 (`entity_extractor_legacy.py` import 0, caller 0). P-1 = Hygiene v1 외 별도 orphan cleanup area.
- ~~`entity_extractor_v2` separate dir boundary~~ — **해소 (2026-05-15 follow-up)**: `entity_extractor_v2/9.202605130226/` = current active prompt path + `entity_extractor_v3.py` (impl, `_MODULE = "entity_extractor_v2"`) + `entity_extractor_v2_legacy.py` (fallback, `operation_type="entity_extraction"` provenance label emit). active path 시나리오 leak 0.

### 11.2 Cross-shot consistency (별도 audit 필요)
- L-1 / L-4 / L-5 의 LLM emit ↔ code consume 의 cross-shot consistency
- shot_staging 의 `framing_scale` (가설 enum) vs scene_detail prompt 의 `framing_scale_keywords` inject 의 production trigger 빈도
- `_CLOSE_FRAMING_RE` 의 production miss 빈도 (canary log)

### 11.3 Routing map §2 case 6/7/8 unverified (cross-ref)
- Routing Map §2 의 case 6 (perception_mode reflection / projection) unverified
- 본 audit #18 + L-6 결과 와 정합 검증 필요

## 12. Completion Criteria

본 audit 가 완료된 것으로 간주되는 조건:

- [x] 사용자 32 항목 인벤토리 매핑 완료 (code 18 + prompt 11 + LLM 3 = 32, 모두 confirmed)
- [x] Codex 1차 결과 흡수 + 정정 (인용 오류 1건 / underspec 1건 / 인벤토리 외 4건 LLM counterpart)
- [x] 추가 grep 의무 충족 (code `_classify_label` 신규 1 / prompt 도메인 분산 6 신규 / LLM scene_detail 4 신규)
- [x] DB row 실측 완료 (table 부재 발견 + 11 module 매트릭스 + PENDING 4 항목 명시)
- [x] 4 gate 자가 검증 ([[feedback_llm_based_judgment]] gate 1 Semantic Regex Ban — 본 audit 가 직접 위반 0)
- [x] Codex 흡수 / 보강 / 추가 / 정정 정책 명시
- [x] First implementation candidate 2개 결정 + 순서 명시 (사용자 결정 = Hygiene v1 → framing_scale)
- [x] Routing Map §6 prerequisite cross-ref 명시
- [x] Do Not Implement 5 patterns + 추가 2 boundary 명시
- [x] Verification Backlog 11.1 ~ 11.3 명시

## 13. 파일 구조

```
docs/visual-reliability-audit/
├── 2026-05-14-semantic-string-routing-debt-map.md       (Codex code-side audit, 보존)
├── 2026-05-14-prompt-hygiene-v1-spec.md                  (Codex prompt audit, 보존)
├── 2026-05-14-nine-case-remediation-roadmap.md           (별개 영역, cross-ref)
└── 2026-05-14-semantic-string-routing-debt-audit/        ← 본 audit
    ├── 00-index.md                                       (본 파일)
    ├── 01-code-side-regex-audit.md                       (code 18 + #19)
    ├── 02-prompt-side-hygiene-audit.md                   (prompt 6 + 도메인 5 + ADD-6~11)
    ├── 03-llm-side-heuristic-audit.md                    (LLM 3 + L-4~L-7)
    └── 04-db-row-verification.md                         (11 module matrix + PENDING)
```

## 14. 다음 진입점

- **즉시**: Prompt Hygiene v1 spec 작성 (`docs/superpowers/specs/2026-05-15-prompt-hygiene-v1-spec.md`) — P-1 ~ P-6 fix (단 module 1 orphan check 우선).
- **Hygiene v1 closure 후**: framing_scale enum SOT spec 작성 — #1 + #2 + #16 + #17 + L-4 + L-5 atomic area.
- **별도 진입**: visual_world_rules SOT 일원화 area / shot_visibility drift only Area 2 / ref-contract phantom guard Area 3 / representation_binding enum / t2i_review mutation redesign / scene_detail_owned_judge schema echo.

본 audit 의 결과로 routing map §6 cross-ref 업데이트 + 사용자 메모 [[next_session_semantic_string_routing_debt_audit]] supersede (audit document 완료, first implementation 진입점으로 전환).
