From a1c7f6ce6771438debf0f41d7f5f28884fecb402 Mon Sep 17 00:00:00 2001 From: jesse-ux Date: Thu, 22 Oct 2026 00:56:10 +0800 Subject: [PATCH] feat: attach Goel Jaimini strength to jaimini and full-reading Issue #94 T3. Add _goel_jaimini_evidence and merge it for jaimini modes all/special and before modules.jaimini is stored. Goel failures are logged and returned as blocked so they cannot drop the jaimini module. cmd_jaimini passes degree_raw, falling back to degree. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor --- scripts/jyotish_engine.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/scripts/jyotish_engine.py b/scripts/jyotish_engine.py index d3332577..ff8e4de8 100644 --- a/scripts/jyotish_engine.py +++ b/scripts/jyotish_engine.py @@ -14339,6 +14339,39 @@ def cmd_aspects(args): # ============================================================================ # 17. Jaimini系统(v3.7新增) # ============================================================================ +def _goel_jaimini_evidence(planet_longitudes, ascendant_longitude): + """Shared CLI/full-reading view of the source-bounded Goel producer. + + Failures stay inside this helper. A Goel error must not escape into the + full-reading ``except Exception`` that drops the whole jaimini module. + """ + try: + from scripts.goel_jaimini_strength import build_goel_chart_evidence + goel = build_goel_chart_evidence(planet_longitudes, ascendant_longitude) + fields = { + 'goel_full_strength': goel['strength'], + 'goel_special_points': goel['special_points'], + } + for key in ('lagna_seventh_strength', 'niryaana_shoola_strength'): + if key in goel: + fields[key] = goel[key] + return fields + except (ImportError, KeyError, TypeError, ValueError) as exc: + logger.warning( + "Goel Jaimini strength failed: %s: %s", + exc.__class__.__name__, + exc, + ) + reason = f'{exc.__class__.__name__}: {exc}' + return { + 'goel_full_strength': {'status': 'blocked', 'reason': reason}, + 'goel_special_points': { + name: {'status': 'blocked', 'reason': reason} + for name in ('Brahma', 'Maheshwara', 'Rudra') + }, + } + + def cmd_jaimini(args): chart, asc_idx, jd, ayanamsa = _compute_chart_from_args(args) if chart is None: @@ -14411,6 +14444,11 @@ def cmd_jaimini(args): result['graha_padas'] = calc_graha_padas(planet_lons) if mode in ('all', 'special'): result['special_lagnas'] = calc_special_lagnas(asc_idx, args.hour, args.minute + _arg_second(args) / 60.0) + goel_lons = {} + for pn, pd in planets.items(): + if isinstance(pd, dict) and 'degree' in pd: + goel_lons[pn] = pd.get('degree_raw', pd['degree']) + result.update(_goel_jaimini_evidence(goel_lons, asc_deg)) return _build_response_envelope('jaimini', result, args=args, execution_status='executed') @@ -16283,6 +16321,7 @@ def cmd_full_reading(args): except Exception as dk_e: jaimini_result['darakaraka'] = {'error': str(dk_e)} + jaimini_result.update(_goel_jaimini_evidence(planet_lons, asc_deg)) report['modules']['jaimini'] = jaimini_result except Exception as e: report['errors'].append(f"jaimini: {e}")