diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index a5d36fac..6692988d 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -11077,3 +11077,19 @@ - 相关记录:TASK-ephemeris-page-20260915、TASK-readonly-pages-fix-20260916 - 复发自:无 - 修复版本:待发布 + +## BUG-713 | 新增 `/ephemeris` 未同步 capability audit 路由契约,staging 门禁红 + +- 状态:resolved +- 首次发现:2026-09-16 +- 最近更新:2026-09-16 +- 影响面:Gitea `backend-quality-gate` run `2635`、`tests/test_api_server_security.py::test_capability_audit_scans_registry_and_local_sources` +- 用户现象:`a38a9415` 门禁 Python 段 `1 failed, 765 passed`。失败断言 `app_routes` 在 `chart` 之后多了 `ephemeris`。 +- 触发条件:星历页独立 route `frontend/src/app/ephemeris/page.tsx` 合入后跑 capability audit 精确集合。 +- 根因:BUG-143 / BUG-454 同类。`_scan_app_routes` 动态扫描 `frontend/src/app/**/page.tsx`;精确期望列表未列入 `ephemeris`。星历单被要求不碰后端测试,chart-page 只把 `chart` 写进了该列表。 +- 修复:期望路由集合加入 `ephemeris`,不隐藏真实入口。 +- 验证:`pytest tests/test_api_server_security.py::test_capability_audit_scans_registry_and_local_sources`;推 staging 后核对门禁 run。 +- 防复发:新增或删除 `frontend/src/app/**/page.tsx` 必须同一提交更新该精确集合,并跑 capability audit。前端矩阵不能替代这条 Python 契约。 +- 相关记录:BUG-014、BUG-126、BUG-143、BUG-454 +- 复发自:BUG-454 +- 修复版本:待发布 diff --git a/docs/tasks/PROGRESS-readonly-pages-fix-20260916.md b/docs/tasks/PROGRESS-readonly-pages-fix-20260916.md index 0fcd4fad..ab2ae0b3 100644 --- a/docs/tasks/PROGRESS-readonly-pages-fix-20260916.md +++ b/docs/tasks/PROGRESS-readonly-pages-fix-20260916.md @@ -44,6 +44,20 @@ 未改 `jyotish_api_server.py` 行数契约。未删 sidebar 星历入口。未放宽 `dignities` / boundary。 +## 门禁补修(BUG-713) + +Gitea `backend-quality-gate` run `2635`(`a38a9415`)失败: + +`tests/test_api_server_security.py::test_capability_audit_scans_registry_and_local_sources` + +| | | +| --- | --- | +| 原值 | `app_routes` 在 `chart` 后直接 `home`,无 `ephemeris` | +| 新值 | 加入 `'ephemeris'` | +| 原因 | `_scan_app_routes` 扫到了 `frontend/src/app/ephemeris/page.tsx`;这是 BUG-454 同类遗漏,不是放宽 | + +门禁数字:`1 failed, 765 passed, 1 skipped`。本条修完后应回到 766 passed。 + ## 合入 `git push origin HEAD:staging`,核对远端 SHA。部署是否追上见推送后的 `/api/health`。 diff --git a/tests/test_api_server_security.py b/tests/test_api_server_security.py index c085779e..da8b848d 100644 --- a/tests/test_api_server_security.py +++ b/tests/test_api_server_security.py @@ -1592,6 +1592,10 @@ def test_capability_audit_scans_registry_and_local_sources() -> None: 'admin/usage', 'admin/users', 'chart', + # 原值: 无 'ephemeris' + # 新值: 在 chart 与 home 之间加入 'ephemeris' + # 原因: /ephemeris 是产品入口,_scan_app_routes 已扫到;这是 BUG-143/454 同类遗漏(BUG-713) + 'ephemeris', 'home', 'login', 'reports',