{"candidate_reason": "python scope discovery", "chunk_end": 48, "chunk_start": 1, "chunk_summary": "No actionable findings; the file is a standard LLM wrapper that delegates visual rule extraction to a structured LLM call without performing local string-based semantic judgment.", "duration_ms": 4656, "findings": [], "path": "backend/app/modules/pipeline/visual_world_rules.py", "scan_kind": "python", "sha256": "d175b0ca2f77e250eb3e5f62c48a7af863d5ea6426c80c7c7a03b630a4b1c411"}
{"candidate_reason": "python scope discovery", "chunk_end": 403, "chunk_start": 1, "chunk_summary": "The file provides infrastructure for loading prompt templates and schemas from a database or filesystem with versioning logic, and contains no actionable findings regarding semantic string judgment or scenario pollution.", "duration_ms": 8297, "findings": [], "path": "backend/app/modules/prompt_loader.py", "scan_kind": "python", "sha256": "4f096399c0a91a5d5bc3adbc065988b68a1ea77178a4d4a8da063de484233a1b"}
{"candidate_reason": "python scope discovery", "chunk_end": 152, "chunk_start": 1, "chunk_summary": "The file implements a router that determines semantic constraints for prompt sanitization by matching natural-language state descriptions within an overloaded gaze target field.", "duration_ms": 15231, "findings": [{"category": "semantic_string_judgment", "evidence": "IMMOBILIZED_GAZE: frozenset[str] = frozenset({\"dead\", \"unconscious\", \"severely_injured\"}) ... if gaze not in IMMOBILIZED_GAZE: continue", "line_end": 107, "line_start": 22, "recommended_fix": "Migrate to a dedicated structured field (e.g., 'subject_state.immobility_state') in the shot_staging schema as planned in the file's docstring, and use a canonical enum instead of inferring state from gaze targets.", "severity": "P1", "why_problematic": "The 'gaze_target' field is being overloaded to carry physical state information. The code uses a brittle list of natural-language strings to infer an 'immobilized' state, which subsequently triggers strict sanitization constraints such as 'forbid_state_polarity_rewrite'. This is a semantic judgment over an overloaded channel."}], "path": "backend/app/modules/semantic_contract_router.py", "scan_kind": "python", "sha256": "3eabedd46fc41df8eb486c7c37b479c82096db368111f44188c3cc7912667d56"}
{"candidate_reason": "python scope discovery", "chunk_end": 302, "chunk_start": 1, "chunk_summary": "The file is a StepRunner that orchestrates shot dependency analysis using an LLM, passing natural language descriptions and generated T2I prompts to the model without performing brittle string matching or containing scenario pollution in its prompt construction.", "duration_ms": 18997, "findings": [], "path": "backend/app/core/steps/shot_dependency_t2i_step.py", "scan_kind": "python", "sha256": "4e5bf81c1d9040583870f1e8f14636e453dad73093f557bbbaf9b1511ec9cc8a"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 137, "chunk_start": 1, "chunk_summary": "The prompt defines a closed-list semantic classifier for location sub-spaces, restricting open-world scenario analysis to a fixed set of keys.", "duration_ms": 12851, "findings": [{"category": "llm_closed_list_instruction", "evidence": "allowed_space_keys 는 controlled vocab 안에서 선택: main / kitchen / rooftop / stairs / yard / exterior / office.", "line_end": 101, "line_start": 97, "recommended_fix": "Transition to a more flexible or descriptive key generation strategy, or move the classification logic to a stage that can handle a broader ontology.", "severity": "P2", "why_problematic": "The LLM is instructed to map arbitrary scenario locations to a hard-coded list of sub-space types. This is a closed-world semantic classifier applied to open-world story text, which will fail or lose detail for scenarios involving spaces not in the list (e.g., 'bedroom', 'cave', 'bridge')."}], "path": "prompts/_base/entity_extractor_v2/9.202605130226/system.md", "scan_kind": "prompt", "sha256": "4c6ca2572963ae30038f2acd9e844dc18c96adf97ceab28cead3f90c4a8af01a"}
{"candidate_reason": "python scope discovery", "chunk_end": 522, "chunk_start": 1, "chunk_summary": "The file defines a structured entity extraction pipeline using LiteLLM and structured JSON schemas, with no actionable findings regarding brittle string patterns or scenario pollution.", "duration_ms": 38632, "findings": [], "path": "backend/app/modules/pipeline/entity_extractor_v3.py", "scan_kind": "python", "sha256": "c986035718b7f91b3dc9915305b09b38345443d8f0dfc9fcb7f037ea64709b33"}
{"candidate_reason": "python scope discovery", "chunk_end": 171, "chunk_start": 1, "chunk_summary": "The module converts entity and scene descriptions into T2I prompts, but uses a brittle bracketed marker system for entity referencing that relies on blind string mutation.", "duration_ms": 40225, "findings": [{"category": "blind_string_mutation", "evidence": "1. 각 씬 아래의 '★ 엔티티 목록'에 있는 이름만 [이름] 마커 사용 가능 ... 4. [] 마커는 참조 이미지 치환용이므로 목록 외 사용 시 시스템 오류 발생", "line_end": 159, "line_start": 128, "recommended_fix": "Transition to a structured prompt assembly where the LLM identifies entity presence and their specific scene-contextual descriptions as separate fields, allowing the backend to inject visual references using stable IDs rather than performing substring replacement on natural language output.", "severity": "P1", "why_problematic": "The prompt establishes a contract where the LLM must identify entities and wrap them in exact bracketed markers ([Name]) for later blind string substitution. This is brittle because it relies on the LLM's ability to perfectly replicate names (including spacing) and assumes downstream code can safely replace these markers without context, which often leads to broken prompts or failed matches."}], "path": "backend/app/modules/t2i_visual_converter.py", "scan_kind": "python", "sha256": "c288f257d1b6d258eea3850beaec967eb2d189a69209f4f25642ea86e9f3249c"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 112, "chunk_start": 1, "chunk_summary": "The prompt defines a background continuity planning task with clear instructions on language handling, visual continuity logic, and a skip decision framework, and it appears to be free of actionable semantic string debt or scenario pollution.", "duration_ms": 34654, "findings": [], "path": "prompts/_base/background_chain_planning/4.202604291315/system.md", "scan_kind": "prompt", "sha256": "b6d96cccd24910b03feb484005f1233195e64b54e48add4ed8c1f3fc1ecec938"}
{"candidate_reason": "python scope discovery", "chunk_end": 1511, "chunk_start": 1, "chunk_summary": "The file coordinates scene generation and reference attachment, containing one instance of brittle string-based prompt mutation.", "duration_ms": 45593, "findings": [{"category": "semantic_string_judgment", "evidence": "if shot_name and shot_name.lower() not in var_t2i.lower(): var_t2i = f\"[Camera: {shot_name}] {var_t2i}\"", "line_end": 719, "line_start": 718, "recommended_fix": "Pass the shot_name as a separate structured parameter to the generation pipeline or use a more robust semantic check to determine if the camera directive is already present.", "severity": "P1", "why_problematic": "This code performs a case-insensitive substring check on the natural-language T2I prompt (var_t2i) to decide whether to mutate it by prepending a camera directive. This is brittle because the same semantic meaning (the shot type) can be expressed in many ways in the prompt (e.g., 'CU' vs 'Close Up'), leading to redundant or conflicting instructions if the pattern match fails."}], "path": "backend/app/services/scene_generation_coordinator.py", "scan_kind": "python", "sha256": "258fea47b6c20d942e942bb8a6629f39495560b30f2655559c8b72a5818993fc"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 92, "chunk_start": 1, "chunk_summary": "The prompt defines a workflow where location visual consistency is managed by generating prose intended for blind insertion into a brittle bracketed string pattern within T2I prompts.", "duration_ms": 14707, "findings": [{"category": "semantic_string_judgment", "evidence": "`[L##: 설명]` 블록이 location의 유일한 시각 정보입니다", "line_end": 5, "line_start": 5, "recommended_fix": "Pass location descriptions as structured metadata or separate prompt segments rather than relying on pattern-matching within a single prompt string.", "severity": "P1", "why_problematic": "The system relies on a brittle bracketed string pattern ([L##: description]) within natural language prompts to identify and isolate location-specific visual information, implying downstream regex or substring dependency."}, {"category": "blind_string_mutation", "evidence": "이 문장은 나중에 scene_detail이 t2i_prompt에 그대로 삽입하므로", "line_end": 11, "line_start": 11, "recommended_fix": "Use a structured templating system or a dedicated prompt assembly step that validates the generated description before integration into the final T2I prompt.", "severity": "P1", "why_problematic": "The prompt establishes a contract for blind string insertion of generated prose into a downstream T2I prompt. This bypasses structured validation and risks breaking prompt syntax or introducing semantic conflicts."}], "path": "prompts/_base/location_consistency/2.202604201230/system.md", "scan_kind": "prompt", "sha256": "dcac2b2e414a6c2561a116c4c282f6c435b823785ea9f2f1b808241c949a7645"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 28, "chunk_start": 1, "chunk_summary": "The prompt defines semantic classification rules for humanoid vs. non-humanoid entities and specific object types to control schema membership and routing.", "duration_ms": 17269, "findings": [{"category": "llm_closed_list_instruction", "evidence": "사람 형상이 아닌 캐릭터: 동물, 뱀, 곤충 떼, 박쥐 떼, 물체, 차량 등 / 사람 형상인 캐릭터: 인간, 인간형 요괴/괴물, 뱀파이어, 좀비 등 ... 비인간형 캐릭터는 아웃룩이 필요 없으므로 outlooks에서 제외하세요", "line_end": 26, "line_start": 22, "recommended_fix": "Define a formal 'entity_type' in the character schema and move the classification logic to a dedicated stage or use a more robust semantic definition that doesn't rely on a list of specific creature examples.", "severity": "P1", "why_problematic": "The prompt uses a closed list of specific examples (insect swarms, bat swarms, vampires, zombies) to instruct the LLM on a binary semantic classification (humanoid vs non-humanoid). This classification directly controls entity membership in the 'outlooks' schema, creating a brittle semantic boundary based on specific tropes that may bias or fail for other non-humanoid types."}, {"category": "semantic_string_judgment", "evidence": "사람이 탑승하거나 착용하는 인간형 기계장치(메카, 파워드슈트, 강화복, 갑옷 로봇 등)도 아웃룩으로 추출", "line_end": 16, "line_start": 16, "recommended_fix": "Allow the schema to handle 'equipment' or 'mechanical_shell' as distinct categories rather than overloading the 'outlook' field with mechanical entities.", "severity": "P2", "why_problematic": "This rule forces a semantic mapping where specific physical object categories (mecha, power suits) are treated as 'outlooks' (clothing). This is a non-obvious semantic instruction that biases how the LLM categorizes complex entities into the clothing schema."}], "path": "prompts/_base/outlook_extractor/11.202603311724/phase1.md", "scan_kind": "prompt", "sha256": "48204c280029e2dbd933775dd1b7e23fa8e9c3fda4c2cc85e10d6e1ad7722129"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 26, "chunk_start": 1, "chunk_summary": "The prompt defines rigid T2I templates for different entity types and references an external controlled vocabulary for schema values, creating potential for visual bias and schema drift.", "duration_ms": 28938, "findings": [{"category": "llm_closed_list_instruction", "evidence": "\"Passport-style ID photo, head and upper chest visible, ... plain white background.\", \"Photorealistic cinematic establishing shot, ... no people, no vehicles, no objects.\", \"Photorealistic product photo, isolated object, ... plain neutral background.\"", "line_end": 18, "line_start": 10, "recommended_fix": "Replace rigid templates with descriptive goals (e.g., 'isolate the entity against a neutral background') or allow the LLM to select from a broader, more flexible set of visual styles appropriate for the entity's nature.", "severity": "P1", "why_problematic": "The prompt forces all open-world entities into three rigid visual templates (Passport, Establishing Shot, Product Photo) based on their type. This acts as a closed-list semantic classifier for visual identity, which may bias or incorrectly represent entities that do not fit these specific photographic metaphors (e.g., non-humanoid characters, abstract locations, or complex props)."}, {"category": "schema_or_enum_drift", "evidence": "\"kind\": \"single_space\", \"kind\": \"multi_space\", \"system prompt 의 controlled vocab 따라\"", "line_end": 23, "line_start": 21, "recommended_fix": "Ensure these enum values are derived from a central SOT and passed into the prompt as variables, or use a shared schema definition that the LLM is instructed to follow.", "severity": "P2", "why_problematic": "The prompt explicitly references a 'controlled vocab' from the system prompt and hardcodes specific enum values ('single_space', 'multi_space') into the instructions. This creates a synchronization risk where changes to the central schema or system prompt may not be reflected here, leading to validation failures."}], "path": "prompts/_base/entity_extractor_v2/9.202605130226/turn_entity_detail.md", "scan_kind": "prompt", "sha256": "ec173df86b94c263a602aab6f01fd08b3b04afbda67b0ffdfe8a18ae0058482e"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 29, "chunk_start": 1, "chunk_summary": "The schema defines semantic categories for world rules and includes a specific story trope as an example in the field descriptions.", "duration_ms": 21949, "findings": [{"category": "schema_or_enum_drift", "evidence": "\"rule_type\": {\"type\": \"string\", \"description\": \"규칙 유형 (possession, transformation, ghost, time_period, costume, technology 등)\"}", "line_end": 9, "line_start": 9, "recommended_fix": "Convert the rule_type field into a formal JSON enum if the categories are used for downstream logic, or move the examples to a separate documentation field if they are purely illustrative.", "severity": "P2", "why_problematic": "The schema defines a semantic taxonomy (possession, ghost, etc.) within a string description rather than using a formal JSON enum. This creates an unenforced contract that downstream logic likely relies on for visual or behavioral routing."}, {"category": "scenario_dependent_prompt", "evidence": "\"예: A의 영혼이 B의 몸에 전이된 경우 A는 물리적 존재가 아님\"", "line_end": 21, "line_start": 17, "recommended_fix": "Replace the specific trope example with an abstract definition of physical presence (e.g., 'whether the entity occupies physical space and interacts with the environment').", "severity": "P2", "why_problematic": "The description contains a concrete scenario-specific trope (soul transfer/possession) to explain physical presence logic. This can bias the LLM's reasoning towards specific supernatural genres instead of maintaining a neutral, abstract definition of physical presence."}], "path": "prompts/_base/visual_world_rules/6.202605021400/rules_schema.json", "scan_kind": "prompt", "sha256": "c2d9af79cac5595c1a405bf3805e945791b8dbc25cecd56cb85e222e6a328849"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 109, "chunk_start": 1, "chunk_summary": "The prompt defines semantic rules for suppressing technical identifiers based on visual state and provides manual mappings for technical camera/lighting enums to natural language descriptions.", "duration_ms": 23631, "findings": [{"category": "semantic_string_judgment", "evidence": "얼굴/형태 식별 불가 인물 — short_id 사용 금지: 실루엣, 그림자, 창문 반사, 역광, 안개 속 등으로 인물의 얼굴이나 신체 형태를 식별할 수 없는 경우 C##O## short_id를 사용하지 마세요.", "line_end": 38, "line_start": 34, "recommended_fix": "Pass a structured 'visibility_state' or 'is_silhouette' flag in the character-outlook mapping and instruct the LLM to omit the short_id based on that explicit flag rather than inferring it from the scene text.", "severity": "P1", "why_problematic": "This instruction requires the LLM to perform a semantic classification of the visual scene (identifying silhouettes, shadows, etc.) to decide whether to suppress technical identifiers (short_id). This logic couples visual interpretation with technical payload routing, which can lead to inconsistent ID enforcement if the LLM's interpretation of 'silhouette' or 'fog' varies."}, {"category": "llm_closed_list_instruction", "evidence": "카메라 기법 이름을 T2I 텍스트에 그대로 쓰지 마세요... 'soft_light_intimate' → 'soft warm light from one side, shallow depth of field blurring the background'", "line_end": 63, "line_start": 57, "recommended_fix": "Provide the descriptive text directly in the input data (e.g., in a camera_config object) instead of asking the LLM to translate technical strings into prose based on a list in the prompt.", "severity": "P2", "why_problematic": "The prompt contains a hardcoded mapping of technical enums (e.g., soft_light_intimate, dutch_angle) to specific natural language descriptions. This creates a maintenance burden and potential drift between the system's technical vocabulary and the prompt's translation logic."}, {"category": "scenario_dependent_prompt", "evidence": "`<region-derived demonym> police officer`, `<region-style apartment>`, `<region-style convenience store>`", "line_end": 85, "line_start": 82, "recommended_fix": "Allow the LLM to describe the region naturally based on the provided world-building context rather than enforcing a specific bracketed template for every entity.", "severity": "P2", "why_problematic": "These instructions force the LLM to use specific linguistic templates for regional/cultural markers. This biases the generation towards a specific structure and may result in unnatural phrasing or 'hallucinated' cultural markers if the 'region' cue is not well-defined in the source scenario."}], "path": "prompts/_base/scene_extractor_v2/18.202605150955/turn_scene_detail.md", "scan_kind": "prompt", "sha256": "a32ab2a3e97d6e51050ae5abda5d9ee002879725bc1ee1d626e9436b3d4c03d2"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 70, "chunk_start": 1, "chunk_summary": "The prompt defines semantic classification rules for scene types and entity visibility based on brittle string patterns and keyword markers.", "duration_ms": 27886, "findings": [{"category": "semantic_string_judgment", "evidence": "(<몽타주> 표시 또는 빠른 컷 전환)", "line_end": 47, "line_start": 47, "recommended_fix": "Pass the scene type or montage status as a structured metadata field from the upstream parser instead of relying on the LLM to detect string markers in natural language.", "severity": "P1", "why_problematic": "The prompt instructs the LLM to classify a scene as 'montage' based on the presence of a specific string marker ('<몽타주>') in the input scenario text, which is a brittle pattern-based semantic judgment."}, {"category": "semantic_string_judgment", "evidence": "V.O., 전화 통화, 무전, 방송 음성 / \"<visible_body_name>(<remote_identity_name>)\"", "line_end": 60, "line_start": 58, "recommended_fix": "Use structured entity state flags (e.g., is_offscreen, is_voice_only, is_remote_possession) in the input payload rather than asking the LLM to infer visibility from screenplay notations or name patterns.", "severity": "P1", "why_problematic": "The prompt uses a list of keywords (V.O., phone call, etc.) and a specific parenthetical string pattern to determine physical entity visibility. This relies on the LLM performing string-based semantic routing to include or exclude entities from the visual frame."}, {"category": "schema_or_enum_drift", "evidence": "normal, montage, flashback, dream, voiceover, transition", "line_end": 52, "line_start": 44, "recommended_fix": "Define these scene types in a central JSON schema enum and reference that schema in the prompt to ensure consistency across the pipeline.", "severity": "P2", "why_problematic": "These scene types function as a semantic enum for classification but are defined only as a list in the prompt instructions. If downstream code or other prompt stages expect these exact strings, it creates a synchronization risk without schema enforcement."}], "path": "prompts/_base/scene_extractor_v2/18.202605150955/system.md", "scan_kind": "prompt", "sha256": "acf7ef11303d21772e3caa534a4c7c76b02a391b7de8574ceb0e881072ca1874"}
{"candidate_reason": "prompt scope discovery", "chunk_end": 110, "chunk_start": 1, "chunk_summary": "The prompt defines a closed list of semantic categories for classifying supernatural and technical phenomena in scenarios, which acts as a rigid classifier for open-world story elements.", "duration_ms": 26464, "findings": [{"category": "llm_closed_list_instruction", "evidence": "rule_type은 다음 중 선택: possession, transformation, ghost, projection, superpower, body_deformation, time_period, costume, technology, other", "line_end": 51, "line_start": 51, "recommended_fix": "Transition to a more flexible tagging system or allow the LLM to provide a 'category_name' and 'category_description' pair instead of selecting from a hardcoded list.", "severity": "P2", "why_problematic": "The LLM is instructed to classify diverse, open-world narrative phenomena into a fixed set of categories. This rigid classification can fail to capture the nuances of unique story elements or force them into ill-fitting buckets like 'other', potentially leading to incorrect downstream visual processing if those categories drive specific rendering logic."}], "path": "prompts/_base/visual_world_rules/6.202605021400/system.md", "scan_kind": "prompt", "sha256": "911f1af6897a9acde2ff8b3b295158bda139b9d20ef07df8af570f02730c4a42"}
