{"candidate_reason": "prompt scope discovery", "chunk_end": 175, "chunk_start": 1, "chunk_summary": "The prompt defines complex logic for visual continuity and reference usage, but relies on overloaded semantic channels, brittle keyword-based exclusion lists for validation, and contains scenario-specific pollution in examples.", "duration_ms": 28043, "findings": [{"category": "semantic_string_judgment", "evidence": "staging.gaze_target 기반 immobilized mode 산출", "line_end": 68, "line_start": 68, "recommended_fix": "Introduce a dedicated physical_state or mobility_status field in the schema instead of inferring state from gaze targets.", "severity": "P1", "why_problematic": "The gaze_target field is being overloaded to carry physical state information (immobilized mode). This is a brittle semantic channel where a field named for one purpose (gaze) is used to infer a completely different physical state for prompt sanitization."}, {"category": "llm_closed_list_instruction", "evidence": "human / person / character / body / figure / man / woman / detective / prisoner / child / person silhouette", "line_end": 157, "line_start": 156, "recommended_fix": "Use a structured entity_type enum (e.g., PERSON, PROP, ENVIRONMENT) and have the LLM categorize entities rather than relying on keyword exclusion in natural language labels.", "severity": "P1", "why_problematic": "This is a closed list of phrases used as a semantic classifier to define what constitutes a 'person' for the purpose of fail-fast validation. It forces the LLM to match open-world descriptions against a brittle list to enforce a non-person constraint on labels."}, {"category": "schema_or_enum_drift", "evidence": "immobilized_character / character / pose 등 enum 외 값 절대 금지", "line_end": 161, "line_start": 161, "recommended_fix": "Ensure the kind enum is centrally defined in the SOT schema and shared across all pipeline steps to prevent drift.", "severity": "P2", "why_problematic": "The prompt explicitly lists forbidden enum values that likely exist in other parts of the pipeline or previous versions, indicating that the 'kind' field's enum is not centrally enforced or synchronized."}, {"category": "scenario_dependent_prompt", "evidence": "the same small reddish mark on the wrist", "line_end": 169, "line_start": 169, "recommended_fix": "Replace specific scenario details with generic placeholders like 'a unique texture detail' or 'a specific marking on the object'.", "severity": "P2", "why_problematic": "This is a highly specific visual detail (a 'reddish mark on the wrist') used as a concrete example. Such specific scenario-dependent props can bias the LLM towards forensic or injury-related scenarios in arbitrary future generations."}], "path": "prompts/_base/shot_dependency_t2i/7.202605151200/system.md", "scan_kind": "prompt", "sha256": "4bb9564d103d4c10a4183bbc190f58568e1564cf199cf2e4defb057a3542b378"}
{"candidate_reason": "python scope discovery", "chunk_end": 953, "chunk_start": 1, "chunk_summary": "The file implements a multi-turn scene extraction pipeline using LLMs, featuring brittle substring-based scenario segmentation and blind mutation of both prompts and generated T2I text.", "duration_ms": 51568, "findings": [{"category": "semantic_string_judgment", "evidence": "scene_text.find(st), fulltext.find(start_text), if split_text in scene_text", "line_end": 451, "line_start": 214, "recommended_fix": "Use character offsets or line indices returned by the LLM, or use a fuzzy matcher/anchor-based approach that is resilient to minor text variations.", "severity": "P1", "why_problematic": "The pipeline relies on LLMs to 'exactly copy' snippets from the source scenario to identify split points (lines 61, 174, 288). Substring matching is brittle to minor LLM hallucinations in punctuation or spacing, leading to failed or shifted scene boundaries which directly routes the pipeline's structural output."}, {"category": "blind_string_mutation", "evidence": "_re_cine.sub(r'카메라 구도 선택지:.*?주의:', '주의:', turn_msg, flags=_re_cine.DOTALL)", "line_end": 741, "line_start": 736, "recommended_fix": "Use structured prompt templates with named placeholders or conditional blocks instead of regex-based string manipulation over natural language prompt prose.", "severity": "P1", "why_problematic": "The code performs a blind regex replacement on the active prompt text to swap out instructions. This creates a hidden dependency on the exact wording of the prompt template, which will break silently if the template is updated or translated."}, {"category": "blind_string_mutation", "evidence": "if marker not in current_t2i and f\"[[{char_name}]+[\" not in current_t2i: ... var[\"t2i_prompt\"] = current_t2i.rstrip() + \" \" + suffix", "line_end": 823, "line_start": 817, "recommended_fix": "Instead of post-hoc string appending, provide the required entities as a structured list to the LLM and validate the output, or use a more sophisticated prompt-merging strategy that understands the existing prompt content.", "severity": "P1", "why_problematic": "The code blindly appends character markers to the generated T2I prompt if a specific substring is missing. This can lead to semantic duplication if the LLM described the character using natural language instead of the marker, and it forces a specific visual layout ('visible in the background') regardless of the actual scene context."}], "path": "backend/app/modules/pipeline/scene_extractor_v2.py", "scan_kind": "python", "sha256": "9ead4b3967543b38bc6f0d8ec6b108a3f20681a680830b6ad10a8cef99948480"}
{"candidate_reason": "python scope discovery", "chunk_end": 3657, "chunk_start": 1, "chunk_summary": "This file defines the RenderPromptCard builder, which centralizes system-level rules (framing, ID policy, continuity) into a structured format for LLM consumption, but contains brittle keyword-based instructions and substring replacement contracts.", "duration_ms": 59576, "findings": [{"category": "blind_string_mutation", "evidence": "replace the common-noun person reference inside fixed_elements[i].description... with the matched C## or C##O##", "line_end": 1663, "line_start": 1494, "recommended_fix": "Instead of instructing the LLM to perform string replacement, provide the fixed_elements as structured context and ask the LLM to generate the prompt using the provided IDs directly, or use a structured template system where IDs are injected by code.", "severity": "P1", "why_problematic": "This establishes a contract for the LLM to perform blind substring replacement on natural-language scenario text (fixed_elements description). This is brittle and prone to errors such as partial replacements or 'phantom' character generation if the LLM fails to identify the exact noun phrase to substitute."}, {"category": "llm_closed_list_instruction", "evidence": "camera_direction specifies a vertical height/position (low / hip-height / overhead / ground level / quay level / floor level / from above) ... trigger_phrases: list(_ID_BODY_PART_TRIGGERS)", "line_end": 1191, "line_start": 582, "recommended_fix": "Perform semantic classification (e.g., framing scale, focus target) in upstream code using structured metadata or a dedicated classifier, and pass the resulting boolean flags or enums to the card builder to drive deterministic policy selection.", "severity": "P2", "why_problematic": "The prompt card offloads semantic classification of visual framing and focus to the LLM using closed keyword lists. This is brittle because it relies on the LLM matching specific phrases (e.g., 'focus on') to trigger policy changes (e.g., forbidding character IDs), which may fail if synonyms or variations are used in the scenario text."}, {"category": "scenario_dependent_prompt", "evidence": "_ID_ETHNICITY_COMPONENTS ... (e.g. 'An Asian man' / 'a woman' / 'a figure')", "line_end": 1496, "line_start": 169, "recommended_fix": "Use abstract placeholders like [ethnicity] or [demographic_descriptor] in examples, and ensure the ethnicity vocabulary is either dynamically injected based on the project's visual world rules or remains strictly neutral.", "severity": "P2", "why_problematic": "The system-level card templates contain concrete scenario pollution, specifically a bias towards 'Asian' demographics as the default or primary example for person descriptions. This biases the LLM's generation for arbitrary future scenarios that may not share this demographic context."}], "path": "backend/app/core/steps/render_prompt_card.py", "scan_kind": "python", "sha256": "d7960bcbc097897cfdc1205fc20d0a448feb49c786901023e7461f33438f221d"}
