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:
@@ -61,7 +61,7 @@ def test_builds_annual_tajika_pack_contract() -> None:
|
||||
assert isinstance(pack["patyayini_dasha"]["periods"], list)
|
||||
assert isinstance(pack["monthly_windows"], list)
|
||||
assert pack["external_engine_comparison"]["status"] in {"blocked", "partial_verified"}
|
||||
assert pack["report_sections"]["executive_summary"]["status"] in {"blocked", "parameter_sensitive"}
|
||||
assert pack["report_sections"]["executive_summary"]["status"] == "partial_verified"
|
||||
assert isinstance(pack["report_sections"]["executive_summary"]["quick_takeaways"], list)
|
||||
assert "tajika_yogas" in pack["report_sections"]["evidence_appendix"]["field_briefs"]
|
||||
assert "sahams" in pack["report_sections"]["evidence_appendix"]["field_briefs"]
|
||||
@@ -71,7 +71,7 @@ def test_builds_annual_tajika_pack_contract() -> None:
|
||||
unified = pack["exports"]["unified_report_pack_contract"]
|
||||
assert unified["schema"] == "pl9.unified_report_pack_contract.v1"
|
||||
assert unified["pack_id"] == "annual_tajika_pack"
|
||||
assert unified["status"] in {"blocked", "parameter_sensitive"}
|
||||
assert unified["status"] == "partial_verified"
|
||||
assert unified["status"] == pack["report_sections"]["executive_summary"]["status"]
|
||||
assert pack["audit"]["technique_audit"][0]["technique"] == "Calculation Profile"
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ HOME_SURFACE_FILES = (
|
||||
FRONTEND / "src" / "components" / "profile-fields.tsx",
|
||||
FRONTEND / "src" / "components" / "onboarding-chat-message.tsx",
|
||||
FRONTEND / "src" / "components" / "home-onboarding-shell.tsx",
|
||||
FRONTEND / "src" / "components" / "chart-library-panel.tsx",
|
||||
FRONTEND / "src" / "components" / "people" / "people-page.tsx",
|
||||
FRONTEND / "src" / "components" / "starter-home.tsx",
|
||||
)
|
||||
OPTIONAL_HOME_HOOKS = (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,7 +11,7 @@ HOME_SURFACE_FILES = (
|
||||
_FRONTEND_SRC / "components" / "birth-location-fields.tsx",
|
||||
_FRONTEND_SRC / "components" / "profile-fields.tsx",
|
||||
_FRONTEND_SRC / "components" / "onboarding-chat-message.tsx",
|
||||
_FRONTEND_SRC / "components" / "chart-library-panel.tsx",
|
||||
_FRONTEND_SRC / "components" / "people" / "people-page.tsx",
|
||||
_FRONTEND_SRC / "components" / "starter-home.tsx",
|
||||
)
|
||||
OPTIONAL_HOME_HOOKS = (
|
||||
|
||||
@@ -47,7 +47,7 @@ HOME_SURFACE_FILES = (
|
||||
_FRONTEND_SRC / "components" / "birth-location-fields.tsx",
|
||||
_FRONTEND_SRC / "components" / "profile-fields.tsx",
|
||||
_FRONTEND_SRC / "components" / "onboarding-chat-message.tsx",
|
||||
_FRONTEND_SRC / "components" / "chart-library-panel.tsx",
|
||||
_FRONTEND_SRC / "components" / "people" / "people-page.tsx",
|
||||
_FRONTEND_SRC / "components" / "starter-home.tsx",
|
||||
)
|
||||
|
||||
@@ -263,15 +263,17 @@ def test_chart_profile_library_has_cloud_table_api_and_local_fallback() -> None:
|
||||
"synastryReportCard",
|
||||
"synastryHistory",
|
||||
"discardLegacyCloudMirrorKeys",
|
||||
"synastry-report-card",
|
||||
"synastry-history-list",
|
||||
# 原值 / 新值 / 原因:退役面板样式 / 人物详情与带用量的删除 / 锁实际 /people 入口。
|
||||
"people-archive-detail",
|
||||
"pendingDelete",
|
||||
'fetch("/api/synastry"',
|
||||
"Ashtakoot",
|
||||
"jyotisha_chart_library",
|
||||
"保存失败,请重试",
|
||||
"星盘库",
|
||||
"添加其他人的星盘",
|
||||
"用于合盘",
|
||||
# 原值 / 新值 / 原因:添加其他人的星盘、用于合盘 / 添加一个人、和我合盘 / 新人物页文案。
|
||||
"添加一个人",
|
||||
"和我合盘",
|
||||
):
|
||||
assert token in page
|
||||
# 原值: 首页表面必须有「设为默认」。
|
||||
|
||||
Reference in New Issue
Block a user