Files
Jyotisha/tests/test_report_user_layer_2028.py
T

38 lines
2.0 KiB
Python

"""BUG-2028 (占星师 2026-11-19 分层答复、第 18 条): what the report's Python side hands the reader layer."""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT / "scripts"))
from report_render.evidence_grade import GRADE_ALGORITHM, GRADE_CONTRACT, OTHER_SIDE_LINE_ZH, evidence_grades # noqa: E402
DEVELOPER_WORDS = ("分盘", "上升星座", "情景下,该项", "时间窗口", "秒", "取消条件", "规则版本", "具名规则", "证据链")
def test_stored_grades_are_marked_as_the_legacy_algorithm():
grades = evidence_grades({})
assert grades["contract"] == GRADE_CONTRACT
# Her 2026-11-19 standard (per-claim sufficiency, case validation listed apart) is not implemented;
# results of today's rule (D when a required layer is missing, otherwise C) must not be read as it.
assert grades["grade_algorithm"] == GRADE_ALGORITHM == "v1_legacy"
def test_the_readers_other_scenario_sentence_uses_everyday_words():
assert OTHER_SIDE_LINE_ZH == "另一种情景下的结论还没有评估。"
assert not any(word in OTHER_SIDE_LINE_ZH for word in DEVELOPER_WORDS)
def test_the_report_rules_keep_grades_and_developer_terms_out_of_the_readers_text():
contract = (ROOT / "references" / "product_runtime_contract.md").read_text(encoding="utf-8")
start = contract.index("<!-- product-block:report-reading -->")
rules = contract[start:contract.index("<!-- /product-block:report-reading -->", start)]
assert "这一点目前还不能明确判断" in rules
assert "等级只在后台保存,不给读者看" in rules and "等级列在文末附录" not in rules
assert "该项结论及时间窗口尚未评估" not in rules
assert "不写「落陷取消」「取消条件已满足」" in rules
for word in ("具名规则", "证据链", "方法版本", "候选分支"):
assert f"「{word}」" in rules # listed among the words the reading must not use