fix: align combustion thresholds across engine (upstream 080c286c, adapted)

One direct / retrograde orb table (Moon included) in the shared
COMBUSTION_ORBS / is_combust, used by the full reading and the consultation
graha-drishti layer. TASK-upstream-sync5-20261002 U3.

(cherry picked from commit 080c286c, resolved onto our shared helper)

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:15 +08:00
co-authored by Claude Opus 5.5
parent 765ff66ce5
commit cf78d4ca21
3 changed files with 38 additions and 11 deletions
+1 -1
View File
@@ -643,7 +643,7 @@ def build_graha_drishti(engine, chart: dict) -> dict:
for name in DRISHTI_CASTERS:
lon = _planet_lon(planets.get(name))
if lon is not None and name in rows:
rows[name]["combust"] = bool(engine.is_combust(name, lon, sun_lon))
rows[name]["combust"] = bool(engine.is_combust(name, lon, sun_lon, bool(_record(planets.get(name)).get("retrograde"))))
for row in rows.values():
row.pop("house", None)
return {
+22 -4
View File
@@ -10730,13 +10730,29 @@ def _oracle_progress_snapshot():
# and Ketu have no orb here; the Sun is never combust. Shared with the web
# consultation layer (consultation_native_layers.build_graha_drishti) so both
# read the same rule (BUG-1154).
COMBUSTION_ORBS = {'Mars': 17, 'Mercury': 12, 'Jupiter': 11, 'Venus': 10, 'Saturn': 15}
# Upstream yinduzhanxing 080c286c (sync5 U3): one direct / retrograde orb
# table for the whole engine, the Moon included.
COMBUSTION_ORBS = {
'Moon': {'direct': 12, 'retrograde': 12},
'Mars': {'direct': 17, 'retrograde': 10},
'Mercury': {'direct': 14, 'retrograde': 12},
'Jupiter': {'direct': 11, 'retrograde': 10},
'Venus': {'direct': 10, 'retrograde': 8},
'Saturn': {'direct': 15, 'retrograde': 10},
}
def is_combust(planet_name, longitude, sun_longitude):
def combustion_threshold(planet_name, retrograde=False):
"""Orb in degrees for `planet_name` (None when the body has no orb)."""
profile = COMBUSTION_ORBS.get(planet_name)
return profile['retrograde' if retrograde else 'direct'] if profile else None
def is_combust(planet_name, longitude, sun_longitude, retrograde=False):
"""True when `planet_name` is within its combustion orb of the Sun."""
separation = abs(((float(longitude) - float(sun_longitude) + 180) % 360) - 180)
return planet_name != 'Sun' and separation <= COMBUSTION_ORBS.get(planet_name, 0)
threshold = combustion_threshold(planet_name, retrograde)
return planet_name != 'Sun' and threshold is not None and separation <= threshold
def _functional_benefic_malefic_snapshot(planets, ascendant):
@@ -16369,7 +16385,9 @@ def cmd_full_reading(args):
if longitude is None:
continue
planet.update(get_kp_lords(float(longitude)))
planet['combust'] = is_combust(planet_name, float(longitude), sun_longitude)
retrograde = bool(planet.get('retrograde'))
planet['combust'] = is_combust(planet_name, float(longitude), sun_longitude, retrograde)
planet['combustion_threshold_degrees'] = combustion_threshold(planet_name, retrograde)
planet['r_c'] = 'R' if planet.get('retrograde') else 'C' if planet['combust'] else ''
strength = sb_planets.get(planet_name) if isinstance(sb_planets.get(planet_name), dict) else {}
if strength: