Files
Jyotisha/tests/test_capability_evidence_pool.py
T
Jesse_Chen 45d132588f feat(upstream): snapshot a6f47abd, REST VedAstro path, and 116-technique truth layer
Advance the one-way import to git commit a6f47abd with consultation keypath golden, switch official VedAstro comparison to the REST Calculate bridge, and receive the 25 new registry entries behind research_only_blocked.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 17:35:26 +08:00

90 lines
4.0 KiB
Python

from __future__ import annotations
import json
from pathlib import Path
from scripts.capability_evidence_pool import build_capability_evidence_pool_summary
ROOT = Path(__file__).resolve().parents[1]
REGISTRY = ROOT / "references" / "technique_registry.json"
README = ROOT / "README.md"
def test_registry_is_backend_evidence_pool_not_flat_user_skill_list() -> None:
registry = json.loads(REGISTRY.read_text(encoding="utf-8"))
techniques = registry["techniques"]
assert registry["registry_role"] == "backend_capability_evidence_pool"
assert registry["public_label"] == "89 capability entries"
assert "question-domain router" in registry["ordinary_user_policy"]
allowed_entry_types = {
"core_technique",
"supporting_indicator",
"composite_adjudicator",
"workflow_or_engineering",
"alias_entry",
"experimental_variant",
}
allowed_roles = {"primary", "secondary", "context", "audit_only", "alias", "comparison_only"}
allowed_visibility = {"ordinary_topic_router", "expert_audit", "hidden"}
allowed_prediction = {
"case_validated_partial",
"support_only",
"not_claimed",
"not_applicable",
"blocked",
}
allowed_rule = {"verified", "partial", "not_applicable", "blocked"}
allowed_calculation = {"verified", "partial", "not_applicable", "experimental"}
for tech_id, tech in techniques.items():
assert tech["entry_type"] in allowed_entry_types, tech_id
assert tech["evidence_role"] in allowed_roles, tech_id
assert tech["user_visibility"] in allowed_visibility, tech_id
assert tech["verification_level"]["calculation"] in allowed_calculation, tech_id
assert tech["verification_level"]["rule"] in allowed_rule, tech_id
assert tech["verification_level"]["prediction"] in allowed_prediction, tech_id
assert tech["conclusion_policy"], tech_id
if tech["entry_type"] == "experimental_variant":
assert tech["verification_level"]["prediction"] == "blocked", tech_id
assert tech["verification_level"]["rule"] == "blocked", tech_id
assert tech["user_visibility"] == "expert_audit", tech_id
assert techniques["case_validator"]["evidence_role"] == "audit_only"
assert techniques["thematic_report_orchestrator"]["entry_type"] == "workflow_or_engineering"
assert techniques["neechabhanga"]["evidence_role"] == "alias"
assert techniques["special_lagnas"]["evidence_role"] == "alias"
def test_evidence_pool_summary_routes_few_primary_items_and_many_support_items() -> None:
summary = build_capability_evidence_pool_summary()
assert summary["scope"] == "backend_capability_evidence_pool"
# 原值=91;新值=116。原因=任务 1 接收上游 25 项注册表内容。
assert summary["total_entries"] == 116
assert summary["ordinary_user_policy"].startswith("Users see topic-level")
assert summary["evidence_role_counts"]["primary"] >= 8
assert summary["evidence_role_counts"]["secondary"] > summary["evidence_role_counts"]["primary"]
assert summary["evidence_role_counts"]["audit_only"] >= 3
# 原值=仅 rangacharya_jaimini_variant;新值=加上 3 个上游 ziwei comparison-only。
assert summary["comparison_only_entries"] == [
"rangacharya_jaimini_variant",
"ziwei_bridge_script_pack",
"ziwei_doushu_bridge",
"ziwei_runtime_bridge_scripts",
]
assert summary["conclusion_policy"]["comparison_only_entries_cannot_affect_astrological_conclusions"] is True
assert summary["prediction_verification_counts"]["not_claimed"] > 0
assert summary["conclusion_policy"]["primary_chain_required"] is True
assert summary["conclusion_policy"]["all_89_entries_must_not_be_flattened_into_conclusions"] is True
def test_readme_uses_capability_entries_language_instead_of_89_techniques_claim() -> None:
readme = README.read_text(encoding="utf-8")
assert "89 capability entries" in readme
assert "89 techniques" not in readme
assert "backend evidence pool" in readme