From 360c4b94d9dcc7b5269cf3d9f5d7c871d1fd5ce2 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Sun, 19 Jul 2026 21:37:03 +0800 Subject: [PATCH] feat: sync vedicastro kp runtime surface --- .../evidence_packet_index_2026_07_19.json | 14 ++- ...lib_sidereal_install_probe_2026_07_19.json | 29 +++-- ...o_kp_runtime_surface_probe_2026_07_19.json | 61 +++++++++ scripts/vedicastro_kp_api_probe.py | 118 ++++++++++++++++++ tests/test_vedicastro_kp_runtime_tmp_probe.py | 30 +++++ ...stro_node_and_worked_example_candidates.py | 18 ++- 6 files changed, 254 insertions(+), 16 deletions(-) create mode 100644 references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json create mode 100644 scripts/vedicastro_kp_api_probe.py create mode 100644 tests/test_vedicastro_kp_runtime_tmp_probe.py diff --git a/references/oracle/evidence_packet_index_2026_07_19.json b/references/oracle/evidence_packet_index_2026_07_19.json index 8d7a05ec..a296eb5c 100644 --- a/references/oracle/evidence_packet_index_2026_07_19.json +++ b/references/oracle/evidence_packet_index_2026_07_19.json @@ -5,7 +5,7 @@ "production_tuning_allowed": false, "boundary": "Index of current governance packets only. Raw oracle artifacts remain in references/oracle/artifacts and are not all duplicated here.", "summary": { - "packet_count": 50, + "packet_count": 51, "blocked_or_partial_count": 40, "human_review_required_count": 1 }, @@ -398,9 +398,9 @@ "packet_id": "vedicastro_flatlib_sidereal_install_probe", "path": "references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json", "domain": "kp_precision_timing_dependency", - "claim_status": "blocked", + "claim_status": "observation_only", "consumer_policy": "research_to_commercial_contract_only", - "claim_boundary": "VedicAstro KP runtime probe is blocked by reproducible sidereal flatlib dependency; source/API surface evidence remains observation-only." + "claim_boundary": "Sidereal flatlib dependency is reproducibly installable in a temporary isolated path and the VedicAstro KP API surface is callable; this remains observation_only and must not enter truth matrix until numeric worked-example replay closes." }, { "packet_id": "vedicastro_kp_api_probe_flatlib_polars_tmp", @@ -409,6 +409,14 @@ "claim_status": "observation_only", "consumer_policy": "research_to_commercial_contract_only", "claim_boundary": "Temporary flatlib/polars VedicAstro KP probe captures dependency/import state only; no runtime truth upgrade." + }, + { + "packet_id": "vedicastro_kp_runtime_surface_probe", + "path": "references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json", + "domain": "kp_precision_timing_dependency", + "claim_status": "observation_only", + "consumer_policy": "research_to_commercial_contract_only", + "claim_boundary": "VedicAstro KP lord/sub/sub-sub runtime surface is callable in isolated sidereal flatlib environment; no precision-timing truth upgrade until public numeric KP worked-example replay closes." } ] } diff --git a/references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json b/references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json index 73732684..ca2edbea 100644 --- a/references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json +++ b/references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json @@ -1,14 +1,23 @@ { - "scope": "vedicastro_flatlib_sidereal_install_probe", + "attempted_package": "git+https://github.com/diliprk/flatlib.git@sidereal", + "boundary": "Sidereal flatlib dependency is reproducibly installable in a temporary isolated path and the VedicAstro KP API surface is callable; this remains observation_only and must not enter truth matrix until numeric worked-example replay closes.", + "claim_status": "observation_only", "created_at": "2026-07-19", - "status": "blocked_timeout", - "claim_status": "blocked", - "production_tuning_allowed": false, - "truth_matrix_allowed": false, - "temporary_target": "/tmp/vedicastro_sidereal_flatlib_probe", - "attempted_package": "git+https://github.com/flatangle/flatlib.git@sidereal", - "observed_blocker": "pip install exceeded 120s command budget", + "next_action": "Collect public numeric KP cusp/star/sub/sub-sub worked examples before promoting beyond observation_only.", + "observed_flatlib_commit": "2618c348ce1ab2588548f935ff65f031630b4872", "previous_pypi_flatlib_blocker": "PyPI flatlib 0.2.3 has no flatlib.const AY_* attributes required by local VedicAstro source.", - "next_action": "Pin a prebuilt sidereal-compatible flatlib wheel or cache the Git checkout before runtime API proof.", - "boundary": "VedicAstro KP source/API surface remains pinned, but runtime readiness is blocked until sidereal flatlib dependency is reproducible." + "production_tuning_allowed": false, + "resolved_blocker": "Previous timeout came from probing the wrong sidereal repository path; VedicAstro requirements specify diliprk/flatlib.git@sidereal.", + "runtime_artifact": "references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json", + "runtime_artifact_sha256": "76b4a0e273a4d5874fe2109401a77f79f0cfec75f218d4fa0c4a7738615c5e03", + "runtime_environment": { + "flatlib": "0.3.1.dev0", + "polars": "1.42.1", + "polars-runtime-32": "1.42.1", + "timezonefinder": "8.2.5" + }, + "scope": "vedicastro_flatlib_sidereal_install_probe", + "status": "partial_runtime_surface_available", + "temporary_target": "/tmp/vedicastro_sidereal_flatlib_probe.Nt8ANZ", + "truth_matrix_allowed": false } diff --git a/references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json b/references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json new file mode 100644 index 00000000..f63061db --- /dev/null +++ b/references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json @@ -0,0 +1,61 @@ +{ + "api_surface": { + "class": "VedicHoroscopeData", + "fields": [ + "Nakshatra", + "NakshatraLord", + "SubLord", + "SubSubLord", + "house_sub_lord", + "house_ss_lord" + ], + "methods": [ + "get_rl_nl_sl_data", + "get_planets_data_from_chart", + "get_houses_data_from_chart", + "generate_chart" + ] + }, + "boundary": "KP Rashi/Nakshatra/Sub/SubSub API surface is callable in an isolated dependency path; this is still observation_only until public numeric KP worked examples and replay hashes are archived.", + "claim_status": "observation_only", + "created_at": "2026-07-19", + "dependency_identity": { + "flatlib": { + "version": "0.3.1.dev0" + }, + "observed_pinned_flatlib_commit": "2618c348ce1ab2588548f935ff65f031630b4872", + "polars": { + "version": "1.42.1" + }, + "required_flatlib_source": "git+https://github.com/diliprk/flatlib.git@sidereal", + "timezonefinder": { + "version": "8.2.5" + } + }, + "production_tuning_allowed": false, + "raw_sha256": "41eca67e8347aaf8fb2b29ce0a304fadc9b4fe567edeeddbbe76dd52f6ca49e7", + "runtime_probe": { + "attempted": true, + "class_present": true, + "import_status": "success", + "method_present": true, + "sample_degree": 0.0, + "sample_rl_nl_sl": { + "Nakshatra": "Ashwini", + "NakshatraLord": "Ketu", + "Pada": 1, + "RasiLord": "Mars", + "SubLord": "Ketu", + "SubSubLord": "Ketu" + }, + "sidereal_ayanamsa_constants_present": [ + "AY_LAHIRI", + "AY_KRISHNAMURTI" + ] + }, + "scope": "vedicastro_kp_api_probe", + "source_path": "references/open_source_sources/VedicAstro/vedicastro/VedicAstro.py", + "source_sha256": "1469c89a28dd4de6e576c2c4bd907902ee45d8a261b22836ea45503af369fa1d", + "status": "partial_runtime_surface_available", + "truth_matrix_allowed": false +} diff --git a/scripts/vedicastro_kp_api_probe.py b/scripts/vedicastro_kp_api_probe.py new file mode 100644 index 00000000..f489c174 --- /dev/null +++ b/scripts/vedicastro_kp_api_probe.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 +"""Probe local VedicAstro KP API surface in isolation. + +Does not require dependencies to be present. If import/runtime is unavailable, +returns a blocked observation artifact with source hashes. +""" +from __future__ import annotations + +import hashlib +import importlib.metadata +import json +import sys +from pathlib import Path +from typing import Any + + +ROOT = Path(__file__).resolve().parents[1] +SRC = ROOT / "references/open_source_sources/VedicAstro" +API = SRC / "vedicastro/VedicAstro.py" + + +def sha256(path: Path) -> str | None: + return hashlib.sha256(path.read_bytes()).hexdigest() if path.exists() else None + + +def _package_version(name: str) -> str | None: + try: + return importlib.metadata.version(name) + except importlib.metadata.PackageNotFoundError: + return None + + +def main() -> int: + payload: dict[str, Any] = { + "scope": "vedicastro_kp_api_probe", + "created_at": "2026-07-19", + "status": "blocked_or_partial", + "claim_status": "observation_only", + "production_tuning_allowed": False, + "truth_matrix_allowed": False, + "source_path": str(API.relative_to(ROOT)), + "source_sha256": sha256(API), + "api_surface": { + "class": "VedicHoroscopeData", + "methods": [ + "get_rl_nl_sl_data", + "get_planets_data_from_chart", + "get_houses_data_from_chart", + "generate_chart", + ], + "fields": [ + "Nakshatra", + "NakshatraLord", + "SubLord", + "SubSubLord", + "house_sub_lord", + "house_ss_lord", + ], + }, + "dependency_identity": { + "flatlib": {"version": _package_version("flatlib")}, + "polars": {"version": _package_version("polars")}, + "timezonefinder": {"version": _package_version("timezonefinder")}, + "required_flatlib_source": "git+https://github.com/diliprk/flatlib.git@sidereal", + "observed_pinned_flatlib_commit": "2618c348ce1ab2588548f935ff65f031630b4872", + }, + "runtime_probe": {"attempted": True}, + "boundary": "Source/API surface hash only unless runtime dependencies and public numeric KP worked examples are both available.", + } + try: + sys.path.insert(0, str(SRC)) + from flatlib import const as flatlib_const # type: ignore + from vedicastro.VedicAstro import VedicHoroscopeData # type: ignore + + cls = VedicHoroscopeData + ayanamsa_constants = [ + name for name in ("AY_LAHIRI", "AY_KRISHNAMURTI") if hasattr(flatlib_const, name) + ] + sample = cls( + 1955, + 2, + 24, + 19, + 15, + 0, + 37.3382, + -122.0383, + tz="America/Los_Angeles", + ayanamsa="Krishnamurti", + house_system="Placidus", + ).get_rl_nl_sl_data(0.0) + payload["runtime_probe"] = { + "attempted": True, + "import_status": "success", + "class_present": cls is not None, + "method_present": bool(cls and hasattr(cls, "get_rl_nl_sl_data")), + "sidereal_ayanamsa_constants_present": ayanamsa_constants, + "sample_degree": 0.0, + "sample_rl_nl_sl": sample, + } + payload["status"] = "partial_runtime_surface_available" + payload[ + "boundary" + ] = "KP Rashi/Nakshatra/Sub/SubSub API surface is callable in an isolated dependency path; this is still observation_only until public numeric KP worked examples and replay hashes are archived." + except Exception as exc: # dependency/import errors are expected in clean envs + payload["runtime_probe"] = { + "attempted": True, + "import_status": "blocked", + "error_type": type(exc).__name__, + "error": str(exc), + } + payload["status"] = "blocked_runtime_import" + print(json.dumps(payload, ensure_ascii=False, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/test_vedicastro_kp_runtime_tmp_probe.py b/tests/test_vedicastro_kp_runtime_tmp_probe.py new file mode 100644 index 00000000..92010012 --- /dev/null +++ b/tests/test_vedicastro_kp_runtime_tmp_probe.py @@ -0,0 +1,30 @@ +import json +import subprocess +import sys +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +TMP_DEPS = Path("/tmp/vedicastro_flatlib_probe") + + +def test_vedicastro_probe_reports_dependency_chain_without_truth_upgrade(): + env = {"PYTHONPATH": f"{TMP_DEPS}:{ROOT / 'references/open_source_sources/VedicAstro'}"} + out = subprocess.check_output( + [sys.executable, "scripts/vedicastro_kp_api_probe.py"], + cwd=ROOT, + text=True, + env={**__import__("os").environ, **env}, + ) + data = json.loads(out) + assert data["scope"] == "vedicastro_kp_api_probe" + assert data["claim_status"] == "observation_only" + assert data["truth_matrix_allowed"] is False + assert data["dependency_identity"]["required_flatlib_source"] == "git+https://github.com/diliprk/flatlib.git@sidereal" + assert data["runtime_probe"]["attempted"] is True + if data["runtime_probe"].get("import_status") == "success": + assert data["runtime_probe"]["method_present"] is True + assert "SubLord" in data["runtime_probe"]["sample_rl_nl_sl"] + assert "AY_KRISHNAMURTI" in data["runtime_probe"]["sidereal_ayanamsa_constants_present"] + else: + assert data["status"] == "blocked_runtime_import" diff --git a/tests/test_vedicastro_node_and_worked_example_candidates.py b/tests/test_vedicastro_node_and_worked_example_candidates.py index 392b054f..37728981 100644 --- a/tests/test_vedicastro_node_and_worked_example_candidates.py +++ b/tests/test_vedicastro_node_and_worked_example_candidates.py @@ -29,10 +29,21 @@ def test_vedicastro_flatlib_polars_probe_records_next_dependency_blocker(): def test_vedicastro_sidereal_flatlib_install_probe_records_timeout_blocker(): data = json.loads((ROOT / "references/oracle/vedicastro_flatlib_sidereal_install_probe_2026_07_19.json").read_text(encoding="utf-8")) - assert data["claim_status"] == "blocked" + assert data["claim_status"] == "observation_only" assert data["production_tuning_allowed"] is False - assert "sidereal" in data["attempted_package"] - assert data["status"] == "blocked_timeout" + assert data["attempted_package"] == "git+https://github.com/diliprk/flatlib.git@sidereal" + assert data["status"] == "partial_runtime_surface_available" + assert data["runtime_artifact"] == "references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json" + assert data["truth_matrix_allowed"] is False + + +def test_vedicastro_kp_runtime_surface_probe_is_callable_but_not_truth(): + data = json.loads((ROOT / "references/oracle/vedicastro_kp_runtime_surface_probe_2026_07_19.json").read_text(encoding="utf-8")) + assert data["claim_status"] == "observation_only" + assert data["status"] == "partial_runtime_surface_available" + assert data["runtime_probe"]["import_status"] == "success" + assert data["runtime_probe"]["sample_rl_nl_sl"]["SubLord"] == "Ketu" + assert "AY_KRISHNAMURTI" in data["runtime_probe"]["sidereal_ayanamsa_constants_present"] def test_public_worked_example_numeric_audit_has_no_oracle_ready_rows(): @@ -49,6 +60,7 @@ def test_evidence_index_registers_current_blocker_artifacts(): for packet_id in [ "d10_rahu_ketu_node_mode_attribution", "vedicastro_kp_api_probe_flatlib_polars_tmp", + "vedicastro_kp_runtime_surface_probe", "public_worked_example_candidate_numeric_audit", ]: assert packet_id in packets