require auditable external parity artifacts

This commit is contained in:
732642856
2026-07-13 23:00:56 +08:00
parent 7ae756f97b
commit 62b699c1bd
4 changed files with 61 additions and 1 deletions
@@ -0,0 +1,21 @@
import json
from scripts.three_engine_parity_replay_validator import validate_manifest
def test_verified_oracle_requires_raw_artifact_hash_and_settings(tmp_path):
manifest = {
"engines": {
"VedAstro": {"status": "official_verified"},
"PyJHora_JHora": {"status": "blocked"},
"jyotishganit": {"status": "blocked"},
},
"comparison_rows": [],
}
path = tmp_path / "manifest.json"
path.write_text(json.dumps(manifest), encoding="utf-8")
result = validate_manifest(path)
assert result["status"] == "invalid"
assert any(error["error"] == "required_for_verified_status" for error in result["errors"])
@@ -1,5 +1,6 @@
from __future__ import annotations
import hashlib
import json
from pathlib import Path
@@ -18,12 +19,19 @@ def test_three_engine_parity_manifest_blocks_without_oracle_rows() -> None:
def test_three_engine_parity_validator_accepts_one_same_chart_row(tmp_path: Path) -> None:
raw = tmp_path / "vedastro.json"
raw.write_text('{"source":"official"}', encoding="utf-8")
manifest = {
"case_id": "public_same_chart_001",
"birth_data_policy": "public_case_only",
"status": "tested",
"engines": {
"VedAstro": {"status": "official_verified", "official_raw_response_path": "references/oracle/artifacts/vedastro.json"},
"VedAstro": {
"status": "official_verified",
"official_raw_response_path": "vedastro.json",
"artifact_hash": hashlib.sha256(raw.read_bytes()).hexdigest(),
"settings": {"ayanamsa": "lahiri"},
},
"PyJHora_JHora": {"status": "tested", "raw_output_path": "references/oracle/artifacts/pyjhora.txt"},
"jyotishganit": {"status": "tested", "raw_output_path": "references/oracle/artifacts/jyotishganit.json"},
},