Route capability entries as evidence pool
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
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",
|
||||
}
|
||||
allowed_roles = {"primary", "secondary", "context", "audit_only", "alias"}
|
||||
allowed_visibility = {"ordinary_topic_router", "expert_audit", "hidden"}
|
||||
allowed_prediction = {
|
||||
"case_validated_partial",
|
||||
"support_only",
|
||||
"not_claimed",
|
||||
"not_applicable",
|
||||
}
|
||||
|
||||
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 {"verified", "partial", "not_applicable"}, tech_id
|
||||
assert tech["verification_level"]["rule"] in {"verified", "partial", "not_applicable"}, tech_id
|
||||
assert tech["verification_level"]["prediction"] in allowed_prediction, tech_id
|
||||
assert tech["conclusion_policy"], 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"
|
||||
assert summary["total_entries"] == 89
|
||||
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
|
||||
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
|
||||
@@ -334,6 +334,11 @@ def test_full_reading_reports_ayanamsa_metadata_and_ai_prompt_pack() -> None:
|
||||
assert vedastro_rows[0]["status"] in {"used", "blocked"}
|
||||
assert "overview only" in vedastro_rows[0]["note"]
|
||||
assert "domain_statuses" in vedastro_rows[0]["note"]
|
||||
capability_pool = prompt_pack["evidence_snapshot"]["capability_evidence_pool"]
|
||||
assert capability_pool["scope"] == "backend_capability_evidence_pool"
|
||||
assert capability_pool["total_entries"] == 89
|
||||
assert capability_pool["conclusion_policy"]["all_89_entries_must_not_be_flattened_into_conclusions"] is True
|
||||
assert "后台备选证据池" in prompt_pack["prompt_zh"]
|
||||
|
||||
|
||||
def test_full_reading_generates_guided_topics_from_real_evidence() -> None:
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_readme_badges_match_technique_registry_counts() -> None:
|
||||
counts = Counter(item["status"] for item in techniques)
|
||||
total = len(registry["techniques"])
|
||||
|
||||
assert _readme_badge_value("Techniques") == total
|
||||
assert _readme_badge_value("Capabilities") == total
|
||||
assert _readme_badge_value("Covered") == counts["covered"]
|
||||
assert _readme_badge_value("Complete") == counts["complete"]
|
||||
assert _readme_badge_value("Partial") == counts["partial"]
|
||||
|
||||
Reference in New Issue
Block a user