feat(bhava-bala): reports use the formal three components; local +2/-1.5 score hidden (T4, BUG-1210)

Astrologer ruling 甲13. shadbala.calc_bhava_bala renamed calc_local_bhava_score and
removed from calc_shadbala's result (it fed the report's Bhava Bala table). New
bhava_bala.bhava_bala_from_chart (Bhavadhipati = lord's Shadbala virupas, Bhava
Dig, Bhava Drishti; equal houses as /api/bhava_bala; total and total_rupas; the
module's invented level bands not shown) drives modules.bhava_bala in the full
reading. Reader table: Bhavadhipati | Dig | Drishti | Total (Virupa) | Total
(Rupa); reference edition table and wealth/summary lines read the formal totals.
Other users of the local score: none outside shadbala.py (remedies and health
narrative read Shadbala rupas only).

Changed assertions (three columns in PROGRESS): test_shadbala_complete local-score
tests renamed; test_report_longform_gaps2 fixture rows and heading.

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-03 12:45:58 +08:00
co-authored by Claude Opus 5.5
parent ea78804b78
commit 6feb1a4aaa
7 changed files with 160 additions and 41 deletions
+7 -5
View File
@@ -1194,19 +1194,21 @@ def render_pl9_parity_markdown(packet: dict) -> str:
if str(key).isdigit() and isinstance(value, dict)
]
if bhava_rows:
# BUG-1210 (甲13): the formal three components (scripts/bhava_bala.py);
# the local +2 / -1.5 house score is never shown.
lines.extend([
'### p32 Bhava Bala 十二宫力量',
'',
'| House | Sign | Lord | Score | 关键因素 |',
'|-------|------|------|-------|----------|',
'| House | Sign | Lord | Bhavadhipati | Dig | Drishti | Total (Virupa) | Total (Rupa) |',
'|-------|------|------|--------------|-----|---------|----------------|--------------|',
])
for row in bhava_rows[:12]:
if not isinstance(row, dict):
if not isinstance(row, dict) or row.get('total') is None:
continue
factors = row.get('factors') if isinstance(row.get('factors'), list) else []
lines.append(
f"| {_cell(row.get('house') or row.get('number'))} | {_cell(_token(row.get('sign')))} | {_cell(_token(row.get('lord')))} | "
f"{_num(row.get('score'))} | {_cell(_brief(factors, 2))} |"
f"{_num(row.get('adhipathi_bala'))} | {_num(row.get('dig_bala'))} | {_num(row.get('drik_bala'))} | "
f"{_num(row.get('total'))} | {_num(row.get('total_rupas'))} |"
)
lines.append('')
friendship = _dict(strengths.get('planetary_friendship'))