feat(product): present consult and rectification in local skill form
Independent Staging Quality Gate / validate (push) Failing after 6m42s
Independent Staging Quality Gate / publish (push) Has been skipped

Default ayanamsa to Raman with true_pushya support, attach governed Raman packets, restore Path C questionnaires and eight-method verification copy, and keep unique-minute confirmation blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-20 21:42:47 +08:00
co-authored by Cursor
parent f8569c5c65
commit 8010245981
83 changed files with 2881 additions and 270 deletions
+40 -10
View File
@@ -3,6 +3,9 @@
Swiss Ephemeris stores sidereal mode globally inside the process. Any helper
that calls calc_ut(..., FLG_SIDEREAL) must set the intended mode explicitly.
Unknown names fail; they never silently collapse to Lahiri. VedAstro / oracle
comparison fixtures must pass an explicit `lahiri` name.
"""
from __future__ import annotations
@@ -24,6 +27,7 @@ AYANAMSA_MODES = {
'djwhal_khul': getattr(swe, 'SIDM_DJWHAL_KHUL', 6) if swe else 6,
'sassanian': getattr(swe, 'SIDM_SASSANIAN', 16) if swe else 16,
'true_citra': getattr(swe, 'SIDM_TRUE_CITRA', 27) if swe else 27,
'true_pushya': getattr(swe, 'SIDM_TRUE_PUSHYA', 29) if swe else 29,
}
AYANAMSA_DISPLAY_NAMES = {
@@ -35,16 +39,44 @@ AYANAMSA_DISPLAY_NAMES = {
'djwhal_khul': 'Djwhal Khul',
'sassanian': 'Sassanian',
'true_citra': 'True Citra',
'true_pushya': 'True Pushya',
}
ACTIVE_AYANAMSA_NAME = 'lahiri'
DEFAULT_AYANAMSA_NAME = 'raman'
ACTIVE_AYANAMSA_NAME = DEFAULT_AYANAMSA_NAME
class UnsupportedAyanamsaError(ValueError):
"""Raised when a caller asks for an ayanamsa that is not in AYANAMSA_MODES."""
def _canonical_ayanamsa_key(name: Any) -> str:
key = str(name or '').strip().lower().replace('-', '_')
if key in ('krishnamurti_paddhati', 'krishnamurti/kp'):
key = 'kp'
if key == 'true_chitra':
key = 'true_citra'
return key
def is_supported_ayanamsa_name(name: Any = None) -> bool:
key = _canonical_ayanamsa_key(name if name not in (None, '') else DEFAULT_AYANAMSA_NAME)
return key in AYANAMSA_MODES
def supported_ayanamsa_names() -> list[str]:
return sorted(AYANAMSA_MODES)
def normalize_ayanamsa_name(name: Any = None) -> str:
key = str(name or 'lahiri').strip().lower().replace('-', '_')
if key in ('krishnamurti_paddhati', 'krishnamurti/kp'):
key = 'kp'
return key if key in AYANAMSA_MODES else 'lahiri'
if name is None or (isinstance(name, str) and not name.strip()):
return DEFAULT_AYANAMSA_NAME
key = _canonical_ayanamsa_key(name)
if key not in AYANAMSA_MODES:
raise UnsupportedAyanamsaError(
f"unsupported ayanamsa name {name!r}; supported: {', '.join(supported_ayanamsa_names())}"
)
return key
def ayanamsa_display_name(name: Any = None) -> str:
@@ -54,12 +86,11 @@ def ayanamsa_display_name(name: Any = None) -> str:
def current_ayanamsa_name(args: Any = None) -> str:
name = getattr(args, 'ayanamsa', None) if args is not None else None
return normalize_ayanamsa_name(name or ACTIVE_AYANAMSA_NAME)
return normalize_ayanamsa_name(name)
def apply_ayanamsa(name: Any = 'lahiri', swe_module: Any = None) -> bool:
def apply_ayanamsa(name: Any = None, swe_module: Any = None) -> bool:
"""Set Swiss Ephemeris sidereal mode explicitly."""
global ACTIVE_AYANAMSA_NAME
module = swe_module or swe
if module is None:
return False
@@ -68,10 +99,9 @@ def apply_ayanamsa(name: Any = 'lahiri', swe_module: Any = None) -> bool:
module.set_sid_mode(AYANAMSA_MODES[key])
except Exception:
return False
ACTIVE_AYANAMSA_NAME = key
return True
def sidereal_flags(swe_module: Any, ayanamsa_name: Any = 'lahiri') -> int:
def sidereal_flags(swe_module: Any, ayanamsa_name: Any = None) -> int:
apply_ayanamsa(ayanamsa_name, swe_module)
return getattr(swe_module, 'FLG_SWIEPH', 2) | getattr(swe_module, 'FLG_SIDEREAL', 65536)