fix(report): keep the chat annual card's Tajika list, finish KP headings, say the dasha caveat once (BUG-1282)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-10-08 22:30:33 +08:00
co-authored by Claude Opus 5.5
parent b8eef75871
commit a13f5c2683
9 changed files with 116 additions and 18 deletions
+18 -1
View File
@@ -104,6 +104,23 @@ def _normalize_languages(value: Any) -> list[str]:
return selected
def _with_report_tajika_view(packet: dict) -> dict:
"""Read Tajika named yogas from their own field in the full-data report.
The shared annual pack keeps `tajika_yogas` as the candidate list the chat
annual card uses; only this report copy swaps in `tajika_named_yogas`.
"""
worksheets = packet.get("worksheets")
timing = worksheets.get("timing_and_predictive_systems") if isinstance(worksheets, dict) else None
annual = timing.get("annual_tajika_pack") if isinstance(timing, dict) else None
named = annual.get("tajika_named_yogas") if isinstance(annual, dict) else None
if not isinstance(named, dict) or named.get("status") == "not_applicable":
return packet
packet["worksheets"] = {**worksheets, "timing_and_predictive_systems": {
**timing, "annual_tajika_pack": {**annual, "tajika_yogas": named}}}
return packet
def _english_edition(packet: dict, include_fact_tables: bool) -> dict[str, Any]:
"""Render the English reader from a deep copy of the same packet.
@@ -194,7 +211,7 @@ def build_professional_report_reference(handler, body: dict[str, Any], *, engine
raise ProfessionalReportReferenceInputError(str(exc)) from exc
if edition == FULL_DATA_EDITION and isinstance(packet, dict):
packet = dict(packet)
packet = _with_report_tajika_view(dict(packet))
packet["report_version"] = REPORT_VERSION_FULL
if output_format == "markdown":
if edition == FULL_DATA_EDITION: