|
|
@@ -0,0 +1,65 @@
|
|
|
+# discovery-2026-12-02-1205(lan-248·只读复核+扫描+pytest审计)
|
|
|
+
|
|
|
+> 只读;不改 src/tests/API_REFERENCE/sc-key-map/.tdd;证据 `file:Lx`;本轮 **0 live e2e / 0 pytest run**(仅静态取证);运行期结果=待核实;未命中=「未发现(扫描口径)」;仅建议;G-304-1/B-260-1/B-325-1 等长期 blocker **只登记不销号**;源台账 `discovery-2026-12-02-1030.md`。
|
|
|
+> 复核基准:10:51 `23c130645 test(e2e): S-cfc-497 + S-cfc-496 三流用例`(**仅新增 2 个 test 文件,不改生产源码** `git show 23c130645 --stat`);1030 已于 10:54 `29833a06d` 扫描其后态。
|
|
|
+
|
|
|
+## 1) 复核 1030 五键缺口 · 10:51 落地后是否消化
|
|
|
+
|
|
|
+| 能力键 / 来源 | 1030 记录缺口(摘) | 10:51 `23c130645` 是否消化 | 判定 | 当前证据 `file:Lx` / commit |
|
|
|
+|---|---|---|---|---|
|
|
|
+| **SC-P-70 `tongue.emotion.capture`**;`sc-key-map.md:187`;SRS/specs 未见 | RED 未跑通;API doc §4.37 缺 key/assessmentRef/MIME/模糊/低置信/隐私;`AiGateway` 丢 `is_blur/sharpness`;`assessmentRef` 不落库;B-70-1(非照片500非400)/B-70-2/N-R373-*;P1 | 10:51 只加 SC-P-84/496 用例;**无关**。(已单独于 10:45 `06e734b17`、10:12 `aada44499`、06:41 `68ce07fcd` 加测/补约,但不转态、不补文档、不修 AiGateway) | **仍缺** | `sc-key-map.md:187` RED/S-cfc-289;`API_REFERENCE.md:1564-1613` §4.37 仅4键无 key/assessmentRef;`AiGateway.java:1005-1050`(`:1012-1015,:1043-1046`)仅 `emotions/dominant_emotion/dominant_label_zh/all_emotions`;`EmotionRecognitionController.java:34,66,95` `isBlurry` `:143-152` 读 `is_blur/sharpness` 但 gateway 不注入→模糊拒绝链路空转;`Result.error→code500`(`Result.java:37-41`)非400;MIME `:47-48,isSupportedImage` 仅 image/jpeg|jpg|png;`assessmentRef` 生成 `:132`+`buildAssessmentRef:188`+`EmotionCheckinDTO.java:27` 但 `EmotionCheckinService.createCheckin` `:47-90` 不读不存、`EmotionCheckin` 无列;e2e `tongue-emotion-sc-p70.spec.js`10 + unit `TongueEmotionCaptureContractTest`8;TC 键 `P-70`≠`SC-P-70` `parent.md:102,200,296`;`68ce07fcd`;B-70 在 test header 非 blockers.md |
|
|
|
+| **SC-P-66 `privacy.setting.config`**;`sc-key-map.md:183`;SRS/specs 未见 | RED 未跑通;`SC-P-66→/api/consent/*` 文档不符实际 `/api/privacy/setting/*`;`/api/privacy` 不入 LOGIN_REQUIRED;`selectOne(null)`;`effectiveSharingScope/isSensitiveFieldExposed` 无 caller;迁移512;P0 G-304-1;B-260-1 | 10:51 无关;(10:12 `aada44499` + 07:14 `8273554e3` 已加测+实现,不转态/不补文档/不改拦截器) | **仍缺** | `sc-key-map.md:183` RED/S-cfc-287;实现 `PrivacySettingController.java:23,29` `/api/privacy/setting/get\|save` + `PrivacySettingService` + 迁移512 `schema.sql`;`JwtInterceptor.java:100-243` **无 `/api/privacy`**(仅 `/api/mind/:138` `/api/aiyunyi/:123`…)→ 匿名 `userId=-1` `setAnonymousUser:393` 非401;`PrivacySettingService.java:91 effectiveSharingScope`,`:102 isSensitiveFieldExposed`,`:120-135 selectOne(...)+:133 selectOne(null)`;非法 scope→400 `Result.badRequest`;`API_REFERENCE.md:3584` 仅 `/api/consent/*`(`ConsentController.java:19`)**无 `/api/privacy/setting/*`**;e2e `privacy-setting-sc-p66.spec.js`10 + unit `PrivacySettingConfigContractTest`13;TC `SC-P-66/-E/-P` `parent.md:90,191,288`;**G-304-1 `blockers.md:3205` P0**;**B-260-1 `blockers.md:2245`**;`8273554e3`,`aada44499` |
|
|
|
+| **`food.rule.pairingMatrix`**;CR-03 `docs/需求分析/2026-11-22-食材推荐加权规则引擎需求变更.md:159-175,:273` `pairing_effect×w4`:133;第六节#3:273;SRS/specs 未见 | **无 sc-key-map 行**;**无 TC**;键名漂移;无 key 后端入口/无生产 caller;`loadEnabledRules List<FoodPairingMatrix>` vs `resolvePairingEffect List<Map>`;**CR-07 硬避让未接线**;无 API doc;no TC+no e2e(本键)+状态机未登记+API doc不一致+实现不完整;P1 | 10:51 无关;(07:25 `af9a9558d` 实现 service+mapper;09:43 `77dbbdb75` 加 S-cfc-507 e2e;**e2e 打 `/api/admin/food-rule/pairing/*` 内存 `food.ops`,非本键**) | **仍缺** | `sc-key-map.md` **无 `food.rule.pairingMatrix`**、无 `food.ops.ruleManagement`、无 CR-07 `diet.menu.pairingConstraint`(`docs/...2026-11-22...md:273,277,81,236,179,292`);`tests/test-cases/parent.md|child.md` **无 TC**;`FoodPairingMatrixService.java:59 resolvePairingEffect(List<Map>...)`,`:76 requiresAvoidance`,`:96 loadEnabledRules→List<FoodPairingMatrix>` `:100-108`,`isAvoidanceRelation` `xiangke/antagonism` `:111-113`;`FoodService.java:29-46` `food.rule.pairingMatrix` 注释;**无生产 caller**;admin `FoodRuleManagementController.java` `@RequestMapping("/api/admin/food-rule")` 键 `food.ops.ruleManagement` `/pairing/list\|save\|delete`;`FoodRuleManagementService.java:43` **内存 `Map<Long,FoodPairingMatrix> pairings`**、无 Mapper、不写 `food_pairing_matrix`(`schema.sql:7870`);CR-07 `DietRecommendationService.java:78-81 KNOWN_AVOID_PAIRS`(2条硬编码)`applyPairingAvoidance:818,call:795`,`:75` 注“food_pairing_matrix 尚未接入本链路”;e2e `s-cfc-507-pairing-matrix.spec.js`12 钉 **B-507-1/2/3**(白名单/clamp/必填缺失,**承袭不销号**)+ unit `FoodPairingMatrixContractTest`20 + `DietMenuPairingConstraintContractTest`6;`af9a9558d`,`77dbbdb75`;**API_REFERENCE 无** |
|
|
|
+| **SC-P-84 `share.link.generate`**;`sc-key-map.md:201`;SRS/specs 未见 | RED 未跑通;TC 键 `P-84`;SC-P-84 冲突 `report-closedloop-kickoff-20261106.md`; NPE 缺 targetType; API doc `:2903-2917` 不一致; G-304-1; **P1** | **10:51 `23c130645` +S-cfc-497 e2e `s-cfc-497-share-link-generate.spec.js`13(仅测试,不改源码);gap 未转态/未补文档/未修 NPE/未解 G-304-1** | **仍缺** | `sc-key-map.md:201` RED/S-cfc-300;`ShareController.java:38 /create`; **`:46 params.get("targetType").toString()` NPE**; `:41-44 userId==null` 但匿名 `userId=-1` → `ShareService.canCreateShare:216-218 userId<=0→false`→`Result.error("无权分享该内容")code500` `Result.java:37-41` **非401**;`/api/share/create` **不在 `JwtInterceptor.LOGIN_REQUIRED_PATHS`**(仅 `/api/share/qrcode:101`)`setAnonymousUser`; `ShareController:76 Integer.parseInt(duration...)` NPE/NumberFormat→500; `/api/share/click` 匿名无守卫; `canCreateShare:229-230 familyId==null\|\|...`; `canReadSharedTarget:237-249`; `resolveFamilyId:252-260`; `c71a518cf` 6/6 + `ShareLinkGenerateContractTest`6;e2e13;**G-304-1 `blockers.md:3205`**;冲突 `report-closedloop-kickoff-20261106.md:23`→`health.report.share` vs `share.link.generate`;TC `P-84/-E/-P` `parent.md:116,214,310`;**API_REFERENCE.md:2911** `/api/share/create`需登录→`ShareEvent`**无越权/NPE/401/duration 语义** |
|
|
|
+| **`ai.aiyunyi.upload`**;B.7 `docs/爱云医接入/爱云医接口契约-完整版.md:2773-2782`;`docs/2026-11-24-爱云医AI检测接入方案.md` §3.3/§4.1;SRS/specs 未见 | **无 sc-key-map key**;**无 TC**;API doc 无 `/api/aiyunyi/upload`/B.7;unit says S-cfc-489;**P1**;N-R373-2 | **10:51 `23c130645` +S-cfc-496 e2e `s-cfc-496-ai-aiyunyi-upload.spec.js`9(仅测试,不改源码);不改 sc-key-map/API doc/blockers** | **仍缺** | `sc-key-map.md` **无 key**;**无 TC**;`AicdsController.java:79-93 POST /api/aiyunyi/upload @RequestParam file 必填/path 选填 + isAllowedRole:63-66`(任何登录角色,非admin)`@RequestAttribute role`; `JwtInterceptor.java:123 /api/aiyunyi/` LOGIN_REQUIRED 匿名401 + 二道防线; `AicdsDetectionService.uploadFile`; `AicdsGatewayService.java:648-710 /app-api/detection/package/enter/upload`(**/app-api/ 非 /open-api/**,平台免登录仅网关签名头); `4fc5c828f` + unit `AiyunyiUploadContractTest`12; e2e9 钉 **缺file→500/空file→500/非multipart→400/仅POST→405/上游→500/匿名401/任何登录角色**(承袭不销号); **外部爱云医上游未 live=待核实 N-R373-2 `blockers.md:4049`**; **API_REFERENCE 无** |
|
|
|
+
|
|
|
+**小结**:五键 **全部「仍缺」**,10:51 仅对 SC-P-84/S-cfc-497 与 `ai.aiyunyi.upload`/S-cfc-496 **补入测试**(e2e+unit 已存在,1030 已计),**未**关闭任一 1030 缺口(sc-key-map 未转态/未登记、用例台账键名漂移或无 TC、API doc 不一致、实现残留、长期 blocker 未销号)。运行期是否真绿(e2e live、上游可达、生产部署、blocker 现象)本轮 **待核实**(0 live run)。无任何键判「已消化」。
|
|
|
+
|
|
|
+## 2) 近 6h src 提交对照 sc-key-map + 用例台账 + API_REFERENCE(只读)
|
|
|
+
|
|
|
+| commit | src 变更(stat) | 能力键 | sc-key-map 登记? | 用例台账 TC? | API doc 一致? | 残余缺口 |
|
|
|
+|---|---|---|---|---|---|---|
|
|
|
+| `c71a518cf` 09:53 S-cfc-497 | `ShareController.java`+4 `ShareService.java`+84 分享权限闭环 6/6 | `share.link.generate`/SC-P-84 | SC-P-84 RED `sc-key-map.md:201`**未更新** | TC 键`P-84`≠`SC-P-84` `parent.md:116,214,310` | 不一致 `API_REFERENCE.md:2911` 无越权/NPE/401 | NPE `ShareController.java:46`;匿名非401(`JwtInterceptor` 未含 `/api/share/create`;`canCreateShare:216-218`);`familyId==null:229-230`;**G-304-1**;冲突 `report-closedloop...:23`;未转态 |
|
|
|
+| `4fc5c828f` 08:53 S-cfc-496 | `AicdsController`+29 `AicdsDetectionService`+16 `AicdsGatewayService`+90 | `ai.aiyunyi.upload` | **未登记** | **无 TC** | **缺** `/api/aiyunyi/upload`/B.7 | 登录门 `JwtInterceptor.java:123`✓+角色闸 `AicdsController:63-66`✓(任何登录角色);**上游未 live=待核实 N-R373-2**;缺file/空→500、非multipart→400 钉住不造绿;`sc-key-map`/doc 未更新 |
|
|
|
+| `af9a9558d` 07:25 S-cfc-507 | `FoodPairingMatrixMapper`+12 `FoodPairingMatrixService`+168 `FoodService`+19 | `food.rule.pairingMatrix`(CR-03:273) | **未登记**(无 `food.*`;admin 键 `food.ops.ruleManagement` 亦未登记) | **无 TC** | **缺** | **无生产 caller**;`loadEnabledRules List<FoodPairingMatrix>`vs`resolvePairingEffect List<Map>`;**admin 内存 `FoodRuleManagementService.java:43` 不落 `food_pairing_matrix`**;**CR-07 仅硬编码 `KNOWN_AVOID_PAIRS` `DietRecommendationService.java:78-81`,未接 `food_pairing_matrix`,`diet.menu.pairingConstraint` 未登记**;B-507-* 承袭 |
|
|
|
+| `8273554e3` 07:14 S-cfc-505 | 新增 `PrivacySetting{,DTO,Mapper,Service,Controller}` +迁移512 +`schema.sql` | `privacy.setting.config`/SC-P-66 | SC-P-66 RED `sc-key-map.md:183`**未更新** | TC `SC-P-66/-E/-P` `parent.md:90,191,288`(实现前已有) | 不一致 `API_REFERENCE.md:3584`→`/api/consent/*`**无 `/api/privacy/setting/*`** | `/api/privacy`**不入 LOGIN_REQUIRED**`JwtInterceptor.java:100-243`;`selectOne(null):133`;`effectiveSharingScope:91/isSensitiveFieldExposed:102`**无 caller**;**G-304-1/B-260-1**;未转态 |
|
|
|
+| `169b8f11c` 06:53 S-cfc-78 | cfc-web `Families.vue`+5/-24 删「更多」留进入工作台/编辑 | `admin.family.actionMenu`(源 `docs/需求分析/2026-11-13-家庭运营工作台重构需求变更.md §S1-1`) | **未登记** | **无 TC**(仅 web 单测 `cfc-web/src/__tests__/Families.actionMenu.spec.js`) | 不涉 API(前端) | `/families/:id/workbench` vs 目标 `/family-workbench?familyId=`**B-202-1 承袭不改**;未转态 |
|
|
|
+| `68ce07fcd` 06:41 S-cfc-506 | `EmotionRecognitionController`+122/-11 `EmotionCheckinDTO`+3 `EmotionRecognitionResult`-2 | `tongue.emotion.capture`/SC-P-70 | SC-P-70 RED `sc-key-map.md:187`**未更新** | TC 键`P-70`≠`SC-P-70` `parent.md:102,200,296` | 不一致 `API_REFERENCE.md:1564-1613`**未更新** | `AiGateway.java:1005-1050`**不透传 `is_blur/sharpness`**→模糊拒绝空转;`Result.error→500`非400(B-70-1);`assessmentRef`**不落库**(`EmotionCheckinService` 不读);MIME 缺非照片仍500;**B-70-1/B-70-2**;未转态 |
|
|
|
+
|
|
|
+> 六 commit 中 **无任何一项**同步改 `sc-key-map.md`、`API_REFERENCE.md`、`tests/test-cases`;新增能力键 `privacy.setting.config`/`food.rule.pairingMatrix`/`ai.aiyunyi.upload`/`admin.family.actionMenu` **sc-key-map 未登记**;`food.rule.pairingMatrix` **无 TC**;`ai.aiyunyi.upload` **无 TC**;`admin.family.actionMenu` **无 TC**。其余细节=**未发现(扫描口径)**。`169b8f11c` 非 src/main 后端/非 API。运行期=待核实。
|
|
|
+
|
|
|
+## 3) cfc-langgraph 无逐节点 pytest 覆盖 graph(依 1030 台账 `discovery-2026-12-02-1030.md:15-30` 清单·只读·本轮不跑 pytest)
|
|
|
+
|
|
|
+测试口径(`cfc-langgraph/tests/`,10 收集文件 +`tests/qna/test_graph.py` 因 **`src.qna` 缺失** `qna-missing` `pytest.importorskip` 全 skipped;`tests_contract` 未计入;**B-325-1 `blockers.md:3474` lg pytest 进程不退出/EXIT=124 `@app.on_event` `app/main.py:39,:84` 不销号**;当前盘点 `tests/*.py` 无逐节点用例)。**下列全部无逐节点 pytest**(现有最强口径见右列):
|
|
|
+
|
|
|
+| graph(`StateGraph`+`add_node`) | nodes `file:Lx` | 现有测试口径(非逐节点) |
|
|
|
+|---|---|---|
|
|
|
+| `src/graphs/emotion.py build_emotion_graph` | `load_image,analyze_emotion,format_result,cleanup` `emotion.py:157-160` | 无 |
|
|
|
+| `src/graphs/tongue.py build_tongue_graph` | `load_image,analyze_tongue,parse_result` `tongue.py:122-124` | 仅缺文件 422 `tests/test_tongue.py` |
|
|
|
+| `src/graphs/questionnaire.py build_questionnaire_graph` | `build_prompt,call_llm,validate` `questionnaire.py:105-107` | graph-level `tests/test_graph.py`(非逐节点) |
|
|
|
+| `app/graphs/analysis_graph.py create_analysis_graph` | `gather_data,analyze` `analysis_graph.py:89-90` | endpoint-level `tests/test_analyze.py` |
|
|
|
+| `app/graphs/chat_graph.py create_chat_graph` | `classify_intent,load_context,llm_call,save_memory` `chat_graph.py:213-216` | endpoint-level `tests/test_chat.py`;`test_intent/test_memory`非本图节点 |
|
|
|
+| `app/graphs/health_plan_graph.py create_health_plan_graph` | `collect_data,generate_plan,regenerate_section` `health_plan_graph.py:353-355` | 无 graph;`test_health_plan.py` 测 `app.models`+`app.api.adapter` |
|
|
|
+| `app/graphs/portrait_generation_graph.py` | `generate_portrait` `portrait_generation_graph.py:127` | 无 |
|
|
|
+| `app/graphs/question_generation_graph.py` | `analyze_user_profile,select_dimensions,generate_questions,validate_questions,avoid_duplicates` `question_generation_graph.py:361-365` | 无 |
|
|
|
+| `app/graphs/self_check_analysis_graph.py` | `parse,llm,validate` `self_check_analysis_graph.py:100-102` | 无 |
|
|
|
+| `app/graphs/nutrition_graph.py` | `generate_answer,save_memory` `nutrition_graph.py:149-150` | 无 |
|
|
|
+| `app/graphs/health_butler_graph.py` | `load_knowledge,search_knowledge,llm_answer,save_memory` `health_butler_graph.py:278-281` | 无 |
|
|
|
+| `app/graphs/health_coach_graph.py` | `generate_answer,save_memory` `health_coach_graph.py:183-184` | 无 |
|
|
|
+| `app/graphs/self_check_trend_graph.py` | `llm` `self_check_trend_graph.py:64` | 无 |
|
|
|
+| `app/graphs/recommend_graph.py`(非 `StateGraph`,`RecommendAgent.run`) | — | endpoint-level `tests/test_recommend.py`(非 graph 节点) |
|
|
|
+
|
|
|
+> 1030 清单 12 graph + `recommend_graph`;盘点补 `app/graphs/article_quiz_graph.py`、`app/graphs/innate_portrait_graph.py`(**不在 1030 清单,未逐项核验=未发现/扫描口径**);`src/graphs/__init__.py` 无额外 graph。**全部无逐节点 pytest**;本轮仅登记不执行。
|
|
|
+
|
|
|
+## 长期 blocker(仅登记现象·不销号)
|
|
|
+
|
|
|
+- **G-304-1**(P0 跨家庭越权拒绝系统性缺失) `docs/tdd/test/blockers.md:3205` + SC-P-66/privacy `PrivacySettingService` + `JwtInterceptor` + share `ShareService` + `s-cfc-497-share-link-generate.spec.js` + `privacy-setting-sc-p66.spec.js`;**未发现已解决**。
|
|
|
+- **B-260-1**(P1 `/web/privacy.html`+`/web/agreement.html` 生产 404) `blockers.md:2245`;privacy 域承袭;**不销号**。
|
|
|
+- **B-325-1**(P1 lg pytest 进程不退出/EXIT=124 `@app.on_event` `app/main.py:39,:84` `JavaClient._get_client`) `blockers.md:3474`;**未发现已解决**。
|
|
|
+- 承袭 **N-R373-2**(lg 上游 AI `ConnectError`) `blockers.md:4049`;**B-70-1/B-70-2**(tongue e2e header);**B-507-1/2/3**(S-cfc-507 header);**B-202-1**(S-cfc-78);**B-84-1**(G-304-1 子类);**B-260-1**;均**仅登记不销号**。
|
|
|
+
|
|
|
+## 建议后续动作(仅建议·不代执行)
|
|
|
+
|
|
|
+- 补用例:SC-P-70 严格400 + `AiGateway` 透传 `is_blur/sharpness` + `assessmentRef` 落库断言;SC-P-66 匿名401 + `/api/privacy` 入 LOGIN_REQUIRED + `effectiveSharingScope` 生产 caller;SC-P-84 缺 targetType 400 + 匿名401 + `duration` 校验 + `familyId==null` 收口;`food.rule.pairingMatrix` 本键 N/E/P + CR-07 接 `food_pairing_matrix` + admin 落库 + B-507-*;`ai.aiyunyi.upload` 缺file/空→400 + 上游 live N-R373-2。
|
|
|
+- 建 RED 任务:`sc-key-map` 登记 `food.rule.pairingMatrix`/`diet.menu.pairingConstraint`/`ai.aiyunyi.upload`/`admin.family.actionMenu`/`food.ops.ruleManagement`;`API_REFERENCE` 补 `/api/privacy/setting/*`、`/api/aiyunyi/upload`、SC-P-70 §4.37 新增契约、SC-P-84 §4.59.4.3 越权/NPE/401;TC 键 `P-70`→`SC-P-70`、`P-84`→`SC-P-84`、补 SC-P-496/507 TC。
|
|
|
+- 登记 blocker:G-304-1/B-260-1/B-325-1/N-R373-2/B-70-1/B-70-2/B-507-1/2/3/B-202-1 承袭;SC-P-84 冲突 `report-closedloop-kickoff...:23` vs `sc-key-map.md:201` 待裁决;**本轮只读、未 live run,运行期=待核实**。
|