fix: bound Budhaditya yoga under combustion (upstream 994638f0, Budha-Aditya part only)

A combust Mercury keeps the Budha-Aditya formation visible but downgrades it
to conditional. Upstream's other card-gating fields in the same hunk come
from separate commits and are not taken. TASK-upstream-sync5-20261002 U7.

(cherry picked from commit 994638f0)

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-02 23:40:55 +08:00
co-authored by Claude Opus 5.5
parent 5172620c72
commit 45d6dbf6ca
2 changed files with 44 additions and 0 deletions
+15
View File
@@ -744,6 +744,21 @@ class YogaEngine:
"effects_en": list(rule.get("effects_en") or rule.get("effects", [])),
"strength_en": rule.get("strength_en") if strength == rule.get("strength") and rule.get("strength_en") else STRENGTH_EN.get(str(strength), str(strength)),
}
# Budha-Aditya is a conjunction witness, but a combust
# Mercury must not be presented as an unqualified full yoga
# (upstream yinduzhanxing 994638f0; sync5 U7).
if rule.get('id') == 'budhaditya_yoga':
mercury = ctx.planets.get('Mercury') or {}
if mercury.get('combust') is True:
entry['condition_status'] = 'combustion_requires_review'
entry['traditional_effects'] = entry['effects']
entry['effects'] = []
entry['strength'] = 'conditional'
entry['combustion_witness'] = {
'planet': 'Mercury',
'combust': True,
'claim_boundary': 'Do not treat Budha-Aditya as an unqualified benefic result while Mercury is combust.'
}
dedup_key = rule.get("dedup_key") or rule["name"]
dedup_val = f"{dedup_key}:{m.get('combination', '')}"
if dedup_val in seen_dedup:
+29
View File
@@ -0,0 +1,29 @@
from scripts.yoga_engine import YogaEngine
def test_budhaditya_with_combust_mercury_is_conditional():
engine = YogaEngine('references/yoga_rules.json')
planets = {
'Sun': {'sign': 'Aries', 'house': 1},
'Mercury': {'sign': 'Aries', 'house': 1, 'combust': True},
}
rows = [row for row in engine.detect(planets, 'Aries') if row['rule_id'] == 'budhaditya_yoga']
assert len(rows) == 1
row = rows[0]
assert row['condition_status'] == 'combustion_requires_review'
assert row['effects'] == []
assert row['traditional_effects']
assert row['strength'] == 'conditional'
assert row['combustion_witness']['planet'] == 'Mercury'
def test_budhaditya_without_combustion_keeps_traditional_effects():
engine = YogaEngine('references/yoga_rules.json')
planets = {
'Sun': {'sign': 'Aries', 'house': 1},
'Mercury': {'sign': 'Aries', 'house': 1, 'combust': False},
}
rows = [row for row in engine.detect(planets, 'Aries') if row['rule_id'] == 'budhaditya_yoga']
assert len(rows) == 1
assert rows[0]['effects']
assert 'combustion_witness' not in rows[0]