fix(saham): add 30 degrees when the third operand misses the B-to-A arc

Upstream ce9fed15. The exception now tests C on the forward arc from B to A, in both the value and the trace. BUG-1387.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-18 16:44:43 +08:00
co-authored by Grok (agent loop) Cursor
parent aa87c0f127
commit 2f8263b6ac
5 changed files with 78 additions and 13 deletions
+15
View File
@@ -36593,3 +36593,18 @@
- 相关记录:无。
- 复发自:无。
- 修复版本:分支 `codex/upstream-sync8-20261017`。上游提交 `e7301feb`、`86935c0a`、`4f1536f2`。
## BUG-1387 | Saham 的 +30° 例外看错了操作数
- 状态:resolved
- 首次发现 / 最近更新:2026-10-17 / 2026-10-18
- 来源:issue #80,任务书 T9。上游 `ce9fed15`。检索「add_30_degrees」「Punya_Saham」,无既有编号。
- 现象:公式 Saham 在上升不落在第一操作数到第二操作数的顺行弧上时加 30°。规则文件七条公式的第三项都是上升,所以大量结果和 PVR 的判法差 30°。
- 触发条件:`_calc_formula_saham`。本仓原先没有 trace 入口。
- 根因:例外检查的是上升是否落在 A→B,PVR §28.8.1 检查的是第三操作数 C 是否落在 B→A。
- 修复:两个入口都改为 `(C - B) % 360 <= (A - B) % 360`,不满足则结果加 30°。`references/saham_rules.json` 的描述改为同一条。补上 `_formula_saham_trace`,与数值入口使用同一判法。
- 验证:`tests/test_saham_directed_operand_contract.py`。`tests/test_tajika.py` 三处断言按三栏改过:Punya 原值 85 / 新值 115;Karma 原值 40 / 新值 70;跨零点例子原值 340 / 新值 310。年运快照测试没有锁这三条公式的旧经度。
- 防复发:契约测试覆盖 C 不是上升的公式,以及 trace 与数值入口一致。
- 相关记录:无。
- 复发自:无。
- 修复版本:分支 `codex/upstream-sync8-20261017`。上游提交 `ce9fed15`。