feat(upstream): merge a6f47abd engine, MCP, and orchestrator
Three-way-merge calculation modules and pl9-export into the product fork while keeping commercial API routes, Raman ayanamsa, and the consultation contract as a keypath superset. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+46
-18
@@ -27,6 +27,41 @@ def _nearest_aspect(delta: float) -> tuple[float, float]:
|
||||
return min(candidates, key=lambda item: abs(item[1]))
|
||||
|
||||
|
||||
def evaluate_tajika_pair(
|
||||
left: str,
|
||||
right: str,
|
||||
planets: dict[str, dict[str, Any]],
|
||||
) -> dict[str, Any] | None:
|
||||
"""Return the shared motion/orb contract for one seven-planet Tajika pair."""
|
||||
if left not in planets or right not in planets:
|
||||
return None
|
||||
left_payload = planets[left]
|
||||
right_payload = planets[right]
|
||||
if not isinstance(left_payload, dict) or not isinstance(right_payload, dict):
|
||||
return None
|
||||
if "longitude" not in left_payload or "longitude" not in right_payload:
|
||||
return None
|
||||
if "speed" not in left_payload or "speed" not in right_payload:
|
||||
return None
|
||||
|
||||
left_lon, right_lon = float(left_payload["longitude"]) % 360, float(right_payload["longitude"]) % 360
|
||||
aspect, residual = _nearest_aspect(right_lon - left_lon)
|
||||
orb = (DEEPTAMSA[left] + DEEPTAMSA[right]) / 2.0
|
||||
if abs(residual) > orb:
|
||||
return None
|
||||
relative_speed = float(right_payload["speed"]) - float(left_payload["speed"])
|
||||
future_residual = _signed_angle(residual + relative_speed)
|
||||
applying = abs(future_residual) < abs(residual)
|
||||
return {
|
||||
"planets": [left, right],
|
||||
"aspect": abs(aspect),
|
||||
"residual": round(residual, 6),
|
||||
"average_deeptamsa": orb,
|
||||
"motion": "applying" if applying else "separating",
|
||||
"within_deeptamsa": True,
|
||||
}
|
||||
|
||||
|
||||
def calculate_tajika_interactions(planets: dict[str, dict[str, Any]]) -> dict[str, Any]:
|
||||
missing = [planet for planet in SEVEN_PLANETS if planet not in planets or "longitude" not in planets[planet] or "speed" not in planets[planet]]
|
||||
if missing:
|
||||
@@ -40,22 +75,9 @@ def calculate_tajika_interactions(planets: dict[str, dict[str, Any]]) -> dict[st
|
||||
interactions = []
|
||||
for index, left in enumerate(SEVEN_PLANETS):
|
||||
for right in SEVEN_PLANETS[index + 1:]:
|
||||
left_lon, right_lon = float(planets[left]["longitude"]) % 360, float(planets[right]["longitude"]) % 360
|
||||
aspect, residual = _nearest_aspect(right_lon - left_lon)
|
||||
orb = (DEEPTAMSA[left] + DEEPTAMSA[right]) / 2.0
|
||||
if abs(residual) > orb:
|
||||
continue
|
||||
relative_speed = float(planets[right]["speed"]) - float(planets[left]["speed"])
|
||||
future_residual = _signed_angle(residual + relative_speed)
|
||||
applying = abs(future_residual) < abs(residual)
|
||||
interactions.append({
|
||||
"planets": [left, right],
|
||||
"aspect": abs(aspect),
|
||||
"residual": round(residual, 6),
|
||||
"average_deeptamsa": orb,
|
||||
"motion": "applying" if applying else "separating",
|
||||
"within_deeptamsa": True,
|
||||
})
|
||||
pair = evaluate_tajika_pair(left, right, planets)
|
||||
if pair is not None:
|
||||
interactions.append(pair)
|
||||
return {
|
||||
"scope": "tajika_seven_planet_kernel",
|
||||
"status": "partial",
|
||||
@@ -74,6 +96,12 @@ def calculate_tajika_interactions(planets: dict[str, dict[str, Any]]) -> dict[st
|
||||
}
|
||||
for row in interactions
|
||||
],
|
||||
"blocked_named_yogas": ["Nakta", "Yamaya", "Manahoo", "Kamboola", "Ithasala/Easarapha adjudication"],
|
||||
"boundary": "Candidate labels are derived only from seven-planet aspect, Deeptamsa and applying/separating evidence. Full named-yoga chains and event verdicts remain blocked pending classic golden cases.",
|
||||
"supported_named_yogas": ["Ithasala", "Easarapha"],
|
||||
"blocked_named_yogas": ["Nakta", "Yamaya", "Manahoo", "Kamboola"],
|
||||
"authority_lane": "scripts/tajika_named_yoga_authority.py",
|
||||
"boundary": (
|
||||
"Seven-planet aspect, Deeptamsa, and applying/separating evidence are "
|
||||
"admissible for governed Ithasala/Easarapha authority. Broader named-yoga "
|
||||
"chains and event verdicts remain blocked pending classic golden cases."
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user