fix(special-lagnas): compute eight birth points without PyJHora
Independent Staging Quality Gate / validate (push) Successful in 19m4s
Independent Staging Quality Gate / publish (push) Successful in 3m51s

Production images do not install PyJHora, so those eight points were blocked.
Swiss Ephemeris now computes them in-process. Rectification keeps the old
Hora and Ghati formulas.

BUG-1273.
This commit is contained in:
jesse-ux
2026-10-08 15:01:44 +08:00
parent fe833b3576
commit 795b8845c7
16 changed files with 1270 additions and 245 deletions
@@ -0,0 +1,37 @@
# PROGRESS · 特殊上升点改为本仓原生计算(2026-10-08)
执行分支 `codex/special-lagnas-native-20261008`。工作树从当时的 `origin/staging` `fe833b35` 拉出(任务书写的基线是 `c04786f7`,其后 staging 又有纯文档提交)。状态:待验收。未上线。
## 做了什么
- 八个特殊上升点在有经纬度时改由 Swiss Ephemeris 计算,`source` 为 `native_special_lagna`。日出用出生地经纬度和请求的岁差,算完恢复原来的岁差。
- 公式按本仓已引用的出处:P.V.R. Narasimha Rao《Vedic Astrology: An Integrated Approach》§5.2(Bhava 0.25°/分、Hora 0.5°/分、Ghati 1.25°/分、Vighati 15°/分),Sree 为月亮在星宿内剩余度数乘 27 再加上升,Indu 与 Varnada 用 B.V. Raman。没有把「一宫每一 vighati」写成 75°/分。`references/` 里没有 BPHS 第 4 章原文,八点都有上述具名出处,没有写 blocked。
- 运行时删除 `calculate_pyjhora_special_lagnas`。PyJHora 4.8.7 只离线生成 `tests/fixtures/special_lagnas_pyjhora_487.json`。生成命令:`python scripts/research/freeze_special_lagnas_pyjhora_fixture.py`。
- 缺坐标时仍用原来的 Bhava / Hora / Ghati 公式。生时校正继续调用这三个函数,算法身份不升。
- Tajika 的进程内 PyJHora 打分、校正三引擎对照的 PyJHora 列,分别挪到 `scripts/pyjhora_panchavargiya_reference.py` 和 `scripts/pyjhora_rectification_d1_reference.py`。默认全盘不调用它们。
- 快速门增加 `tests/test_runtime_jhora_import_scan.py`。
## 对照
三张公开或虚构盘 × Lahiri、Raman × 八个点,相对冻结的 PyJHora 4.8.7,最大绝对差 4.9e-5°。Hora 与 Ghati 度数不同。公开盘 Lahiri 的 Bhava / Hora / Ghati 仍是狮子 17.12°、水瓶 22.58°、处女 8.94°。
## 本机验证
| 检查 | 结果 |
| --- | --- |
| ruff(本轮改过的 Python 文件) | 通过 |
| py_compile(本轮改过的模块) | 通过 |
| `test_runtime_jhora_import_scan.py`、`test_special_lagnas_birth_instant.py`(不含全盘那条)、`test_rectification_three_engine_packet.py` | 18 通过 |
| 屏蔽 `jhora` 后的 `cmd_full_reading`,加上三引擎包测试 | 5 通过;八点 `computed`,`source` 为 `native_special_lagna` |
| 隐私扫描 `tests/test_repo_privacy_markers.py` | 通过 |
未跑、不能写成通过:没有 PyJHora 的门禁虚拟环境(本机 Anaconda 装了 PyJHora 4.8.7,测试是屏蔽导入);Linux 全量 pytest 相对 62 条基线;快速门整段(含 npm test 与 turbopack 构建);部署后的 `/api/health`、`/login`、未登录 `/api/account`。
## 开工预检
`python scripts/pre_work_check.py --remote-timeout 8 --command-timeout 45` 在本工作树跑完。远端可见性已核对,外部引擎适配器诊断通过,Python 运行时通过。碎片扫描在 90 秒超时,聚焦测试在 45 秒超时。不把这次退出当成通过,也没有改断言或补 `.workbuddy` 镜像。
## 偏离
- 导入扫描会走到 `jyotish_api_server` 再走到校正三引擎包。那里的 `import_module("jhora...")` 挪进 pyjhora 文件名的参考模块,包函数 `_pyjhora_d1` 仍在原处,现有测试照旧替换它。
- 全盘年运段仍会按需导入 `annual_pyjhora_replay`(文件名含 pyjhora,扫描不进入)。导入失败时该段记 blocked,不挡八个特殊上升点。
+1 -1
View File
@@ -315,7 +315,7 @@
| `TASK-rectification-probe-supply-research-20260913.md` | — | 研究单:六题后引擎在剩余候选上再出带年月题的四种放宽规则,20 例公开 AA 数据离线量收益,有收益才立实现单 | 已合入(离线测量,不改线上) | `b063c668` |
| `TASK-rectification-refresh-r3-r4-20260913.md` | `PROGRESS-rectification-refresh-r3-r4-20260913.md` | 刷新阶段 R3(MIN_BOUNDARY_DAYS 45→30)+ R4(pratyantar 与 D9/D10 上升 Narayana);首轮出题不变。即使放宽仍有 0 题例子,定向补事另线保留(BUG-664/665) | 已实现 `ab1ade59`,已部署;2026-09-13 验收通过(实现单由执行方自拟,无产品决策记录段;收益口径见研究文档) | `codex/rectification-refresh-r3-r4-20260913` |
| `TASK-upstream-sync6-20261007.md` | [PROGRESS-upstream-sync6-20261007.md](PROGRESS-upstream-sync6-20261007.md) | **上游同步第六轮(`23be1807`)**:10-05 五个计算修正一行未合——D5/D6/D8/D11 映射(乔布斯盘四张分盘星座全不同)、Vimsopaka 权重、Yogini 顺序与出生余额、Panchadhikari 宫位参照、Narayana 并列、特殊上升、出生秒数、Neecha Bhanga 两条件、首段大运子运、岁差被覆盖;逐项对照原书核实;最先做 | 已验收(门禁补修 `2df6ee72`,已部署 staging) | [PROGRESS-upstream-sync6-20261007.md](PROGRESS-upstream-sync6-20261007.md) |
| `TASK-special-lagnas-native-20261008.md` | — | **特殊上升点原生计算(线上缺陷)**:sync6 U6 运行时调 PyJHora,生产镜像没有 PyJHora → staging 上 Hora/Ghati/Sree/Indu/Pranapada 全 blocked;原生实现、PyJHora 只作冻结对照、快速门禁止运行时 import jhora;最先做 | 待领取 | — |
| `TASK-special-lagnas-native-20261008.md` | `PROGRESS-special-lagnas-native-20261008.md` | **特殊上升点原生计算(线上缺陷)**:sync6 U6 运行时调 PyJHora,生产镜像没有 PyJHora → staging 上 Hora/Ghati/Sree/Indu/Pranapada 全 blocked;原生实现、PyJHora 只作冻结对照、快速门禁止运行时 import jhora;最先做 | 待验收 | `codex/special-lagnas-native-20261008`(未上线;部署以 `/api/health` 为准) |
| `TASK-sync6-gate-red-20261007.md` | — | **sync6 后门禁仍红**:run 3213 快速门已过,「Frontend and database tests」开跑 20 秒后日志中断、15 分钟后判失败,后续步骤 failure 0 秒;疑运行机掉线;先 Re-run,红则本机带 Docker 跑 `CI=1 npm test` 对照 `0ed45a4b` | 已完成(Re-run 通过,BUG-1271,部署 `2df6ee72`) | — |
| `TASK-rectification-tie-break-entry-fix-20260913.md` | `PROGRESS-rectification-tie-break-entry-fix-20260913.md` | 修复单:参考题入口只读 `window_scan` 标志位 → 两道答完后仍显示、再点弹「现在没有可答的参考题」;并按产品拍板改成点一次连出 D9+D10(BUG-666~668,Skill 10.0.26) | 已合入(无独立验收记录) | `99127601`(BUG-666~668 resolved;已部署 staging,run 2589) |