英文漏译改在渲染侧查表,测试不再放行 PyJHora 子进程。

冻结的 jaimini.py 恢复成 staging 原样。缺译单元格写成固定标记,不再留空。

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-22 09:58:09 +08:00
co-authored by Grok (agent loop) Cursor
parent 7876c0b4ac
commit adfa98bf97
11 changed files with 378 additions and 89 deletions
+23 -15
View File
@@ -2072,22 +2072,20 @@ def _render_pl9_ai_density_raw_data_markdown_en(packet: dict) -> str:
english_report = _pl9_report_language(packet) == "en"
strength_en_map: dict[str, str] = {}
han_leaks = None
if english_report:
try:
from yoga_engine import STRENGTH_EN as strength_en_map
except ImportError:
from scripts.yoga_engine import STRENGTH_EN as strength_en_map
try:
from pl9_reader_english import HAN as han_leaks
from report_render.english_gaps import english_effects, first_clean_english
except ImportError:
from scripts.pl9_reader_english import HAN as han_leaks
from scripts.report_render.english_gaps import english_effects, first_clean_english
def _english_plain(value: Any) -> str:
text = str(value or "").strip()
if not text or (han_leaks is not None and han_leaks.search(text)):
return ""
return text
def _english_plain(value: Any, field: str, chinese: Any = None, fallback: Any = None) -> str:
if not english_report:
return str(value or "").strip()
return first_clean_english(value, fallback, field=field, chinese=chinese)
yoga = dict_get(("advanced_systems", "yoga", "detected_yogas"), [])
if isinstance(yoga, list):
@@ -2095,12 +2093,18 @@ def _render_pl9_ai_density_raw_data_markdown_en(packet: dict) -> str:
for item in yoga:
if isinstance(item, dict):
if english_report:
effects_src = item.get("effects_en") if isinstance(item.get("effects_en"), list) else []
effects = [text for text in (_english_plain(effect) for effect in effects_src) if text]
combination = _english_plain(item.get("combination_en")) or "-"
strength = _english_plain(item.get("strength_en"))
if not strength:
strength = _english_plain(strength_en_map.get(str(item.get("strength") or ""), ""))
effects = english_effects(item.get("effects_en"), item.get("effects"))
combination = _english_plain(
item.get("combination_en"),
"combination",
item.get("combination"),
) or "-"
strength = _english_plain(
item.get("strength_en"),
"strength",
item.get("strength"),
strength_en_map.get(str(item.get("strength") or ""), ""),
) or "-"
else:
effects = [effect for effect in (clean_effect(e) for e in item.get("effects", [])) if effect]
combination = item.get("combination")
@@ -2122,7 +2126,11 @@ def _render_pl9_ai_density_raw_data_markdown_en(packet: dict) -> str:
item = dosha.get(key)
if isinstance(item, dict):
if english_report:
summary = _english_plain(item.get("summary_en")) or "-"
summary = _english_plain(
item.get("summary_en"),
"summary",
item.get("summary"),
) or "-"
else:
summary = item.get("summary") or item.get("phase") or item.get("type")
rows.append([