fix(arudha): sign-only coordinates, no invented degree (BUG-1477, upstream 8b55630a)
Arudha, A10, and Upapada report the sign and house only. Rectification still reads Bhava, Hora, and Ghati degrees plus frozen jaimini padas. Sealed 20-case replay and 900 reported-offset windows match the sync8 metrics line for line. Frozen-file hash matched. Co-Authored-By: Grok (agent loop)
This commit is contained in:
co-authored by
Grok (agent loop)
parent
c1bd59e97a
commit
bd09485243
@@ -15532,12 +15532,11 @@ def cmd_full_reading(args):
|
||||
pada = _padas.get(key)
|
||||
if not pada:
|
||||
return {"error": f"jaimini.calc_arudha_padas 未给出 {key}"}
|
||||
lord_deg = planet_lons.get(pada['source_house_lord'], 0)
|
||||
degree = (pada['sign_idx'] * 30 + (lord_deg % 30)) % 360
|
||||
return {
|
||||
"degree": round(degree, 4),
|
||||
"degree": None,
|
||||
"coordinate_basis": "sign_only_arudha",
|
||||
"sign": pada['sign'],
|
||||
"sign_degree": round(degree % 30, 4),
|
||||
"sign_degree": None,
|
||||
"house": ((pada['sign_idx'] - asc_idx) % 12) + 1,
|
||||
"distance_from_source": pada['distance'],
|
||||
"exception_applied": pada['exception_triggered'],
|
||||
|
||||
@@ -254,13 +254,14 @@ class SpecialLagnasCalculator:
|
||||
pada_sign = (pada_sign + 9) % 12
|
||||
exception_applied = True
|
||||
|
||||
pada_degree = (pada_sign * 30 + (source_lord_degree % 30)) % 360
|
||||
# Sign counting determines a sign, not a longitude inside that sign.
|
||||
return {
|
||||
"label": label,
|
||||
"source_house": source_house,
|
||||
"degree": round(pada_degree, 4),
|
||||
"degree": None,
|
||||
"coordinate_basis": "sign_only_arudha",
|
||||
"sign": self.SIGNS[pada_sign],
|
||||
"sign_degree": round(pada_degree % 30, 4),
|
||||
"sign_degree": None,
|
||||
"house": ((pada_sign - asc_sign) % 12) + 1,
|
||||
"source_sign": self.SIGNS[source_sign],
|
||||
"source_lord_sign": self.SIGNS[lord_sign],
|
||||
@@ -284,6 +285,10 @@ class SpecialLagnasCalculator:
|
||||
lines.append(f"{lagna_name}:")
|
||||
if "note" in data:
|
||||
lines.append(f" {data['note']}")
|
||||
elif data.get("coordinate_basis") == "sign_only_arudha":
|
||||
lines.append(f" Position: {data['sign']} (sign-level result); house {data['house']}")
|
||||
lines.append(f" Formula: {data['formula']}")
|
||||
lines.append(f" Meaning: {data['meaning']}")
|
||||
else:
|
||||
lines.append(f" Position: {data['sign']} {data['sign_degree']:.2f}° ({data['degree']:.2f}°)")
|
||||
lines.append(f" Formula: {data['formula']}")
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
"""Arudha counting yields a sign, not a fabricated intra-sign longitude.
|
||||
|
||||
Upstream calls calculate_arudha_lagna / calculate_upapada_lagna. This tree's
|
||||
names are calculate_arudha_pada (house 1 and house 12) and calculate_a10.
|
||||
"""
|
||||
|
||||
from scripts.special_lagnas import SpecialLagnasCalculator
|
||||
|
||||
|
||||
def test_arudha_outputs_are_explicitly_sign_level() -> None:
|
||||
calculator = SpecialLagnasCalculator()
|
||||
rows = (
|
||||
calculator.calculate_arudha_pada(15.0, 1, 95.0),
|
||||
calculator.calculate_a10(15.0, 215.0),
|
||||
calculator.calculate_arudha_pada(15.0, 12, 305.0, "Upapada"),
|
||||
)
|
||||
|
||||
for row in rows:
|
||||
assert row["coordinate_basis"] == "sign_only_arudha"
|
||||
assert row["degree"] is None
|
||||
assert row["sign_degree"] is None
|
||||
|
||||
|
||||
def test_sign_level_arudha_is_not_rendered_as_a_degree() -> None:
|
||||
calculator = SpecialLagnasCalculator()
|
||||
arudha = calculator.calculate_arudha_pada(15.0, 1, 95.0)
|
||||
rendered = calculator.format_output({"Arudha_Lagna": arudha})
|
||||
|
||||
assert "sign-level result" in rendered
|
||||
assert "None°" not in rendered
|
||||
Reference in New Issue
Block a user