fix(qizheng): pass school options into the vendored chart and stabilize gates
BUG-710: call getSevenGovernorsChart with ketuMode/siderealMode so calculation.ketu_mode is the engine school, not the request echo. BUG-711: stop forbidding /ephemeris in the sidebar contract. BUG-712: compare ephemeris event longitudes at 6 decimals and fail closed when the golden is missing.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# PROGRESS · 三份只读页单验收修复(2026-09-16)
|
||||
|
||||
- 执行分支:`codex/readonly-pages-fix-20260916`
|
||||
- 工作树:`.worktrees/readonly-pages-fix-20260916`
|
||||
- 基线:`origin/staging` @ `6bb892b8`(含 `fadb64fb` 任务书与 `page.tsx` 1951 冻结修复)
|
||||
|
||||
## 方案选择
|
||||
|
||||
**BUG-710 走任务书方案 A。** vendored `cli.cjs` 里的库函数 `getSevenGovernorsChart(date, location, options)` 接受 `ketuMode` / `siderealMode`;CLI `main()` 调用时不传 options。本单用 `scripts/qizheng_seven_governors.js` 在内存编译该 bundle、取出库函数并传入 options,不改 `vendor/**` 字节、不加 CLI 旗标。
|
||||
|
||||
## 做了什么
|
||||
|
||||
- **BUG-710:** 请求派别真正进入引擎。`calculation.ketu_mode` / `sidereal_mode` 只写实际生效值。mapper 读 `calculation.engine_ketu_mode`。
|
||||
- **BUG-711:** 星历合同不再禁止 sidebar 出现 `ephemeris`。侧栏「星历」入口保留。
|
||||
- **BUG-712:** 浮点量化到 6 位;golden 缺失失败,不自动重建。
|
||||
|
||||
## 测试
|
||||
|
||||
| 项 | 结果 |
|
||||
| --- | --- |
|
||||
| `node --version` | v22.23.2 |
|
||||
| `pytest tests/test_qizheng_chart_engine.py tests/test_ephemeris_events.py tests/test_qizheng_api_productization.py` | **21 passed** |
|
||||
| `pytest tests/test_api_server_growth_contract.py` | 通过(未改 `jyotish_api_server.py`) |
|
||||
| `npx tsx --test tests/ephemeris-page.test.tsx` | **6/6** |
|
||||
| `npx tsx --test tests/chart-view-route.test.ts` | **8/8**(含冻结上限与 mapper 引擎字段) |
|
||||
|
||||
### 既有断言变更(AGENTS.md §7.3)
|
||||
|
||||
`frontend/tests/ephemeris-page.test.tsx`「the ephemeris page is its own route and never grows page.tsx」:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| 原值 | `assert.doesNotMatch(app-sidebar.tsx, /ephemeris/)` |
|
||||
| 新值 | 不读 sidebar;本测试文件不得 import `app-sidebar` |
|
||||
| 原因 | chart-page 单按任务书在 sidebar 加了 `/ephemeris` 入口;文件归属不是产品入口禁止(BUG-711) |
|
||||
|
||||
`tests/test_qizheng_chart_engine.py::test_ketu_mode_request_is_echoed_and_engine_mode_is_visible`:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| 原值 | 请求 descending-node 时 `ketu_mode == descending-node` 且 `engine_ketu_mode == apogee` |
|
||||
| 新值 | 请求 descending-node 时两者都是 descending-node,且计都位置相对默认派别改变 |
|
||||
| 原因 | 原断言把 BUG-710 的错误行为锁成合同 |
|
||||
|
||||
未改 `jyotish_api_server.py` 行数契约。未删 sidebar 星历入口。未放宽 `dignities` / boundary。
|
||||
|
||||
## 合入
|
||||
|
||||
`git push origin HEAD:staging`,核对远端 SHA。部署是否追上见推送后的 `/api/health`。
|
||||
@@ -223,10 +223,10 @@
|
||||
|
||||
| `TASK-rectification-house-lord-gochara-research-20260913.md` | `PROGRESS-rectification-house-lord-gochara-research-20260913.md` | 研究单:宫主触发与木星/土星过运(合冲本命宫主、罗睺紧密合、年精度、用于 block 选上升)四种放宽,20 例公开 AA 离线量 block 层与 minute 层两组指标;引擎里已有宫主/功能吉凶/受控过运,只量缺的四条 | 待验收(无收益,关闭;不立实现单) | `codex/rectification-house-lord-gochara-research-20260913` |
|
||||
|
||||
| `TASK-qizheng-native-chart-20260915.md` | `PROGRESS-qizheng-native-chart-20260915.md` | **后端单(独占 `scripts/jyotish_api_server.py`)**:vendored `stem-branch` 0.8.0(Apache-2.0)归档 + API 镜像 Node runtime + 七政适配器(计都派别与宿度坐标系参数化、boundary 按实测重写)+ 三个只读端点 `/api/qizheng`、`/api/western`、`/api/ephemeris_events`。实证三条:四柱时柱按 UTC 算(BUG-700,本轮不修不调用)、`ketuMode` 写死未暴露(BUG-701)、boundary 把空神煞与未闭合庙旺说成已生成(BUG-702)。BUG 段 700–703 | 已推 `origin/staging` `e776cf9d` | 已验收(带修复单) |
|
||||
| `TASK-chart-page-20260915.md` | `PROGRESS-chart-page-20260915.md` | **前端单(独占 `app-sidebar.tsx`,同时加星盘与星历两个入口)**:P0 只读星盘页,五个 Tab(星盘 / 基础信息 / 大运 / 西洋盘 / 七政四余),中宫排盘参数卡,三套坐标系各自标注且禁止互相换算。不扣点不调模型不出 spinner;不碰 `page.tsx`(1951/2000);**不搬 `vedic-chart-svg.tsx`**(rectification-board 也在用)。任务书预占 704–706,Bug 历史未写入;校正 P0 落地占用了 704–706 / 708–709 | 已验收(带修复单) | `codex/chart-page-20260915` |
|
||||
| `TASK-ephemeris-page-20260915.md` | `PROGRESS-ephemeris-page-20260915.md` | **前端单**:P1 星历页,今日五要素 + 当日行运(相对本命宫位)+ 未来九十天换座与停滞,底部「带这天去提问」出口。页面不得出现任何运势判断。含实证缺陷:panchanga 写死 Lahiri 与账户 Raman 分裂(关联 BUG-703;本单标注为 BUG-707)。侧边栏入口由 chart-page 单交付。BUG 段 707–709 | 已验收(带修复单) | `codex/ephemeris-page-20260915` |
|
||||
| `TASK-readonly-pages-fix-20260916.md` | `PROGRESS-readonly-pages-fix-20260916.md` | 三份只读页单的验收修复:**BUG-710** 七政 `ketu_mode`/`sidereal_mode` 收了请求却从不传给引擎,`calculation.ketu_mode` 回写请求值而非实际值(实测请求 descending-node 仍返回 apogee 盘,无警告);**BUG-711** 星历单断言 sidebar 不得含 `/ephemeris`,与星盘单按任务书添加的入口直接冲突,staging 现在是红的;**BUG-712** `ephemeris_events` golden 存全精度浮点跨机不稳,且 golden 缺失时自动重建。另附部署缺口:`deployment.gitCommit` 仍是 `2d7698ea`。BUG 段 710+ | 待领取 | — |
|
||||
| `TASK-qizheng-native-chart-20260915.md` | `PROGRESS-qizheng-native-chart-20260915.md` | **后端单(独占 `scripts/jyotish_api_server.py`)**:vendored `stem-branch` 0.8.0(Apache-2.0)归档 + API 镜像 Node runtime + 七政适配器(计都派别与宿度坐标系参数化、boundary 按实测重写)+ 三个只读端点 `/api/qizheng`、`/api/western`、`/api/ephemeris_events`。实证三条:四柱时柱按 UTC 算(BUG-700,本轮不修不调用)、`ketuMode` 写死未暴露(BUG-701)、boundary 把空神煞与未闭合庙旺说成已生成(BUG-702)。BUG 段 700–703 | 已验收(带修复单) | `e776cf9d` / `f7386e07` |
|
||||
| `TASK-chart-page-20260915.md` | `PROGRESS-chart-page-20260915.md` | **前端单(独占 `app-sidebar.tsx`,同时加星盘与星历两个入口)**:P0 只读星盘页,五个 Tab(星盘 / 基础信息 / 大运 / 西洋盘 / 七政四余),中宫排盘参数卡,三套坐标系各自标注且禁止互相换算。不扣点不调模型不出 spinner;不碰 `page.tsx`(1951/2000);**不搬 `vedic-chart-svg.tsx`**(rectification-board 也在用)。任务书预占 704–706,Bug 历史未写入;校正 P0 落地占用了 704–706 / 708–709 | 已验收(带修复单) | `830799fa` |
|
||||
| `TASK-ephemeris-page-20260915.md` | `PROGRESS-ephemeris-page-20260915.md` | **前端单**:P1 星历页,今日五要素 + 当日行运(相对本命宫位)+ 未来九十天换座与停滞,底部「带这天去提问」出口。页面不得出现任何运势判断。含实证缺陷:panchanga 写死 Lahiri 与账户 Raman 分裂(关联 BUG-703;本单标注为 BUG-707)。侧边栏入口由 chart-page 单交付。BUG 段 707–709 | 已验收(带修复单) | `d3a2c48b` |
|
||||
| `TASK-readonly-pages-fix-20260916.md` | `PROGRESS-readonly-pages-fix-20260916.md` | 三份只读页单的验收修复:**BUG-710** 七政 `ketu_mode`/`sidereal_mode` 收了请求却从不传给引擎,`calculation.ketu_mode` 回写请求值而非实际值(实测请求 descending-node 仍返回 apogee 盘,无警告);**BUG-711** 星历单断言 sidebar 不得含 `/ephemeris`,与星盘单按任务书添加的入口直接冲突,staging 现在是红的;**BUG-712** `ephemeris_events` golden 存全精度浮点跨机不稳,且 golden 缺失时自动重建。另附部署缺口:`deployment.gitCommit` 仍是 `2d7698ea`。BUG 段 710+ | 待验收 | `codex/readonly-pages-fix-20260916` |
|
||||
| `TASK-api-server-decomposition-20260916.md` | `PROGRESS-api-server-decomposition-20260916.md` | **重构单(串行在 qizheng 单之后)**:把业务逻辑搬出 `JyotishAPIHandler`。核心不是行数,是全仓 3 处靠 `JyotishAPIHandler.__new__` 伪造空壳 handler 借方法(`consultation_workflow_service` ×2、`capture_report_blocked_repairs_golden`、`local_accuracy_report`,MCP 也走这条),依赖方向反了、handler 没有 `headers`/`wfile` 随时可炸。四阶段:拆 `__new__` 后门 → 抽 ≥150 行业务方法 → `do_POST`/`do_GET` 改路由表 → 重新冻结行数 baseline(余量 300→50)。纯搬运不改行为,`test_api_server_security.py` 3841 行断言一条不许改。预计 11,314 → 约 9,230 行。BUG 段 710+ | 待领取 | — |
|
||||
|
||||
## 命名与归档
|
||||
|
||||
Reference in New Issue
Block a user