fix(tajika): year lord blocked instead of Muntha-lord stand-in (BUG-1223)

Panchadhikari blocked -> status blocked + reason, year_lord None, sentence
「年主暂无法确定(原因)」 on card and report; Tri-Pataka blocked with it;
Mudda unchanged. Aligned with upstream 03bea6ed. Nine public charts: both
producers byte-identical before/after.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
Jesse_Chen
2026-10-04 07:25:48 +08:00
co-authored by Claude Opus 5.5
parent 77645ce25f
commit 7dda1b45c3
8 changed files with 249 additions and 37 deletions
+12 -11
View File
@@ -559,18 +559,15 @@ def solar_return_full_report(
result['muntha'] = {'error': str(e)}
# 3. Year Lord:Panchadhikari 选法(占星师第四轮问 3,BUG-1214)。
# 与 cmd_tajika 共用 tajika_year_lord.select_annual_year_lord;年盘不全
# (降级模式或 Muntha 缺失)时才用 Muntha 主星,并写明 fallback。
# 与 cmd_tajika 共用 tajika_year_lord.select_annual_year_lord;年盘不全时
# 返回 blocked 与原因,不用 Muntha 主星顶替(BUG-1223)。
try:
muntha_data = result.get('muntha', {})
muntha_sign_val = muntha_data.get('muntha_sign_idx') if isinstance(muntha_data, dict) else None
from tajika_year_lord import blocked_year_lord, select_annual_year_lord
if not isinstance(muntha_sign_val, int) or isinstance(muntha_sign_val, bool):
result['year_lord'] = {
'status': 'blocked',
'reason': 'muntha_sign_required_for_year_lord',
}
result['year_lord'] = blocked_year_lord('muntha_sign_required_for_year_lord')
else:
from tajika_year_lord import select_annual_year_lord
result['year_lord'] = select_annual_year_lord(
sr,
natal_asc_sign_idx=sr['birth_asc_sign_idx'],
@@ -624,11 +621,13 @@ def solar_return_full_report(
try:
from tajika import calc_tri_pataka
yl_data = result.get('year_lord', {})
yl = yl_data.get('year_lord', '')
yl = yl_data.get('year_lord') if isinstance(yl_data, dict) else None
muntha_data = result.get('muntha', {})
ms = muntha_data.get('muntha_sign_idx', 0)
tri = calc_tri_pataka(planet_lons, yl, ms)
result['tri_pataka'] = tri
if yl:
result['tri_pataka'] = calc_tri_pataka(planet_lons, yl, ms)
else: # BUG-1223: no year lord -> no Tri-Pataka (no stand-in planet).
result['tri_pataka'] = {'status': 'blocked', 'reason': 'year_lord_blocked'}
except Exception as e:
result['tri_pataka'] = {'error': str(e)}
@@ -708,8 +707,10 @@ def _make_sr_summary(result: Dict) -> str:
lines.append(f" → {muntha.get('interpretation','')[:60]}")
yl = result.get('year_lord', {})
if 'year_lord' in yl:
if yl.get('year_lord'):
lines.append(f" Year Lord:{yl['year_lord']}")
elif yl.get('selection_basis_text'):
lines.append(f" Year Lord:{yl['selection_basis_text']}")
tp = result.get('tri_pataka', {})
if 'verdict' in tp: