feat: enforce commercial Jyotish workflow contracts

This commit is contained in:
732642856
2026-07-19 09:00:14 +08:00
parent 3d6d498892
commit 8b608781c9
14 changed files with 470 additions and 16 deletions
+31
View File
@@ -0,0 +1,31 @@
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def run(*args: str) -> subprocess.CompletedProcess[str]:
return subprocess.run(
[sys.executable, *args],
cwd=ROOT,
text=True,
capture_output=True,
timeout=120,
check=False,
)
def test_ashtakavarga_compare_uses_repository_scripts_and_public_baselines() -> None:
baseline = run("benchmarks/jyotish/scripts/run_pyjhora_compare.py", "--build-local", "--output-prefix", "ashtakavarga_contract")
assert baseline.returncode == 0, baseline.stderr or baseline.stdout
comparison = run("benchmarks/jyotish/scripts/run_ashtakavarga_compare.py")
assert comparison.returncode == 0, comparison.stderr or comparison.stdout
report = ROOT / "benchmarks/jyotish/outputs/jyotish_benchmark_round6_ashtakavarga_compare.md"
assert report.exists()
assert "BAV" in report.read_text(encoding="utf-8")
+23
View File
@@ -0,0 +1,23 @@
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_shadbala_compare_supports_installed_pyjhora_api() -> None:
completed = subprocess.run(
[sys.executable, "benchmarks/jyotish/scripts/run_shadbala_compare.py"],
cwd=ROOT,
text=True,
capture_output=True,
timeout=90,
check=False,
)
assert completed.returncode == 0, completed.stderr or completed.stdout
assert "Shadbala Benchmark" in completed.stdout
assert "Total planets: 35" in completed.stdout