Files
Jyotisha/tests/test_capability_evidence_pool.py
T
ClaudeandClaude Opus 5.5 ac9be6f88c feat(techniques): port the astrologer upstream skill's missing techniques
Port from yinduzhanxing 5fb8379c (MIT): Naisargika, Kaala, Karaka, Tara,
Lagnamsaka, Yogardha, Mandooka, Paryaaya and Padanadhamsa dashas;
Sarvatobhadra, Kota and Kalanala chakras; Nakshatra Latta; Pachakadi;
Raman Amsayu and Pindayu. Producers and their upstream tests are copied;
scripts/upstream_technique_layers.py feeds them our natal and transit
positions and attaches chart.consultation_native_layers.upstream_techniques.

- dasha_registry: kaala and padanadhamsa keys (35 -> 37); the nine ported
  dashas are served by compute_dasha or fail closed with upstream's reason.
- technique_registry.json: 16 partial entries; README badges follow.
- Evidence lookup section `upstream_techniques` in the consultation tool.
- Boundaries: Kalanala carries no PyJHora (AGPL) grid coordinates;
  Padanadhamsa/Lagnamsaka run on our Narayana engine (no Rath Table 12,
  PVR co-lord variants or second cycle). PyJHora observers and the Amsayu
  worked-example scaffold live in scripts/research (root .py budget).
- PyJHora black-box cross-checks: Naisargika (lords/years) and Kaala
  (seed segment and fraction within 5e-4) on a public chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-07 14:44:37 +08:00

91 lines
4.1 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"
# 原值=116;新值=127。原因=任务 2/3 增加 punarphoo + 十套条件大运。
# 原值=127;新值=143。原因=移植占星师上游 skill 的 16 项技法(2026-11-07)。
assert summary["total_entries"] == 143
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