feat(report): ship full-mode longform appendix beside the five-chapter report
Web export now calls the same full pack as the long skill report and caches an owner-only Markdown download. Appendix failure stays unavailable and does not change the main report status. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,7 @@ calculation, and delegates packet assembly/rendering to ``jyotish_engine``.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from importlib import import_module
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
@@ -57,19 +58,32 @@ def _load_engine():
|
||||
|
||||
|
||||
def _export_args(birth: dict[str, Any]) -> SimpleNamespace:
|
||||
normalized_birth = {
|
||||
today = birth.get("today") or datetime.now().strftime("%Y-%m-%d")
|
||||
raw_target = birth.get("target_year")
|
||||
if raw_target in (None, ""):
|
||||
target_year = int(str(today)[:4])
|
||||
else:
|
||||
target_year = int(raw_target)
|
||||
raw_age = birth.get("age")
|
||||
if raw_age in (None, ""):
|
||||
try:
|
||||
age = int(target_year) - int(birth["year"])
|
||||
except (TypeError, ValueError, KeyError):
|
||||
age = None
|
||||
else:
|
||||
age = int(raw_age)
|
||||
payload = {
|
||||
**birth,
|
||||
"hour": int(birth["hour"]),
|
||||
"minute": int(birth["minute"]),
|
||||
"second": int(birth.get("second", 0)),
|
||||
"second": int(birth.get("second", 0) or 0),
|
||||
"today": today,
|
||||
"target_year": target_year,
|
||||
"age": age,
|
||||
"visual_chart_observations": birth.get("visual_chart_observations"),
|
||||
"startrack_language_bridge": bool(birth.get("startrack_language_bridge")),
|
||||
}
|
||||
return SimpleNamespace(
|
||||
**normalized_birth,
|
||||
age=None,
|
||||
target_year=None,
|
||||
visual_chart_observations=None,
|
||||
startrack_language_bridge=False,
|
||||
)
|
||||
return SimpleNamespace(**payload)
|
||||
|
||||
|
||||
def build_professional_report_reference(handler, body: dict[str, Any], *, engine=None) -> dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user