fix(dasha): measure nakshatra index and progress on one grid

Upstream 3c2dad95, 8643bc9a, and the lon_to_nakshatra part of 9e04f0db. Exact star starts were split across int-division and modulo, so 16 of 27 openings reported a zero balance and skipped the mahadasha. Off-boundary longitudes keep the old modulo. BUG-1381.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-18 16:15:48 +08:00
co-authored by Grok (agent loop) Cursor
parent 68762ccec5
commit d11ee6f0dd
5 changed files with 138 additions and 29 deletions
+15
View File
@@ -36503,3 +36503,18 @@
- 相关记录:BUG-1268。
- 复发自:无。
- 修复版本:分支 `codex/upstream-sync8-20261017`。上游提交 `8643bc9a`。
## BUG-1381 | 月亮正好在星宿起点时大运余额变成 0
- 状态:resolved
- 首次发现 / 最近更新:2026-10-17 / 2026-10-18
- 来源:issue #80,任务书 T2。上游 `3c2dad95`、`8643bc9a`、`9e04f0db`(只取星宿定位)。检索「lon_to_nakshatra」「int(moon_lon」,没有更早的同类记录。
- 现象:月亮经度恰好是某星宿起点时,第一大运余额变成 0,整段大运被跳过。27 个起点里有 16 个会这样。
- 触发条件:星宿序号用 `int(经度/跨度)`,已用比例又用 `经度 % 跨度`,两个浮点结果在起点上对不上。
- 根因:序号和进度不是从同一个量算出来的。起点被算成「上一宿几乎走完」。
- 修复:起点用同一把分数网格:这一点属于刚开始的那一宿,已用比例为 0。`cmd_dasha`、`lon_to_nakshatra`、`find_nakshatra` 和星盘星宿字段都走这个函数。不是起点的经度仍用原来的取模,结果不变。
- 验证:27 个起点的第一大运年数等于完整年数,第一段小运主星等于大运主星。起点左右相邻浮点数分别落在前一宿和这一宿。5000 个非起点随机经度与旧算法一致。
- 防复发:`tests/test_nakshatra_native_dasha_clock.py`。
- 相关记录:BUG-1268、BUG-1380。
- 复发自:无。
- 修复版本:分支 `codex/upstream-sync8-20261017`。上游提交 `3c2dad95`、`8643bc9a`、`9e04f0db`。