Files
Jyotisha/scripts/ondemand_calc/__init__.py
T
jesse-uxandGrok (agent loop) 8dcc6537af feat(ondemand): shared on-demand calculation skeleton + transit on a date (#173, BUG-1816)
产品 2026-11-09 拍板 C 方案:本单只做后端共用模块与信封,前端另开单。

- scripts/ondemand_calc/contract.py:信封 jyotish.ondemand_calc.v1;必填校验不猜
  默认值;节点/位置口径缺省用产品默认值 mean/apparent 并标 profile_source;
  输入指纹 sha256;失败只留缺口,不回显推断日期
- registry.py:TOOLS + ondemand_calc_api 分派;未知 tool 阻塞并点名
- transit_date.py:九曜黄经/星座/度数/星宿与 pada/逆行/日速度,按传入的本命
  参考算宫位,UTC 与当地时间都给;position_mode=mean 返回 blocked
- 薄路由 /api/ondemand_calc(_load_local_module,无新增类方法)

Tests: contract 8 条、transit 12 条、api_server_growth_contract 9 条全过。

Co-Authored-By: Grok (agent loop)
2026-11-09 09:09:16 +08:00

28 lines
615 B
Python

"""按需计算(六类共用骨架)。#173 建立,后续 #174–#178 各加一个工具文件。
注册新工具的步骤见 `contract.py` 顶部 docstring。
"""
from __future__ import annotations
from .contract import ( # noqa: F401
OnDemandInputError,
SCHEMA,
build_envelope,
input_fingerprint,
resolve_profile,
validate_common,
)
from .registry import TOOLS, ondemand_calc_api # noqa: F401
__all__ = [
'OnDemandInputError',
'SCHEMA',
'TOOLS',
'build_envelope',
'input_fingerprint',
'ondemand_calc_api',
'resolve_profile',
'validate_common',
]