fix: integrate people archive, report reader and western chart corrections
Validate on Linux Node 22 and PostgreSQL 17: 3894 frontend tests and 64 database tests pass, with no removed test names or new failures. Preserve static Home, bounded gzip, assertion-change records and manual acceptance gaps. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import re
|
||||
|
||||
import pytest
|
||||
@@ -218,3 +219,76 @@ def test_blocked_side_does_not_invent_a_conflict() -> None:
|
||||
{"year_lord": {"year_lord": "Venus", "year_lord_sign": "Taurus"}},
|
||||
)
|
||||
assert disagree["status"] == "conflict"
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def reader_packet(full_reading):
|
||||
from scripts.jyotish_engine import build_professional_report_reference_packet
|
||||
|
||||
return build_professional_report_reference_packet(full_reading, _class_args(), ["full"])
|
||||
|
||||
|
||||
def test_real_annual_producers_agree_without_identical_metadata(reader_packet) -> None:
|
||||
years = reader_packet["worksheets"]["timing_and_predictive_systems"]["annual_tajika_series"]["years"]
|
||||
for annual in years.values():
|
||||
field = annual["year_lord"]
|
||||
assert field["status"] == "partial_verified"
|
||||
left, right = [item["value"] for item in field["producers_checked"]]
|
||||
assert "year_lord_sign" in left
|
||||
assert "year_lord_sign" not in right
|
||||
assert left["year_lord"] == right["year_lord"]
|
||||
assert field["data"] == left
|
||||
sections = annual["report_sections"]
|
||||
assert "冲突" not in repr(sections["executive_summary"]["summary_lines"])
|
||||
assert "分歧" not in repr(sections["thematic_narrative"]["highlights"])
|
||||
assert "外部验证已经完成" in repr(sections["thematic_narrative"]["highlights"])
|
||||
|
||||
|
||||
def test_reader_annual_cells_use_real_distinct_years_and_keep_return_dates(reader_packet) -> None:
|
||||
reader = _pl9_export_markdown_for_edition(reader_packet, "reader_main")
|
||||
lords = re.findall(r"^\| Varshesha \| ([^|]+) \|$", reader, re.M)
|
||||
signs = re.findall(r"^\| Muntha sign \| ([^|]+) \|$", reader, re.M)
|
||||
assert len(lords) == len(signs) == 3
|
||||
assert "-" not in lords + signs
|
||||
assert len(set(lords)) >= 2
|
||||
assert len(set(signs)) >= 2
|
||||
assert "| Selection basis | Muntha 所在星座的守护星(当前本地口径) |" in reader
|
||||
assert "| Annual ascendant sign | - |" not in reader
|
||||
timing = reader_packet["worksheets"]["timing_and_predictive_systems"]
|
||||
for year in ("2027", "2028"):
|
||||
annual = timing["annual_tajika_series"]["years"][year]
|
||||
return_time = annual["solar_return"]["data"]["dt_local"]
|
||||
section = reader.split(f"### {year} 年度 Varshaphala / Tajika 细项", 1)[1].split("### ", 1)[0]
|
||||
assert f"| Varshapravesha | {return_time} |" in section
|
||||
assert _leak_hits(reader) == []
|
||||
|
||||
|
||||
def test_reader_annual_conflict_keeps_both_real_producer_values(reader_packet) -> None:
|
||||
packet = copy.deepcopy(reader_packet)
|
||||
timing = packet["worksheets"]["timing_and_predictive_systems"]
|
||||
annual = timing["annual_tajika_pack"]
|
||||
current = annual["year_lord"]["data"]
|
||||
later = timing["annual_tajika_series"]["years"]["2027"]["year_lord"]["data"]
|
||||
annual["year_lord"] = _field_with_conflict_gate(
|
||||
"year_lord", {"year_lord": current}, {"year_lord": later},
|
||||
)
|
||||
assert annual["year_lord"]["status"] == "conflict"
|
||||
reader = _pl9_export_markdown_for_edition(packet, "reader_main")
|
||||
assert "| Varshesha | 太阳返照:火星;Tajika:金星(两者不同) |" in reader
|
||||
assert "两种计算口径给出的年主不同,暂不合并" in reader
|
||||
assert "| Muntha sign | 白羊座 |" in reader
|
||||
assert _leak_hits(reader) == []
|
||||
|
||||
|
||||
def test_reader_omits_missing_name_and_panchanga_machine_keys(reader_packet) -> None:
|
||||
packet = copy.deepcopy(reader_packet)
|
||||
packet["birth_info"].pop("name", None)
|
||||
packet["birth_info"].pop("user_name", None)
|
||||
reader = _pl9_export_markdown_for_edition(packet, "reader_main")
|
||||
assert "- 姓名:" not in reader
|
||||
assert "overall_score" not in reader
|
||||
assert "吉性_count" not in reader
|
||||
assert "total_elements" not in reader
|
||||
assert "| 综合性质 |" in reader
|
||||
assert "| 吉性要素数量 |" in reader
|
||||
assert "| 要素总数 |" in reader
|
||||
|
||||
Reference in New Issue
Block a user