From 3e20c125b8b7fe708a9785544fcbfe24561b15bd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 15:27:53 +0800 Subject: [PATCH] test(api): capability audit no longer counts the deleted dead panel as app-visible (BUG-1342) The audit scans frontend app/components source. Its only Case Validation hit was evidence-audit-panel.tsx, never mounted and deleted in #63, so the topic is truthfully gone and case_validator's UX level is thin. Product owner chose option A on issue #63 (Claude fixes directly). Staging gate run 1824 was red on this test. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LutgzyJqNhPpZy1nFsJtN3 --- docs/BUG_HISTORY.md | 1 + tests/test_api_server_security.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index f672e047..29ffd0b2 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -36085,3 +36085,4 @@ - 相关记录:BUG-1247(首页卡片入口已删)。 - 复发自:无。 - 修复版本:分支 `codex/frontend-dead-code-20261013`,尚未合入 staging。 +- 合入后回归(2026-10-14):staging 门禁 run 1824 红在 `tests/test_api_server_security.py::test_capability_audit_scans_registry_and_local_sources`。能力审计扫描前端页面与组件源码判断「界面可见」,唯一命中「案例校验」的是本单删掉的从未挂载的内部面板,删后该项不再可见、对应体验评级由 excellent 变 thin。两处期望按三栏改为如实结果(产品负责人在 issue #63 选 A,由 Claude 直接修)。验收时只跑了被改的两份 Python 测试、没跑全量,是验收侧漏检。防复发补充:删前端组件的单,验收必须跑 Python 全量(审计会扫前端源码)。 diff --git a/tests/test_api_server_security.py b/tests/test_api_server_security.py index d181c887..801c380e 100644 --- a/tests/test_api_server_security.py +++ b/tests/test_api_server_security.py @@ -1632,9 +1632,12 @@ def test_capability_audit_scans_registry_and_local_sources() -> None: 'reports/[reportId]', 'terms', ] + # 原值: 期望集合含 'Case Validation' + # 新值: 去掉 'Case Validation' + # 原因: 唯一命中它的是从未挂载的内部面板 evidence-audit-panel.tsx(含 MEVG 字样), + # BUG-1342 删掉该死组件后,用户界面上本来就看不到案例校验;审计现在如实不再列出 assert set(audit['surfaces']['app_visible_topics']) == { 'Birth Rectification', - 'Case Validation', 'Synastry 16-factor', } assert '/api/deep_varga_avastha' in audit['surfaces']['api_endpoints'] @@ -1666,7 +1669,11 @@ def test_capability_audit_scans_registry_and_local_sources() -> None: assert all('ux_next_action' in row for row in ux['next_queue']) ux_by_id = {row['id']: row for row in ux['rows']} assert ux_by_id['birth_time_rectifier']['ux_level'] in {'excellent', 'usable'} - assert ux_by_id['case_validator']['ux_level'] == 'excellent' + # 原值: case_validator 的 ux_level == 'excellent' + # 新值: == 'thin' + # 原因: 同上,'excellent' 靠的是从未挂载的 evidence-audit-panel.tsx 被扫成「界面可见」; + # BUG-1342 删掉它后按真实界面评分,案例校验没有用户入口,评为 thin 是如实结果 + assert ux_by_id['case_validator']['ux_level'] == 'thin' assert ux_by_id['synastry_16factor']['ux_level'] == 'excellent' for technique_id in [ 'ashtakavarga_pav',