fix(rectification): scan chart boundaries in the user's ayanamsa (BUG-1307, BUG-1309)

This commit is contained in:
jesse-ux
2026-10-12 14:41:13 +08:00
parent b9a2866a22
commit ce4e98036d
12 changed files with 252 additions and 25 deletions
@@ -86,3 +86,35 @@ Python 用 Anaconda `C:\Users\74082\anaconda3\python.exe`,`PYTHONHASHSEED=0`
## 真机
`docs/testing/rectification-nearest-boundary-opening-20261012.md`。公开盘两档:19:01 是「不到 1 分钟」,19:04 是「差 3 分钟」。公开记录 19:15 在默认前后 15 分钟窗口里是「差 2 分钟」。窗口内不换那一句,界面选不出那么窄的窗,由自动化测试覆盖。
## F1 / F2(2026-10-12,修复单,未推送,未部署)
任务书 `TASK-rectification-1012-batch-fix-20261012.md` 的 F1、F2。做在本分支上。不标 resolved。77 例持久回放(`scripts/research/varga_resolution_persisted_replay.py`)没跑,也不把下面的对照说成那次回放通过。
### 证明
改函数之前,用测试里已有的公开盘请求(不带 `ayanamsa`)跑了一次 `scan_varga_segments`,响应写在仓库外:`D:\Users\74082\AppData\Local\Temp\rectification-varga-segments-omitted-ayanamsa-prechange.json`。改完之后同一请求与这份捕获逐字段相同。显式 `"raman"` 与省略相同,缓存键仍是 `58c936a2ccdbb5e339c79f9c43b990d556b627230cd5d5d200f3fcaaea85fad4`。同一窗口的 `lahiri` 换了缓存键,也换了星座。版本字符串仍是 `rectification-varga-segments-v1`。`node_mode` 仍是 mean,请求体不收这个字段。
打分、`decision_policy`、闸门、`scripts/jyotish_api_server.py` 都没改。
### 开场句
最近换段的层里有 `d1` 时,同一句先写「这里连本命上升都换」,再写其余人生事。没有其余事时整句停在这里。只有本命上升在换,不加「接下来先问这几件」。句数上限仍是 3。不换、不到 1 分钟、附近这些盘都不换、只知道大概时段,都保持原来的句子。
### 留下的一句
`frontend/src/lib/ayanamsa.ts` 的 `AYANAMSA_SWITCH_HINT` 仍写「生时校正目前仍固定按 Raman,之后的版本才会跟着这项设置走。」修复单没有授权改这句。`frontend/tests/ayanamsa.test.ts` 没改。设置页这句和现在的扫描行为不一致,留给后面的单。
### 既有断言
没有改既有断言,所以没有「原值 / 新值 / 原因」三栏。新测试加在 `tests/test_rectification_nearest_boundary.py` 和 `frontend/tests/rectification-nearest-boundary-opening-20261012.test.ts`。
### 这轮测试
| 项 | 结果 |
| --- | --- |
| `pytest tests/test_rectification_nearest_boundary.py tests/test_varga_segments_api.py -q --tb=line` | 22 通过(5 + 17),失败 0 |
| `npx tsx --test tests/rectification-nearest-boundary-opening-20261012.test.ts` | 7 通过,失败 0,cancelled 0 |
| `npx tsc --noEmit` | 通过,退出码 0 |
没跑 `next build`,没跑全量 `npm test`,没跑 77 例回放。
+2 -2
View File
@@ -125,9 +125,9 @@
| `TASK-mobile-viewport-scroll-lock-20260917.md` | `PROGRESS-mobile-viewport-scroll-lock-20260917.md` | iPhone 上键盘收起 / 刷新后整页上移、顶栏点不到(BUG-920):iOS 不支持 `interactive-widget`,键盘弹出时 Safari 滚动 window,`html/body overflow: hidden` 让用户拉不回来,reload 又还原 `scrollY`;代码里无任何 window 级复位。补 `ViewportScrollLock`(`scrollRestoration=manual` + `visualViewport` 复位)。与今天两单无关,既有缺陷。**T3 顶栏积分块「有点扁」(BUG-921)**:两枚芯片 44px 塞在 46px 顶栏里、字号/内边距/圆角各一套、积分块强制 64px 最小宽度;统一尺寸并把手机顶栏放到 52px | 已合入(无独立验收记录) | `1b508d5e`(BUG-920/921 resolved;已部署 staging,run 2715);真机待核 |
| `TASK-rectification-session-composer-guard-20260917.md` | `PROGRESS-rectification-session-composer-guard-20260917.md` | 校正会话激活但校正面未开(刷新揭幕超时 / 打开失败不重试 / 删除与 popstate 回退落到列表第一条)时露出可用的普通输入框,问题发到 `/api/consult` 回 404「咨询会话不存在」;`send()` 无会话类型守卫;服务端无独立错误码。关联 BUG-505。BUG 段 924 起 | 已验收 | `6d81062b`(Claude 验收:T1–T5 全通过;409 `session_not_consultation` 在扣点前、不扣点;回退路径多修了归档一条;page.tsx 1830→1830。残留 P3:列表只剩校正会话时 `activeSession` 为空,输入框可用但发送静默无效 → BUG-935 在 fix 单);真机三条欠 |
| `TASK-rectification-explicit-entry-20261012.md` | `PROGRESS-rectification-explicit-entry-20261012.md` | **明说要校正就直接进入(BUG-1306)**:模型判断意图(禁正则),服务端判定后直接开案并绑定来源对话;首轮排盘合同对此轮豁免;拒绝必须一句话说明(推翻 BUG-1248 静默两条);普通对话不得假装校正、申报时段不写子运起止。**先做** | 待验收 | — |
| `TASK-rectification-nearest-boundary-opening-20261012.md` | `PROGRESS-rectification-nearest-boundary-opening-20261012.md` | **最近分界开场(BUG-1307)**:开场说记录时间离最近换段多近、两侧哪些事不同。选题开关默认关(77 例未跑)。不改打分 / 闸门 / 4 件 3 域。未改 page.tsx | 待验收 | 分支 `codex/rectification-nearest-boundary-opening-20261012`,未推送 |
| `TASK-rectification-nearest-boundary-opening-20261012.md` | `PROGRESS-rectification-nearest-boundary-opening-20261012.md` | **最近分界开场(BUG-1307)**:开场说记录时间离最近换段多近、两侧哪些事不同。F1 段扫描按用户岁差(BUG-1309)、F2 本命上升换段要先说「这里连本命上升都换」,都在本分支,待验收。选题开关默认关(77 例未跑)。不改打分 / 闸门 / 4 件 3 域。未改 page.tsx | 待验收 | 分支 `codex/rectification-nearest-boundary-opening-20261012`,未推送 |
| `TASK-rectification-d12-parent-probes-research-20261012.md` | — | **父母静态是非题(D12)研究(BUG-1308)**:公开案例 ≥60、预登记、乱序与正对照,过门才立实现单;纯研究可并行 | 待领取 | — |
| `TASK-rectification-1012-batch-fix-20261012.md` | — | **10-12 三单验收修复**:entry `6a799582` 通过(合入待产品);boundary `b285011a` 未通过——F1 开场与段汇总岁差写死 Raman(BUG-1307 / 新 BUG-1309)、F2 本命上升换段不说;F3 打开失败卡片仍说已开始(BUG-1306 跟进);F4 研究报告补编码问题与暂停结论(BUG-1308) | 待领取 | — |
| `TASK-rectification-1012-batch-fix-20261012.md` | `PROGRESS-rectification-nearest-boundary-opening-20261012.md` | **10-12 三单验收修复**:F1 开场与段汇总按用户岁差(BUG-1307 / BUG-1309)、F2 本命上升换段开场句,在分支 `codex/rectification-nearest-boundary-opening-20261012`,待验收。F3 打开失败卡片仍说已开始(BUG-1306)未做。F4 研究报告补编码问题与暂停结论(BUG-1308)未做 | F1/F2 待验收 | 本分支,未推送 |
### 聊天主链路与首页