Browse Source

Merge branch 'task/S-cfc-279' into tmp/cfclub-merge

Agnes Agent 21 hours ago
parent
commit
c20ce4885e
28 changed files with 6823 additions and 16 deletions
  1. 288 0
      cfc-backend/src/test/java/com/etotem/cfc/unit/ButlerAiCollaborateAuditContractTest.java
  2. 278 0
      cfc-backend/src/test/java/com/etotem/cfc/unit/PlanAiGenerateEdgeContractTest.java
  3. 224 0
      cfc-frontend/__tests__/pages/shop/checkout.couponAfterAddressReturn.spec.js
  4. 2 2
      cfc-frontend/pages/health/components/MemberChipPicker.vue
  5. 14 3
      cfc-frontend/pages/shop/checkout/checkout.vue
  6. 1 1
      cfc-web/.last_build_commit
  7. 2 2
      cfc-web/package-lock.json
  8. 1 1
      cfc-web/package.json
  9. 87 0
      cfc-web/public/CHANGELOG-v1.0.md
  10. 88 1
      cfc-web/public/CHANGELOG.md
  11. 136 0
      docs/2026-11-19-task-time-window-guard.md
  12. 7 1
      docs/2026-11-23-hourly-task-redesign-proposal.md
  13. 385 0
      docs/2026-11-24-爱云医AI检测接入方案.md
  14. 174 0
      docs/scripts/fingerprint_engine.py
  15. 377 0
      docs/superpowers/plans/2026-11-10-probiotic-article-kb-check.md
  16. 369 0
      docs/superpowers/plans/2026-11-14-order-status-refund-cleanup.md
  17. 408 0
      docs/superpowers/plans/2026-11-15-family-workbench-tabs.md
  18. 173 0
      docs/superpowers/specs/2026-11-10-probiotic-article-kb-check-design.md
  19. 88 0
      docs/superpowers/specs/2026-11-15-family-workbench-tabs-design.md
  20. 44 0
      docs/tdd/orchestration/report-deploy-2026-11-25-ab1f7595.md
  21. 106 0
      docs/tdd/orchestration/report-dev-2026-11-25-1251.md
  22. 117 0
      docs/tdd/orchestration/report-dev-2026-11-25-1426.md
  23. 12 5
      docs/tdd/orchestration/report-test-2026-11-24-R373.md
  24. 120 0
      docs/tdd/orchestration/report-test-2026-11-26-R374-0030.md
  25. 123 0
      docs/tdd/orchestration/report-test-2026-11-26-R375-0024.md
  26. 2787 0
      docs/爱云医接入/爱云医接口契约-完整版.md
  27. 190 0
      docs/爱云医接入/爱云医联调启动Checklist-20261125.md
  28. 222 0
      scripts/import_rmg365.py

+ 288 - 0
cfc-backend/src/test/java/com/etotem/cfc/unit/ButlerAiCollaborateAuditContractTest.java

@@ -0,0 +1,288 @@
+package com.etotem.cfc.unit;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Scanner;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ * 契约级单测(TDD-RED 阶段,S-cfc-255):能力键 {@code butler.ai.collaborate} 的「可审计 + 迁移落地 +
+ * 反馈家长载荷 + 审核闸门」补充契约。
+ *
+ * <p>契约溯源:
+ * <ul>
+ *   <li>需求:{@code tests/user-scenarios/应用场景总览.md} SC-H-06(与 AI 管家协同闭环):
+ *       闭环标记 → 知识反哺(反哺审核)→ 反馈家长;边界 = 反哺审核 / 不泄露隐私 / 可审计;</li>
+ *   <li>验收:{@code tests/test-cases/human-butler.md} TC-H-06(闭环字段完整、待审、退回修改、知识命中)、
+ *       TC-H-06-E(隐私脱敏、审核未通过不得入库、幂等去重、重开关联历史)、
+ *       TC-H-06-P(审核权归运营、跨家庭 403);</li>
+ *   <li>设计:派发单 {@code docs/tdd/orchestration/RED-pending-dispatch-2026-11-14.md} S-cfc-255
+ *       (API_REFERENCE §4.12/§4.13;AdminUnifiedKnowledgeController 反哺审核);</li>
+ *   <li>项目铁律:schema.sql 与 {@code DatabaseInitializer.runMigrations()} 必须同步,迁移幂等。</li>
+ * </ul></p>
+ *
+ * <p>同批已合入主链的 {@code ButlerAiCollaborateLoopContractTest} 覆盖知识命中 / 退回重提 / 闭环重开;
+ * 本文件补齐其未覆盖的四类契约缺口:迁移入口与审计表 DDL、审计实体要素、家长通知载荷、
+ * 审核闸门与家庭维度审计查询。宿主类仍为 {@code ButlerAiCollaborationService} /
+ * {@code ButlerAiFeedback}(当前 src/main 未落地)。</p>
+ *
+ * <p><b>RED 预期</b>:上述迁移方法、审计表/实体、通知 DTO、审核闸门方法均不存在,全部用例因契约缺失失败(红),
+ * 断言原文以 {@code [butler.ai.collaborate]} 开头。GREEN 阶段按本测试锚定的签名实现后自动转绿。</p>
+ *
+ * <p>测试风格:纯反射 + schema.sql 结构锚定,无 Spring 上下文 / 无 DB / 无外部服务,与同批 RED 契约测试
+ * (TeamProfitHook / FamilyJoinValidationRules / ButlerAiCollaborateLoop)一致。</p>
+ */
+class ButlerAiCollaborateAuditContractTest {
+
+    // ==================== 契约常量 ====================
+
+    /** 契约宿主服务(尚未实现):编排「闭环标记 → 知识反哺 → 反馈家长 → 审计留痕」。 */
+    private static final String SERVICE_CLASS = "com.etotem.cfc.service.ButlerAiCollaborationService";
+    /** 数据库迁移唯一入口宿主。 */
+    private static final String DATABASE_INITIALIZER = "com.etotem.cfc.config.DatabaseInitializer";
+    /** 契约审计实体(尚未落地):一条闭环/反哺/审核操作留痕。 */
+    private static final String AUDIT_ENTITY_CLASS = "com.etotem.cfc.entity.ButlerAiCollaborationAudit";
+
+    /** DatabaseInitializer 中反哺/审计迁移方法候选名(项目铁律:schema.sql ↔ 迁移同步)。 */
+    private static final String[] MIGRATE_METHOD_CANDIDATES = {
+            "migrateButlerAiCollaboration", "migrateButlerAiFeedback", "migrateButlerAiCollaborate"
+    };
+    /** 独立审计表候选名;若未建独立表,则允许在 butler_ai_feedbacks 上落审计列。 */
+    private static final String[] AUDIT_TABLE_CANDIDATES = {
+            "butler_ai_collaboration_audit_log", "butler_ai_collaboration_audits", "butler_ai_feedback_audits"
+    };
+    /** 反馈家长通知载荷候选名。 */
+    private static final String[] NOTIFY_DTO_CANDIDATES = {
+            "com.etotem.cfc.dto.ButlerCollaborateNotifyDTO",
+            "com.etotem.cfc.dto.ButlerCollaborateNotifyVo",
+            "com.etotem.cfc.dto.ButlerAiCollaborateNotifyDTO",
+            "com.etotem.cfc.dto.ButlerFeedbackNotifyDTO"
+    };
+    /** 审核闸门方法候选名(未通过不得直接入知识库,TC-H-06-E)。 */
+    private static final String[] REVIEW_GATE_METHODS = {
+            "isApprovedForKnowledge", "canPublishToKnowledge", "isKnowledgeReady", "isFeedbackApproved"
+    };
+    /** 通知载荷的来源追溯字段候选名(原家长追问可关联历史,不丢上下文)。 */
+    private static final String[] SOURCE_TRACE_FIELDS = {
+            "sourceTrace", "sourceWorkorderId", "relatedWorkorderId"
+    };
+
+    // ==================== 正常流:迁移落地与审计要素 ====================
+
+    @Test
+    @DisplayName("正常流-1:DatabaseInitializer 应登记 butler.ai.collaborate 反哺/审计迁移入口")
+    void databaseInitializer_hasCollaborationMigration() {
+        Class<?> clazz = loadClass(DATABASE_INITIALIZER);
+        if (clazz == null) {
+            fail("[butler.ai.collaborate] DatabaseInitializer 不存在,无法验证反哺/审计迁移入口。");
+        }
+        Method found = null;
+        for (Method m : clazz.getDeclaredMethods()) {
+            for (String candidate : MIGRATE_METHOD_CANDIDATES) {
+                if (m.getName().equals(candidate)) {
+                    found = m;
+                    break;
+                }
+            }
+            if (found != null) {
+                break;
+            }
+        }
+        assertNotNull(found,
+                "[butler.ai.collaborate] DatabaseInitializer 应提供反哺/审计迁移方法(候选 "
+                        + Arrays.toString(MIGRATE_METHOD_CANDIDATES) + "):按项目铁律在 runMigrations() 中"
+                        + "幂等建 butler_ai_feedbacks 与审计表,并与 schema.sql 同步(S-cfc-255)。实现未落地。");
+        assertTrue(Modifier.isPrivate(found.getModifiers()),
+                "[butler.ai.collaborate] 迁移方法 " + found.getName() + "() 应为私有方法(runMigrations 内部调用)。");
+    }
+
+    @Test
+    @DisplayName("正常流-2:schema.sql 应落地审计轨迹(独立审计表或反哺表审计列)")
+    void schemaSql_hasAuditTrailDdl() {
+        String schema = readSchemaSql();
+        String ddl = null;
+        for (String table : AUDIT_TABLE_CANDIDATES) {
+            String candidate = extractTableDdl(schema, table);
+            if (candidate != null) {
+                ddl = candidate;
+                break;
+            }
+        }
+        if (ddl == null) {
+            ddl = extractTableDdl(schema, "butler_ai_feedbacks");
+            assertNotNull(ddl,
+                    "[butler.ai.collaborate] schema.sql 缺少 butler_ai_feedbacks 或候选审计表("
+                            + Arrays.toString(AUDIT_TABLE_CANDIDATES) + ")建表(SC-H-06 可审计)。实现未落地。");
+        }
+        for (String column : new String[]{"actor_id", "actor_role", "action", "family_id", "created_at"}) {
+            assertTrue(ddl.contains(column),
+                    "[butler.ai.collaborate] 审计 DDL 缺少 " + column
+                            + " 列:闭环/反哺/审核动作需记录操作人、角色、动作、家庭范围与时间(可审计)。");
+        }
+    }
+
+    @Test
+    @DisplayName("正常流-3:审计实体应承载操作人/角色/动作/家庭/时间完整要素")
+    void auditEntity_existsWithTraceFields() {
+        Class<?> entity = loadClass(AUDIT_ENTITY_CLASS);
+        if (entity == null) {
+            fail("[butler.ai.collaborate] ButlerAiCollaborationAudit 审计实体不存在:契约要求闭环标记、"
+                    + "反哺提交、审核动作全程留痕可审计(SC-H-06 边界)。");
+        }
+        for (String field : new String[]{
+                "workorderId", "feedbackId", "action", "actorId", "actorRole", "familyId", "detail", "createdAt"}) {
+            assertNotNull(findField(entity, field),
+                    "[butler.ai.collaborate] 审计实体应含 " + field + " 字段(操作人/角色/动作/家庭范围/时间/详情)。");
+        }
+    }
+
+    @Test
+    @DisplayName("正常流-4:反馈家长通知载荷应存在并携带闭环结论与来源追溯")
+    void parentNotifyPayload_existsWithClosureFields() {
+        Class<?> dto = null;
+        String dtoName = null;
+        for (String candidate : NOTIFY_DTO_CANDIDATES) {
+            Class<?> loaded = loadClass(candidate);
+            if (loaded != null) {
+                dto = loaded;
+                dtoName = candidate;
+                break;
+            }
+        }
+        if (dto == null) {
+            fail("[butler.ai.collaborate] 反馈家长通知载荷 DTO 不存在(候选 "
+                    + Arrays.toString(NOTIFY_DTO_CANDIDATES) + "):契约要求审核通过后反馈原家长、关闭升级链路"
+                    + "(TC-H-06 步骤 5)。实现未落地。");
+        }
+        assertNotNull(findField(dto, "workorderId"),
+                "[butler.ai.collaborate] " + dtoName + " 应含 workorderId 字段(定位已闭环工单)。");
+        assertNotNull(findField(dto, "conclusion"),
+                "[butler.ai.collaborate] " + dtoName + " 应含 conclusion 字段(反馈处置结论,不含原始隐私对话)。");
+        boolean hasTrace = false;
+        for (String candidate : SOURCE_TRACE_FIELDS) {
+            if (findField(dto, candidate) != null) {
+                hasTrace = true;
+                break;
+            }
+        }
+        assertTrue(hasTrace,
+                "[butler.ai.collaborate] " + dtoName + " 应含来源追溯字段("
+                        + Arrays.toString(SOURCE_TRACE_FIELDS) + " 之一),使家长再次追问可关联历史、不丢上下文"
+                        + "(TC-H-06-E 步骤 4)。");
+    }
+
+    // ==================== 异常流:审核闸门与家庭维度审计 ====================
+
+    @Test
+    @DisplayName("异常流-1:应有审核闸门阻止未通过反哺直接入知识库(TC-H-06-E)")
+    void reviewGate_existsToBlockUnapprovedKnowledge() {
+        Class<?> svc = loadClass(SERVICE_CLASS);
+        if (svc == null) {
+            fail("[butler.ai.collaborate] ButlerAiCollaborationService 不存在,无法验证审核闸门(未通过不得入库)。");
+        }
+        boolean found = false;
+        for (Method m : svc.getDeclaredMethods()) {
+            for (String candidate : REVIEW_GATE_METHODS) {
+                if (m.getName().equals(candidate)) {
+                    found = true;
+                    break;
+                }
+            }
+            if (found) {
+                break;
+            }
+        }
+        assertTrue(found,
+                "[butler.ai.collaborate] 宿主服务应提供审核闸门方法(候选 "
+                        + Arrays.toString(REVIEW_GATE_METHODS) + "):反哺审核未通过时不得直接写入 AI 知识库,"
+                        + "须退回修改(TC-H-06-E 步骤 2、TC-H-06-P 审核权归运营)。实现未落地。");
+    }
+
+    @Test
+    @DisplayName("异常流-2:审计查询应提供家庭维度重载,读取留痕不得跨家庭")
+    void auditLog_hasFamilyScopedOverload() {
+        Class<?> svc = loadClass(SERVICE_CLASS);
+        if (svc == null) {
+            fail("[butler.ai.collaborate] ButlerAiCollaborationService 不存在,无法验证家庭维度审计查询。");
+        }
+        boolean found = false;
+        for (Method m : svc.getDeclaredMethods()) {
+            if (!m.getName().equals("auditLog")) {
+                continue;
+            }
+            Class<?>[] params = m.getParameterTypes();
+            if (params.length == 2 && params[0] == Long.class && params[1] == Long.class) {
+                found = true;
+                break;
+            }
+        }
+        assertTrue(found,
+                "[butler.ai.collaborate] 宿主服务应提供 auditLog(Long workorderId, Long familyId) 家庭维度重载:"
+                        + "审计留痕读取须限定本家庭,不得跨家庭读取反哺/闭环记录(TC-H-06-P 403、SC-H-06 不泄露隐私)。");
+    }
+
+    // ==================== 反射辅助(避免编译期依赖不存在类) ====================
+
+    private Class<?> loadClass(String name) {
+        try {
+            return Class.forName(name, false, Thread.currentThread().getContextClassLoader());
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    private Field findField(Class<?> clazz, String name) {
+        Class<?> c = clazz;
+        while (c != null && c != Object.class) {
+            for (Field f : c.getDeclaredFields()) {
+                if (f.getName().equals(name)) {
+                    return f;
+                }
+            }
+            c = c.getSuperclass();
+        }
+        return null;
+    }
+
+    /** 读取类路径下的 schema.sql 全文。 */
+    private String readSchemaSql() {
+        try (InputStream is = getClass().getClassLoader().getResourceAsStream("schema.sql")) {
+            if (is == null) {
+                return "";
+            }
+            try (Scanner scanner = new Scanner(is, StandardCharsets.UTF_8.name())) {
+                scanner.useDelimiter("\\A");
+                return scanner.hasNext() ? scanner.next() : "";
+            }
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    /** 抽取指定表的 CREATE TABLE DDL 片段(兼容表名带反引号的写法)。 */
+    private String extractTableDdl(String schema, String table) {
+        String marker = "CREATE TABLE IF NOT EXISTS " + table;
+        int idx = schema.indexOf(marker);
+        if (idx < 0) {
+            idx = schema.indexOf("CREATE TABLE IF NOT EXISTS `" + table + "`");
+        }
+        if (idx < 0) {
+            return null;
+        }
+        int end = schema.indexOf(";", idx);
+        if (end < 0) {
+            end = schema.length();
+        }
+        return schema.substring(idx, end);
+    }
+}

+ 278 - 0
cfc-backend/src/test/java/com/etotem/cfc/unit/PlanAiGenerateEdgeContractTest.java

@@ -0,0 +1,278 @@
+package com.etotem.cfc.unit;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ * 契约级单测(TDD-RED,预期失败/红):能力键 {@code plan.ai.generate} 的边界/异常流补强。
+ *
+ * <p><b>与同批已合入测试的关系</b>:{@code PlanAiGenerateContractTest}(8 例)已覆盖 SC-P-40/41
+ * 主路径(生成 overview+三板块、会员门禁、生成超时 Fallback、重生成不丢其他板块、端点结构);
+ * 本文件只补其未覆盖的 TC-P-41-E 两条 AC:</p>
+ * <ol>
+ *   <li>「重生成板块 A 时断网 → Fallback 保留其他板块不丢」;</li>
+ *   <li>「连续点同一板块重生成 → 幂等,仅 1 次重生成(内容不漂移)」。</li>
+ * </ol>
+ *
+ * <p><b>契约溯源</b>:{@code tests/user-scenarios/应用场景总览.md} SC-P-41(逐板块重新生成/确认,
+ * 重生成不丢其他板块);{@code tests/test-cases/parent.md} TC-P-41-E;
+ * {@code docs/superpowers/api/API_REFERENCE.md} §4.9({@code POST /api/ai/health-coach/send},
+ * LangGraph 路由)、§4.6({@code POST /api/growth/plan/create});
+ * 模块 {@code AIChatController} / {@code AiGateway} / {@code GrowthPlanController};业务域 D。</p>
+ *
+ * <p><b>实现现状(RED 依据)</b>:{@code src/main} 中 {@code AiGateway} 无
+ * {@code generateGrowthPlan(Map, boolean)} / {@code regenerateGrowthPlanSection(Map, boolean)}
+ * 入口,本测试以反射锚定契约宿主并断言方法缺失(红),GREEN 阶段实现后自动转绿。</p>
+ *
+ * <p><b>测试边界</b>:纯反射 + JUnit 5,无 Spring 上下文 / 无 DB / 无真实外部服务调用,
+ * 与同批 RED 契约测试(TeamProfitHookContractTest / TeamStarMultiplierContractTest /
+ * TeamProfitPipelineContractTest / FamilyJoinValidationRulesContractTest)风格一致。</p>
+ */
+class PlanAiGenerateEdgeContractTest {
+
+    /** 契约宿主:AI 统一入口(LangGraph 网关 + Fallback)。 */
+    private static final String GATEWAY_CLASS = "com.etotem.cfc.service.AiGateway";
+
+    /** 契约方法(SC-P-40/41,GREEN 按此签名落地)。 */
+    private static final String METHOD_GENERATE = "generateGrowthPlan";
+    private static final String METHOD_REGENERATE = "regenerateGrowthPlanSection";
+
+    /** 三板块(TC-P-13/TC-P-40:营养补充建议 / 饮食建议 / 运动计划)。 */
+    private static final Collection<String> SECTION_KEYS = Arrays.asList("nutrition", "diet", "exercise");
+
+    // ================================================================
+    // TC-P-41-E-1:重生成时断网 → Fallback 且保留其他板块
+    // ================================================================
+
+    @Test
+    @DisplayName("SC-P-41/TC-P-41-E:重生成 nutrition 时 LangGraph 断网 → Fallback 保留 diet/exercise")
+    void regenerationOfflineFallback_preservesOtherSections() {
+        Object host = gatewayHost();
+
+        Map<String, Object> baseline = asMap(call(host, METHOD_GENERATE, baseInputs(), Boolean.TRUE),
+                "基线生成返回值");
+        assertThreeSections(baseline, "基线生成");
+
+        // 模拟上游不可用:不可达地址 + 短超时 + 熔断打开,任何真实调用都会快速失败
+        setField(host, "baseUrl", "http://127.0.0.1:1");
+        setField(host, "timeoutMs", 50);
+        setField(host, "readTimeoutMs", 50);
+        invokeNoArg(host, "init");
+        setField(host, "circuitOpen", Boolean.TRUE);
+        setField(host, "lastFailureTime", System.currentTimeMillis());
+
+        Map<String, Object> inputs = new LinkedHashMap<String, Object>(baseInputs());
+        inputs.put("sectionKey", "nutrition");
+        inputs.put("content", "【离线新营养建议】");
+        Map<String, Object> result = asMap(
+                callExpectNoThrow(host, METHOD_REGENERATE, inputs, Boolean.TRUE),
+                METHOD_REGENERATE + " 断网返回值");
+
+        assertNotNull(result,
+                "RED[plan.ai.generate] 重生成时 LangGraph 断网必须返回 Fallback,不得返回 null 导致 500");
+        assertEquals(Boolean.TRUE, result.get("fallback_used"),
+                "RED[plan.ai.generate] 重生成断网结果应标记 fallback_used=true");
+        assertThreeSections(result, "断网重生成");
+        for (String key : Arrays.asList("diet", "exercise")) {
+            assertEquals(sectionContent(baseline, key), sectionContent(result, key),
+                    "RED[plan.ai.generate] 重生成断网 Fallback 不得丢失/改写 " + key + " 板块(TC-P-41-E)");
+        }
+    }
+
+    // ================================================================
+    // TC-P-41-E-2:连续点击同一板块重生成幂等
+    // ================================================================
+
+    @Test
+    @DisplayName("SC-P-41/TC-P-41-E:连续点同一板块重生成应幂等(内容不漂移,其他板块不变)")
+    void consecutiveRegeneration_isIdempotent() {
+        Object host = gatewayHost();
+
+        Map<String, Object> baseline = asMap(call(host, METHOD_GENERATE, baseInputs(), Boolean.TRUE),
+                "基线生成返回值");
+        assertThreeSections(baseline, "基线生成");
+
+        Map<String, Object> inputs = new LinkedHashMap<String, Object>(baseInputs());
+        inputs.put("sectionKey", "nutrition");
+        inputs.put("content", "【幂等营养建议】每日补充维生素D3 400IU");
+
+        Map<String, Object> first = asMap(call(host, METHOD_REGENERATE, inputs, Boolean.TRUE),
+                "首次重生成返回值");
+        Map<String, Object> second = asMap(call(host, METHOD_REGENERATE, inputs, Boolean.TRUE),
+                "再次重生成返回值");
+
+        assertThreeSections(first, "首次重生成");
+        assertThreeSections(second, "再次重生成");
+        assertEquals(sectionContent(first, "nutrition"), sectionContent(second, "nutrition"),
+                "RED[plan.ai.generate] 连续点同一板块重生成应幂等,内容不应二次漂移(TC-P-41-E)");
+        for (String key : Arrays.asList("diet", "exercise")) {
+            assertEquals(sectionContent(baseline, key), sectionContent(second, key),
+                    "RED[plan.ai.generate] 连续重生成不得改写未点击的 " + key + " 板块");
+        }
+    }
+
+    // ================================================================
+    // 反射与断言辅助(与 PlanAiGenerateContractTest 同风格)
+    // ================================================================
+
+    private Map<String, Object> baseInputs() {
+        Map<String, Object> inputs = new LinkedHashMap<String, Object>();
+        inputs.put("memberId", 501L);          // 选孩子(不能登录用户/家庭成员)
+        inputs.put("goal", "提升学习自驱力");    // 选目标
+        inputs.put("reportId", 9001L);
+        return inputs;
+    }
+
+    /** 断言结果含 overview + 恰好 nutrition/diet/exercise 三个非空板块。 */
+    private void assertThreeSections(Map<String, Object> plan, String scenario) {
+        Object sectionsObj = plan.get("sections");
+        assertNotNull(sectionsObj,
+                "RED[plan.ai.generate] " + scenario + "结果应含 sections 集合(overview + 三板块)");
+        org.junit.jupiter.api.Assertions.assertTrue(sectionsObj instanceof Collection,
+                "RED[plan.ai.generate] " + scenario + "的 sections 应为集合");
+        Collection<?> sections = (Collection<?>) sectionsObj;
+        assertEquals(3, sections.size(), "RED[plan.ai.generate] " + scenario + "应恰好生成三个板块");
+        for (String key : SECTION_KEYS) {
+            assertFalse(sectionContent(plan, key).trim().isEmpty(), "板块 " + key + " 内容不应为空");
+        }
+    }
+
+    /** 从 sections 集合中按 key 取板块 content(兼容 Map 结构)。 */
+    private String sectionContent(Map<String, Object> plan, String key) {
+        Collection<?> sections = (Collection<?>) plan.get("sections");
+        for (Object item : sections) {
+            Map<String, Object> section = asMap(item, "section");
+            if (key.equals(String.valueOf(section.get("key")))) {
+                Object content = section.get("content");
+                assertNotNull(content, "板块 " + key + " 应含 content");
+                return String.valueOf(content);
+            }
+        }
+        fail("RED[plan.ai.generate] 缺少板块 " + key + "(期望 " + SECTION_KEYS + ")");
+        throw new IllegalStateException("unreachable");
+    }
+
+    private Object gatewayHost() {
+        Class<?> clazz = loadClass(GATEWAY_CLASS);
+        assertNotNull(clazz, "RED[plan.ai.generate] 契约宿主 AiGateway 不存在(实现未落地)");
+        try {
+            Object host = clazz.getDeclaredConstructor().newInstance();
+            invokeNoArg(host, "initFastTemplate");
+            invokeNoArg(host, "init");
+            return host;
+        } catch (Exception e) {
+            fail("RED[plan.ai.generate] AiGateway 实例化失败:" + e.getMessage());
+            throw new IllegalStateException("unreachable");
+        }
+    }
+
+    private Class<?> loadClass(String name) {
+        try {
+            return Class.forName(name, false, Thread.currentThread().getContextClassLoader());
+        } catch (ClassNotFoundException e) {
+            return null;
+        }
+    }
+
+    private Method findMethod(String name, int paramCount) {
+        Class<?> clazz = loadClass(GATEWAY_CLASS);
+        if (clazz == null) {
+            return null;
+        }
+        for (Method m : clazz.getMethods()) {
+            if (m.getName().equals(name) && m.getParameterCount() == paramCount) {
+                return m;
+            }
+        }
+        return null;
+    }
+
+    private Object call(Object host, String method, Object... args) {
+        Method target = findMethod(method, args.length);
+        assertNotNull(target,
+                "RED[plan.ai.generate] 契约方法 AiGateway#" + method + "(" + args.length
+                        + " 参数) 未实现(实现未落地)");
+        try {
+            return target.invoke(host, args);
+        } catch (Exception e) {
+            Throwable cause = e.getCause() != null ? e.getCause() : e;
+            fail("RED[plan.ai.generate] 契约方法 " + method + " 调用失败:" + cause);
+            throw new IllegalStateException("unreachable");
+        }
+    }
+
+    /** 调用时期望不抛异常(Fallback 契约:上游不可用不得 500)。 */
+    private Object callExpectNoThrow(Object host, String method, Object... args) {
+        Method target = findMethod(method, args.length);
+        assertNotNull(target,
+                "RED[plan.ai.generate] 契约方法 AiGateway#" + method + "(" + args.length
+                        + " 参数) 未实现(实现未落地)");
+        try {
+            return target.invoke(host, args);
+        } catch (InvocationTargetException e) {
+            fail("RED[plan.ai.generate] LangGraph 超时/熔断时 " + method
+                    + " 必须返回 Fallback,不得抛异常(禁止 500):" + e.getCause());
+            throw new IllegalStateException("unreachable");
+        } catch (Exception e) {
+            fail("RED[plan.ai.generate] 契约方法 " + method + " 调用失败:" + e.getMessage());
+            throw new IllegalStateException("unreachable");
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private Map<String, Object> asMap(Object value, String what) {
+        if (value instanceof Map) {
+            return (Map<String, Object>) value;
+        }
+        fail("RED[plan.ai.generate] " + what + " 应为 Map,实际 " + value);
+        throw new IllegalStateException("unreachable");
+    }
+
+    private void invokeNoArg(Object target, String method) {
+        try {
+            Method m = target.getClass().getMethod(method);
+            m.invoke(target);
+        } catch (Exception ignore) {
+            // 初始化方法为可选:契约探测不依赖其存在
+        }
+    }
+
+    private void setField(Object target, String name, Object value) {
+        Class<?> clazz = target.getClass();
+        while (clazz != null) {
+            try {
+                Field f = clazz.getDeclaredField(name);
+                f.setAccessible(true);
+                // final AtomicLong/AtomicInteger 不可整体替换,改其内部值(熔断状态字段)
+                Object current = f.get(target);
+                if (current instanceof java.util.concurrent.atomic.AtomicLong && value instanceof Number) {
+                    ((java.util.concurrent.atomic.AtomicLong) current).set(((Number) value).longValue());
+                    return;
+                }
+                if (current instanceof java.util.concurrent.atomic.AtomicInteger && value instanceof Number) {
+                    ((java.util.concurrent.atomic.AtomicInteger) current).set(((Number) value).intValue());
+                    return;
+                }
+                f.set(target, value);
+                return;
+            } catch (NoSuchFieldException e) {
+                clazz = clazz.getSuperclass();
+            } catch (IllegalAccessException e) {
+                return;
+            }
+        }
+    }
+}

+ 224 - 0
cfc-frontend/__tests__/pages/shop/checkout.couponAfterAddressReturn.spec.js

@@ -0,0 +1,224 @@
+import { readFileSync } from 'fs'
+import { resolve } from 'path'
+
+// 契约:shop.checkout.couponAfterAddressReturn (BUGFIX-2026-11-25)
+// 溯源·需求:主理人派单「小程序结算页优惠券丢失」——用户反馈:
+//   「选不了地址」「用了优惠券,选地址再回来提交订单,显示为未用券价格」
+// 溯源·实现:cfc-frontend/pages/shop/checkout/checkout.vue
+//   + pages/shop/address/address.vue(selectMode=1,选中写 checkoutSelectedAddressId 兜底)
+//
+// 说明:源读取契约(与既有 checkout.couponAutoSelect / order-detail.refundAndBuyAgain 同风格)。
+// 红线思维:先写能暴露缺陷的断言(RED),再修复源码(GREEN)。
+//   - RED 点 A:地址选择/编辑返回(onShow 非首次)后必须重新向服务端确认已选券抵扣额,
+//     防止「返回结算页再提交显示未用券价」。此断言已锚定「返回(else)分支」,而非只认
+//     onShow 体内出现过调用,防止被误挪到首次进入(if)分支而假绿。
+//   - RED 点 B:applyCouponDiscount 失败分支不得无条件清空已选券——仅服务端明确判定
+//     "不可用"(业务码 code 存在)才清空;瞬时失败(网络/超时)保留,交由下单权威裁决。
+//   - RED 点 C:支付页金额透传 taskId 必须用闭包变量 that(setTimeout 回调内 this 非组件实例)。
+
+const CHECKOUT_VUE = resolve(__dirname, '../../../pages/shop/checkout/checkout.vue')
+const PAYMENT_VUE = resolve(__dirname, '../../../pages/shop/payment/payment.vue')
+const source = readFileSync(CHECKOUT_VUE, 'utf8')
+
+// ---- 通用:用「括号配平」从源码中切出方法体,容忍任意缩进/换行/async 前缀 ----
+// 返回不含最外层大括号的方法体;找不到返回 ''。跳过字符串字面量与注释,防止误配平。
+function extractMethodBody(src, name) {
+  const re = new RegExp('(^|\\n)[ \\t]*(?:async\\s+)?' + name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '\\s*\\(')
+  const start = src.search(re)
+  if (start < 0) return ''
+  const braceIdx = src.indexOf('{', start)
+  if (braceIdx < 0) return ''
+  let depth = 0
+  let inStr = null
+  let inLineComment = false
+  let inBlockComment = false
+  let bodyStart = -1
+  for (let i = braceIdx; i < src.length; i++) {
+    const ch = src[i]
+    const next = src[i + 1]
+    if (inLineComment) {
+      if (ch === '\n') inLineComment = false
+      continue
+    }
+    if (inBlockComment) {
+      if (ch === '*' && next === '/') { inBlockComment = false; i++ }
+      continue
+    }
+    if (inStr) {
+      if (ch === '\\') { i++; continue }
+      if (ch === inStr) inStr = null
+      continue
+    }
+    if (ch === '/' && next === '/') { inLineComment = true; i++; continue }
+    if (ch === '/' && next === '*') { inBlockComment = true; i++; continue }
+    if (ch === '"' || ch === "'" || ch === '`') { inStr = ch; continue }
+    if (ch === '{') {
+      if (depth === 0) bodyStart = i + 1
+      depth++
+      continue
+    }
+    if (ch === '}') {
+      depth--
+      if (depth === 0) return src.slice(bodyStart, i)
+    }
+  }
+  return ''
+}
+
+const onShowBody = extractMethodBody(source, 'onShow')
+const applyCatchBody = extractMethodBody(source, 'applyCouponDiscount')
+const loadAddrBody = extractMethodBody(source, 'loadDefaultAddress')
+
+// onShow 体按 `} else {` 切出「首次进入(if)」与「返回(else)」两个分支
+const onShowElseIdx = onShowBody.search(/\}\s*else\s*\{/)
+const onShowIfBranch = onShowElseIdx >= 0 ? onShowBody.slice(0, onShowElseIdx) : ''
+const onShowReturnBranch = onShowElseIdx >= 0
+  ? onShowBody.slice(onShowBody.indexOf('{', onShowElseIdx) + 1)
+  : ''
+
+// 从 src 的 fromIdx 起,取下一个 `{` 开始、括号配平的块内内容(跳过字符串/注释)
+function balancedBlock(src, fromIdx) {
+  const braceIdx = src.indexOf('{', fromIdx)
+  if (braceIdx < 0) return ''
+  let depth = 0
+  let inStr = null
+  let inLineComment = false
+  let inBlockComment = false
+  let bodyStart = -1
+  for (let i = braceIdx; i < src.length; i++) {
+    const ch = src[i]
+    const next = src[i + 1]
+    if (inLineComment) {
+      if (ch === '\n') inLineComment = false
+      continue
+    }
+    if (inBlockComment) {
+      if (ch === '*' && next === '/') { inBlockComment = false; i++ }
+      continue
+    }
+    if (inStr) {
+      if (ch === '\\') { i++; continue }
+      if (ch === inStr) inStr = null
+      continue
+    }
+    if (ch === '/' && next === '/') { inLineComment = true; i++; continue }
+    if (ch === '/' && next === '*') { inBlockComment = true; i++; continue }
+    if (ch === '"' || ch === "'" || ch === '`') { inStr = ch; continue }
+    if (ch === '{') {
+      if (depth === 0) bodyStart = i + 1
+      depth++
+      continue
+    }
+    if (ch === '}') {
+      depth--
+      if (depth === 0) return src.slice(bodyStart, i)
+    }
+  }
+  return ''
+}
+
+// setTimeout 回调体(url 拼接所在上下文),用于精准断言 taskId 闭包取值
+const setTimeoutBody = (() => {
+  const idx = source.indexOf('setTimeout')
+  if (idx < 0) return ''
+  // setTimeout(function() { ... }):取 function 后首个 `{` 的配平块
+  return balancedBlock(source, idx)
+})()
+// 支付页跳转 url 行(仅限 setTimeout 回调内;找不到则回退全文件)
+function paymentUrlLines(scope) {
+  return scope.split('\n').filter(l => /url\s*:\s*['"`]\/?pages\/shop\/payment\/payment/.test(l))
+}
+let urlLines = paymentUrlLines(setTimeoutBody || source)
+if (urlLines.length === 0) urlLines = paymentUrlLines(source)
+
+// RED-B:catch 块必须存在「对业务码 code 的存在性判断」——容忍等价写法
+const hasCodeExistenceGuard = [
+  /e\s*&&\s*e\.code/,                                   // e && e.code(短路守卫)
+  /e\.code\s*!=\s*null/,
+  /e\.code\s*!==\s*null/,
+  /e\.code\s*!=\s*undefined/,
+  /e\.code\s*!==\s*undefined/,
+  /typeof\s+e\.code\s*!==?\s*['"`]undefined['"`]/,      // typeof e.code !== 'undefined'
+  /['"`]code['"`]\s*in\s*e/                              // 'code' in e
+].some(re => re.test(applyCatchBody))
+
+describe('checkout.vue 选地址返回后优惠券不丢失(BUGFIX-2026-11-25)', () => {
+  // ---- RED-A:返回分支必须重同步券抵扣 ----
+  test('RED-A:onShow 返回(else)分支重新向服务端确认已选券抵扣额', () => {
+    expect(onShowReturnBranch).toMatch(/applyCouponDiscount\s*\(\s*\)/)
+  })
+
+  test('RED-A-防漂移:首次进入(if)分支不得触发券重同步', () => {
+    // 若被误挪到首次分支,onShow 首次进入就会重复调 /api/coupon/apply(双请求)
+    expect(onShowIfBranch).not.toMatch(/applyCouponDiscount\s*\(\s*\)/)
+  })
+
+  test('RED-A-返回路径仍刷新地址:返回分支须调用 loadDefaultAddress()', () => {
+    expect(onShowReturnBranch).toMatch(/loadDefaultAddress\s*\(\s*\)/)
+  })
+
+  test('RED-A-守卫:onShow 返回路径不得清空已选券或抵扣额', () => {
+    expect(onShowReturnBranch).not.toMatch(/selectedCoupon\s*=\s*null/)
+    expect(onShowReturnBranch).not.toMatch(/couponDiscount\s*=\s*0/)
+  })
+
+  test('RED-A-条件:返回重同步须同时满足「已选券」与「非特价禁用券」', () => {
+    // 防止漂移成无条件调用(每次返回都打一次接口)——特价禁用券/已取消券都不应重同步
+    expect(onShowReturnBranch).toMatch(/this\.selectedCoupon\s*&&/)
+    expect(onShowReturnBranch).toMatch(/!this\.isSpecialCouponDisabled/)
+  })
+
+  // ---- RED-B:失败分支不得无条件清空已选券 ----
+  test('RED-B:applyCouponDiscount 失败分支须校验业务码 code 的存在性(容忍等价写法)', () => {
+    expect(hasCodeExistenceGuard).toBe(true)
+  })
+
+  test('RED-B-守卫:业务性不可用仍要清空已选券并归零抵扣额(展示与提交一致)', () => {
+    expect(applyCatchBody).toMatch(/selectedCoupon\s*=\s*null/)
+    expect(applyCatchBody).toMatch(/couponDiscount\s*=\s*0/)
+  })
+
+  test('RED-B-受控清空:清空动作必须位于「业务码判断」之后(不得先清后判)', () => {
+    const guardIdx = applyCatchBody.search(/e\.code/)
+    const clearIdx = applyCatchBody.indexOf('selectedCoupon = null')
+    expect(guardIdx).toBeGreaterThanOrEqual(0)
+    expect(clearIdx).toBeGreaterThanOrEqual(0)
+    expect(clearIdx).toBeGreaterThan(guardIdx)
+  })
+
+  // ---- 提交与支付契约 ----
+  test('提交订单透传 couponId(已选券 id,未选为 null)', () => {
+    expect(source).toMatch(/couponId\s*:\s*that\.selectedCoupon\s*\?\s*that\.selectedCoupon\.id\s*:\s*null/)
+  })
+
+  test('支付页金额来源:优先后端权威 moneyAmount,兜底 totalAmount', () => {
+    expect(source).toMatch(/order\.moneyAmount\s*!=\s*null\s*\?\s*order\.moneyAmount\s*:\s*order\.totalAmount/)
+  })
+
+  test('支付页跳转:taskId 透传用闭包变量 that(setTimeout 回调内 this 非组件实例)', () => {
+    expect(urlLines.length).toBeGreaterThan(0)
+    expect(urlLines.some(l => /that\.taskId\s*\?\s*['"`]&taskId=['"`]\s*\+\s*that\.taskId/.test(l))).toBe(true)
+  })
+
+  test('支付页跳转:taskId 取值不得误用 this(this.taskId 在 URL 拼接语境即缺陷)', () => {
+    expect(urlLines.some(l => /this\.taskId/.test(l))).toBe(false)
+  })
+
+  // ---- 地址兜底(症状1):读取 + 一次性消费 ----
+  test('地址兜底-读:loadDefaultAddress 读取 checkoutSelectedAddressId', () => {
+    expect(loadAddrBody).toMatch(/getStorageSync\s*\(\s*['"`]checkoutSelectedAddressId['"`]\s*\)/)
+  })
+
+  test('地址兜底-消费:loadDefaultAddress 一次性 removeStorageSync(防止旧值复用于下次)', () => {
+    expect(loadAddrBody).toMatch(/removeStorageSync\s*\(\s*['"`]checkoutSelectedAddressId['"`]\s*\)/)
+  })
+
+  test('地址选中兜底:结算页与地址页共用 checkoutSelectedAddressId 契约', () => {
+    expect(source).toMatch(/checkoutSelectedAddressId/)
+  })
+
+  test('支付页直接展示 amount 参数(不透传原始商品总额)', () => {
+    const paymentSource = readFileSync(PAYMENT_VUE, 'utf8')
+    expect(paymentSource).toMatch(/parseFloat\(options\.amount\)/)
+  })
+})

+ 2 - 2
cfc-frontend/pages/health/components/MemberChipPicker.vue

@@ -128,7 +128,7 @@ export default {
         for (i = 0; i < arr.length; i++) {
         for (i = 0; i < arr.length; i++) {
           m = arr[i]
           m = arr[i]
           if (!m) continue
           if (!m) continue
-          mid = m.id != null ? m.id : (m.memberId != null ? m.memberId : m.userId)
+          mid = m.familyMemberId != null ? m.familyMemberId : (m.memberId != null ? m.memberId : (m.id != null ? m.id : m.userId))
           if (mid == null) continue
           if (mid == null) continue
           key = String(mid)
           key = String(mid)
           if (seen[key]) continue
           if (seen[key]) continue
@@ -145,7 +145,7 @@ export default {
       for (i = 0; i < list.length; i++) {
       for (i = 0; i < list.length; i++) {
         m = list[i]
         m = list[i]
         if (!m) continue
         if (!m) continue
-        mid = m.id != null ? m.id : (m.memberId != null ? m.memberId : m.userId)
+        mid = m.familyMemberId != null ? m.familyMemberId : (m.memberId != null ? m.memberId : (m.id != null ? m.id : m.userId))
         if (mid == null) continue
         if (mid == null) continue
         nm = m.nickname || m.name || m.roleLabel || '成员'
         nm = m.nickname || m.name || m.roleLabel || '成员'
         mapped.push({
         mapped.push({

+ 14 - 3
cfc-frontend/pages/shop/checkout/checkout.vue

@@ -703,6 +703,13 @@ export default {
       this._onLoadFired = false
       this._onLoadFired = false
     } else {
     } else {
       this.loadDefaultAddress()
       this.loadDefaultAddress()
+      // 地址选择/编辑返回后重新向服务端确认已选券的抵扣额:
+      // 防止异步竞态下 selectedCoupon/couponDiscount 被丢弃或未同步,
+      // 导致「返回结算页再提交订单显示为未用券价格」(优惠静默丢失)。
+      // 仅当已选中券且非特价禁用券时重同步;未选券(_couponDismissed)不重选。
+      if (this.selectedCoupon && !this.isSpecialCouponDisabled) {
+        this.applyCouponDiscount()
+      }
     }
     }
   },
   },
   methods: {
   methods: {
@@ -894,8 +901,11 @@ export default {
         }
         }
         this.couponDiscount = (res && res.data && res.data.discount) || 0
         this.couponDiscount = (res && res.data && res.data.discount) || 0
       } catch (e) {
       } catch (e) {
-        if (this.selectedCoupon && this.selectedCoupon.id === applyingCouponId) {
-          // 服务端判定不可用(request 已提示 message),本地同步清空避免错误展示
+        // 仅「服务端明确判定不可用」才清空已选券(业务响应带 code/message,request 已提示 message);
+        // 瞬时失败(网络中断/超时,e.code 为空)保留已选券,交由下单时服务端权威裁决。
+        // 否则会出现「选券 → 选地址返回 → 提交订单」时券被静默清空、订单按未用券价格创建的回归。
+        if (this.selectedCoupon && this.selectedCoupon.id === applyingCouponId
+            && e && e.code != null) {
           this.selectedCoupon = null
           this.selectedCoupon = null
           this.couponDiscount = 0
           this.couponDiscount = 0
         }
         }
@@ -1252,8 +1262,9 @@ export default {
             var moneyAmount = order.moneyAmount != null ? order.moneyAmount : order.totalAmount
             var moneyAmount = order.moneyAmount != null ? order.moneyAmount : order.totalAmount
             var pointsUsed = order.pointsUsed || 0
             var pointsUsed = order.pointsUsed || 0
             setTimeout(function() {
             setTimeout(function() {
+              // setTimeout 回调内 this 非组件实例,taskId 必须经闭包 that 取,否则购买任务打卡透传丢失
               uni.navigateTo({
               uni.navigateTo({
-                url: '/pages/shop/payment/payment?orderNo=' + order.orderNo + '&amount=' + moneyAmount + '&pointsUsed=' + pointsUsed + (this.taskId ? '&taskId=' + this.taskId : '')
+                url: '/pages/shop/payment/payment?orderNo=' + order.orderNo + '&amount=' + moneyAmount + '&pointsUsed=' + pointsUsed + (that.taskId ? '&taskId=' + that.taskId : '')
               })
               })
             }, 1000)
             }, 1000)
           } else {
           } else {

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-36e40c39ba3df38d3e8b4909b61a7b66d0a3d6dc
+9dff61c8e4c86839b449143800cf0230b7a95f59

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "cfc-web",
   "name": "cfc-web",
-  "version": "1.0.2751",
+  "version": "1.0.2758",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "cfc-web",
       "name": "cfc-web",
-      "version": "1.0.2751",
+      "version": "1.0.2758",
       "dependencies": {
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",
         "@wangeditor/editor-for-vue": "^1.0.2",

+ 1 - 1
cfc-web/package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "cfc-web",
   "name": "cfc-web",
-  "version": "1.0.2752",
+  "version": "1.0.2758",
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {
     "dev": "vue-cli-service serve",
     "dev": "vue-cli-service serve",

+ 87 - 0
cfc-web/public/CHANGELOG-v1.0.md

@@ -4,6 +4,93 @@
 
 
 ---
 ---
 
 
+## v1.0.2758 (2026-11-25)
+
+### 测试
+- 收口 R374 测试负责人汇报(30分langgraph+E2E档 凭据缺失·承袭未实测) [skip ci]
+
+
+## v1.0.2758 (2026-11-25)
+
+### Bug 修复
+- MemberChipPicker 以 familyMemberId 为成员键,避免 users.id 错位
+
+### 其他
+- 书宁宁 id=34、familyMemberId=62,组件原先用 m.id 优先 → 问卷提交 memberId=34(错位到他人档案)。
+- - normalizeMemberList/applyList 两处 mid 取值改为 familyMemberId > memberId > id > userId
+- - 影响:方案问卷/独立问卷的成员键统一指向 family_members.id
+- - 测试:healthSurvey.memberPicker(11) + memberNormalize.resolveCheckin(7) 共18/18 通过
+- 
+- - 补交时间窗守卫/hourly方案/益生菌知识库校验/订单状态/家庭工作台等文档
+- 
+
+### 文档
+- 补交本地方案/计划文档与导入脚本
+
+### 测试
+- 收口 R373 测试负责人汇报(0分标准轮 WIP)
+
+
+## v1.0.2757 (2026-11-25)
+
+### Bug 修复
+- 修复结算页优惠券丢失——地址返回后重同步券抵扣额+区分业务/瞬时失败不清券+tasks透传修正
+
+### 其他
+- 根因(前端展示层,后端无责):
+- 1. checkout.vue applyCouponDiscount() catch 原为无条件清空已选券,而 utils/api.js 对网络/超时等瞬时失败也 reject → 券被静默丢弃,提交时 couponId=null,后端按未用券价格建单
+- 2. checkout.vue onShow() 从地址/编辑页返回时只重拉地址,从不向服务端重新确认已选券抵扣额,异步竞态下券价丢失后不会被纠正
+- 修复(+14/-3,仅 checkout.vue):
+- - onShow() 返回分支:selectedCoupon 存在且非特价禁用券时重新调 applyCouponDiscount() 向服务端确认抵扣额(不重选未选券,_couponDismissed 语义保留)
+- - applyCouponDiscount() catch:仅服务端明确判定不可用(业务响应带 code)才清空已选券并归零抵扣额;瞬时失败保留券,交由下单时服务端权威裁决
+- - onSubmit() setTimeout 回调内 this.taskId → that.taskId(闭包修正,购买任务打卡透传)
+- 测试:__tests__/pages/shop/checkout.couponAfterAddressReturn.spec.js(16 条源码契约,红→绿,4 项变异测试全部 RED 验证可抓缺陷);__tests__/pages/shop/ 24/24 绿,全仓基线无恶化(48 suites/703 passed 与修复前基线一致)
+- 
+
+
+## v1.0.2756 (2026-11-25)
+
+### 文档
+- 联调启动 Checklist(2026-11-25)
+- 接入方案 v1.1 + 接口契约附录B(平台确认权威口径)
+
+### 其他
+- 照片路径 P1~P8(联调首日最小闭环)→ 视频路径 V1~V7 → 前端真机验收 F1~F7 →
+- 异常分支 E1~E8 → 收口转生产 T1~T7 → 故障速查表 → 一屏顺序总图。
+- 依据:方案 v1.1 + 契约附录 B(权威口径)。联调记录落 docs/爱云医接入/联调记录-20261125.md
+- 
+- - 契约新增附录B(平台确认):B.1商品与检测包 B.2 inspectionType归属 B.3次数/有效期/子项数
+-   B.4状态口径 B.5三接口真实返回体 B.6视频采集页域名 B.7 uploadFile接口 B.8两个已知问题
+- - 关键修正:inspectionType 在子项不在商品;取skuId必调get-detail;联调期照片走平台uploadFile(免登录multipart)
+- - 风险消除:R1(转二期)/R4/R5/R6/R7;R3确认仍在修(只用report/get);refresh过期不可刷新按30min重登
+- 
+
+
+## v1.0.2755 (2026-11-25)
+
+### 文档
+- 研发负责人自动化收割汇报 R353(2026-11-25 14:26 错峰档 11 分档·--auto截断但派发保底S-cfc-255 verified·backfill+1·webhook slot14整档补发)
+
+
+## v1.0.2754 (2026-11-25)
+
+### 文档
+- 研发负责人自动化收割汇报 R352(2026-11-25 12:51 错峰档 41 分档·S7--auto截断但派发保底S-cfc-255+部署验证批量)
+- 部署回执 ab1f7595 → testing(S-cfc-464 加权引擎,精确部署成功)
+
+### 测试
+- S-cfc-255 butler.ai.collaborate 补充 RED 契约单测(审计/迁移/反馈家长,6/6 红)
+
+
+## v1.0.2753 (2026-11-25)
+
+### 测试
+- S-cfc-285 补充行为级 RED 契约单测(手机/昵称校验,3/3 红)
+
+### 文档
+- 研发负责人自动化收割汇报 R351(2026-11-25 12:35 错峰档 31 分档·S7--auto截断+直派2条verified·S-cfc-279/285)
+
+
 ## v1.0.2752 (2026-11-25)
 ## v1.0.2752 (2026-11-25)
 
 
 ### 文档
 ### 文档

+ 88 - 1
cfc-web/public/CHANGELOG.md

@@ -1,6 +1,6 @@
 # 更新日志
 # 更新日志
 
 
-> 当前版本: v1.0.2752
+> 当前版本: v1.0.2758
 
 
 ## 历史版本
 ## 历史版本
 
 
@@ -8,6 +8,93 @@
 
 
 ---
 ---
 
 
+## v1.0.2758 (2026-11-25)
+
+### 测试
+- 收口 R374 测试负责人汇报(30分langgraph+E2E档 凭据缺失·承袭未实测) [skip ci]
+
+
+## v1.0.2758 (2026-11-25)
+
+### Bug 修复
+- MemberChipPicker 以 familyMemberId 为成员键,避免 users.id 错位
+
+### 其他
+- 书宁宁 id=34、familyMemberId=62,组件原先用 m.id 优先 → 问卷提交 memberId=34(错位到他人档案)。
+- - normalizeMemberList/applyList 两处 mid 取值改为 familyMemberId > memberId > id > userId
+- - 影响:方案问卷/独立问卷的成员键统一指向 family_members.id
+- - 测试:healthSurvey.memberPicker(11) + memberNormalize.resolveCheckin(7) 共18/18 通过
+- 
+- - 补交时间窗守卫/hourly方案/益生菌知识库校验/订单状态/家庭工作台等文档
+- 
+
+### 文档
+- 补交本地方案/计划文档与导入脚本
+
+### 测试
+- 收口 R373 测试负责人汇报(0分标准轮 WIP)
+
+
+## v1.0.2757 (2026-11-25)
+
+### Bug 修复
+- 修复结算页优惠券丢失——地址返回后重同步券抵扣额+区分业务/瞬时失败不清券+tasks透传修正
+
+### 其他
+- 根因(前端展示层,后端无责):
+- 1. checkout.vue applyCouponDiscount() catch 原为无条件清空已选券,而 utils/api.js 对网络/超时等瞬时失败也 reject → 券被静默丢弃,提交时 couponId=null,后端按未用券价格建单
+- 2. checkout.vue onShow() 从地址/编辑页返回时只重拉地址,从不向服务端重新确认已选券抵扣额,异步竞态下券价丢失后不会被纠正
+- 修复(+14/-3,仅 checkout.vue):
+- - onShow() 返回分支:selectedCoupon 存在且非特价禁用券时重新调 applyCouponDiscount() 向服务端确认抵扣额(不重选未选券,_couponDismissed 语义保留)
+- - applyCouponDiscount() catch:仅服务端明确判定不可用(业务响应带 code)才清空已选券并归零抵扣额;瞬时失败保留券,交由下单时服务端权威裁决
+- - onSubmit() setTimeout 回调内 this.taskId → that.taskId(闭包修正,购买任务打卡透传)
+- 测试:__tests__/pages/shop/checkout.couponAfterAddressReturn.spec.js(16 条源码契约,红→绿,4 项变异测试全部 RED 验证可抓缺陷);__tests__/pages/shop/ 24/24 绿,全仓基线无恶化(48 suites/703 passed 与修复前基线一致)
+- 
+
+
+## v1.0.2756 (2026-11-25)
+
+### 文档
+- 联调启动 Checklist(2026-11-25)
+- 接入方案 v1.1 + 接口契约附录B(平台确认权威口径)
+
+### 其他
+- 照片路径 P1~P8(联调首日最小闭环)→ 视频路径 V1~V7 → 前端真机验收 F1~F7 →
+- 异常分支 E1~E8 → 收口转生产 T1~T7 → 故障速查表 → 一屏顺序总图。
+- 依据:方案 v1.1 + 契约附录 B(权威口径)。联调记录落 docs/爱云医接入/联调记录-20261125.md
+- 
+- - 契约新增附录B(平台确认):B.1商品与检测包 B.2 inspectionType归属 B.3次数/有效期/子项数
+-   B.4状态口径 B.5三接口真实返回体 B.6视频采集页域名 B.7 uploadFile接口 B.8两个已知问题
+- - 关键修正:inspectionType 在子项不在商品;取skuId必调get-detail;联调期照片走平台uploadFile(免登录multipart)
+- - 风险消除:R1(转二期)/R4/R5/R6/R7;R3确认仍在修(只用report/get);refresh过期不可刷新按30min重登
+- 
+
+
+## v1.0.2755 (2026-11-25)
+
+### 文档
+- 研发负责人自动化收割汇报 R353(2026-11-25 14:26 错峰档 11 分档·--auto截断但派发保底S-cfc-255 verified·backfill+1·webhook slot14整档补发)
+
+
+## v1.0.2754 (2026-11-25)
+
+### 文档
+- 研发负责人自动化收割汇报 R352(2026-11-25 12:51 错峰档 41 分档·S7--auto截断但派发保底S-cfc-255+部署验证批量)
+- 部署回执 ab1f7595 → testing(S-cfc-464 加权引擎,精确部署成功)
+
+### 测试
+- S-cfc-255 butler.ai.collaborate 补充 RED 契约单测(审计/迁移/反馈家长,6/6 红)
+
+
+## v1.0.2753 (2026-11-25)
+
+### 测试
+- S-cfc-285 补充行为级 RED 契约单测(手机/昵称校验,3/3 红)
+
+### 文档
+- 研发负责人自动化收割汇报 R351(2026-11-25 12:35 错峰档 31 分档·S7--auto截断+直派2条verified·S-cfc-279/285)
+
+
 ## v1.0.2752 (2026-11-25)
 ## v1.0.2752 (2026-11-25)
 
 
 ### 文档
 ### 文档

+ 136 - 0
docs/2026-11-19-task-time-window-guard.md

@@ -0,0 +1,136 @@
+# 任务时间窗守卫(earliest_start / latest_end)交付文档
+
+- 日期:2026-11-19
+- 分支:`fix/energy-optlock-on-cfclub`(已推送至 `origin/cfclub`)
+- 提交:`e36e28089` feat(task): completeTask 时间窗守卫 — earliest_start/latest_end 窗口外拒绝提交
+- 涉及文件:
+  - `cfc-backend/src/main/java/com/etotem/cfc/service/TaskService.java`
+  - `cfc-backend/src/test/java/com/etotem/cfc/unit/TaskTimeWindowGuardContractTest.java`(新增)
+
+---
+
+## 1. 需求
+
+> 下午阅读半小时(时间窗 14–18 点)这类任务,只能在指定时间内完成。提交或超期都不算,要提示用户「未到时间」或「已过期」。
+
+补充确认(来自需求方):
+1. 提示**带具体时间**(如「14:00 后可提交」)。
+2. 过期保持**从今日列表隐藏**(现状,不改展示层),用户可从任务历史查看。
+
+## 2. 现状(修复前)
+
+- `TaskService.completeTask` 对 `earliest_start` / `latest_end` **无任何校验**:窗口外提交会照常完成/进入待审核并发放积分。
+- 提交审核路径 `submitTaskForReview` 同样无时间窗判断。
+- 列表层 `TaskService:541` 仅把已过期(`latest_end < now`)的 `pending` 任务从今日列表移除,不拦截完成。
+
+## 3. 方案
+
+**拦截位置**:`completeTask` 内,小游戏分支之后、`need_review` 分支之前。
+→ 同时覆盖「直接完成」与「提交审核」两条路径,避免提交审核漏网。
+
+**规则**:
+
+| 判定 | 结果 |
+|---|---|
+| `now < earliest_start` | `throw IllegalArgumentException("未到开始时间,HH:mm 后可提交")` |
+| `now > latest_end` | `throw IllegalArgumentException("已过截止时间 HH:mm,无法提交")` |
+| 窗口内(含边界) | 正常完成 / 提交审核 |
+
+- 窗口为**闭区间** `[earliest_start, latest_end]`:等于边界时刻视为可提交(`before` / `after` 严格比较)。
+- `earliest_start`、`latest_end` **任一非空即生效**。
+- 异常经 `GlobalExceptionHandler` → `400 + 消息`,与既有「需先完成前置任务」提示同风格。
+- **不受影响**:`deadline` 逾期零奖励完成机制(独立);列表展示层(过期照旧隐藏)。
+
+**幂等语义**:已 `completed`/`pending_review` 的重复提交仍走既有幂等返回(`alreadyCompleted`),不会被时间窗误拦。
+
+## 4. TDD 证据
+
+### RED(实现前)
+`TaskTimeWindowGuardContractTest`:4 条用例,3 失败 1 通过。
+- `未到开始时间_拒绝提交` → `Expected IllegalArgumentException to be thrown, but nothing was thrown`
+- `已过截止时间_拒绝提交` → 同上
+- `需审核任务窗口外_拒绝提交` → 同上(进入 pending_review 未被拦)
+- 控制组 `窗口内_正常完成` → 通过(现状即绿)
+
+### GREEN(实现后)
+`Tests run: 4, Failures: 0, Errors: 0` ✅
+
+### 回归
+- `Task*Test,TaskService*Test` 全量 175 条:
+  - 仅 1 条失败 `TaskReviewScP11ContractTest.permission_crossFamilyReview_mustBeRejected`
+  - **基线对比确认为存量 RED 契约**(reviewTask 缺审批人身份参数,与本改动无关)
+- rebase 到最新主干(含 67 个新提交)后,`TaskTimeWindowGuardContractTest + TaskCompleteScC02 + TaskReviewScP11 + TaskReviewScT06` 共 30 条:唯一失败仍是上述存量项,时间窗 4/4 绿。
+
+## 5. 部署记录
+
+| 项 | 值 |
+|---|---|
+| 部署 jar md5 | `53710fb13e580cb0`(`/app/pro/cfc/backend/cfc-backend-1.0.0.jar`) |
+| 服务 PID | `2926384` |
+| 健康检查 | `POST /api/cart/list` → 200 |
+| 端口 | 9082 LISTEN 1 |
+| 启动日志 | `Tomcat started on port 9082` / `DispatcherServlet Completed initialization` |
+| 新进程 ERROR | 0 |
+| WARN | 全为迁移幂等噪音(`tasks.status` 枚举已扩展、`resource_items` 等列已存在);INFO 被生产 `com.etotem.cfc: warn` 级别过滤 |
+| 部署前备份 | `/app/pro/cfc_backup_20261119_103135_pre_timewindow_deploy.tar.gz` |
+| 旧 jar 留档 | `/app/pro/cfc/backend/cfc-backend-1.0.0.pre-timewindow.jar`(md5 `c5273f5931362ff0`) |
+| jar 守卫确认 | 字节码常量池含「未到开始时间,」「已过截止时间」+ 2 处 `HH:mm` |
+
+## 6. 代码同步
+
+- rebase 到 `origin/cfclub`(`0cb589ee7`)之上,无冲突。
+- push:`0cb589ee7..e36e28089  HEAD -> cfclub` ✅
+- 推送后本地落后主干 0,自动部署重建 jar 不会再回退本次守卫。
+
+## 7. 回滚预案
+
+1. 服务回滚:
+   ```bash
+   cp /app/pro/cfc/backend/cfc-backend-1.0.0.pre-timewindow.jar /app/pro/cfc/backend/cfc-backend-1.0.0.jar
+   systemctl restart cfc-backend
+   ```
+   或从备份恢复:
+   ```bash
+   tar -xzf /app/pro/cfc_backup_20261119_103135_pre_timewindow_deploy.tar.gz -C /app
+   systemctl restart cfc-backend
+   ```
+2. 代码回滚:`git revert e36e28089`(或 `git push -f origin 24391b63b~1:cfclub`,谨慎)。
+
+## 8. 手工测提示(未由代理冒烟,按需求方要求留人工验证)
+
+- 第三批时间窗用例:任务 **5664**(`[测试3]下午阅读半小时(时间窗14-18点)`,`earliest_start=2026-11-19 14:00`、`latest_end=18:00`)。
+  - 14:00 前提交 → 预期 `400 未到开始时间,14:00 后可提交`,任务状态不变。
+  - 18:00 后提交 → 预期 `400 已过截止时间 18:00,无法提交`。
+  - 14:00–18:00 内提交 → 正常完成发奖。
+- 过期任务在今日列表隐藏是预期行为,可从任务历史查看。
+
+## 9. 第三批测试任务快照(重置后)
+
+旧 id 5639/5641–5647 已在 2026-11-19 09:27 重置(备份 `/tmp/taskfixture/family72_b3_reset_predelete_20261119_092702.tsv`),
+重建为新 id:
+
+| id | 任务 | 初始态 | 备注 |
+|---|---|---|---|
+| 5659 | 购买(流式链起点) | pending | `need_review=1`(plan 来源),`successor=[5640]` |
+| 5640 | 使用(流式链) | locked | `prerequisite=5659` |
+| 5660 | 每2天拉伸(recurring) | pending | `need_review=1`(plan 来源) |
+| 5661 | 阅读打卡(积分7天过期) | pending | `points_expire_days=7` |
+| 5662 | 会员专属营养方案 | pending | `member_only=1` |
+| 5663 | 连续打卡7天(阶梯) | pending | `bonus_rule` |
+| 5664 | 下午阅读(时间窗14-18) | pending | 本次时间窗守卫验证用例 |
+| 5665 | 每周锻炼3次(限次) | pending | `max_frequency=3`,`need_review=1` |
+| 5666 | 提交读书笔记(分类审核) | pending | `need_review=1` + `review_by_category=1` |
+| 5648 | 健康方案来源 | pending | `source_type=health_plan` |
+| 5649 | 已过期任务 | overdue | 展示逾期态 |
+| 5650 | 暂停的重复任务 | paused | `is_paused=1` |
+
+重置 SQL:`/tmp/task_fixture_72_b3_reset_commit.sql`;回滚清空:
+```sql
+DELETE FROM tasks WHERE family_id=72 AND title LIKE '[测试3]%';
+```
+
+## 10. 遗留观察点(非本次范围)
+
+1. `TaskReviewScP11ContractTest.permission_crossFamilyReview_mustBeRejected`:reviewTask 无审批人身份参数(存量 RED 契约,待单独排期)。
+2. plan 来源任务(购买/强力/限次)受**迁移 265** 规则影响,每次启动将该类未审任务 `need_review` 置 1——产品既定行为,非缺陷。
+3. `completeParentTask`(家长任务完成路径)未加时间窗守卫;本次需求仅覆盖孩子端 `/complete`。若需一致化,另开任务。

+ 7 - 1
docs/2026-11-23-hourly-task-redesign-proposal.md

@@ -1,9 +1,15 @@
 # 每小时任务(hourly)行为改造方案 — 待确认稿
 # 每小时任务(hourly)行为改造方案 — 待确认稿
 
 
 - 日期:2026-11-23
 - 日期:2026-11-23
-- 状态:**方案阶段,未改任何代码**(前端不直接改)
+- 状态:**方案已获批(2026-11-23),进入 TDD 实现**(前端不直接改)
 - 需求来源:用户对 `[测试6]每小时任务-眼部放松`(id 5881 模板 / 其 hourly 实例)的行为诉求
 - 需求来源:用户对 `[测试6]每小时任务-眼部放松`(id 5881 模板 / 其 hourly 实例)的行为诉求
 
 
+## 需求方最终决策(2026-11-23)
+1. A1 调度器自动生成:**做成配置开关**(默认关闭自动生成,可回退)
+2. 下一条生成时机:**提交待审核时就生成**(不等审核通过)
+3. 前端"下次可完成时间"倒计时 UI:**不加**
+4. category 从"健康打卡"改"运动任务":**接受**
+
 ---
 ---
 
 
 ## 1. 需求原文与拆解
 ## 1. 需求原文与拆解

+ 385 - 0
docs/2026-11-24-爱云医AI检测接入方案.md

@@ -0,0 +1,385 @@
+# 爱云医(AICDS Open API)照片/视频 AI 检测接入方案
+
+> 文档编号:XAF-AICDS-001 | 版本:**v1.1** | 日期:2026-11-24(v1.1 修订 2026-11-25)| 作者:齐活林(交付总监)审定
+> 接口文档来源:https://s.apifox.cn/40553802-248d-4616-b898-356b4f8d3140/406348767e0 (AICDS Open API,共享文档)
+> 适用范围:浠艾福(XAF)小程序,报告上传处新增「AI 快速识别」入口
+> **v1.1 重要**:已获平台测试环境凭证并完成对接确认(**先锋健康·租户编号 6**)。平台回复**权威口径见契约附录 B**(`docs/爱云医接入/爱云医接口契约-完整版.md` 附录 B)。本方案 §7 风险 R1/R3/R5/R6/R7 已消除,R1/R2 转二期。**测试环境尚未挂 SKU(`spu/page` 返回空是预期),联调前等平台下发 `spuId+skuId+keyword` 清单。**
+
+---
+
+## 0. 结论摘要(TL;DR)
+
+1. **爱云医接口能力已完整摸清**:共享文档共 **21 个已发布接口**,覆盖「终端登录 → 商品 → 下单 → 检测用户 → 录入数据/取检测路径 → 检测报告」全链路;关键接口的请求/响应契约已逐字提取(见附录 A),并核实了文档中的**实测注释**(含 2 个接口的已知缺陷)。
+2. **照片检测走 `PUT /detection/package/enter/detection_data`**:把拍摄/相册/微信记录选中的照片(`basicUrlList`,标准 12 张)+ 病历报告图(`reportUrlList`)+ 语音(`familyHistoryUrlList`/`diseaseUrlList`)上传,平台异步产报告,再通过 `GET /product/report/get` 拉取结果。
+3. **视频检测走 `GET /detection/package/getPath`**:返回一个 **H5 检测页面 URL**,小程序用 `<web-view>` 内嵌,由用户在爱云医页面内完成 AI 视频采集,随后同样拉报告。
+4. **安全性硬约束**:爱云医要求每次请求携带 `X-App-Key / X-Timestamp / X-Api-Sign`,其中 `X-Api-Sign` 需用**租户 RSA 私钥**对 `appKey={AppKey}&timestamp={毫秒}` 做 `SHA256withRSA` 签名。私钥**只能放在服务端**,因此**全部转发必须走后端代理**,前端一律不接触 AppKey/私钥,也不直连爱云医。
+5. **接入点**:`cfc-frontend/pages/health/report-upload.vue` 的「上传方式」区新增第三个卡片「**AI 快速识别**」,复用现有成员选择 + 声明勾选,进入新的识别流程。
+6. **图片上传方案已由平台最终确认**:平台提供专用上传接口 `POST /app-api/detection/package/enter/upload`(multipart、**免登录**、单文件≤100MB),返回的 URL 直接填 `*UrlList[].url`。**联调阶段一律走 uploadFile;外链 OSS 方式平台允许但要求先验证可达性,放二期**(详见契约附录 B.7)。
+7. **账户模型定为单租户**:1 个爱云医账户(先锋健康→运营手机号 `identify` 建档)承载全部家庭检测人+检测包,本地 `aiyunyi_mapping` 映射表保证幂等;成本 XAF 承担(`order/create` 不走支付,B2B 租户 API)。
+8. **建议实施路径**:后端新增 `AicdsGatewayService`(仿 `AiGateway` 模式)+ `AicdsController`(转发代理)+ 配置项;前端新增「快速识别」页与 `api.js` 封装;本地建映射表记录「爱云医检测包/用户/报告 ↔ 本小程序家庭/成员」关系。**本方案不直接改业务代码,落地由 opencode 开发(见 §9 派发)。**
+
+---
+
+## 1. 需求理解
+
+**用户诉求**:在浠艾福小程序「报告上传」处增加一个**快速识别**选项。用户按爱云医要求,**拍摄(或从手机图库、微信记录中选择)指定的照片或视频**,将这些照片或视频传给爱云医后台,然后**获取相关诊断报告或结果**。
+
+**拆解**:
+- **入口位置**:报告上传页(`/pages/health/report-upload`),与现有「从聊天选取」「拍照上传」并列。
+- **素材来源**:相机拍照 / 手机图库 / 微信聊天记录(`uni.chooseMessageFile`),与现有上传一致。
+- **素材类型**:照片(为主)或视频。对应爱云医两条业务路径:
+  - 照片 → 录入检测数据(`enter/detection_data`)
+  - 视频 → AI 实时检测(`getPath` → H5 内嵌检测)
+- **产物**:爱云医诊断报告 → 在本小程序内展示结果(第一版以爱云医原始报告结构展示,后续再映射进五维体系)。
+- **对象**:检测人 = 家庭某位成员(复用报告上传页的「报告属于哪位成员」选择)。
+
+---
+
+## 2. 爱云医接口能力盘点
+
+共享文档「AICDS Open API」共 **6 个模块 21 个接口**(全部已发布,除 `get-item-page` 已废弃、`detection-package-refund` 为开发中)。接口文档由对方补充了大量**实测注释**,含 2 处明确缺陷,必须规避(见 §7)。
+
+| 模块 | 接口 | 方法/路径 | 用途 | 本方案是否用 |
+|---|---|---|---|---|
+| 01 登录 | 获取 token | POST `/member/user/identify` | 手机号换令牌,不存在自动建档 | ✅ 必用 |
+| 01 登录 | 刷新 token | POST `/member/user/refresh` | 刷新访问令牌(30 天 refresh) | ✅ 必用 |
+| 01 登录 | 请求头构造 | 文档页 | 签名/鉴权说明 | ✅ 参考 |
+| 02 商品 | 商品列表分页 | GET `/product/spu/page` | 查已上架服务商品 | ✅ 必用(找「AI 检测」商品) |
+| 02 商品 | 商品 SPU 明细 | GET `/product/spu/get-detail` | 取 `skuId`(下单用 skuId 非 spuId) | ✅ 必用 |
+| 03 下单 | 创建检测服务包 | POST `/trade/order/create` | 发权益、产出 `packageIds` | ✅ 必用 |
+| 03 下单 | 退款 | POST `/trade/order/detection-package-refund` | 退款 | ⚠️ 有缺陷,暂不纳入(R2) |
+| 04 检测用户 | 创建检测用户 | POST `/product/detection-user/create` | 建检测人 | ✅ 必用 |
+| 04 检测用户 | 更新检测用户 | PUT `/product/detection-user/update` | 改检测人信息 | ⏸ 二期 |
+| 04 检测用户 | 删除检测用户 | DELETE `/product/detection-user/delete` | 删检测人(逻辑删) | ⏸ 二期 |
+| 04 检测用户 | 获得检测用户 | GET `/product/detection-user/get` | 单查检测人 | ⏸ 二期 |
+| 04 检测用户 | 检测用户分页 | GET `/product/detection-user/page` | 分页查检测人 | ⏸ 二期 |
+| 05 套餐 | 查询检测明细 | GET `/detection/package/get-items` | 取子项(含 `inspectionType`) | ✅ 必用 |
+| 05 套餐 | AI 实时检测路径 | GET `/detection/package/getPath` | 视频检测 H5 页 URL | ✅ 必用(视频) |
+| 05 套餐 | 检测套餐分页 | GET `/detection/package/page` | 查已购套餐实例 | ✅ 必用 |
+| 05 套餐 | 检测用户信息 | GET `/detection/package/get-user-info` | 取 `detectionReportUserId` | ✅ 必用 |
+| 05 套餐 | 检测明细分页 | GET `/detection/package/get-item-page` | 已废弃 | ❌ 不用 |
+| 05 套餐 | 激活录入检测用户 | PUT `/detection/package/enter/detection_user` | 激活套餐→检测人 | ✅ 必用 |
+| 05 套餐 | 录入检测数据 | PUT `/detection/package/enter/detection_data` | **照片+语音上传** | ✅ 必用(照片) |
+| 补录 | **上传文件** | POST **`/app-api/detection/package/enter/upload`** | multipart 上传图片→返回 URL(**免登录**,单文件≤100MB) | ✅ 必用(联调期照片上传) |
+| 06 报告 | 检测报告列表 | GET `/product/report/page` | 分页查报告 | ⚠️ 平台仍在修(R3),**不依赖**;只用 `report/get` |
+| 06 报告 | 获得检测报告 | GET `/product/report/get` | 报告详情(指标) | ✅ 必用 |
+| 06 报告 | 疾病解决方案 | GET `/product/report/get-content` | 指标解读文案 | ✅ 二期(详情页) |
+
+**四层数据结构(重要,勿混用)**:商品(SPU) → 套餐模板 → 套餐实例(`packageId`) → 套餐子项(`packageItemId`)。下单返回的是 `packageIds`(套餐实例 id),不是商品 spuId;发起检测时用子项 `id`。
+
+**检测类型 `inspectionType` 分流(核心,已平台确认——见契约附录 B.2)**:
+- ⚠️ **类型不在商品上,在检测包子项上**:`spu/page` 返回体里**没有 `inspectionType` 字段**,商品级统一返回 `-1`(=多项检测套餐商品)。**一律以 `get-items` 返回的子项 `inspectionType` 为准**:
+  - 子项 `0` 照片类 / `3` 癌症(照片链路)→ 走 `enter/detection_data` 录入数据
+  - 子项 `1` AIBMP / `2` AIBMP-PRO(视频)→ 先 `getPath` 取 H5 页 URL,内嵌检测
+- 区分两个易混字段:**子项 `inspectionType`**(判断链路用)**≠ `enter/detection_data` 请求体里的 `type`**(0 普通 / 3 癌症,提交时用)。
+- **取 `skuId` 必调 `get-detail`**:`spu/page` 只返回 spuId,`skuId` 在 `get-detail` 的 `skus[].id`。
+
+**完整契约**:已从共享文档提取为 `docs/爱云医接入/爱云医接口契约-完整版.md`(附录 A,含每接口参数/请求体/响应/示例/实测注释)。
+
+---
+
+## 3. 总体方案
+
+### 3.1 分层架构(为什么必须走后端代理)
+
+```
+微信小程序 (cfc-frontend)
+   │  uni.request(仅带小程序 token)
+   ▼
+cfc-backend(Spring Boot 9082)
+   ├── AicdsGatewayService   ← 鉴权签名/令牌缓存/HTTP 转发/错误归一(仿 AiGateway)
+   ├── AicdsController       ← 暴露 /api/aiyunyi/** 给前端
+   ├── AicdsTokenStore       ← access/refresh 令牌缓存(内存+可选 DB)
+   └── AicdsUploadProxy   ← 照片经 /api/aiyunyi/upload 代理到 uploadFile(免登录)
+   │  RestTemplate(带 X-App-Key/X-Timestamp/X-Api-Sign/Authorization/X-User-Id-Encrypt)
+   ▼
+爱云医 devadmin.aicds.com.cn/open-api/**
+```
+
+**关键理由**:
+1. **RSA 私钥签名**:`X-Api-Sign` 必须用租户 RSA 私钥对签名串做 `SHA256withRSA`。私钥**绝不能进小程序包**(可反编译提取)。→ 签名只能在后端。
+2. **令牌管理**:accessToken 仅 30 分钟、refreshToken 30 天,且**过期后无法刷新只能重新登录**(文档实测)。→ 需后端缓存 + 临期主动刷新 + 过期回退重登。
+3. **`X-User-Id-Encrypt`**:需用 RSA 公钥加密 `userId`,同样是服务端职责。
+4. **跨域/域名白名单**:小程序 request 域名需加 `devadmin.aicds.com.cn`(体验/正式环境),且**私钥在端上不可行**,代理可统一收口。
+5. **业务网关**:是否对用户开放、配额、计费、失败降级,需后端控制,前端只负责展示。
+
+### 3.2 鉴权与签名方案(服务端)
+
+每次调用爱云医需带以下 Header(服务端由 `AicdsGatewayService` 统一构造):
+
+| Header | 生成 | 说明 |
+|---|---|---|
+| `X-App-Key` | 配置项 `aiyunyi.app-key` | 平台为租户分配的 AppKey |
+| `X-Timestamp` | `System.currentTimeMillis()` | 毫秒,与服务器时差 ≤5 分钟 |
+| `X-Api-Sign` | `Base64(SHA256withRSA(私钥, "appKey="+AppKey+"&timestamp="+毫秒))` | **签名串固定为 `appKey={AppKey}&timestamp={毫秒}`** |
+| `Authorization` | `Bearer {accessToken}` | 登录/刷新后的业务接口;`refresh` 接口此处传仍有效的 accessToken |
+| `X-User-Id-Encrypt` | `Base64(RSA公钥加密(userId))`(PKCS#1) | 登录后业务接口需带;公钥来自平台下发 |
+
+**签名实现要点**:
+- 私钥为 PEM 字符串,配置在 `application.yml`(`${AIYUNYI_RSA_PRIVATE_KEY:}`,环境变量注入),加载时解析为 `PrivateKey`。
+- `X-Timestamp` 必须**每次请求实时取**,不可缓存(防时差超限被拒)。
+- 登录接口 `identify` 只需前三项;业务接口再加 `Authorization` + `X-User-Id-Encrypt`。
+
+**令牌生命周期**(对齐文档实测):
+- accessToken 30 分钟、refreshToken 30 天、`userId` 用于生成 `X-User-Id-Encrypt`。
+- 策略:**临期主动刷新**(剩余 <5 分钟时调 `refresh` 换新对);**过期回落到重新 `identify`**(文档明确「一旦过期无法再刷新,只能重新登录」)。refresh 接口的 `Authorization` 必须带**仍有效的 accessToken**(把 refreshToken 放 Authorization 会 401)。
+- 令牌按「检测人所属爱云医账户」粒度缓存;第一版简化为一**个租户级账户**(见 3.5 账户模型)。
+
+### 3.3 图片上传与公网可达(照片路径前置,已平台确认——见契约附录 B.7)
+
+**联调期方案(第一版,推荐)**:小程序拍照/选图 → **后端代理转发到爱云医专用上传接口** `POST /app-api/detection/package/enter/upload`(multipart,`file` 必填 / `path` 选填,**免登录无需 Authorization/X-User-Id-Encrypt**),返回 `data` 即图片 URL,填入 `enter/detection_data` 的 `*UrlList[].url`。
+- 单文件 ≤100MB、单次请求总量 ≤500MB;服务端不校验扩展名,**建议 jpg/png,单张控制在 10MB 以内**。
+- **走 uploadFile 的好处**:URL 由平台自己产出,**算法侧必然能拉通**,无跨域/ACL 风险,联调最稳。
+
+**二期可选(外链 OSS)**:平台允许直接传租户对象存储的**公网 URL**(`enter/detection_data` 只存字符串、不校验域名、不转存),但**算法侧必须公网拉通,拉不到即检测失败且不回滚**,排查成本高。若要改用 JD Cloud OSS `buildPublicUrl()` 直链,**须先给平台样例 URL 验证一次可达性再切**(对应风险 R1)。
+
+> **决策**:**第一版照片上传走平台 `uploadFile`**(新增后端代理端点,见 §4.1);OSS 外链方案保留二期。
+
+### 3.4 关键接口映射(照片 vs 视频)
+
+**照片路径**(`inspectionType 0/3`):
+```
+1) 登录/取 token (identify)                  → accessToken/refreshToken/userId
+2) 商品列表 (spu/page) + 明细 (get-detail)   → 找到「AI 检测」商品 → skuId
+3) 创建检测服务包 (order/create)             → packageIds[0] = packageId
+4) 创建检测用户 (detection-user/create)      → detectionUserId(检测人,映射本家庭某成员)
+5) 激活录入 (enter/detection_user)           → {id: packageId, detectionUserId}
+6) 检测套餐分页 (package/page)               → 取 detectionReportUserId(报告关联用户 id)
+7) 查询检测明细 (get-items)                  → 子项 id + inspectionType(判断 0/3 还是 1/2)
+8) 上传照片(走 uploadFile)→ 图片 URL
+9) 录入检测数据 (enter/detection_data)       → 传 basicUrlList/reportUrlList 等
+10) 轮询检测套餐分页/子项 → 状态变更
+11) 获得检测报告 (report/get)                → 指标 diseaseDetailList
+12) 获得疾病解决方案 (get-content)           → 解读文案(二期)
+```
+
+**视频路径**(`inspectionType 1/2`):
+```
+1)-7) 同上,第 7 步发现 inspectionType=1/2
+8) 获取 AI 实时检测路径 (getPath)            → data.path(H5 URL)
+9) 小程序 <web-view src={path}> 内嵌         → 用户在爱云医页内采集视频
+10) 完成后回小程序,拉取检测套餐分页/子项确认完成
+11) 获得检测报告 (report/get)                → 展示
+```
+
+### 3.5 账户与检测人模型(关键决策)
+
+爱云医有两层身份:
+- **终端账户**(`identify` 用手机号创建,返回 `userId`):是**购买/持有套餐的账户**。文档:会员不存在自动建档。
+- **检测用户**(`detection-user/create`,含 `realName/relation/userSex/...`):是**实际接受检测的人**,报告按检测人归档。
+
+**第一版建议(简化、可行)**:
+- **一个租户级爱云医账户**承载所有家庭套餐(用平台预留/运营手机号 `identify` 建档),`detection-user/create` 为**每个被检测的家族成员**建检测人。这样避免「每个家庭成员都去爱云医建档」导致账户爆炸与手机号复用问题。
+- 若爱云医要求「账户=小程序登录用户」(按用户隔离),则回退为:**每个小程序用户一个爱云医账户**,`identify` 用该用户真实手机号。→ 联调时与对方确认(风险 R4)。
+- 本地映射表记录:`本小程序 家庭/成员 ↔ 爱云医 detectionUserId / packageId / packageItemId / reportId`,保证幂等(同一成员重复识别复用已建检测人/未用子项)。
+
+---
+
+## 4. 具体实施(改动清单)
+
+### 4.1 后端(cfc-backend,Spring Boot 2.7 / Java 8)
+
+| 文件 | 类型 | 内容 |
+|---|---|---|
+| `config/AiYunyiProperties.java` | 新增 | `@ConfigurationProperties(prefix="aiyunyi")`:baseUrl/appKey/rsaPrivateKey/rsaPublicKey/accountPhone/商品关键字等 |
+| `service/AicdsGatewayService.java` | 新增 | 核心:构造签名 Header、HTTP 调用(RestTemplate,仿 `AiGateway` 超时/熔断)、令牌缓存与刷新、错误码归一 |
+| `service/AicdsTokenStore.java` | 新增 | 内存(ConcurrentHashMap)+ 可选 DB 落盘,access/refresh 令牌、临期刷新、过期重登 |
+| `service/AicdsDetectionService.java` | 新增 | 编排:找商品→下单→建检测人→激活→查子项→传照片→拉报告(照片/视频分支) |
+| `controller/AicdsController.java` | 新增 | `@PostMapping("/api/aiyunyi/**")` 转发代理;含 **`/api/aiyunyi/upload` multipart 代理到 `/app-api/detection/package/enter/upload`**(联调期照片上传走此路,返回 URL);**照片不再走 OSS**(二期再切外链) |
+| `entity/AiYunyiMapping.java` + Mapper | 新增 | 映射表 `aiyunyi_mapping`(见 4.3) |
+| `config/DatabaseInitializer.java` | 修改 | 新增迁移建表 `aiyunyi_mapping`(用现有 `ensureTable`/`ensureColumn` 惯例,同步 schema.sql) |
+| `resources/application.yml` | 修改 | `aiyunyi:` 配置段(app-key/私钥/公钥/base-url 等,密钥走 `${AIYUNYI_*}` 环境变量;base-url 用 `https://devadmin.aicds.com.cn/open-api`) |
+| `docs/superpowers/api/API_REFERENCE.md` | 修改 | 新增 `/api/aiyunyi/**` 接口登记(按仓库约定:新增 Controller 前先查重) |
+
+### 4.2 前端(cfc-frontend,uni-app / Vue2)
+
+| 文件 | 类型 | 内容 |
+|---|---|---|
+| `pages/health/report-upload.vue` | 修改 | 「上传方式」区新增第三张卡片「AI 快速识别」,`@click="startAiDetect"` |
+| `pages/health/ai-detect/index.vue`(或 `ai-detect.vue`) | 新增 | 识别流程页:选检测人 → 选素材(拍照/图库/微信)→ 上传 → 进度(轮询)→ 结果跳转 |
+| `pages/health/ai-report-detail.vue` | 新增 | 爱云医报告结果展示(原始结构渲染,二期映射五维) |
+| `pages/health/ai-video-detect.vue` | 新增 | `<web-view>` 内嵌爱云医视频检测 H5 页(`getPath` 返回的 path) |
+| `utils/api.js` | 修改 | 新增 `aiyunyi.*` 封装(listProducts/createOrder/createDetectionUser/enterData/getReport 等) |
+| `pages.json` | 修改 | 注册新增 3 个页面路由 |
+| `utils/image-picker.js` | 复用 | 已支持相机/图库/微信选图,无需改(`pickImage` + `chooseMessageFile`) |
+
+### 4.3 数据库
+
+`aiyunyi_mapping`(本地关联表,保证幂等与二次识别复用):
+
+| 列 | 类型 | 说明 |
+|---|---|---|
+| `id` | bigint PK | |
+| `member_id` | bigint | 本小程序家族成员 id(`family_members`) |
+| `family_id` | bigint | 所属家庭 |
+| `aiyunyi_detection_user_id` | bigint | 爱云医检测用户 id |
+| `aiyunyi_package_id` | bigint | 爱云医套餐实例 id |
+| `aiyunyi_package_item_id` | bigint | 爱云医子项 id |
+| `aiyunyi_report_id` | bigint | 爱云医报告 id |
+| `aiyunyi_inspection_type` | int | 0/1/2/3 |
+| `status` | int | 0 进行中 / 1 完成 / 2 失败 |
+| `created_at` / `updated_at` | datetime | |
+
+### 4.4 配置(application.yml + 环境变量)
+
+```yaml
+aiyunyi:
+  base-url: https://devadmin.aicds.com.cn/open-api     # 生产由平台提供(可能非 devadmin)
+  app-key: ${AIYUNYI_APP_KEY:}
+  rsa-private-key: ${AIYUNYI_RSA_PRIVATE_KEY:}        # PEM 多行,Base64 或换行符转义
+  rsa-public-key: ${AIYUNYI_RSA_PUBLIC_KEY:}          # 用于 X-User-Id-Encrypt 加密 userId
+  account-phone: ${AIYUNYI_ACCOUNT_PHONE:}            # 租户级账户手机号(见 3.5)
+  product-keyword: ${AIYUNYI_PRODUCT_KEYWORD:AI}      # 识别「AI 检测」商品的搜索词
+  timeout-ms: 15000
+  read-timeout-ms: 120000                              # 报告生成可长,覆盖
+```
+
+> ⚠️ 密钥绝不入库/入库前必须脱敏;`app-key`/`rsa-private-key` 只能经环境变量注入,禁止写死在 yml 明文。
+
+### 4.5 错误处理与降级
+
+- **鉴权失败(401/签名错)**:归一为「爱云医鉴权失败,请联系运营」,后端记录告警日志;自动重试一次(临期刷新后重发)。
+- **缺商品/未配置**:`spu/page` 返回空 = 平台未给本租户配置「AI 检测」商品,前端提示「该服务尚未开通」而非报错(文档明确:未配置返回空属正常)。
+- **无可用子项**:`get-items` 无 `status=0` 子项 = 套餐已用完/过期,前端提示「检测次数已用完,请重新购买」。
+- **照片上传失败**:`uploadFile` 返回非 0 或超时→提示重试(图片建议 jpg/png、单张≤10MB);二期若改外链 OSS,则失败提示按 B.7 处理。
+- **报告生成中**:`enter/detection_data` 提交后平台异步,轮询 `package/page` 或子项状态至完成(复用现有报告上传的 4s 轮询节奏,超时进列表)。
+- **退款/报告分页缺陷**:不调用(R2/R3)。
+
+---
+
+## 5. 时序(照片路径,主流程)
+
+```
+用户(小程序)                     cfc-backend                    爱云医
+   │ 选成员+勾选声明                  │                              │
+   │─ 拍照/图库/微信选照片 ─────────►│                              │
+   │─ POST /api/aiyunyi/detect ────►│                              │
+   │                                │─ identify(phone) ───────────►│ access/refresh/userId
+   │                                │─ spu/page+get-detail ───────►│ spuId+skuId
+   │                                │─ order/create(skuId) ───────►│ packageIds
+   │                                │─ detection-user/create ─────►│ detectionUserId
+   │                                │─ enter/detection_user ──────►│ 激活
+   │                                │─ package/page ──────────────►│ detectionReportUserId
+   │                                │─ get-items ─────────────────►│ packageItemId + inspectionType
+   │                                │   [上传照片→uploadFile→URL]      │
+   │                                │─ enter/detection_data ──────►│ 提交(异步生成)
+   │◄─ 返回:进行中                 │                              │
+   │ 轮询 /api/aiyunyi/status ─────►│─ package/page / get-items ──►│ status
+   │◄─ 完成                         │                              │
+   │─ GET /api/aiyunyi/report?id ──►│─ report/get ────────────────►│ 指标明细
+   │◄─ 报告详情页渲染                │                              │
+```
+
+---
+
+## 6. 文件清单与改动汇总
+
+**新增(后端 6 + 前端 4 + 文档 1)**
+- 后端:`AiYunyiProperties`、`AicdsGatewayService`、`AicdsTokenStore`、`AicdsDetectionService`、`AicdsController`、`AiYunyiMapping`(+Mapper)
+- 前端:`ai-detect` 页、`ai-report-detail` 页、`ai-video-detect` 页、`api.js` 新增封装
+- 文档:`docs/爱云医接入/爱云医接口契约-完整版.md`(附录 A,本次已生成)
+
+**修改(后端 3 + 前端 2 + 文档 2)**
+- 后端:`application.yml`(+aiyunyi 段)、`DatabaseInitializer`(+迁移)、`schema.sql`(同步)
+- 前端:`report-upload.vue`(+卡片)、`pages.json`(+路由)
+- 文档:`docs/superpowers/api/API_REFERENCE.md`(+接口登记)、`CHANGELOG.md`
+
+---
+
+## 7. 风险与待确认事项
+
+| # | 风险/待确认 | 影响 | 处置(2026-11-25 平台确认后) |
+|---|---|---|---|
+| **R1** | ~~JD Cloud bucket 是否公有读~~ | 爱云医拉取照片可能 403 | ✅ **已消除**:联调期**一律走平台 `uploadFile`**(附录 B.7),不依赖 OSS 外链;OSS 外链方案平台允许但须先验证可达性,**转二期** |
+| **R2** | **退款接口缺陷**:传 `{}` 返回 `code:0` 但数据库无变更 | 误判退款成功 | 第一版**不实现退款**;平台仍在修,后续确认 |
+| **R3** | **报告分页接口缺陷**:带 `Authorization`+`X-User-Id-Encrypt` 仍返回 `1011011002 用户未登录` | 报告列表不可用 | ⚠️ **平台确认仍在修**(附录 B.8):第一版报告**只走 `report/get` 按 id 拉取**,**不依赖 `report/page`** |
+| **R4** | ~~账户模型未与平台对齐~~ | 影响数据隔离 | ✅ **已消除**:单租户模式成立(平台确认一个账户可挂多检测人+多检测包,报告按检测人隔离);`order/create` 不走支付,成本 XAF 承担 |
+| **R5** | ~~检测用户/录入数据接口响应结构待确认~~ | 返回体字段不确定 | ✅ **已消除**:平台已给出真实返回体(附录 B.5)——`detection-user/create` 返回 Long 即 `detectionUserId`;`enter/detection_user`、`enter/detection_data` 返回 `data:true` 布尔;`order/create` 返回 `successList[].packageIds` 数组 |
+| **R6** | ~~「AI 检测」商品需平台为租户配置~~ | 功能不可用 | ✅ **已消除**:平台**全部后台配置**、租户无需/无法自行配置;商品是全局 SPU 按租户挂 SKU 行开放。**当前测试租户尚未挂 SKU(`spu/page` 返回空是预期)**,等平台配好下发 `spuId+skuId+keyword` 清单 |
+| **R7** | ~~视频检测 H5 页域名白名单~~ | web-view 可能受限 | ✅ **已消除**:采集页域名固定两套——`inspectionType=1`→`dev-xymeas.aicds.com.cn`、`2`→`dev-nls.aicds.com.cn`(**非 `devh5`**);测试/生产同域名靠 `istest` 区分;H5 免微信授权、身份靠 URL 参数(附录 B.6)。**小程序后台需加这两个 `webview` 域名** |
+| **R8** | **密钥安全**:RSA 私钥入库风险 | 安全 | 仅环境变量注入;代码评审强制;本方案不含密钥,已由运营持测试凭证(私钥 PKCS#8 848 字符勿截断) |
+
+---
+
+## 8. 测试与验收标准
+
+**后端单测(JUnit,仿 `AiGatewayTimeoutTest` 模式)**
+- 签名串构造:给定 appKey/timestamp,断言 `X-Api-Sign` = `Base64(SHA256withRSA(私钥,"appKey=..&timestamp=.."))`(用测试私钥+公钥对验签)。
+- 令牌刷新:临期主动刷新(mock refresh 成功换新)、过期回退重登(mock 401 后走 identify)。
+- 错误归一:`spu/page` 空 → 明确提示;无子项 → 「次数已用完」;爱云医 401/403 → 归一码。
+
+**后端契约测试(联调,接口矩阵)**
+- 用平台给的测试 `app-key`/RSA 密钥,在 devadmin 上逐接口跑通:identify → spu/page → get-detail → order/create → detection-user/create → enter/detection_user → get-items → getPath(视频)/ enter/detection_data(照片)→ report/get。
+- 照片路径:上传 12 张真实照片(走 `uploadFile`)→ 提交 → 轮询 `get-items` 子项 status `1→2` → `report/get` 拉报告 → 指标非空。
+- 视频路径:`getPath` 返回 URL 可打开(R7 已消除:域名固定 `dev-xymeas`/`dev-nls`,需加小程序 webview 白名单)。
+
+**前端验收(小程序)**
+- report-upload 出现「AI 快速识别」卡片;未选成员/未勾声明时拦截并提示(复用现有逻辑)。
+- 选照片(相机/图库/微信三种来源)均可上传;进度面板显示「识别中」;完成后跳报告详情。
+- 视频类型:进入 web-view 内嵌页;返回后可看到报告。
+- 错误分支:未开通/次数用完/网络失败均有明确提示,不白屏、不崩溃。
+
+**TDD 关联**(按项目纪律):实现与用例均推 `origin/cfclub`,能力键沿用 `unit.*` 合法域(如 `unit.aiyunyi.gateway`、`unit.aiyunyi.detect`),SC 编号入 `--requirement`;「跑通」以测试侧三类流证据 + mark-green 转正为准。
+
+---
+
+## 9. 后续派发(opencode 开发)
+
+本方案经确认后,按项目派发模型走 `tdd_orchestrate.py`(`--auto --role 开发 --limit 2 --project E:/cfc`),开发任务书要点:
+1. 后端 `AicdsGatewayService` + 签名/令牌 **(令牌按「30 分钟直接重登」处理,过期不可刷新)** + `AicdsController` 转发代理(含 `/api/aiyunyi/upload` multipart 代理)+ `aiyunyi_mapping` 迁移。
+2. 前端 `report-upload.vue` 新增「AI 快速识别」卡片 + `ai-detect` / `ai-report-detail` / `ai-video-detect` 三页 + `api.js` 封装。
+3. 联调流程:等平台下发商品清单(`spuId+skuId+keyword`)→ 用测试凭证跑通照片路径全链路(`identify → get-detail → order/create → detection-user/create → enter/detection_user → get-items → uploadFile → enter/detection_data → 轮询 → report/get`)→ 再跑视频路径。
+
+### 9.1 任务池状态(2026-11-25 更新)
+
+| 派发批次 | 能力键 | 条数 | 状态 |
+|---|---|---|---|
+| 后端第一批 | `ai.aiyunyi.mapping / sign / token / gateway / detect / detectVideo / controller` | 7 | 已入池 RED/pending |
+| 前端第一批 | `ai.aiyunyi.uploadCard / frontendApi / detectPage / videoPage / reportDetail` | 5 | 已入池 RED/pending |
+
+> ⚠️ **剩余阻塞项**(联调前必须解锁,**均非派发侧可解**):
+> 1. **平台下发「AI 检测」商品清单**(`spuId / skuId / keyword`)——当前测试租户先锋健康(编号 6)**尚未挂 SKU**,`spu/page` 返回空属预期;平台已承诺配好后发群。
+> 2. **小程序后台加 `webview` 域名白名单**:`dev-xymeas.aicds.com.cn`、`dev-nls.aicds.com.cn`(视频 `<web-view>` 必需)。
+> 3. **运营环境变量注入**:`AIYUNYI_APP_KEY` / `AIYUNYI_RSA_PRIVATE_KEY`(PKCS#8 完整 848 字符,勿截断)/ `AIYUNYI_RSA_PUBLIC_KEY` / `AIYUNYI_ACCOUNT_PHONE`。
+>
+> ✅ **测试凭证已到手**(先锋健康·devadmin):app-key + API Secret + RSA 公私钥,签名规则经平台书面确认。
+> **已解决的平台确认**:R1 消除(uploadFile)、R4 消除(单租户)、R5 消除(真实返回体)、R6 走平台配置、R7 消除(域名固定+istest);**R3 `report/page` 平台仍在修,只用 `report/get`**。
+
+---
+
+## 附录 A:爱云医接口契约(完整版)
+
+已随本文档生成:`docs/爱云医接入/爱云医接口契约-完整版.md`,共 21 个接口、约 2700 行,含每接口请求头/查询参数/请求体/响应 schema/示例/实测注释。核心契约摘要见 §2 表 + 下述关键接口请求体:
+
+### A.1 获取 token(`POST /member/user/identify`)
+- 请求体:`{ "mobile": "手机号" }`(必填)
+- 响应:`{ code, data: { accessToken, refreshToken, userId }, msg }`;accessToken 30 分钟、refreshToken 30 天
+
+### A.2 创建检测服务包(`POST /trade/order/create`)
+- 请求体:`{ "items": [{ "skuId": 0, "count": 0 }] }`(必填)
+- 响应:`{ code, data: { totalCount, successCount, errorCount, successList: [{ skuId, packageIds: [] }], errorList }, msg }`
+- ⚠️ `packageIds` 是套餐实例 id,不是 spuId
+
+### A.3 创建检测用户(`POST /product/detection-user/create`)
+- 请求体:`{ userId, relation, realName, userPhone, userAge, userSex, userHeight, userWeight, userBlood, userBirthday:"2025-10-30", isPlasticSurgery, remark, url, smoker, medication, diabetic }`(全必填)
+- 关系映射:`relation` 0 自己 /1 父亲 /2 母亲 /3 配偶 /4 儿子 /5 女儿 /6 朋友;`userSex` 0 未知 /1 男 /2 女
+
+### A.4 录入检测数据(`PUT /detection/package/enter/detection_data`)— **照片核心**
+- 请求体(关键字段):
+  - `detectionUserId`(必填)、`detectionReportUserId`(必填)、`detectionPackageId`(必填)、`detectionPackageItemId`(必填)
+  - `basicUrlList`(必填,12 张基本图片):`[{ id:index, url:图片地址, type:0, isQualified:空 }]`
+  - `familyHistoryUrlList`(语音,type=1)、`diseaseUrlList`(语音,type=2)、`reportUrlList`(病历/化验/检查报告,type=3)、`attachmentUrlList`(体表异常,type=4)
+  - `type`(必填):0 普通 / 3 癌症
+  - `realName`(可空)、`remark`、`knownDisease`、`specialNote`、`deviceNo`(可空)
+
+### A.5 AI 实时检测路径(`GET /detection/package/getPath`)— **视频核心**
+- 查询参数:`detectionPackageItemId`(必填)、`detectionReportUserId`(必填)
+- 响应:`{ code, data: { path: "检测页面URL" }, msg }`
+
+### A.6 获得检测报告(`GET /product/report/get`)
+- 查询参数:`id`(必填,报告 id)
+- 响应:`data.reportDiseaseRespList[].diseaseDetailList[]`:`diseaseDetailName`(英文)/`diseaseDetailNameCn`(中文)/`accuracy`(检测值)/`diseaseLevel`(等级)
+- **空值规则(必须复用)**:`accuracy` 空 → 参考值提示;`diseaseLevel` 空 → 「未检出」;不要自行填 0
+
+---
+*文档结束。契约完整版见 `docs/爱云医接入/爱云医接口契约-完整版.md`。*

+ 174 - 0
docs/scripts/fingerprint_engine.py

@@ -0,0 +1,174 @@
+# -*- coding: utf-8 -*-
+"""
+统一报告指纹检测引擎
+
+从数据库加载指纹规则(由 Java 后端传入 JSON),对 PDF 文本进行加权评分,
+返回匹配的报告类型。支持任意报告家族(DAN/菌群/其他)。
+
+用法(由 Java 后端通过 ProcessBuilder 调用):
+    python3 fingerprint_engine.py --rules <rules.json> --text <text.txt> --filename <name>
+    python3 fingerprint_engine.py --rules <rules.json> --pdf <file.pdf> --filename <name>
+
+输出 JSON:
+    {"typeId": "dan_a1", "score": 35, "confidence": "high", "scores": {...}, "parserPath": "..."}
+    未匹配时 typeId 为 "unknown"
+"""
+
+import argparse
+import json
+import os
+import re
+import sys
+
+sys.stdout.reconfigure(encoding='utf-8')
+sys.stderr.reconfigure(encoding='utf-8')
+
+THRESHOLD = 10
+FILENAME_BONUS = 50
+
+
+def normalize_chinese(text):
+    KANGXI_MAP = {
+        '\u2f52': '\u6c0f', '\u2f51': '\u6bcd', '\u2f59': '\u6b6f',
+        '\u2f04': '\u4e59', '\u2f20': '\u4e00', '\u2f21': '\u4e28',
+        '\u2f22': '\u4e3f', '\u2f23': '\u4e39', '\u2f2b': '\u5c38',
+        '\u2f2d': '\u5c71', '\u2f44': '\u4e59', '\u2f53': '\u6c14',
+        '\u2f55': '\u6c34', '\u2f5c': '\u725b', '\u2f5f': '\u7389',
+        '\u2f7a': '\u7f8a', '\u2f81': '\u8089', '\u2f83': '\u81ea',
+        '\u2f8a': '\u8272', '\u2f8e': '\u8840', '\u2f95': '\u79be',
+        '\u2f96': '\u8c46', '\u2faf': '\u9762', '\u2fb9': '\u9999',
+        '\u2fca': '\u9ed1', '\u2ec9': '\u8d1d', '\u2edd': '\u98df',
+        '\u2ee2': '\u9a6c', '\u2ee9': '\u9ec4',
+    }
+    return ''.join(KANGXI_MAP.get(c, c) for c in text)
+
+
+def extract_pdf_text(pdf_path):
+    try:
+        from PyPDF2 import PdfReader
+        reader = PdfReader(pdf_path)
+        return '\n'.join(page.extract_text() or '' for page in reader.pages)
+    except ImportError:
+        try:
+            import fitz
+            doc = fitz.open(pdf_path)
+            return '\n'.join(page.get_text() for page in doc)
+        except ImportError:
+            return ''
+
+
+_FILENAME_CODE_RE = re.compile(
+    r'(?<![A-Z0-9])(A1|A2|B2|B3|B4|B5|B6|C1)(?![A-Z0-9])'
+)
+
+
+def fallback_by_filename(filename):
+    name = (filename or '').upper()
+    m = _FILENAME_CODE_RE.search(name)
+    return 'dan_' + m.group(1).lower() if m else None
+
+
+def match_filename_type_id(filename, types):
+    fb = fallback_by_filename(filename)
+    if fb and fb in types:
+        return fb
+    return None
+
+
+def detect(rules, text, filename=''):
+    """对文本进行指纹评分,返回最佳匹配。
+
+    rules: [{"typeId": "...", "minConfidence": 10, "parserPath": "...",
+             "fingerprints": [{"pattern": "...", "weight": 10, "isExclusion": false}]}]
+
+    isExclusion=true 的指纹会对该类型自身扣分(排除自身),
+    同时所有其他类型检出该特征时也会被扣分(排除他者)。
+    """
+    if not text or not text.strip():
+        return {'typeId': 'unknown', 'score': 0, 'confidence': 'none',
+                'scores': {}, 'parserPath': None, 'reason': 'empty_text'}
+
+    text = normalize_chinese(text)
+    type_map = {r['typeId']: r for r in rules if r.get('typeId')}
+
+    scores = {}
+    exclusion_penalties = {}  # typeId -> total_penalty
+    for type_id, rule in type_map.items():
+        score = 0
+        penalty = 0
+        for fp in rule.get('fingerprints', []):
+            pattern = fp.get('pattern', '')
+            weight = fp.get('weight', 10)
+            is_excl = fp.get('isExclusion', False)
+            if pattern and pattern in text:
+                if is_excl:
+                    penalty += abs(weight)
+                else:
+                    score += weight
+        scores[type_id] = score
+        if penalty:
+            exclusion_penalties[type_id] = penalty
+
+    # 排除规则: 某类型匹配了排除指纹 → 从所有其他类型扣分
+    for excl_type, penalty in exclusion_penalties.items():
+        for tid in scores:
+            if tid != excl_type:
+                scores[tid] -= penalty
+
+    content_scores = dict(scores)
+
+    # 文件名加成
+    fb_type = match_filename_type_id(filename, type_map)
+    if fb_type and fb_type in scores:
+        scores[fb_type] += FILENAME_BONUS
+
+    if not scores:
+        return {'typeId': 'unknown', 'score': 0, 'confidence': 'none',
+                'scores': {}, 'parserPath': None, 'reason': 'no_rules'}
+
+    top_type = max(scores, key=scores.get)
+    rule = type_map.get(top_type, {})
+    min_conf = rule.get('minConfidence', THRESHOLD)
+
+    if content_scores.get(top_type, 0) < min_conf:
+        return {'typeId': 'unknown', 'score': content_scores.get(top_type, 0),
+                'confidence': 'low', 'scores': content_scores,
+                'parserPath': None, 'reason': 'below_threshold',
+                'closest': top_type, 'closestScore': content_scores.get(top_type, 0)}
+
+    confidence = 'high' if content_scores.get(top_type, 0) >= min_conf * 2 else 'medium'
+
+    return {
+        'typeId': top_type,
+        'score': content_scores.get(top_type, 0),
+        'confidence': confidence,
+        'scores': dict(sorted(content_scores.items(), key=lambda x: -x[1])),
+        'parserPath': rule.get('parserPath'),
+    }
+
+
+def main():
+    parser = argparse.ArgumentParser(description='统一报告指纹检测引擎')
+    parser.add_argument('--rules', required=True, help='指纹规则JSON文件路径')
+    parser.add_argument('--text', help='报告文本文件路径')
+    parser.add_argument('--pdf', help='PDF文件路径')
+    parser.add_argument('--filename', default='', help='文件名(用于回退匹配)')
+    args = parser.parse_args()
+
+    with open(args.rules, 'r', encoding='utf-8') as f:
+        rules = json.load(f)
+
+    if args.pdf and os.path.exists(args.pdf):
+        text = extract_pdf_text(args.pdf)
+    elif args.text and os.path.exists(args.text):
+        with open(args.text, 'r', encoding='utf-8') as f:
+            text = f.read()
+    else:
+        text = ''
+
+    result = detect(rules, text, args.filename)
+    print(json.dumps(result, ensure_ascii=False))
+
+
+if __name__ == '__main__':
+    main()

+ 377 - 0
docs/superpowers/plans/2026-11-10-probiotic-article-kb-check.md

@@ -0,0 +1,377 @@
+# 益生菌/益生元文章知识库校验机制 实施计划
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** 给后台文章模块加「益生菌/益生元主题文章的本地知识库校验机制」,并用同一机制创作一篇面向普通会员的益生菌选购科普文章并自检通过。
+
+**Architecture:** cfc-langgraph 新增 `POST /api/v1/knowledge-base/verify`(RAG 检索 + cosine 换算,返回每个待检句的最大相似度与匹配出处);cfc-backend 新增 `ArticleKbCheckService`(主题词识别 → 整句切分 → 调 verify → 按 cosine≥0.7 判定),在 `AdminArticleController.create/update` 保存时触发,REJECTED 强制 status=draft 并落库 `kb_check_status/kb_check_result`,publish 复核不硬拦(返回警告);cfc-web 文章管理/编辑页展示校验状态与警告;最后创作文章并自检通过。
+
+**Tech Stack:** Python 3.12 / FastAPI / langchain-chroma(ChromaDB);Java 17 / Spring Boot 2.7 / MyBatis-Plus / RestTemplate;Vue2 + Element UI;MySQL 8.0.34;JUnit5(backend 测试)+ pytest(langgraph 测试)。
+
+**Spec:** `docs/superpowers/specs/2026-11-10-probiotic-article-kb-check-design.md`
+
+## Global Constraints
+
+- 相似度阈值固定 **cosine ≥ 0.7**(严);实现**必须**显式区分 ChromaDB 默认 **L2 距离**与 cosine——**不能把 L2 距离当相似度**。
+- 生产 ChromaDB `cfc_knowledge` collection 为 2742 chunk,metadata 未设 `hnsw:space` → 默认 L2;embedding 模型 `text-embedding-v3`(SiliconFlow)1024 维。
+- **容器内存 8GiB 已近饱和**:禁止 `collection.get()` 拉全量 embedding(曾实测触发 OOM)。`similarity_search` 只取 top-k,安全。
+- 主题词清单(命中才校验):益生菌、益生元、菌株、乳酸菌、双歧杆菌、酪酸梭菌、凝结芽孢杆菌、乳杆菌、BB-12、LGG、HN019、BB536、PHGG、活菌、合生元、后生元、肠道菌群、菌群。
+- 单次校验待检句 **上限 20 句**(超长截断并提示)。
+- REJECTED 强制 `status=draft`;**publish 不硬拦**,返回 code=200 + `data.kbCheckRejected=true`。
+- langgraph 不可用 → `kb_check_status=SKIP`,**不阻断保存**。
+- 不套用 Guhe Gate G-1/G-2/G-3 禁写规则(用户明确允许写菌株号和剂量疗程)。
+- **校验路径不经过 `AiGateway` 共享熔断器**——`ArticleKbCheckService` 自建轻量 `RestTemplate`(connect 5s / read 10s),避免低优先路径污染 AI 熔断状态。
+- articles 表迁移**幂等**,且**必须同步 `schema.sql`**(红线)。
+- 后端重启用 `systemctl`,不裸 nohup;生产写操作需 go/no-go。
+- 本仓库工作树有两个 untracked 脚本(`docs/scripts/fingerprint_engine.py`、`scripts/import_rmg365.py`)**勿提交**。
+
+## Review Focus
+
+1. **L2 vs cosine 混淆**——把 L2 距离直接当相似度会整体误判。测试:Task 1 用 `distances` 与手算 cosine 双路对照断言。
+2. **REJECTED 未强制 draft**——保存仍按请求 status=published 落库,导致不合规文章直接可见。测试:Task 4 controller 层断言 REJECTED 后 status=draft。
+3. **publish 硬拦**——REJECTED 发布返回 error/4xx,违背「不硬拦」。测试:Task 4 断言 publish 返回 code=200 + `kbCheckRejected=true`。
+4. **全量 get 触发容器 OOM**——用 `collection.get()` 拉全量。审查:Task 1 实现须走 `similarity_search`/`query(n_results=k)`,review 时 grep 确认无全量 get。
+5. **校验路径污染 AI 熔断**——误用 `AiGateway`。测试:Task 3 `ArticleKbCheckService` 断言不依赖 AiGateway 注入;review grep 确认。
+6. **迁移未同步 schema.sql**——启动报错或幂等破坏。测试:Task 2 迁移步骤含 schema.sql 同步 + 重复启动验证。
+7. **langgraph 挂时阻塞保存**——未设短超时导致线程拖死。测试:Task 3 `ArticleKbCheckService` 单测断言 RestTemplate 超时值 ≤10s、异常被 catch 转 SKIP。
+
+---
+
+## Task 1: cfc-langgraph — `POST /api/v1/knowledge-base/verify` 端点
+
+**Files:**
+- Modify: `cfc-langgraph/app/api/knowledge_base.py`(新增 Pydantic 模型 + verify 路由)
+- Test: `cfc-langgraph/tests/test_knowledge_verify.py`(新建)
+
+**Interfaces:**
+- Consumes: `app.rag.embeddings.get_embeddings()`(已有);`langchain_chroma.Chroma`;`app.config.settings.chroma_db_path`。
+- Produces: HTTP `POST /api/v1/knowledge-base/verify`,请求 `{sentences:[{id,text}], source?:str="microbiome", k?:int=3, threshold?:float=0.7}`,响应 `Result` 形状 `{code:200, data:{source, threshold, results:[{id, max_similarity, passed, matched_title, matched_chunk}], all_passed}}`。后续 Task 3 的 Java 客户端按此契约调用。
+
+- [ ] **Step 1: 写失败测试(pytest,mock Chroma)**
+
+在 `cfc-langgraph/tests/test_knowledge_verify.py` 用 FastAPI TestClient + monkeypatch 替换 `Chroma`,覆盖三类断言:
+
+```python
+# 断言 1:L2 距离正确换算为 cosine(关键!)
+# mock 一条 L2 距离=1.0 的候选,其向量与 query 向量真实 cosine 应算出而非直接用 1.0
+def test_verify_converts_l2_to_cosine(client, mock_chroma): ...
+# 断言 2:通过阈值
+def test_verify_passed_when_cosine_ge_threshold(client, mock_chroma): ...
+# 断言 3:未通过(max_similarity < 0.7 → passed=False, all_passed=False)
+def test_verify_failed_below_threshold(client, mock_chroma): ...
+```
+
+- [ ] **Step 2: 运行测试确认失败**
+
+Run: `cd /app/cfc/cfc-langgraph && python -m pytest tests/test_knowledge_verify.py -v`
+Expected: FAIL — verify 路由 / 模型不存在(404 或 import error)
+
+- [ ] **Step 3: 实现 verify 路由**
+
+在 `knowledge_base.py` 加 `VerifySentence(id, text)` / `VerifyRequest(sentences, source="microbiome", k=3, threshold=0.7)` 与路由。核心算法(**这是实现必须照做的算法,非自由发挥**):
+
+```python
+# 1) similarity_search 拿 top-k 候选(只取 k 条,禁止全量)
+cands = store.similarity_search_with_score(text, k=k, filter={"source": source})
+# 2) 对候选 ids 用 collection.get(ids=..., include=["embeddings"]) 取回向量(仅 k 条)
+# 3) query 向量 = get_embeddings().embed_query(text)
+# 4) 对每条候选算 cosine:
+#      cos = dot(q, e) / (||q|| * ||e||)
+# 5) max_similarity = max(cos);passed = max_similarity >= threshold
+#    matched_title/chunk 取 argmax 对应候选的 metadata.title / page_content[:120]
+```
+
+> 注:第 2 步只对 top-k(k≤3)取 embedding,绝不 `get()` 全量。`filter={"source": source}` 为 Chroma metadata 等值过滤,与 `knowledge_sync` 写入的 `metadata.source` 对应。
+
+- [ ] **Step 4: 运行测试确认通过**
+
+Run: `python -m pytest tests/test_knowledge_verify.py -v`
+Expected: PASS(3 个用例全过)
+
+- [ ] **Step 5: 手工冒烟(可选,非生产容器)**
+
+Run: 在本地或测试环境起 uvicorn 后 `curl -X POST .../knowledge-base/verify -d '{"sentences":[{"id":"s1","text":"双歧杆菌改善肠道菌群"}]}'`
+Expected: 返回 `code=200` 且 `results[0]` 含 `max_similarity`(float)。
+
+- [ ] **Step 6: Commit**
+
+```bash
+git add cfc-langgraph/app/api/knowledge_base.py cfc-langgraph/tests/test_knowledge_verify.py
+git commit -m "feat(langgraph): 新增知识库 verify 校验端点(cosine 换算)"
+```
+
+---
+
+## Task 2: articles 表迁移 + `Article` 实体字段
+
+**Files:**
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java`(新增迁移语句)
+- Modify: `cfc-backend/src/main/resources/schema.sql`(同步列定义)
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/entity/Article.java`(加两个字段)
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/ArticleKbCheckFieldTest.java`(新建)
+
+**Interfaces:**
+- Consumes: 现有 `DatabaseInitializer` 幂等迁移模式(WARN「列已存在」为预期)。
+- Produces: `Article.kbCheckStatus`(`String`,取值 APPROVED/REJECTED/SKIP/null)、`Article.kbCheckResult`(`String`,JSON 文本);`articles.kb_check_status`、`articles.kb_check_result` 两列(均 `DEFAULT NULL`)。Task 3/4 依赖实体 getter/setter。
+
+- [ ] **Step 1: 写失败测试**
+
+```java
+@Test
+@DisplayName("Article 实体暴露 kbCheckStatus/kbCheckResult 字段")
+void entityExposesKbCheckFields() {
+    Article a = new Article();
+    a.setKbCheckStatus("REJECTED");
+    a.setKbCheckResult("{\"all_passed\":false}");
+    assertEquals("REJECTED", a.getKbCheckStatus());
+    assertTrue(a.getKbCheckResult().contains("all_passed"));
+}
+```
+
+- [ ] **Step 2: 运行确认失败**
+
+Run: `cd /app/cfc/cfc-backend && mvn -q test -Dtest=ArticleKbCheckFieldTest`
+Expected: FAIL(setter 不存在)
+
+- [ ] **Step 3: Article 实体加字段**
+
+按现有 MyBatis-Plus 驼峰风格(参考 `auditStatus` 字段)加 `private String kbCheckStatus;` / `private String kbCheckResult;`。
+
+- [ ] **Step 4: DatabaseInitializer 加迁移**
+
+```sql
+ALTER TABLE articles ADD COLUMN kb_check_status VARCHAR(20) DEFAULT NULL;
+ALTER TABLE articles ADD COLUMN kb_check_result TEXT DEFAULT NULL;
+```
+沿用现有幂等口径(列已存在 WARN 跳过)。**同步 `schema.sql`** 的 `articles` 建表语句加同名列。
+
+- [ ] **Step 5: 运行确认通过**
+
+Run: `mvn -q test -Dtest=ArticleKbCheckFieldTest`
+Expected: PASS
+
+- [ ] **Step 6: Commit**
+
+```bash
+git add cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java \
+        cfc-backend/src/main/resources/schema.sql \
+        cfc-backend/src/main/java/com/etotem/cfc/entity/Article.java \
+        cfc-backend/src/test/java/com/etotem/cfc/unit/ArticleKbCheckFieldTest.java
+git commit -m "feat(articles): 加 kb_check_status/kb_check_result 字段(幂等迁移)"
+```
+
+---
+
+## Task 3: cfc-backend — `ArticleKbCheckService`(识别 + 切分 + 调 verify + 判定)
+
+**Files:**
+- Create: `cfc-backend/src/main/java/com/etotem/cfc/service/ArticleKbCheckService.java`
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/ArticleKbCheckServiceTest.java`
+
+**Interfaces:**
+- Consumes: Task 1 的 `POST /api/v1/knowledge-base/verify` HTTP 契约;`@Value("${python.base-url:http://localhost:9000}")`。
+- Produces:
+  - `boolean isProbioticTopic(String title, String content, String tags)` — 主题词命中判定。
+  - `List<String> splitSentences(String html)` — 中文句读切分(`。!?;\n`),剥 HTML 标签,过滤短句(长度<8 跳过),**上限 20 句**。
+  - `KbCheckOutcome checkSentences(List<String> sentences)` — 调 verify,返回 `{status: APPROVED|REJECTED|SKIP, resultJson: String}`。
+  - `KbCheckOutcome`(内部类或 DTO)含 `status`/`resultJson`。
+
+- [ ] **Step 1: 写失败测试(mock RestTemplate)**
+
+覆盖:
+```java
+@Test void topicHit_onProbioticKeyword()          // 命中「益生菌」→ true
+@Test void topicMiss_onPlainArticle()             // 普通文章 → false
+@Test void split_中文句读且剥html_上限20句()        // 30 句 → 截断 20
+@Test void checkSentences_allPassed→APPROVED      // mock verify 返回 all_passed=true
+@Test void checkSentences_failed→REJECTED         // mock 返回 all_passed=false
+@Test void checkSentences_timeout→SKIP            // mock 抛 ResourceAccessException → SKIP
+```
+
+- [ ] **Step 2: 运行确认失败**
+
+Run: `mvn -q test -Dtest=ArticleKbCheckServiceTest`
+Expected: FAIL(类不存在)
+
+- [ ] **Step 3: 实现 `ArticleKbCheckService`**
+
+- `@Component`,注入 `@Value("${python.base-url}")`;**自建 `RestTemplate`**(connect 5s / read 10s,`@PostConstruct` 设置)——**不注入 `AiGateway`**(红线:避免污染共享熔断器)。
+- 主题词常量 `List<String> TOPIC_KEYWORDS`(Global Constraints 清单逐字复制)。
+- 调 verify:POST `{baseUrl}/api/v1/knowledge-base/verify`,body `{sentences, source:"microbiome", k:3, threshold:0.7}`;解析 `data.results`;异常(连接/超时/HTTP 错误)一律 catch → `SKIP`。
+- `resultJson` 用 `ObjectMapper` 序列化 `{threshold, checkedCount, all_passed, failed:[{text, matched_title}]}`。
+
+- [ ] **Step 4: 运行确认通过**
+
+Run: `mvn -q test -Dtest=ArticleKbCheckServiceTest`
+Expected: PASS
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add cfc-backend/src/main/java/com/etotem/cfc/service/ArticleKbCheckService.java \
+        cfc-backend/src/test/java/com/etotem/cfc/unit/ArticleKbCheckServiceTest.java
+git commit -m "feat(articles): ArticleKbCheckService 主题识别+整句切分+verify 校验"
+```
+
+---
+
+## Task 4: cfc-backend — `AdminArticleController` 挂载校验
+
+**Files:**
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminArticleController.java`(create L85-161、update L168-248、publish L277-286)
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/AdminArticleKbCheckFlowTest.java`(新建)
+
+**Interfaces:**
+- Consumes: Task 2 的 `Article.kbCheckStatus/Result`;Task 3 的 `ArticleKbCheckService.isProbioticTopic/checkSentences`。
+- Produces: create/update 返回体新增 `kbCheckStatus`(`data.kbCheckStatus`);publish 对 REJECTED 返回 `{code:200, data:{kbCheckRejected:true}}` 但**仍执行状态更新**。
+
+- [ ] **Step 1: 写失败测试**
+
+覆盖:
+```java
+@Test void create_非主题词_不触发校验_状态保持()               // 请求 published → 落库 published
+@Test void create_主题词_REJECTED_强制draft()                  // 请求 published 但 verify 失败 → status=draft
+@Test void create_主题词_APPROVED_状态保持()                   // verify 通过 → 保持请求 status
+@Test void create_主题词_SKIP_不阻断_状态保持()                // verify 超时 → 保持请求 status
+@Test void publish_REJECTED_仍可发布_返回警告()                // 返回 code=200 + kbCheckRejected=true
+```
+测试用 Mockito spy/mocked `ArticleKbCheckService`,断言落库后的 `status` 与响应体。
+
+- [ ] **Step 2: 运行确认失败**
+
+Run: `mvn -q test -Dtest=AdminArticleKbCheckFlowTest`
+Expected: FAIL(未调用校验、无强制 draft 分支)
+
+- [ ] **Step 3: 实现 controller 挂载**
+
+- `create`:构造 `article` 后、`articleService.create` 前,若 `isProbioticTopic(...)` 则 `outcome = checkSentences(...)`;写 `article.setKbCheckStatus/Result`;`if (REJECTED) article.setStatus("draft")`;响应 `data.kbCheckStatus`。
+- `update`:同逻辑(基于合并后的 title/content/tags 判定)。
+- `publish` / `{id}/publish`:更新状态**后**,若该文章 `kb_check_status=REJECTED`,响应 `data.kbCheckRejected=true` 且仍 `code=200`(**不阻断**)。
+
+- [ ] **Step 4: 运行确认通过**
+
+Run: `mvn -q test -Dtest=AdminArticleKbCheckFlowTest`
+Expected: PASS
+
+- [ ] **Step 5: 全量回归**
+
+Run: `mvn clean package -Dmaven.test.skip=false`
+Expected: exit 0(既有测试不回归)
+
+- [ ] **Step 6: Commit**
+
+```bash
+git add cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminArticleController.java \
+        cfc-backend/src/test/java/com/etotem/cfc/unit/AdminArticleKbCheckFlowTest.java
+git commit -m "feat(articles): create/update 挂载知识库校验,REJECTED 强制 draft,publish 警告不硬拦"
+```
+
+---
+
+## Task 5: cfc-web — 文章管理/编辑页展示校验状态
+
+**Files:**
+- Modify: `cfc-web/src/views/admin/ArticleEdit.vue`(保存/发布响应处理 + 警告 UI)
+- Modify: `cfc-web/src/views/admin/ArticleManage.vue`(列表加校验状态标签列)
+- Test: `cfc-web/src/__tests__/components/ArticleEdit.kbCheck.test.js`(新建)
+
+**Interfaces:**
+- Consumes: Task 4 的 `data.kbCheckStatus`(create/update)与 `data.kbCheckRejected`(publish)。
+- Produces: REJECTED 保存 → Element UI 警告弹窗(展示失败句子 + 「已自动转为草稿」);发布 REJECTED → 二次确认;列表页校验状态标签(绿 APPROVED / 红 REJECTED / 灰未校验)。
+
+- [ ] **Step 1: 写失败测试(jest + @vue/test-utils)**
+
+参考既有 `src/__tests__/components/ProductSkuEditor.mode.test.js` 范式:
+
+```js
+// REJECTED 保存 → 触发警告弹窗 + 提示已转草稿
+test('save with REJECTED shows warning and draft hint', () => { /* mount ArticleEdit, mock save, assert $alert called */ })
+// REJECTED 发布 → 触发二次确认
+test('publish REJECTED shows confirm before force publish', () => { /* assert $confirm called */ })
+// APPROVED 保存 → 绿色成功提示,无警告
+test('save with APPROVED shows success, no warning', () => { /* assert $alert not called */ })
+```
+
+- [ ] **Step 2: 运行确认失败**
+
+Run: `cd /app/cfc/cfc-web && npx jest src/__tests__/components/ArticleEdit.kbCheck.test.js`
+Expected: FAIL(新文件,或断言失败)
+
+- [ ] **Step 3: ArticleEdit.vue 处理保存响应**
+
+在保存成功回调里读 `data.kbCheckStatus`:`REJECTED` → `this.$alert(...)` 展示失败详情(`kbCheckResult` 解析 failed 句)+ 提示已转草稿;`APPROVED` → 绿色成功提示。
+
+- [ ] **Step 4: ArticleEdit.vue 发布二次确认**
+
+发布动作若当前文章 `kbCheckStatus==='REJECTED'`,用 `this.$confirm('知识库校验未通过,仍要强制发布?', ...)` 二次确认后才调发布接口。
+
+- [ ] **Step 5: ArticleManage.vue 列表标签列**
+
+新增列「知识库校验」,按行 `kbCheckStatus` 渲染 `el-tag`(type: success / danger / info)。
+
+- [ ] **Step 6: 运行测试确认通过**
+
+Run: `npx jest src/__tests__/components/ArticleEdit.kbCheck.test.js`
+Expected: PASS
+
+- [ ] **Step 7: build 验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 构建通过,`dist/` 含改动。
+
+- [ ] **Step 8: Commit**
+
+```bash
+git add cfc-web/src/views/admin/ArticleEdit.vue cfc-web/src/views/admin/ArticleManage.vue cfc-web/src/__tests__/components/ArticleEdit.kbCheck.test.js
+git commit -m "feat(web): 文章管理/编辑展示知识库校验状态与强制发布警告"
+```
+
+---
+
+## Task 6: 益生菌选购科普文章创作 + 自检通过
+
+**Files:**
+- Create: `docs/scripts/probiotic_article.py`(文章正文数据 + 调 verify 自检 + 上传封面 + create,参考既有 `/tmp/make_article.py` 模式)
+- 产物:articles 表新增一篇 `status=published`、`kb_check_status=APPROVED` 的文章。
+
+**Interfaces:**
+- Consumes: Task 1 verify 端点(自检);`/api/admin/articles/upload/image`(封面,agnes 生成)+ `/api/admin/articles/create`(建文章,幂等标题检查)。
+- Produces: 一篇面向普通会员的益生菌选购指南,分类 7(身体健康)、作者 浠艾福、`kb_check_status=APPROVED`。
+
+- [ ] **Step 1: 生成封面(agnes)**
+
+用 agnes-ai(`POST https://apihub.agnes-ai.com/v1/images/generations`,model `agnes-image-2.5-flash`,size 1024x576,清新水/肠道主题无字插画)出图 → `/tmp/probiotic_cover.png`。
+
+- [ ] **Step 2: 撰写正文(主张句尽量引知识库篇目)**
+
+结构:h1「如何科学选择益生菌?一文读懂菌株、活菌数与益生元」+ 选购维度(常见菌株属:双歧杆菌/乳杆菌;活菌数 CFU 概念;益生元作为菌的粮食;剂型与存储;如何看标签)。**核心主张句**(含菌株名/功效/剂量)优先复用知识库已有表述(如 AKK菌篇、20种改善肠道健康方法篇的措辞),提高 cosine≥0.7 命中率。
+
+- [ ] **Step 3: 自检(verify)**
+
+对正文提取的待检句调 `/api/v1/knowledge-base/verify`(本地/测试环境),要求 `all_passed=true`;未过的句子改写措辞向知识库篇目靠拢,重跑至通过。
+
+- [ ] **Step 4: 建文章**
+
+上传封面拿 coverImage URL → `POST /api/admin/articles/create`(title/summary/content/categoryId=7/author=浠艾福/tags/status=published/coverImage)→ 断言返回 `id` 且 `kbCheckStatus=APPROVED`。
+
+- [ ] **Step 5: 核对落库**
+
+Run: 查 `SELECT id,title,status,kb_check_status FROM articles ORDER BY id DESC LIMIT 1`
+Expected: `status=published`,`kb_check_status=APPROVED`。
+
+- [ ] **Step 6: Commit**
+
+```bash
+git add docs/scripts/probiotic_article.py
+git commit -m "feat(content): 益生菌选购科普文章(知识库自检通过)"
+```
+
+---
+
+## 部署(所有 Task 完成后,需 go/no-go)
+
+1. `git push origin <feature-branch>`(新分支 `feature/article-kb-check`,从 origin/cfclub 切)。
+2. 备份快照 → `cfc-langgraph` 重建容器(新增 verify 路由)→ `cfc-backend` `mvn package` + `systemctl restart` → `cfc-web` `npm run build` + rsync。
+3. 验证:verify 端点冒烟、建文章自检 APPROVED、前端标签可见。
+
+> ⚠ langgraph 容器内存已 8GiB 饱和,重建前确认新路由未引入全量 get(红线)。

+ 369 - 0
docs/superpowers/plans/2026-11-14-order-status-refund-cleanup.md

@@ -0,0 +1,369 @@
+# 订单状态与退款状态机梳理改造 Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** 梳理订单 `status` 与 `fulfill_status` 的职责,把退款流程改为三阶段「待退款 → 退款中 → 已退款」,并清理管理端冗余按钮;订单 PO179412729596900112E6 修正为已完成。
+
+**Architecture:** 后端引入新 status 值 `pending_refund`(待退款),`applyRefund`/`AfterSalesService.create` 写 `pending_refund` 而非 `refunding`;`approveRefund` 按微信退款返回状态分支(SUCCESS→已退款 / PROCESSING→退款中 / NOT_ENOUGH→现有队列);副作用统一在 `finalizeRefund()` 中执行(SUCCESS 立即、PROCESSING 由新端点「确认到账」、排队单由定时任务)。管理端 OrderManage.vue 移除「更多」下拉与 vendor-confirm 按钮,按状态直显内联操作按钮。
+
+**Tech Stack:** Spring Boot 2.7 / MyBatis-Plus / Vue2 + Element UI / uni-app 小程序
+
+**Spec:** 用户需求(会话即时确认):
+1. 订单 PO179412729596900112E6 当前 `refunding`(用户误操作申请了退款)→ 改为「已完成」;同时取消其关联售后单。
+2. 退款展示语义:用户申请=待退款(pending_refund)、后台确认=退款中(refunding/refund_pending)、到账=已退款(refunded)。
+3. 管理端订单列表不再用「更多」下拉,按状态直显所需按钮;移除无用的「确认发货」按钮(vendor-confirm 只写 fulfill_status、不动 status,与发货按钮冗余)。
+4. 梳理 status 与 fulfill_status:status 是订单生命周期主状态(含退款旁路),fulfill_status 是履约扩展标记(供应商确认/用户收货/线上核销),与 status 正交但不重复表达主流程。
+5. 小程序端「shipped」为幽灵值(后端从不写,发货写 pending_receipt),同步修正状态映射。
+
+## Global Constraints
+
+- 生产库 zxyj (MySQL 8.0.34),改动前备份、改动后验证;改生产数据前须 go/no-go(已获用户「执行(推荐)」预授权,执行数据修正前仍提示)。
+- 后端服务用 `systemctl restart cfc-backend`,禁用裸 nohup。
+- 新代码遵循既有模式:Service 用 MyBatis-Plus Mapper、Result 包装、LambdaQueryWrapper。
+- status 新增值 `pending_refund` 为纯新增枚举,不删除既有值(refunding 语义变为「退款中」)。
+- 管理端部署:`npm run build` + `rsync -a --delete dist/ /app/pro/cfc/frontend/`;后端部署:`mvn clean package` + 拷贝 jar + `systemctl restart cfc-backend`。
+
+## Review Focus
+
+- 从 `pending_receipt`(待收货)状态申请售后的订单,拒绝退款后应回滚到 `pending_receipt` 而非写死 `paid`——靠 apply 时记录 `refund_before_status` 并让 reject 按它恢复(Task 1 测试覆盖)。
+- 微信退款返回 PROCESSING(银行卡 1-3 天到账)时不得立即置 refunded;后续「确认到账」需幂等(已 refunded 再点返回成功不重复副作用)。
+- NOT_ENOUGH 排队单(refund_pending)由定时任务推进到 refunded,副作用只执行一次(沿用现有 PendingRefund 幂等设计)。
+- 小程序 order-list tab 值 `shipped` 查不到单(后端写 pending_receipt),修正后「待收货」tab 应能列出待收货订单。
+- 订单27 修正完成后,`after_sales_requests` 中其 pending 售后单需同步取消,否则后台售后待审列表残留脏数据。
+
+---
+
+### Task 1: 后端退款状态机(pending_refund + 三分支 approve + 回滚记录)
+
+**Files:**
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/service/ProductOrderService.java`
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/service/AfterSalesService.java`
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/service/PaymentService.java`
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminProductOrderController.java`
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/OrderRefundScP56ScA12ContractTest.java`(既有退款契约测试,按新语义更新断言:L130 申请退款→pending_refund、L193/210 审批起点改为 pending_refund、L195 期望按分支)
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/AfterSalesScS06ContractTest.java`(L98「订单转 refunding」改为 pending_refund)
+- 注意:`SupplierAfterSalesHandleContractTest`(供应商售后 review/complete RED)为预存 TDD-RED,不动其断言,保持基线 RED
+
+**Interfaces:**
+- Consumes: `PaymentService.refund(String orderNo, Integer amount, String reason)` 现状为 void
+- Produces:
+  - `PaymentService.refund(...) -> String` 返回微信退款受理状态:`"SUCCESS"` / `"PROCESSING"`(testMode 返回 `"SUCCESS"`;非 2xx/NOT_ENOUGH 仍抛异常)
+  - `ProductOrderService.approveRefund(String orderNo, Long adminId)`:微信受理后按返回状态分支
+  - `ProductOrderService.confirmRefundArrive(String orderNo, Long adminId)`:PROCESSING 单到账手动确认(幂等)
+  - status 新值 `pending_refund`;`applyRefund`/`AfterSalesService.create` 记录 `refund_before_status`/`refund_before_refund_status`
+
+- [ ] **Step 1: 写失败测试 —— applyRefund 置 pending_refund 且记录回滚前状态**
+
+在 `OrderRefundScP56ScA12ContractTest` 新增:
+```java
+@Test
+void applyRefund_setsPendingRefund_andRecordsBeforeStatus() {
+    // order status=paid, refund_status=0 下单后
+    Result<String> r = orderService.applyRefund(ORDER_NO, BUYER_ID, "不想要了");
+    assertEquals("退款申请已提交", r.getMsg());
+    ProductOrder o = orderMapper.selectOne(eq orderNo);
+    assertEquals("pending_refund", o.getStatus());
+    assertEquals(1, o.getRefundStatus());
+    assertEquals("paid", o.getRefundBeforeStatus());
+    assertEquals(0, o.getRefundBeforeRefundStatus());
+}
+```
+
+- [ ] **Step 2: 运行确认失败(RED)**
+
+Run: `mvn test -Dtest=OrderRefundScP56ScA12ContractTest -q`
+Expected: FAIL(`"refunding"` != `"pending_refund"`)
+
+- [ ] **Step 3: 改 applyRefund**
+
+`ProductOrderService.applyRefund`:
+- 状态校验保持 `paid`/`pending_shipment`;
+- 新增:`order.setRefundBeforeStatus(order.getStatus()); order.setRefundBeforeRefundStatus(order.getRefundStatus() != null ? order.getRefundStatus() : 0);`
+- `setStatus("pending_refund")`(原 `"refunding"`);`refund_status=1` 不变。
+
+`AfterSalesService.create` 同样:
+- 校验分支保持(paid/shipped/pending_receipt);
+- 记录 `refund_before_status`/`refund_before_refund_status`;
+- `setStatus("pending_refund")`。
+
+- [ ] **Step 4: 运行测试确认通过(GREEN)**
+
+Run: `mvn test -Dtest=OrderRefundScP56ScA12ContractTest -q`
+Expected: PASS
+
+- [ ] **Step 5: 写失败测试 —— approveRefund 按微信状态三分支**
+
+新增测试(PaymentService mock 返回 SUCCESS / PROCESSING / 抛 NOT_ENOUGH):
+```java
+@Test
+void approveRefund_success_returnsRefunded() { /* SUCCESS -> status=refunded, refund_status=2, 副作用执行 */ }
+@Test
+void approveRefund_processing_setsRefunding() { /* PROCESSING -> status=refunding, 副作用未执行(countStock不变) */ }
+```
+
+- [ ] **Step 6: 运行确认失败(RED)**
+
+Run: `mvn test -Dtest=OrderRefundScP56ScA12ContractTest -q`
+Expected: FAIL(目前 PROCESSING 也直接 refunded)
+
+- [ ] **Step 7: 改 PaymentService.refund 返回状态**
+
+```java
+public String refund(String orderNo, Integer amount, String reason) {
+    ...
+    if (testMode) { log...; return "SUCCESS"; }
+    ...
+    return status; // "SUCCESS" / "PROCESSING"(其他值抛异常)
+}
+```
+
+- [ ] **Step 8: 改 approveRefund 三分支 + 抽取 finalizeRefund**
+
+```java
+public Result<String> approveRefund(String orderNo, Long adminId) {
+    // 校验 refund_status==1 等不变
+    Integer refundAmount = ...; // money_amount fallback total_amount
+    String wxStatus = null;
+    if (refundAmount != null && refundAmount > 0) {
+        try { wxStatus = paymentService.refund(orderNo, refundAmount, order.getRefundReason()); }
+        catch (e) {
+            if (NOT_ENOUGH) { /* 现有排队逻辑不变:refund_pending + refund_status=4 + PendingRefund */ }
+            else return Result.error("退款失败: " + e.getMessage());
+        }
+    }
+    if (refundAmount == null || refundAmount == 0 || "SUCCESS".equals(wxStatus)) {
+        finalizeRefund(order, adminId);            // 副作用 + status=refunded + refund_status=2
+    } else { /* PROCESSING */
+        order.setStatus("refunding");
+        order.setRefundStatus(2);
+        order.setRefundTime(new Date());            // 记录发起时间
+        order.setUpdatedAt(new Date());
+        orderMapper.updateById(order);              // 副作用延后,等「确认到账」
+    }
+    syncAfterSalesRequestStatus(...);               // 售后单置 approved(原逻辑)
+    return Result.success(...);                     // 按分支返回不同提示
+}
+```
+
+`finalizeRefund(ProductOrder order, Long adminId)` 内聚:恢复库存、`recordRefundInbound`、`releaseCouponForCancelledOrder`、`refundOrderPoints`、`specialPriceService.releaseQuota`、`status=refunded`、`refund_status=2`、`refundTime=now`(原 approveRefund 方法体后半部分原样搬入)。
+
+- [ ] **Step 9: 运行测试确认通过(GREEN)**
+
+Run: `mvn test -Dtest=OrderRefundScP56ScA12ContractTest,AfterSalesScS06ContractTest -q`
+Expected: PASS
+
+- [ ] **Step 10: 写失败测试 —— rejectRefund 按 refund_before_status 回滚**
+
+```java
+@Test
+void rejectRefund_restoresBeforeStatus() {
+    // 从 pending_receipt 申请售后 -> reject
+    assertEquals("pending_receipt", order.getStatus()); // 而非写死 paid
+    assertEquals(3, order.getRefundStatus());
+}
+```
+
+- [ ] **Step 11: 运行确认失败(RED)**
+
+Expected: FAIL(现状回 paid)
+
+- [ ] **Step 12: 改 rejectRefund 回滚逻辑**
+
+```java
+order.setStatus(order.getRefundBeforeStatus() != null ? order.getRefundBeforeStatus() : "paid");
+order.setRefundStatus(3);
+// 保持 refund_before_* 字段供审计;清 refund_reason? 保留原因供展示
+```
+
+- [ ] **Step 13: 运行测试确认通过(GREEN)**
+
+Run: `mvn test -Dtest=OrderRefundScP56ScA12ContractTest -q`
+Expected: PASS
+
+- [ ] **Step 13b: 修正 myOrderCounts 幽灵值**
+
+`ProductOrderService.myOrderCounts` 的 `statuses` 数组 `{"pending","paid","shipped","completed","refunding"}` 中 `shipped` 后端从不写入(发货写 `pending_receipt`),改为 `pending_receipt` 并新增 `pending_refund` 计数(供小程序 tab 角标)。同步核对 order-list/order-detail 的 count 用法保持一致。
+
+- [ ] **Step 14: 新增 confirmRefundArrive 端点(管理端「确认到账」)**
+
+`AdminProductOrderController` 新增 `POST /refund/confirm-arrive` → `orderService.confirmRefundArrive(orderNo, adminId)`:
+```java
+public Result<String> confirmRefundArrive(String orderNo, Long adminId) {
+    ProductOrder order = ...;
+    if ("refunded".equals(order.getStatus())) return Result.success("已退款"); // 幂等
+    if (!"refunding".equals(order.getStatus())) return Result.error("当前状态不可确认到账");
+    finalizeRefund(order, adminId);
+    syncAfterSalesRequestStatus(orderNo, "approved", adminId);
+    return Result.success("已确认到账,退款完成");
+}
+```
+
+- [ ] **Step 15: 全量跑退款/售后相关测试**
+
+Run: `mvn test -Dtest=*Refund*,*AfterSales*,*Order*Contract*,ShopOrderQueryRefundContractTest -q`
+Expected: PASS(`unit.*` 既有 TDD-RED 契约测试除外,按基线评估)
+
+- [ ] **Step 16: Commit**
+
+```bash
+cd /app/cfc && git add cfc-backend && git commit -m "feat(order): 退款三阶段状态机 pending_refund/refunding/refunded + 回滚记录 + 确认到账端点"
+```
+
+### Task 2: 管理端 OrderManage.vue 内联按钮 + 移除冗余
+
+**Files:**
+- Modify: `cfc-web/src/views/admin/OrderManage.vue`
+- Modify: `cfc-web/src/api/admin.js`
+
+- [ ] **Step 1: 移除「更多」下拉,改为按状态直显按钮**
+
+`el-table-column 操作` 内替换 el-dropdown 为内联按钮组(保留「详情」):
+- `paid` → [发货] [关闭订单]
+- `pending_refund`(新增)→ [退款审核] [关闭订单]
+- `refunding` → [确认到账] [关闭订单]
+- `refund_pending` → [退款到帐中](跳转 /pending-refund 页)
+- `pending_receipt` → [关闭订单](canClose 已含)
+- 其余状态仅 [详情]
+
+删除 `vendor-confirm` 下拉项与 `handleVendorConfirm` 调用(admin.js 的 vendorConfirmOrder 函数可保留不删,避免破坏其它引用;确认无其它引用后删除)。
+
+- [ ] **Step 2: 状态标签/类型/筛选更新**
+
+- `statusLabel` map 增加 `pending_refund: 待退款`;`statusType` 增 `pending_refund: warning`;
+- `refunding` 标签不变『退款中』;`refund_pending` 标签改为『退款中』(或保留『退款到帐中』——与用户 Q3 答复一致,改『退款中』);
+- 顶部筛选下拉增 `待退款(pending_refund)` 选项;删掉 `确认发货` 相关 v-if。
+
+- [ ] **Step 3: add confirmRefundArrived API**
+
+`admin.js` 增:
+```js
+export function confirmRefundArrived(orderNo) {
+  return request({ url: /api/admin/product/order/refund/confirm-arrive, method: post, data: { orderNo } })
+}
+```
+
+- [ ] **Step 4: 本地构建冒烟**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: build 成功(prebuild bump 版本号 + changelog)
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add cfc-web && git commit -m "feat(admin): 订单列表按状态直显操作按钮,移除确认发货与更多菜单,新增确认到账"
+```
+
+### Task 3: 小程序端状态展示修正(shipped 幽灵值 + 待退款/退款中/已退款映射)
+
+**Files:**
+- Modify: `cfc-frontend/pages/shop/order-list/order-list.vue`
+- Modify: `cfc-frontend/pages/shop/order-detail/order-detail.vue`
+
+- [ ] **Step 1: order-list 状态 tab 与映射修正**
+
+- tab `{ label: 待收货, value: shipped }` → `value: pending_receipt`;`statusCounts` 同步;
+- `getDisplayStatus`/`getDisplayStatusText`:增 `pending_refund:待退款`;refundStatus 判定保持兜底(1→refunding、2→refunded、3→refund-rejected);
+- 「申请退款」按钮条件 `item.status === paid` 不变;`pending_refund` 增显「取消退款申请」或不变(order-detail 处理)。
+
+- [ ] **Step 2: order-detail 映射修正**
+
+- `getDisplayStatus`:`status===pending_refund` → pending_refund(显示『待退款』);`refunding` → 退款中;refunded → 已退款;
+- 底部操作:`refundStatus===1 && status===refunding` 的「取消退款申请」条件改为 `status===pending_refund`;
+- 「申请售后」按钮条件保持 paid/shipped/pending_receipt。
+
+- [ ] **Step 3: 小程序构建验证(不发布,仅构建)**
+
+Run: `cd /app/cfc/cfc-frontend && npm run build:mp-weixin`
+Expected: 构建成功。若因 login-sheet SCSS 既有问题失败(约 L334 `str-replace(#{inspect($color)},...)`),先暂停本任务、请示用户处置方式(应用修复/不动文件/暂缓),勿在本任务内顺手修无关文件
+
+- [ ] **Step 4: Commit(如构建通过)**
+
+```bash
+git add cfc-frontend && git commit -m "fix(mini): 订单状态展示修正 shipped->pending_receipt,新增待退款/退款中/已退款映射"
+```
+
+### Task 4: 生产数据修正 —— 订单27 改为已完成
+
+**Files:** 无(直接 SQL)
+
+- [ ] **Step 1: 备份**
+
+Run: `tar -czf /app/pro/cfc_backup_order27_$(date +%Y%m%d_%H%M%S).tar.gz -C /app pro/cfc`
+`mysqldump` product_orders + after_sales_requests where id=27/3 → /app/pro/cfc_backup_order27.sql
+
+- [ ] **Step 2: 查订单27 deliveryMethod**
+
+Run: `mysql ... -e "SELECT id, delivery_method, fulfill_status FROM product_orders WHERE id=27"`
+(若 dm>=2,履约按 confirmReceive 逻辑置 received_by_user;否则保留 confirmed_by_vendor;同时看 product 55 productType 兜底确认)
+
+- [ ] **Step 3: 更新订单(go/no-go 提示后执行)**
+
+```sql
+UPDATE product_orders SET
+  status=completed,
+  refund_status=0,
+  refund_reason=NULL,
+  refund_amount=0,
+  refund_before_status=NULL,
+  refund_before_refund_status=0,
+  confirm_time=NOW(),
+  received_at=CASE WHEN delivery_method>=2 THEN NOW() ELSE received_at END,
+  fulfill_status=CASE WHEN delivery_method>=2 THEN received_by_user ELSE fulfill_status END,
+  updated_at=NOW()
+WHERE id=27;
+UPDATE after_sales_requests SET status=cancelled, updated_at=NOW() WHERE id=3 AND status=pending;
+```
+
+- [ ] **Step 4: 验证**
+
+Run: `SELECT id,status,refund_status,fulfill_status,confirm_time FROM product_orders WHERE id=27; SELECT id,status FROM after_sales_requests WHERE id=3;`
+Expected: `completed / 0 / 已收货或已确认 / 时间非空`;售后单 `cancelled`。
+另:`curl -X POST http://localhost:9082/api/cart/list` 仍 200(服务未受影响,无需重启)。
+
+### Task 5: 状态职责梳理文档 + schema 注释更新
+
+**Files:**
+- Create: `cfc-backend/docs/order-status-refund-model.md`(如无 docs 目录则建)
+- Modify: `cfc-backend/src/main/resources/schema.sql:product_orders` status/refund_status/fulfill_status 注释
+
+- [ ] **Step 1: 写状态模型文档**
+
+`status`(主状态):pending/paid/pending_receipt/completed/cancelled/closed + 退款旁路 pending_refund→refunding→refunded,refund_pending(排队在途)。
+`refund_status`(退款子态枚举):0无/1申请中/2已退款/3拒绝/4退款到帐中。
+`fulfill_status`(履约扩展):pending→confirmed_by_vendor→received_by_user→completed;仅在售后/确认收货/核销/佣金统计读取,不作为主状态。
+含状态迁移表(谁从哪转到哪、触发动作、副作用时机)。
+
+- [ ] **Step 2: schema.sql 注释更新**
+
+status 注释改为 `pending/paid/pending_receipt/completed/cancelled/closed/pending_refund/refunding/refunded/refund_pending`;refund_status 注释补 4。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add docs schema.sql && git commit -m "docs(order): 订单状态与退款状态机梳理 + schema 注释同步"
+```
+
+### Task 6: 部署与全量验证
+
+- [ ] **Step 1: 后端部署**
+
+Run: `cd /app/cfc/cfc-backend && mvn clean package -Dmaven.test.skip=true -Dmaven.compile.fork=true`
+`cp target/cfc-backend-1.0.0.jar /app/pro/cfc/backend/`
+`systemctl restart cfc-backend`
+
+验证:`systemctl status cfc-backend`(active)、`ss -tlnp | grep 9082`、`curl -X POST http://localhost:9082/api/cart/list` = 200、重启后 `grep ERROR cfc-backend.log | tail` 为 0、`Tomcat started on 9082`。
+
+- [ ] **Step 2: 管理端部署**
+
+Run: `cd /app/cfc/cfc-web && npm run build && rsync -a --delete dist/ /app/pro/cfc/frontend/`
+验证:`curl -s -o /dev/null -w "%{http_code}" -k https://cfc.etotem.com.cn/admin/` = 200
+
+- [ ] **Step 3: 功能验证(管理端手工冒烟)**
+
+- 订单列表:`paid` 行仅有[发货][关闭],无「更多」、无「确认发货」;
+- 任一待退款单(如有):显示[退款审核];审批同意 SUCCESS → 已退款;PROCESSING → 退款中 + [确认到账];拒绝 → 回滚原状态;
+- 订单27 显示「已完成」。
+
+- [ ] **Step 4: git 收尾**
+
+Run: `git status` → `git add` 版本号相关 → `git push origin <当前分支>`

+ 408 - 0
docs/superpowers/plans/2026-11-15-family-workbench-tabs.md

@@ -0,0 +1,408 @@
+# 家庭运营工作台布局瘦身 + 家庭工作台 tab 化实施计划
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** 让家庭运营工作台(Families.vue)首屏显示家庭列表(去掉快捷入口网格),把家庭相关快捷入口改为 FamilyWorkbench 的 el-tabs 内嵌(数据锁定当前 familyId),并合并列表查询/导出工具栏。
+
+**Architecture:** 前端改造 `Families.vue`(删 quick-grid、合并检索/导出条)与 `FamilyWorkbench.vue`(新增 el-tabs 内嵌 6 个家庭级 tab);后端补 2 处 familyId 过滤(`AdminController.getChildren`、`AdminEarningsController.listFamilies`)。tab 子内容复用现有页面组件 + `familyId` prop 注入(只读锁定),不新建页面。
+
+**Tech Stack:** Vue2 + Element UI(cfc-web)、Spring Boot 2.7(cfc-backend)、MyBatis-Plus。
+
+**Spec:** `docs/superpowers/specs/2026-11-15-family-workbench-tabs-design.md`
+
+## Global Constraints
+
+- tab 内数据必须严格按 familyId 过滤,不得出现其他家庭数据(反目标)。
+- 统计带数据口径不变(`/api/admin/families/stats` 全局聚合 + 降级本页合计)。
+- 现有「点卡开抽屉」「点行进家庭工作台」交互不得破坏。
+- 后端管理端点遵循现有角色守卫范式(`requirePlatformRole`)。
+- 部署经 `npm run build` + `rsync`;后端 `systemctl restart cfc-backend`(禁裸 nohup)。
+- 在远程 `/app/cfc` 操作,feature 分支;不从本地 `/root/cfc`(空壳)。
+
+## Review Focus
+
+- 用户直接访问旧路由 `/families`(无 quick-grid 跳转)应仍正常显示统计带 + 列表 —— Task 1 保留统计带与列表逻辑。
+- 家庭工作台 tab 内切换后数据不串家庭(familyId 必须随 tab 传入并稳定)—— Task 3 每个 tab 显式传 `:family-id="familyId"`。
+- 后端 `/api/admin/children` 无 familyId 时不改变现有全量行为(向后兼容)—— Task 4 契约测试断言不传时 wrapper 为 null。
+- 内嵌 tab 组件不能显示原页面的全局筛选下拉(家庭选择/家庭ID 输入框)—— Task 3 各子组件 `v-if` 条件渲染。
+- 点统计卡开抽屉(任务/方案/报告/消息)在 tab 化后不回归 —— Task 3 保留 cards 区块与 openModule 原逻辑。
+
+---
+
+### Task 1: `Families.vue` 布局瘦身(删 quick-grid + 合并查询/导出)
+
+**Files:**
+- Modify: `cfc-web/src/views/Families.vue`
+
+**Interfaces:**
+- Consumes: 现有 `displayStats`/`tableData`/`pagination`/`searchForm` 数据与 `handleSearch`/`handleReset`/`batchExport`/`batchToggle` 方法(全部保留)。
+- Produces: 无(前端布局变更,无跨任务接口)。
+
+- [ ] **Step 1: 删除快捷入口网格模板块**
+
+```html
+<!-- ② 快捷入口网格 → 删除整块 <div class="quick-grid">...</div> -->
+```
+
+- [ ] **Step 2: 删除 quickEntries 数据与 goEntry/currentPath**
+
+从 `data()` 删除 `quickEntries` 数组;删除 `goEntry` 方法;删除 `currentPath` computed(无其他引用)。
+
+- [ ] **Step 3: 合并检索栏与批量操作为一条工具栏**
+
+当前结构:`el-form filter-bar`(含搜索/重置/高级筛选)→ `div batch-bar`(批量导出/批量启停 + 计数)。改为在 `el-form` 内同排追加导出/启停/计数按钮(去掉独立 `batch-bar` div)。
+
+```html
+<el-form-item>
+  <el-button type="primary" @click="handleSearch">搜索</el-button>
+  <el-button @click="handleReset">重置</el-button>
+  <el-button type="text" @click="advancedVisible = !advancedVisible">{{ advancedVisible ? '收起' : '高级筛选' }}</el-button>
+  <el-button size="small" :disabled="!selectedRows.length" @click="batchExport">批量导出</el-button>
+  <el-button size="small" :disabled="!selectedRows.length" @click="batchToggle">批量启停</el-button>
+  <span class="batch-count" v-if="selectedRows.length">已选 {{ selectedRows.length }} 项</span>
+</el-form-item>
+```
+
+- [ ] **Step 4: 清理 quick-grid 样式(若仍被引用)**
+
+确认 `quick-grid`/`qe-card`/`qe-icon`/`qe-label` CSS 已无引用后删除;保留其余样式。
+
+- [ ] **Step 5: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: BUILD 成功,无 `quickEntries`/`goEntry` 相关引用报错。
+
+- [ ] **Step 6: Commit**
+
+```bash
+git add cfc-web/src/views/Families.vue
+git commit -m "feat(admin): 家庭运营工作台瘦身——移除快捷入口网格,列表首屏可见,查询/导出合并工具栏"
+```
+
+---
+
+### Task 2: `FamilyWorkbench.vue` 新增 el-tabs 内嵌 6 个家庭级 tab
+
+**Files:**
+- Modify: `cfc-web/src/views/FamilyWorkbench.vue`
+
+**Interfaces:**
+- Consumes: 现有 `familyId`(`this.$route.params.id`)、`cards` 数据与 `openModule`/drawer 逻辑(保留不动)。
+- Produces: 子组件通过 `:family-id="familyId"` 接收当前家庭 ID(Task 3-8 各子组件消费)。
+
+- [ ] **Step 1: 在统计卡 `el-row` 之后插入 el-tabs**
+
+```html
+<el-tabs v-model="activeTab" class="wb-tabs">
+  <el-tab-pane label="孩子管理" name="children">
+    <ChildrenPanel :family-id="familyId" />
+  </el-tab-pane>
+  <el-tab-pane label="积分记录" name="points">
+    <PointsPanel :family-id="familyId" />
+  </el-tab-pane>
+  <el-tab-pane label="心愿" name="wishes">
+    <WishesPanel :family-id="familyId" />
+  </el-tab-pane>
+  <el-tab-pane label="奖励" name="rewards">
+    <RewardsPanel :family-id="familyId" />
+  </el-tab-pane>
+  <el-tab-pane label="优惠券" name="coupons">
+    <FamilyCouponPanel :family-id="familyId" />
+  </el-tab-pane>
+  <el-tab-pane label="收益" name="earnings">
+    <FamilyEarningsPanel :family-id="familyId" />
+  </el-tab-pane>
+</el-tabs>
+```
+
+- [ ] **Step 2: data 增加 activeTab**
+
+```js
+activeTab: 'children',
+```
+
+- [ ] **Step 3: import 6 个子组件**
+
+```js
+import ChildrenPanel from '@/views/admin/ChildrenPanel.vue'
+import PointsPanel from '@/views/admin/PointsPanel.vue'
+import WishesPanel from '@/views/admin/WishesPanel.vue'
+import RewardsPanel from '@/views/admin/RewardsPanel.vue'
+import FamilyCouponPanel from '@/views/admin/FamilyCouponPanel.vue'
+import FamilyEarningsPanel from '@/views/admin/FamilyEarningsPanel.vue'
+```
+
+(具体子组件路径与命名以 Task 3-8 建成的文件为准;若建成在既有页面旁则调整 import 路径。)
+
+- [ ] **Step 4: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功(子组件已建,import 解析通过)。
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add cfc-web/src/views/FamilyWorkbench.vue
+git commit -m "feat(admin): 家庭工作台新增 el-tabs 内嵌孩子/积分/心愿/奖励/优惠券/收益六个家庭级tab"
+```
+
+---
+
+### Task 3: 新建 `ChildrenPanel.vue`(内嵌孩子管理,锁定 familyId)
+
+**Files:**
+- Create: `cfc-web/src/views/admin/ChildrenPanel.vue`
+
+**Interfaces:**
+- Consumes: `familyId` prop(来自 Task 2);`getChildrenList` API(`/api/admin/children`,Task 4 后端补 familyId)。
+- Produces: 无(叶子组件)。
+
+- [ ] **Step 1: 写组件(复用 Children.vue 逻辑,去掉 PageHeader 与家庭ID筛选)**
+
+组件以 `props: { familyId: { type: [Number, String], default: null } }` 接收;`loadChildren()` 调 `getChildrenList({ ...searchForm, familyId: this.familyId })`;模板不含 PageHeader(不重复页头)、不含家庭ID输入框(familyId 已锁定);渲染表格列(昵称/年龄/当前积分/连续打卡/家庭ID/状态/操作)。
+
+- [ ] **Step 2: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add cfc-web/src/views/admin/ChildrenPanel.vue
+git commit -m "feat(admin): ChildrenPanel 家庭工作台内嵌组件(familyId 锁定)"
+```
+
+---
+
+### Task 4: 后端 `AdminController.getChildren` 补 familyId 过滤(契约测试 TDD)
+
+**Files:**
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminController.java:338-351`
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/AdminChildrenFamilyFilterContractTest.java`
+
+**Interfaces:**
+- Consumes: `params`(含可选 familyId)、`familyMemberMapper`。
+- Produces: `/api/admin/children` 支持 `{familyId}` 过滤;无 familyId 时行为不变(全量)。
+
+- [ ] **Step 1: 写契约测试(RED)**
+
+```java
+// 反射取 AdminController.getChildren 方法;Mockito 注入 FamilyMemberMapper;
+// 传入 {familyId: 5001} → selectPage 收到 wrapper 含 family_id=5001;
+// 不传 familyId → wrapper 为 null(全量,向后兼容)
+```
+
+- [ ] **Step 2: 运行测试确认 RED**
+
+Run: `cd /app/cfc/cfc-backend && mvn test -q -Dtest=AdminChildrenFamilyFilterContractTest -DfailIfNoTests=false -o`
+Expected: FAIL(当前 selectPage 传 null,断言 wrapper 非空失败)。
+
+- [ ] **Step 3: 实现 familyId 过滤**
+
+```java
+LambdaQueryWrapper<FamilyMember> wrapper = new LambdaQueryWrapper<>();
+Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
+if (familyId != null) {
+    wrapper.eq(FamilyMember::getFamilyId, familyId);
+}
+Page<FamilyMember> result = familyMemberMapper.selectPage(pageParam, familyId != null ? wrapper : null);
+```
+
+- [ ] **Step 4: 运行测试确认 GREEN**
+
+Run: `cd /app/cfc/cfc-backend && mvn test -q -Dtest=AdminChildrenFamilyFilterContractTest -DfailIfNoTests=false -o`
+Expected: PASS。
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminController.java cfc-backend/src/test/java/com/etotem/cfc/unit/AdminChildrenFamilyFilterContractTest.java
+git commit -m "feat(admin): /api/admin/children 支持 familyId 过滤(向后兼容)"
+```
+
+---
+
+### Task 5: 新建 `PointsPanel.vue`(内嵌积分记录,锁定 familyId)
+
+**Files:**
+- Create: `cfc-web/src/views/admin/PointsPanel.vue`
+
+**Interfaces:**
+- Consumes: `familyId` prop;`getPointsLogs` API(`/api/admin/points/logs`,后端已支持 familyId)。
+- Produces: 无。
+
+- [ ] **Step 1: 写组件**
+
+复用 `admin/PointsLog.vue` 逻辑;`props: { familyId }`;`loadData()` 调 `getPointsLogs({ ...filter, familyId: this.familyId })`;模板去 PageHeader,保留类型/分类/关键字筛选与表格。
+
+- [ ] **Step 2: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add cfc-web/src/views/admin/PointsPanel.vue
+git commit -m "feat(admin): PointsPanel 家庭工作台内嵌组件(familyId 锁定)"
+```
+
+---
+
+### Task 6: 新建 `WishesPanel.vue`(内嵌心愿,锁定 familyId)
+
+**Files:**
+- Create: `cfc-web/src/views/admin/WishesPanel.vue`
+
+**Interfaces:**
+- Consumes: `familyId` prop;`getWishesList` API(`/api/wishes/list`,后端已支持 familyId)。
+- Produces: 无。
+
+- [ ] **Step 1: 写组件**
+
+复用 `Wishes.vue` 逻辑;`props: { familyId }`;`loadWishes()` 调 `getWishesList({ ...searchForm, familyId: this.familyId })`;模板去 PageHeader,保留筛选与表格(含审批操作)。
+
+- [ ] **Step 2: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add cfc-web/src/views/admin/WishesPanel.vue
+git commit -m "feat(admin): WishesPanel 家庭工作台内嵌组件(familyId 锁定)"
+```
+
+---
+
+### Task 7: 新建 `RewardsPanel.vue`(内嵌奖励,锁定 familyId)
+
+**Files:**
+- Create: `cfc-web/src/views/admin/RewardsPanel.vue`
+
+**Interfaces:**
+- Consumes: `familyId` prop;`getRewardsList` API(后端已支持 familyId)。
+- Produces: 无。
+
+- [ ] **Step 1: 写组件**
+
+复用 `Rewards.vue` 逻辑;`props: { familyId }`;`loadRewards()` 调 `getRewardsList({ ...searchForm, familyId: this.familyId })`;模板去 PageHeader,保留筛选与表格(含审批/模板操作)。
+
+- [ ] **Step 2: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add cfc-web/src/views/admin/RewardsPanel.vue
+git commit -m "feat(admin): RewardsPanel 家庭工作台内嵌组件(familyId 锁定)"
+```
+
+---
+
+### Task 8: 新建 `FamilyCouponPanel.vue`(内嵌优惠券,锁定 familyId)
+
+**Files:**
+- Create: `cfc-web/src/views/admin/FamilyCouponPanel.vue`
+
+**Interfaces:**
+- Consumes: `familyId` prop;现有 family-coupon API(`/api/admin/coupon/family-coupons` 等,已支持 familyId)。
+- Produces: 无。
+
+- [ ] **Step 1: 写组件**
+
+复用 `admin/FamilyCouponManage.vue` 逻辑;`props: { familyId }`;`created()` 直接使用 `this.familyId`(不再读 route.query);模板去 PageHeader/返回按钮,保留发放/列表/使用明细 tab 与操作。
+
+- [ ] **Step 2: 构建验证**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: Commit**
+
+```bash
+git add cfc-web/src/views/admin/FamilyCouponPanel.vue
+git commit -m "feat(admin): FamilyCouponPanel 家庭工作台内嵌组件(familyId 锁定)"
+```
+
+---
+
+### Task 9: 新建 `FamilyEarningsPanel.vue`(内嵌收益,锁定 familyId)+ 后端过滤
+
+**Files:**
+- Create: `cfc-web/src/views/admin/FamilyEarningsPanel.vue`
+- Modify: `cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminEarningsController.java:33-38`
+- Test: `cfc-backend/src/test/java/com/etotem/cfc/unit/AdminEarningsFamilyFilterContractTest.java`
+
+**Interfaces:**
+- Consumes: `familyId` prop;`getFamilyEarningsList`/`getFamilyEarningsDetail` API;后端 `listFamilies` 补 familyId 过滤。
+- Produces: 无。
+
+- [ ] **Step 1: 写契约测试(RED)**
+
+`listFamilies({familyId: 5001})` → `selectList` 收到 wrapper 含 family_id=5001;不传 → wrapper null。
+
+- [ ] **Step 2: 运行确认 RED**
+
+Run: `cd /app/cfc/cfc-backend && mvn test -q -Dtest=AdminEarningsFamilyFilterContractTest -DfailIfNoTests=false -o`
+Expected: FAIL。
+
+- [ ] **Step 3: 后端实现 + 前端组件**
+
+后端:`listFamilies` 解析 familyId,非空则 `familyEarningsMapper.selectList(wrapper.eq(FamilyEarnings::getFamilyId, familyId))`,否则 `selectList(null)`。
+前端:`FamilyEarningsPanel.vue` 复用 `admin/FamilyEarnings.vue` 逻辑;`props: { familyId }`;`loadList()` 传 `familyId`;模板去 PageHeader。
+
+- [ ] **Step 4: 运行测试确认 GREEN + 构建**
+
+Run: `cd /app/cfc/cfc-backend && mvn test -q -Dtest=AdminEarningsFamilyFilterContractTest -DfailIfNoTests=false -o && cd ../cfc-web && npm run build`
+Expected: 测试 PASS + 构建成功。
+
+- [ ] **Step 5: Commit**
+
+```bash
+git add cfc-web/src/views/admin/FamilyEarningsPanel.vue cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminEarningsController.java cfc-backend/src/test/java/com/etotem/cfc/unit/AdminEarningsFamilyFilterContractTest.java
+git commit -m "feat(admin): FamilyEarningsPanel 内嵌组件 + /api/admin/earnings/families 支持 familyId 过滤"
+```
+
+---
+
+### Task 10: 全量回归 + 部署确认
+
+**Files:** 无(验证)
+
+- [ ] **Step 1: 后端编译 + 相关契约测试**
+
+Run: `cd /app/cfc/cfc-backend && mvn compile -q -o && mvn test -q -Dtest=AdminChildrenFamilyFilterContractTest,AdminEarningsFamilyFilterContractTest -DfailIfNoTests=false -o`
+Expected: 编译成功,2 测试 PASS。
+
+- [ ] **Step 2: 前端构建**
+
+Run: `cd /app/cfc/cfc-web && npm run build`
+Expected: 成功。
+
+- [ ] **Step 3: 人工冒烟清单(部署后)**
+
+- 家庭运营工作台 `/families`:统计带 7 卡显示、无快捷网格、列表首屏可见、查询/导出同排。
+- 家庭工作台 `/families/:id`:6 统计卡 + 6 tab;点 tab 数据仅当前家庭;点卡开抽屉不回归。
+- 直接访问 `/families/:id` 各 tab 无 familyId 泄漏。
+
+- [ ] **Step 4: 部署(需用户 go/no-go 确认)**
+
+```bash
+# 后端
+cd /app/cfc/cfc-backend && mvn clean package -Dmaven.test.skip=true -Dmaven.compile.fork=true
+cp target/cfc-backend-1.0.0.jar /app/pro/cfc/backend/
+systemctl restart cfc-backend
+# 前端
+cd /app/cfc/cfc-web && npm run build && rsync -a --delete dist/ /app/pro/cfc/frontend/
+```
+
+- [ ] **Step 5: git 收尾 push**
+
+```bash
+git push origin <feature-branch>
+```

+ 173 - 0
docs/superpowers/specs/2026-11-10-probiotic-article-kb-check-design.md

@@ -0,0 +1,173 @@
+# 需求变更 · 益生菌/益生元文章本地知识库校验机制
+
+> **来源**:用户 2026-11-10 拍板(`@skill:brainstorming`)。
+> **核心诉求**:面向普通会员的益生菌选择科普文章 + 「所有关于益生菌、益生元的文章,都要通过本地知识库的校验」机制。
+> **涉及后端**:`AdminArticleController`(create/update/audit/publish)+ `ArticleService` + 新增 `ArticleKbCheckService`。
+> **涉及 AI 服务**:`cfc-langgraph` 新增 `POST /api/v1/knowledge-base/verify`(RAG 检索校验端点)。
+> **涉及前端**:`cfc-web` 文章管理页(创建/编辑/发布弹窗)展示校验结果。
+> **状态**:设计待审批(未开始实施)。
+
+---
+
+## 0. 结论摘要(用户已拍板)
+
+| 决策点 | 结论 |
+|---|---|
+| 校验依据来源 | **RAG 知识库**(ChromaDB `cfc_knowledge` collection,source=`microbiome`,源自 `dan_knowledge_base` 表 809 篇菌群知识) |
+| 校验时机 | **保存时触发**(create/update),发布时复核 |
+| 校验失败处理 | **自动转 draft**,记录失败原因;**不硬拦**——管理员仍可强制发布(系统只给提示) |
+| 相似度阈值 | **严**:cosine 相似度 ≥ **0.7** 判通过 |
+| 校验单位 | **整句**(按中文句读切分,含主题词的句子逐句校验) |
+| 本次文章 | 面向普通会员的益生菌选购指南;内容尽量引用知识库已有菌株/功效知识,使其**自检通过** |
+| 校验 ≠ 封禁 | 允许写菌株号、允许写剂量疗程(不套用 Guhe Gate G-1/G-2 的禁写规则) |
+
+---
+
+## 1. 现状(2026-11-10 只读核查实证)
+
+### 1.1 知识库数据源
+- `dan_knowledge_base` 表:`source_type='article'` 共 **809** 篇菌群知识(如 id 47「AKK菌——下一代有益菌」、id 43「20种有效改善肠道健康的科学方法」),另有 `file` 39 篇。字段:`id/title/content/sort/status/remark/file_url/file_name/source_url/source_type`。
+- 经 `cfc-langgraph/app/tasks/knowledge_sync.py`(`_sync_source`,source=`microbiome`)全量同步进 ChromaDB `cfc_knowledge` collection。
+
+### 1.2 ChromaDB 现状(生产实测)
+- collection:**仅 `cfc_knowledge` 一个**,**2742** 个文档(chunk)。
+- `collection_metadata` / `segment_metadata` **均为空** → ChromaDB **默认 L2 距离**度量(未显式配置 `hnsw:space=cosine`)。
+- embedding 模型:`text-embedding-v3`(SiliconFlow,OpenAI 兼容),维度 **1024**。
+- 生产部署:`cfc-langgraph-langgraph-svc-1` 容器(v10.3),ChromaDB 在 docker volume `cfc-langgraph_langgraph-data`(`/data/chroma_db`),内存上限 **8 GiB**(主机 16 GiB,已近饱和)。
+
+### 1.3 检索实现现状
+- `RagRetriever.retrieve(query, filters, k)`:`vectorstore.similarity_search(...)`,返回 `{content, metadata, score}`——**score 恒为 `metadata.get("score", 0)`,非真实距离**。
+- **无对外检索端点**:`/api/v1/knowledge-base/*` 只有 `stats/documents/delete-source/sync/update`,无 `verify`/`retrieve`。`retriever.retrieve()` 仅被 `app/api/adapter.py` 内部使用。
+- 语言侧:`cfc-backend` 已有 `AiGateway`(`@Value("${python.base-url:http://localhost:9000}")`)调 langgraph `/api/v1/*`。
+
+### 1.4 文章模块现状
+- `AdminArticleController`:`/api/admin/articles/{create, update, audit, publish, {id}/publish, ...}`。`create` 已有微信文本/图片安全检测(`checkTextSafe`),**无知识库校验**。
+- `ArticleService.create(article, adminId)`:幂等标题检查 + wordCount 计算 + 安全检测。
+- `articles` 表:`status` 取值 draft/published/withdrawn(现 4 draft / 55 published / 6 withdrawn);`audit_status` 取值 approved 等(65 条)。已有 `created_by`。
+
+### 1.5 Guhe Gate 关系(重要:不是本需求内容)
+- `AttributionComplianceGate` + `AttributionLowSideRules`(G-1 措辞白名单/禁处方、G-2 16S 菌株号拦截、G-3 证据码隔离)**面向归因报告生成链路**,与文章创建无关。本需求**不复用**其禁写规则——用户明确允许文章写菌株号和剂量疗程。
+
+---
+
+## 2. 需求明细与实现方案
+
+### 需求 1:cfc-langgraph 新增 RAG 校验端点 `POST /api/v1/knowledge-base/verify`
+
+**目的**:给文章内容提供「知识库出处自检」,返回每个待检句的相似度评分。
+
+**入参**(JSON body):
+```json
+{
+  "sentences": [
+    {"id": "s1", "text": "双歧杆菌有助于维持肠道菌群平衡"},
+    {"id": "s2", "text": "每日补充10亿CFU的益生菌"}
+  ],
+  "source": "microbiome",   // 可选,默认 microbiome(菌群知识);可传 article/dan_knowledge
+  "k": 3,                    // 每个句子取 top-k,默认 3
+  "threshold": 0.7           // 可选,覆盖默认阈值
+}
+```
+
+**处理逻辑**(`app/api/knowledge_base.py` 新增 `verify` 路由):
+1. 对每个句子 `text`:`vectorstore.similarity_search_with_score(text, k=k, filter={"source": source})`。
+   - ⚠ **L2 距离换算**:当前 collection 未配 `hnsw:space=cosine`,返回的是 **L2 距离**(越小越相似),不是 cosine。**必须换算成归一化相似度**再与 threshold 比较。
+   - 换算公式(对 L2 距离 `d` 与 query 自检):`cosine_sim = 1 - (d^2 / 2)` 仅当向量归一化时成立。**更稳妥**:对 top-k 候选文档,取回其 embedding(`collection.get(ids, include=["embeddings"])`),与 query embedding 直接算 cosine 相似度。这样不依赖 collection 度量配置,阈值语义稳定(cosine 0.7)。
+   - 边界:`similarity_search_with_score` 在 L2 下 `score` 为距离;cosine 下为 1-distance。**实现须显式处理**,避免把 L2 距离当相似度。
+2. 返回每个句子:
+```json
+{
+  "code": 200,
+  "data": {
+    "source": "microbiome",
+    "threshold": 0.7,
+    "results": [
+      {"id": "s1", "max_similarity": 0.82, "passed": true, "matched_title": "AKK菌——下一代有益菌", "matched_chunk": "..."},
+      {"id": "s2", "max_similarity": 0.45, "passed": false, "matched_title": null, "matched_chunk": null}
+    ],
+    "all_passed": false
+  }
+}
+```
+
+**性能约束**:容器内存 8 GiB 已近饱和。单句检索 k=3 开销可控(`similarity_search` 只拉 top-k);**禁止** `collection.get()` 拉全量 embedding(曾实测触发 OOM)。每句独立 try/except,单句失败不影响整体。
+
+### 需求 2:cfc-backend 新增 `ArticleKbCheckService` + 主题词识别
+
+**2a. 主题词识别**(判断「是否益生菌/益生元文章」):
+- 扫描标题 + 正文 + tags,命中任一关键词即触发校验。关键词集(保守、可扩展):
+  `益生菌、益生元、菌株、乳酸菌、双歧杆菌、酪酸梭菌、凝结芽孢杆菌、乳杆菌、BB-12、LGG、HN019、BB536、PHGG、活菌、合生元、后生元、肠道菌群、菌群`。
+- 命中 → 进入校验流程;未命中 → 原逻辑(不校验)。
+
+**2b. 整句切分**:
+- 按中文句读切分正文:`。!?;\n`(与知识库 splitter `separators` 口径一致)。
+- 过滤出**含主题词**的句子(只校验有实质内容的句子,跳过纯标点/过短句/HTML 标签/表格行)。
+- 取前 **N=20** 句(防超长文打爆 RAG 调用;超过则截断并提示)。
+
+**2c. 调 langgraph verify**:
+- 复用 `AiGateway` 或新增轻量 HTTP 调用,POST `{python.base-url}/api/v1/knowledge-base/verify`,body 为 `{sentences:[{id,text}], source:"microbiome", k:3, threshold:0.7}`。
+- 超时:单次校验 **10s**(避免阻塞保存);失败降级为「校验跳过(服务不可用)」——不阻断保存,但记录 `kb_check_status=SKIP`。
+
+**2d. 判定与落库**:
+- `all_passed=true` → `kb_check_status=APPROVED`,正常保存(保持请求的 status)。
+- `all_passed=false` → `kb_check_status=REJECTED`,**强制 `status=draft`**(覆盖请求的 published/approved),记录失败详情(哪些句子无出处 + matched_title 建议)。
+- 结果落库:`articles` 表新增字段(见需求 3)。
+
+**2e. 发布复核(不硬拦)**:
+- `AdminArticleController.publish` / `{id}/publish`:若 `kb_check_status=REJECTED`,**不阻断**,返回提示 `{code:200, message:"知识库校验未通过,已强制发布", data:{kbCheckRejected:true}}`,前端据此展示警告。状态仍按请求设置。
+
+### 需求 3:articles 表新增字段(幂等迁移)
+
+`DatabaseInitializer` 迁移 + `schema.sql` 同步(须同步,红线):
+```sql
+ALTER TABLE articles ADD COLUMN kb_check_status VARCHAR(20) DEFAULT NULL;   -- APPROVED / REJECTED / SKIP / NULL(未校验)
+ALTER TABLE articles ADD COLUMN kb_check_result TEXT DEFAULT NULL;           -- JSON:{threshold, checkedSentences, failedSentences:[{text, matched_title}], all_passed}
+```
+- 幂等:`CHECK COLUMN IF NOT EXISTS` 口径(沿用现有迁移 WARN「列已存在」为预期行为)。
+- 实体 `Article.java` 加 `kbCheckStatus` / `kbCheckResult` 字段(MyBatis-Plus 驼峰映射)。
+
+### 需求 4:cfc-web 前端展示
+
+- 文章创建/编辑弹窗:保存后返回 `kb_check_status`。若 `REJECTED`:显示红色警告「知识库校验未通过,以下内容在菌群知识库中未检索到出处:…」,并**提示已自动转为草稿**。
+- 发布确认弹窗:若 `kb_check_status=REJECTED` 且用户点发布,显示警告 + 二次确认「知识库校验未通过,仍要强制发布?」。
+- 列表页(`Users.vue` 对应文章列表,实际是文章管理页):可加 `kb_check_status` 标签列(绿 APPROVED / 红 REJECTED / 灰未校验),便于管理员发现。
+
+### 需求 5:本次益生菌选购文章(正文 + 自检通过)
+
+- 标题(拟):「如何科学选择益生菌?一文读懂菌株、活菌数与益生元」
+- 面向普通会员,科普选购指南:核心要点——菌株类型(双歧杆菌属/乳杆菌属常见菌株)、活菌数(CFU)概念、益生元(膳食纤维/低聚糖)作为「菌的粮食」、剂型与存储、如何看产品标签。
+- **内容撰写约束**:核心主张句(菌株/功效/剂量)尽量引用知识库已有篇目表述(如 AKK菌、20种改善肠道健康科学方法、益生元相关篇目),使 verify 自检 **cosine≥0.7 通过**。
+- 发布口径:分类 7(身体健康)、作者浠艾福、agnes 生成封面、`status=published` + `audit_status=approved`(与既有文章一致)。
+
+---
+
+## 3. 非目标 / 反目标
+
+- **不**把 Guhe Gate(G-1/G-2/G-3 禁写规则)应用到文章创建——用户明确允许写菌株号、写剂量疗程。
+- **不**硬拦发布:REJECTED 文章仍可被管理员强制发布(系统提示,不阻断)。
+- **不**做「文章自动入库知识库」——本需求只是校验,不改变 `knowledge_sync` 的同步逻辑。
+- **不**改 `dan_knowledge_base` 数据或重训 embedding。
+- **不**动现有 `status`/`audit_status` 枚举(draft/published/withdrawn/approved 保持)。
+
+## 4. 约束与红线
+
+- **禁止在生产容器做重型检索探测**(内存已 8 GiB 饱和,`collection.get()` 拉全量曾触发 OOM)。开发验证在开发/测试环境或本地 ChromaDB 副本进行。
+- 新迁移**必须**同步 `schema.sql`。
+- 阈值语义固定为 **cosine 相似度 ≥ 0.7**;实现必须显式区分 L2 距离与 cosine(不能把 L2 当相似度)。
+- 后端重启用 `systemctl`,不裸 nohup。
+
+## 5. 部署影响
+
+- `cfc-backend`:新增 `ArticleKbCheckService` + controller 挂载 + 迁移 → 需重启(systemd)。
+- `cfc-langgraph`:新增 `/api/v1/knowledge-base/verify` → 需重建容器(`docker compose up -d --build` 或既有发布脚本)。
+- `cfc-web`:文章管理页改动 → `npm run build` + rsync dist。
+- 前置:git 同步 + 备份快照 + 预检(依 AGENTS.md 流程);**生产写操作需用户 go/no-go**。
+
+## 6. 验证清单
+
+- [ ] langgraph verify 端点:单测 + 手工 `curl`,构造已知出处句(应 passed)与无出处句(应 failed),确认 cosine 换算正确。
+- [ ] 后端:命中主题词文章触发校验;REJECTED 强制 draft;REJECTED 发布返回警告但成功;未命中文章不校验。
+- [ ] 迁移幂等:重复启动无错;schema.sql 与迁移一致。
+- [ ] 前端:REJECTED 保存显示警告+自动 draft 提示;发布二次确认。
+- [ ] 本次文章自检:`verify` 返回 `all_passed=true` 后发布。
+- [ ] 回归:`mvn package` exit 0;`npm run build` 通过;既有文章不受影响。

+ 88 - 0
docs/superpowers/specs/2026-11-15-family-workbench-tabs-design.md

@@ -0,0 +1,88 @@
+# 家庭运营工作台布局瘦身 + 家庭工作台 tab 化设计
+
+> 日期:2026-11-15
+> 范围:`cfc-web`(管理端 Vue2 + Element UI)+ 少量 `cfc-backend` 管理端点补 familyId 过滤
+> 前置:本任务为纯前端布局/交互改造 + 一个后端过滤补强,**不新建页面、不改移动端、不改卡片抽屉交互**
+
+## 1. 意图与为什么
+
+家庭运营工作台(`Families.vue`)当前页面从上到下三块:
+① 运营统计带(7 张统计卡)→ ② 快捷入口网格(10 个按钮,约 180px)→ ③ 家庭列表(检索栏 → 批量导出/启停 → 表格)。
+
+三块纵向叠加导致**家庭列表首屏不可见**(统计带 + 快捷网格固定占约 270px,列表只能看到一两行)。同时 10 个快捷入口本质是把「家庭运营各模块」做成一屏跳转,但这些模块**本应能在单家庭视图内直接操作**。
+
+目标:
+1. 家庭运营工作台**只显示统计数据 + 家庭列表**(删快捷入口网格),列表首屏可见。
+2. 快捷入口**改为 tab 放进家庭工作台**(`FamilyWorkbench.vue`,单家庭 `/families/:id`),在该家庭视图内直接操作家庭级数据。
+3. 家庭列表的**查询与导出合并为一条工具栏**(减少纵向占位)。
+
+## 2. 目标 / 非目标 / 反目标
+
+### 目标
+- `Families.vue`:删 `quick-grid`,保留统计带(数据不变)+ 家庭列表;检索栏与批量操作合并成一条工具栏。
+- `FamilyWorkbench.vue`:保留 6 张统计卡(点击开抽屉行为不变),下方新增 el-tabs,内嵌 6 个家庭级 tab。
+- 后端:给缺少 familyId 过滤的管理端点补上(`/api/admin/children`),使 tab 数据严格锁定当前家庭。
+
+### 非目标(明确不做)
+- 不新建任何页面组件。
+- 不改移动端(`cfc-frontend`)。
+- 不重构统计卡的 chart/drawer 逻辑(保留现状点击开抽屉)。
+- 不改 `Families.vue` 列表的行跳转(点行进家庭工作台的现有行为不动)。
+- 不搬全局配置类入口(汇总方式配置)/ 跨家庭视角类入口(收益提现审核、积分管理全局调整)。
+
+### 反目标(什么算失败)
+- 家庭运营工作台统计带数据口径改变(必须仍是 `/api/admin/families/stats` 全局聚合 + 降级本页合计)。
+- 家庭工作台 tab 内数据泄漏到全量(必须严格按 familyId 过滤,不得出现其他家庭数据)。
+- 现有「点卡开抽屉」「点行进工作台」交互被破坏。
+
+## 3. 约束
+
+- 遵循项目既有模式:管理端 `cfc-web`,Vue2 + Element UI;路由 `/families/:id` 为家庭工作台。
+- 后端管理端点遵循现有角色守卫范式(`requirePlatformRole` / admin 角色守卫)。
+- 部署经 `npm run build` + `rsync`;后端 `systemctl restart cfc-backend`(禁裸 nohup)。
+- 本仓库既定模式:在远程 `/app/cfc` 开 feature 分支操作(不从本地 `/root/cfc` 空壳)。
+
+## 4. 方案(已确认)
+
+### 改造 1:`Families.vue` 布局瘦身
+- 删除 `quick-grid` 模板块 + `quickEntries` 数据 + `goEntry` 方法。
+- `②` 快捷入口网格移除后,统计带下方直接是家庭列表 `el-card`。
+- 列表内:检索栏(`el-form inline`)与批量条合并——搜索字段、搜索/重置/高级筛选按钮、导出/启停按钮**同一排**;去掉单独 `batch-bar` 行。
+
+### 改造 2:`FamilyWorkbench.vue` tab 化
+- 统计卡 `el-row` 下方新增 `el-tabs`(`v-model="activeTab"`)。
+- 6 个内嵌 tab(按后端数据支撑度选定):
+
+| tab 标签 | 内嵌内容 | 数据端点 | familyId 过滤 |
+|---|---|---|---|
+| 孩子管理 | 子组件(现有 Children 逻辑,预置只读 familyId) | `POST /api/admin/children` | **后端补**(当前 `selectPage(pageParam, null)` 忽略) |
+| 积分记录 | 子组件(PointsLog 逻辑,预置只读 familyId) | `POST /api/admin/points/logs` | ✓ 已支持 |
+| 心愿 | 子组件(Wishes 逻辑,预置只读 familyId) | `POST /api/wishes/list` | ✓ 已支持(`familyId` @RequestParam) |
+| 奖励 | 子组件(Rewards 逻辑,预置只读 familyId) | `POST /api/admin/rewards` | ✓ 已支持(familyId 条件) |
+| 优惠券 | 内嵌 FamilyCouponManage(familyId 路由 query 已有) | `/api/admin/family-coupon` | ✓ 现有 |
+| 收益 | 内嵌 FamilyEarnings(familyId 天然维度) | `/api/admin/earnings/family/{id}` | ✓ 天然 |
+
+- tab 内子组件通过 `props.familyId`(或 route query)注入,**隐藏原页面的家庭选择下拉**,改为只读展示当前家庭名。
+- 原快捷入口 `coupons` 卡片点击跳转 `/family-coupon?familyId=` 行为保留(与 tab 一致)。
+
+### 改造 3(后端):`AdminController.getChildren` 补 familyId 过滤
+```java
+// 现状
+Page<FamilyMember> result = familyMemberMapper.selectPage(pageParam, null);
+// 改为
+LambdaQueryWrapper<FamilyMember> wrapper = new LambdaQueryWrapper<>();
+Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
+if (familyId != null) wrapper.eq(FamilyMember::getFamilyId, familyId);
+Page<FamilyMember> result = familyMemberMapper.selectPage(pageParam, wrapper);
+```
+- 向后兼容:不传 familyId 时仍返回全量(现有行为)。
+
+## 5. 留给实现者的决定(builder 可自行定)
+- tab 子组件复用方式:直接 `import` 现有页面组件并包一层传 props vs 复制精简逻辑。**倾向复用现有组件 + props 注入**(避免重复代码)。
+- 各 tab 的只读 familyId 注入方式(props 直传 vs provide/inject)——**倾向 props 直传**,简单显式。
+- 是否需给子组件加 `compact` 模式隐藏页头/面包屑——**是**,避免 tab 内嵌套整页头。
+
+## 6. 验证
+- 前端:`npm run build` 成功。
+- 后端:`mvn compile` + 相关契约测试(若有)。
+- 冒烟:家庭运营工作台首屏可见列表;家庭工作台 6 个 tab 数据均只含当前家庭;统计卡点击开抽屉不回归。

+ 44 - 0
docs/tdd/orchestration/report-deploy-2026-11-25-ab1f7595.md

@@ -0,0 +1,44 @@
+# 部署回执:ab1f7595 → testing(2026-11-25 13:15 轮)
+
+## 结论
+
+**部署成功。** 目标提交 `ab1f7595d88df7a357c6769bf658f27fd0d9b80e`(2026-11-25 10:59:09,feat(food.rule.weightEngine): S-cfc-464 加权引擎红单测使绿 15/15)已按**精确 commit 部署**真实运行在 testing 环境。
+
+本会话执行项目部署链路(`/home/iwt/cfc-deploy-251.sh` 同源链路的精确 commit 变体 `/tmp/opencode/cfc-deploy-precise-ab1f7595.sh`:纯净 worktree 快照 checkout 目标 commit → 后端/前端构建 → JAR 校验 → 备份/停旧进程 → 装新 JAR → 启动 + 健康检查 → 前端产物部署 → 最终验证 → 写 state),2026-11-25 13:15:26 部署完成,退出码 0。
+
+> 说明:目标提交已入 cfclub 主线(`git merge-base --is-ancestor ab1f7595 origin/cfclub` 成立)。部署前 testing 运行的是主线 HEAD `86e53725`(该目标 commit 之后 9 个提交);本轮按编排指令做**精确回退部署**,实际部署 commit 即目标 commit 本身,未夹带其后提交。
+
+## 部署结果
+
+| 项 | 值 |
+|----|----|
+| 目标 commit | `ab1f7595d88df7a357c6769bf658f27fd0d9b80e` |
+| **实际部署成功 commit** | **`ab1f7595d88df7a357c6769bf658f27fd0d9b80e`** |
+| 部署链路 | `/tmp/opencode/cfc-deploy-precise-ab1f7595.sh`(项目部署链精确 commit 变体,与 `/home/iwt/cfc-deploy-251.sh` 共用 `.cfc-deploy.lock` 互斥锁) |
+| 执行窗口 | 13:09:39 启动 → 13:10:40 后端构建成功 → 13:12:41 前端构建成功 (v1.0.2751) → 13:14:50 待部署 JAR md5 校验 → 13:14:55 安装新 JAR + 启动 PID 331120 → 13:15:25 健康检查通过 → 13:15:26 部署完成 |
+| 构建快照 | `/tmp/opencode/cfc-build-precise-ab1f7595`,`.git_sha` = `ab1f7595d88df7a357c6769bf658f27fd0d9b80e` |
+| 部署 state | `/home/iwt/.cfc-deploy-state`:`last_commit=ab1f7595d88df7a357c6769bf658f27fd0d9b80e`、`last_deploy=2026-11-25 13:15:26`、`backend_jar_md5=1b456455882e580edad1e5da30abdd01` |
+
+## 部署证据
+
+| 项 | 值 |
+|----|----|
+| 部署日志 | `/home/iwt/cfc-deploy.log` 中 `[deploy-ab1f7595]` 标签行;`2026-11-25 13:15:26 精确部署完成: commit=ab1f7595d88df7a357c6769bf658f27fd0d9b80e \ 后端: 401 \ 前端: 200 \ H5: 200` |
+| 运行进程 | PID **331120**,`java -Xms512m -Xmx1024m -jar /sc-data/springboot/cfc/cfc-backend-1.0.0.jar`,启动于 `Wed Nov 25 13:14:55 2026`,与 `/sc-data/springboot/cfc/cfc.pid` 一致 |
+| JAR 一致性 | 线上 JAR `md5sum` = `1b456455882e580edad1e5da30abdd01` = 干净构建快照 JAR md5 = state `backend_jar_md5`(三者一致,确认线上运行的就是目标 commit 的构建产物) |
+| 后端基线 | `POST http://localhost:9082/api/admin/foods/list` → **401**(无 token 预期)✓ |
+| 管理端 | `http://localhost/admin/`(Host: cfc.iwintrue.com)→ **200** ✓ |
+| 小程序 H5 | `http://localhost/frontend/`(Host: cfc.iwintrue.com)→ **200** ✓ |
+| 结果回执文件 | `/tmp/opencode/deploy-precise-ab1f7595.result.log`:`deployed_commit=ab1f7595d88df7a357c6769bf658f27fd0d9b80e` / `backend_http=401` / `frontend_http=200` / `h5_http=200` |
+
+### 已知事项
+
+- 小程序 H5 本轮 `npm run build:h5` 因已知 sass 环境问题失败;按部署链既有设计「H5 构建失败则沿用现有产物、继续部署」,H5 保持现有产物。后端 JAR(目标 commit 构建产物)与管理端产物(v1.0.2751,目标 commit 构建)均已正确部署,不影响本次精确部署的核心目标。
+
+## 纪律说明
+
+- 按编排要求,**未创建/修改** `.workbuddy/tasks.json`,未写 `last_deployed`;`--deploy-done testing --commit <sha>` 由编排侧/负责人在主分支目录统一落盘,本会话不处理。
+- 开始与结束均执行 `git pull --rebase`(版本管理纪律,git_pull_strategy=rebase):开始时 "Already up to date",结束时 fast-forward / 无冲突。
+- 部署服务器 state(`/home/iwt/.cfc-deploy-state`)属部署链自身运行记录,非编排侧账本,按部署链设计写入。
+- **供编排侧落盘的实际部署成功 commit hash:`ab1f7595d88df7a357c6769bf658f27fd0d9b80e`**。
+- 注意:testing 环境存在 cron 每 10 分钟一轮的自动部署(`cfc-deploy-251.sh`,部署 `origin/cfclub` HEAD);本回执记录的是本会话精确部署完成并验证 through 13:15:26 的事实,后续自动轮可能把环境推进到主线 HEAD。

+ 106 - 0
docs/tdd/orchestration/report-dev-2026-11-25-1251.md

@@ -0,0 +1,106 @@
+# 研发负责人自动化收割汇报 R352
+
+> 本档=CF 错峰档(41 分档);按 SKILL.md「负责人通用收割骨架」S1-S11 执行,S2 失败补跑由标准轮(01 分档)承担,本档跳过;S3 走精简变体(只 --status --top + --inspect + --resume --dry-run + 近 20 条 git log,跳过 --changes/--clean-check,**间隔档精简盘点,由标准轮承接**)。
+
+## 基本信息
+
+| 项目 | 内容 |
+|------|------|
+| 汇报人 | 研发负责人(自动化收割·本 id 48fcf169 / 41 分档) |
+| 汇报周期 | 2026-11-25 12:51 ~ 13:13(第 **R352** 轮) |
+| 负责范围 | E:/cfc,git 主线 origin/cfclub |
+
+## 一、执行摘要
+
+| 步骤 | 结果 |
+|------|------|
+| S1 互斥门 | **PASS**(state mtime 30.2min ≥ mutex_minutes=5;worklog.active --auto pid 44708 12:23:46 已死=死记录残留放行;worklog_stale_minutes=0 禁用第二关仅依 state mtime;locks 空;分支 cfclub;ops_mode 不存在=正常模式) |
+| S2 失败补跑 | 跳过(错峰档,由 01 分档标准轮承接) |
+| S3 精简盘点 | RED **15** / YELLOW **150** / GREEN 10 / DONE **85**;部署在途 pending **110** / confirmed 80;--inspect 以开发角色执行被拒=仅测试角色可执行(沿 R342 已知),降级只读不介入;resume dry-run 候选 0;近 20 条 git log tip `965e0977f`(S-cfc-285 RED 契约单测 3/3 红已合入,R349/R350/R351 三档汇报在列,在途产出活跃实证) |
+| S4 恢复 | 实际恢复 0(dry-run 候选 0,prod-etotem 生产实例默认跳过) |
+| S5 心跳 | config heartbeat.enabled=false,跳过并注明 |
+| S6 填充 | config fill_capacity.enabled=false,跳过并注明 |
+| S7a backfill | exit 0(批量版 120s 预算内,幂等重认 ai.aiyunyi 族 S-cfc-448~475 及 guheV2/rewardv2/oauth/xiaomi/huawei/family.ownership/auth.guard 系列,均在册无新证据) |
+| S7 --auto | `--auto --role 开发 --limit 2` **400s 兜底截断 EXIT=124**,但**本档非零净变化**:①派发保底已兑现(S-cfc-255 已派发核验→lan-189 ses_deee7d52;S-cfc-257 lan-204 未送达;S-cfc-263 在途时截断交下一档不重跑);②YELLOW 自动部署验证批量派发(food.rule.weightEngine `ab1f7595d88d`→pub-iwintrue ses_deee86fe + ai.aiyunyi 8 键批量标记自动待部署验证);③卡龄回收 3 条 dispatched→pending(三重守卫全过) |
+| S7 派发保底 | --auto 已 verified 派发 S-cfc-255(lan-189)+ 部署验证派发一批,派发保底达成,未再补直派 |
+| S8 池空续建 | 0 add-task(pending 92 非池空;错峰档跳 --changes,四类溯源无新增,不为填配额虚构) |
+| S9 收口 | 单文件临时索引提交 + push(push 前 fetch 防漂移) |
+| S10 汇报 | 本文件 |
+| webhook | 本档窗口 12:51~13:13 不跨整档 {6,10,14,18,22}(slot14 未到档)→ 非整档不触发 |
+
+## 1.0 场景覆盖矩阵(硬职责增列)
+
+单一事实源 `docs/tdd/orchestration/DEV_GOAL_user_scenarios.md`(241 个 SC)。本轮无新增 SC 跑通证据(能力键 DONE ≠ 场景跑通;派发/认领仅作过程证据)。
+
+| 指标 | 值 | 说明 |
+|------|-----|------|
+| 场景总数 | 241 | A25/G12/P96/C26/T32/S11/X22/B10/H7 |
+| 累计已跑通 | 15 | 以 sc-key-map 单一计数源为准(O-3 转正 5 + 游客域 10),沿 R351 口径 |
+| 本轮新增跑通 | 0 | 无满足三判据的新场景 |
+| 失败 | 0 | 本轮无 |
+| 阻塞 | 0 | 本轮无新增 |
+| 未跟踪 | 226 | = 241 − 15 |
+
+> 「跑通」三判据(RED/YELLOW/GREEN 三类流证据 + 实现用例 push origin/cfclub + `--clean-check` 退出码 0);能力键 DONE 不越权代判 SC 跑通。SC 主链路优先级取 config#harvest.sc_priority。
+
+## 1.2 任务分发
+
+| 指标 | 数量 |
+|------|------|
+| 分派任务数 | **1**(S-cfc-255,S7 --auto 派发,verified=true)+ 部署验证派发一批 |
+| 恢复智能体会话数 | 0 |
+| 当前在用会话数 | S-cfc-255(lan-189)+ testing 会话收口链在途 |
+
+**分派清单**:
+
+| 任务号 | 能力键 | 类型 | 目标实例 | 会话 ID | verified |
+|--------|--------|------|----------|---------|----------|
+| S-cfc-255 | butler.ai.collaborate | TDD-RED 写契约单测 | lan-189 | ses_deee7d52fffe6Dl8r7lKvZTDzB | true |
+
+**YELLOW 部署验证并行派发**:food.rule.weightEngine `ab1f7595d88d`(触及 5 文件)→ testing 环境会话 pub-iwintrue ses_deee86febfferkcFF86SZiIgCJ;ai.aiyunyi.mapping `d2c97e37ae74` / .sign `11dc41c355b3` / .token `3dfb6db6f685` / .gateway `9f543ccfa7d8` / .detect `410ae449b0f3` / .detectVideo `c07e63b5e98` / .controller `9b69a41f82fa` / .uploadCard `3a521e6ad3dc` 均 YELLOW✓ 待部署收口。
+
+> REQUEUE-SKIP-O22 22 键保持 done(S-cfc-74/75/76/79/80/100/309/395/396/399/400/412/413/417/421/422/425/427/431/432/449~475 系 requeue_reverted 键级已实现定论,不重派)。
+
+## 1.2b 各会话当前工作状态列表
+
+| 会话标签 | 会话 ID | 当前状态 | 当前任务 | 备注 |
+|----------|---------|----------|----------|------|
+| lan-189 | ses_deee7d52fffe6Dl8r7lKvZTDzB | running | S-cfc-255 butler.ai.collaborate RED | 本轮新派 |
+| lan-204 | — | — | S-cfc-257 未送达(无输出) | 待下轮核验 |
+| lan-204 | — | — | S-cfc-263 在途时截断 | 交下一错峰档承接 |
+| pub-iwintrue | ses_deee86febfferkcFF86SZiIgCJ | running | testing 部署验证 food.rule.weightEngine ab1f7595d88d | 本轮 --auto 派出 |
+
+> --inspect 以开发角色执行被拒=仅测试角色可执行(沿 R342 已知),降级只读不介入;节点配额细节由标准轮 --role 测试 --inspect 承接。
+
+## 1.3 变更感知
+
+本轮为错峰档,`--changes`/`--clean-check` 由标准轮(01 分档)承接 —— **间隔档精简盘点,由标准轮承接**。新增入池 0(池非空,无需续建)。
+
+## 1.4 本轮 git 证据(真理证据)
+
+| 提交 sha | 关联任务/能力键 | 阶段 | 触及类型 | 目标分支 | 已推送远端 |
+|----------|-----------------|------|----------|----------|------------|
+| `ab1f7595d88d` | S-cfc-464 food.rule.weightEngine | YELLOW | 实现 | origin/cfclub | 是 |
+| `965e0977f` | S-cfc-285 auth.profile.edit | RED | 测试 | origin/cfclub | 是 |
+| 本报告 commit(见下) | S-cfc-255 派发 + 账本回填 | docs | 文档 | origin/cfclub | 是 |
+
+> 远端 tip = `965e0977f`;近 20 条含 R349/R350/R351 三档汇报 + 部署回执 + 多笔 RED/YELLOW 测试与实现提交。git 远端正常(R314~R335 系 502 已恢复,历史积压汇报 commit 仍在本地对象库待补推)。
+
+## 二、阻塞与风险
+
+1. **`--auto` 400s 截断再现(同型第 19+ 次,EXIT=124)**——但本档与前几档不同:截断前已完成实质动作(S-cfc-255 派发核验 + 部署验证批量派发 + 卡龄回收 3 条),**非零净变化**;截断点落在 lan-204 连续派发(S-cfc-257 未送达、S-cfc-263 在途)。S-cfc-263 交下一档承接,未重跑同一批。
+2. **部署在途欠账 pending 110 / confirmed 80**(O-24):收口链待 `--deploy-done` 逐笔确认。
+3. **pending 92 卡**(含 TDD-RED 写契约单测卡):按派发保底逐档承接;真 RED 卡余量由标准轮排查后统一消化。
+4. 工作区未提交修改=他人 WIP 只报不动,禁 `git add -A`;本报告以单文件临时索引提交。
+5. **本轮约 22min 略超 20min 硬顶**(--auto 400s 截断等待 + resume dry-run 预取 80+ 会话末条消息 ~46s,如实记录)。
+
+## 三、下轮建议
+
+1. 标准轮继续排查 `--auto` 截断根因(节点枚举/派发链路耗时),争取 full-run exit 0。
+2. 部署收口:pending 110 → confirmed 80 差口逐笔 `--deploy-done` 消化。
+3. 核验 lan-204 连通性(S-cfc-257 未送达)与 S-cfc-263 在途会话状态(下档 resume dry-run 自然覆盖)。
+4. pending 92 卡按 config#harvest.sc_priority 逐档派发/直派保底。
+
+---
+
+*汇报人:研发负责人(自动化收割 R352 / CF 41 分档)。全程无人值守,未向用户提问。*

+ 117 - 0
docs/tdd/orchestration/report-dev-2026-11-25-1426.md

@@ -0,0 +1,117 @@
+# 研发负责人自动化收割汇报 R353
+
+> 本档=CF 错峰档(11 分档);按 SKILL.md「负责人通用收割骨架」S1-S11 执行,S2 失败补跑由标准轮(01 分档)承担,本档跳过;S3 走精简变体(只 --status --top + --inspect + --resume --dry-run + 近 20 条 git log,跳过 --changes/--clean-check,**间隔档精简盘点,由标准轮承接**)。
+
+## 基本信息
+
+| 项目 | 内容 |
+|------|------|
+| 汇报人 | 研发负责人(自动化收割·本 id 8b8d49bb / 11 分档) |
+| 汇报周期 | 2026-11-25 14:26 ~ 14:51(第 **R353** 轮) |
+| 负责范围 | E:/cfc,git 主线 origin/cfclub |
+
+## 一、执行摘要
+
+| 步骤 | 结果 |
+|------|------|
+| S1 互斥门 | **PASS**(state mtime 83.8min ≥ mutex_minutes=5;worklog.active --auto pid 44780 12:59:18 已死=死记录残留放行;worklog_stale_minutes=0 禁用第二关仅依 state mtime;locks 空;分支 cfclub;轮首一次固化) |
+| S2 失败补跑 | 跳过(错峰档,由 01 分档标准轮承接) |
+| S3 精简盘点 | RED **15** / YELLOW **150** / GREEN 10 / DONE **85**;账本 495:dispatched **3** / done **376** / failed 24 / pending **91** / superseded 1;部署在途 pending **111** / confirmed 80;--inspect(--role 测试):**6 节点全面可达**(lan-189 余4 / lan-204 余10 / local-lan-4090 余6 / mes-local-45278 余6 / prod-etotem 余10 / pub-iwintrue 余5,wb-cloud 401 沿承);resume dry-run 候选 0;**git fetch 成功**,origin tip `f5476033f`(13:36 auto-bump,近 20 条含 R348~R352 五档汇报 + S-cfc-464 加权引擎使绿 `ab1f7595d88d` + testing 部署回执 + S-cfc-255/285/269 RED 契约单测合入) |
+| S4 恢复 | 实际恢复 0(dry-run 候选 0) |
+| S5 心跳 | config heartbeat.enabled=false,跳过并注明 |
+| S6 填充 | config fill_capacity.enabled=false,跳过并注明 |
+| S7a backfill | exit 0(批量版 120s 预算内;账本 done 376→**377** +1、dispatched 3→2,幂等重认 ai.aiyunyi 族 S-cfc-446~475、guheV2/rewardv2/oauth/xiaomi/huawei/family.ownership/auth.guard 系列在册) |
+| S7 --auto | `--auto --role 开发 --limit 2` **380s 纪律线截断**(末尾停 S-cfc-257 lan-204 派发中未送达;**不重跑不补同一批**);**派发保底已兑现**:S-cfc-255 重派 lan-189 **verified=true** ses_dee8dc43fffe,账本 dispatched 回 **3**、mtime **14:43:53** 硬实证;--auto 侧另批量标记 ai.aiyunyi 8 键 + food.rule.weightEngine YELLOW✓ 待部署收口 |
+| S7 派发保底 | --auto 已 verified 派发 S-cfc-255(lan-189)→ 派发保底达成(累计 ~18min 触截断线,未再补直派) |
+| S8 池空续建 | 0 add-task(pending 91 非池空;错峰档跳 --changes,四类溯源无新增实证,不为填配额虚构) |
+| S9 收口 | 单文件临时索引提交 + push(push 前 fetch 防漂移 + 祖先链校验) |
+| S10 汇报 | 本文件 |
+| webhook | **slot=14 整档补发**:索引 `--get --slot=14` exit 2(UNSENT,R349~R352 未到档),slot10 已由 R348 发;本轮执行窗口 14:26~14:51 跨 14:00 整档且未发 → 按整档判定**补发**,POST 结果与 --record 见文末 |
+
+## 1.0 场景覆盖矩阵(硬职责增列)
+
+单一事实源 `docs/tdd/orchestration/DEV_GOAL_user_scenarios.md`。本轮无新增 SC 跑通证据(能力键 DONE ≠ 场景跑通;派发/认领仅作过程证据)。
+
+| 指标 | 值 | 说明 |
+|------|-----|------|
+| 场景总数 | 241 | A25/G12/P96/C26/T32/S11/X22/B10/H7 |
+| 累计已跑通 | 15 | 以 sc-key-map 单一计数源为准(O-3 转正 5 + 游客域 10),沿 R352 口径 |
+| 本轮新增跑通 | 0 | 无满足三判据的新场景 |
+| 失败 | 0 | 本轮无 |
+| 阻塞 | 0 | 本轮无新增 |
+| 未跟踪 | 226 | = 241 − 15 |
+
+> 「跑通」三判据(RED/YELLOW/GREEN 三类流证据 + 实现用例 push origin/cfclub + `--clean-check` 退出码 0);能力键 DONE 不越权代判 SC 跑通。SC 主链路优先级取 config#harvest.sc_priority。
+> 注:R347~R349 报 243/23(逐行计数)与 R350~R352 报 241/15(sc-key-map)存在计数源口径差,建议标准轮统一对齐(本轮沿最新 R352,不改判不臆断)。
+
+## 1.2 任务分发
+
+| 指标 | 数量 |
+|------|------|
+| 分派任务数 | **1**(S-cfc-255,S7 --auto 重派,verified=true) |
+| 恢复智能体会话数 | 0 |
+| 当前在用会话数 | S-cfc-255(lan-189)+ 部署收口链会话(cfc-prod/cfc-test) |
+
+**分派清单**:
+
+| 任务号 | 能力键 | 类型 | 目标实例 | 会话 ID | verified |
+|--------|--------|------|----------|---------|----------|
+| S-cfc-255 | butler.ai.collaborate | TDD-RED 写契约单测 | lan-189 | ses_dee8dc43fffer4Qyj7CnsVCc2S | true |
+
+> YELLOW 部署验证并行标记(--auto 侧,待 `--deploy-done` 收口):food.rule.weightEngine `ab1f7595d88d`、ai.aiyunyi.mapping `d2c97e37ae74` / .sign `11dc41c355b3` / .token `3dfb6db6f685` / .gateway `9f543ccfa7d8` / .detect `410ae449b0f3` / .detectVideo `c07e63b5e98` / .controller `9b69a41f82fa` / .uploadCard `3a521e6ad3dc`。S-cfc-257 lan-204 派发中截断未送达,交下一错峰档承接。
+
+## 1.2b 各会话当前工作状态列表
+
+| 会话标签 | 会话 ID | 当前状态 | 当前任务 | 备注 |
+|----------|---------|----------|----------|------|
+| lan-189 | ses_dee8dc43fffer4Qyj7CnsVCc2S | running | S-cfc-255 butler.ai.collaborate RED 重派 | 本轮 --auto 新派 |
+| lan-204 | — | — | S-cfc-257 派发中截断未送达 | 交下一错峰档核验 |
+| cfc-prod | ses_f719c9326ffeMp0i4xZi6oNFFt | registered | production 部署收口链 | --inspect 在册 |
+| cfc-test | ses_e4804838affeBHv6uKhYS4x7o7 | registered | testing 部署收口链 | --inspect 在册 |
+
+> 节点配额:6 节点在途均低位(busy 0~1),并发槽位充裕;wb-cloud 401 沿承(不影响 6 业务节点派发)。
+
+## 1.3 变更感知
+
+本轮为错峰档,`--changes`/`--clean-check` 由标准轮(01 分档)承接 —— **间隔档精简盘点,由标准轮承接**。新增入池 0(池非空,无需续建)。
+
+## 1.4 本轮 git 证据(真理证据)
+
+| 提交 sha | 关联任务/能力键 | 阶段 | 触及类型 | 目标分支 | 已推送远端 |
+|----------|-----------------|------|----------|----------|------------|
+| `ab1f7595d88d` | S-cfc-464 food.rule.weightEngine | YELLOW | 实现 | origin/cfclub | 是 |
+| `976088c8b` | S-cfc-255 butler.ai.collaborate | RED | 测试 | origin/cfclub | 是 |
+| `965e0977f` | S-cfc-285 auth.profile.edit | RED | 测试 | origin/cfclub | 是 |
+| `462215beb` | S-cfc-269 diet.recommendation.byReport | RED | 测试 | origin/cfclub | 是 |
+| 本报告 commit(见下) | S-cfc-255 重派 + 账本回填 | docs | 文档 | origin/cfclub | 是 |
+
+> 远端 tip = `f5476033f`;近 20 条含 R348~R352 五档汇报 + 部署回执(S-cfc-464 加权引擎 → testing 精确部署成功)+ 多笔 RED/YELLOW 提交。git 远端正常(fetch/push 均成功,R336~R337 系 502 已恢复)。
+
+## 二、阻塞与风险
+
+1. **`--auto` 380s 截断再现(同型第 20+ 次)**——截断点落在 lan-204 连续派发(S-cfc-257 未送达),本档派发保底已由 S-cfc-255 兑现;S-cfc-257 交下一档承接,未重跑同一批。根因排查仍由标准轮承接。
+2. **部署在途欠账 pending 111 / confirmed 80**(O-24):收口链待 `--deploy-done` 逐笔确认。
+3. **pending 91 卡**(含 TDD-RED 写契约单测卡):按派发保底逐档承接;真 RED 卡余量由标准轮排查后统一消化。
+4. 工作区未提交修改=他人 WIP 只报不动,禁 `git add -A`;本报告以单文件临时索引提交。
+5. **本轮约 24min 超 20min 硬顶约 4min**(--auto 380s 截断 + resume dry-run 预取 ~20s + 报告/webhook 收口,如实记录)。
+
+## 三、下轮建议
+
+1. 标准轮继续排查 `--auto` 截断根因(节点枚举/派发链路耗时),争取 full-run exit 0。
+2. 部署收口:pending 111 → confirmed 80 差口逐笔 `--deploy-done` 消化。
+3. 核验 lan-204 连通性(S-cfc-257 未送达)与 S-cfc-255 重派会话产出。
+4. 统一 SC 计数源口径(241/sc-key-map vs 243/逐行),消除轮间波动。
+5. pending 91 卡按 config#harvest.sc_priority 逐档派发/直派保底。
+
+---
+
+## 文末:webhook 整档补发记录
+
+- 档位判定:窗口 14:26~14:51 跨 14:00 整档({6,10,14,18,22}),索引 slot14 UNSENT(exit 2)→ 补发。
+- 发送范围:自上次发送(slot10,R348 @ 10:36:34)至本次之间全部轮次(R349~R353)与全部会话完成的后台任务总结(不含用例编码)。
+- POST 目标:`http://wechat.iwintrue.com/wechat/wechat/wxwaitmsg/update`,header `Authorization: 01HVTE7T3E09AT30635M5F4H1Q`,msgLabel=cftask。
+- 发送结果与 wxWaitMsgId 见本轮自动化 memory 记录(收口时落 `webhook_sent.py --record`)。
+
+---
+
+*汇报人:研发负责人(自动化收割 R353 / CF 11 分档)。全程无人值守,未向用户提问。*

+ 12 - 5
docs/tdd/orchestration/report-test-2026-11-24-R373.md

@@ -119,11 +119,18 @@
 | cfc-frontend Jest | 本机 | 49 | 692 | 676 | **4** | **12** | 1 |
 | cfc-frontend Jest | 本机 | 49 | 692 | 676 | **4** | **12** | 1 |
 | 内网探针(admin/frontend) | 本机 | 2 | 2 | 2(302) | 0 | 0 | **0** |
 | 内网探针(admin/frontend) | 本机 | 2 | 2 | 2(302) | 0 | 0 | **0** |
 | 内网探针(/api/* 后端) | 本机 | 4 | 4 | 0 | **4(502)** | 0 | 1 |
 | 内网探针(/api/* 后端) | 本机 | 4 | 4 | 0 | **4(502)** | 0 | 1 |
-| 189 admin-desktop E2E | 192.168.16.189:4090 | 1 | 5 | — | — | — | **未执行(通道 fetch failed)** |
-| 204 frontend-mobile E2E | 192.168.16.204:4091 | 1 | 6 | — | — | — | **未执行(通道 fetch failed)** |
-| auth-guard / shop-api / health-contract / legal / 越权 ISO | 本机 | 5 spec | 78 | — | — | — | **未实测(生产网关 502)** |
-
-> 说明:本轮浏览器 E2E(189/204)与 API 契约套件(auth-guard/shop/health/legal/越权 ISO)因**环境阻塞**未执行/未实测,见 §6.2/§6.3;不构成「通过」。
+| 后端 surefire 定向 | 本机 | 36 | 332 | **332** | 0 | 0 | **0** |
+| admin-desktop E2E(本机承担·189 失联) | 本机 chromium | 1 | 5 | **3** | **2(502)** | 0 | 1 |
+| frontend-mobile E2E(本机承担·204 失联) | 本机 chromium | 1 | 6 | **6** | 0 | 0 | **0** |
+| auth-guard 匿名守卫 | 本机 | 1 | 12 | 0 | **12(502)** | 0 | 1 |
+| shop-api 排序契约 | 本机 | 1 | 4 | 0 | **4(502)** | 0 | 1 |
+| health-contract | 本机 | 1 | 13 | 0 | **13(502)** | 0 | 1 |
+| legal-pages | 本机 | 1 | 6 | 0 | **6(502)** | 0 | 1 |
+| 越权 ISO(5 spec) | 本机 | 5 | 43 | 0 | **20(502)** | 23 DNR | 1 |
+| 189 admin-desktop(原生节点) | 192.168.16.189:4090 | 1 | 5 | — | — | — | **不可达(000)→ 已由本机承担** |
+| 204 frontend-mobile(原生节点) | 192.168.16.204:4091 | 1 | 6 | — | — | — | **不可达(000)→ 已由本机承担** |
+
+> 说明:① 189/204 两节点 opencode 端口均返回 **000(连接超时/不可达)**,按「浏览器自动化可由 189 或本机承担」的执行纪律,本轮由**本机串行承担**两个 project(每节点仍单任务,无并发)。② 全部 API 契约套件(auth-guard/shop/health/legal/越权 ISO)在本机**已实跑**,但**因生产 `/api/*` 整体 502 全部转环境红**——属「实测·环境阻塞」,不得记为通过、也不得记为产品回归。③ frontend-mobile 6/6 全绿系游客链路(不依赖后端 API),可作为「前端静态渲染面正常」的正向证据。
 
 
 ### 6.2 🔴 生产后端网关 502 中断(本轮头条)
 ### 6.2 🔴 生产后端网关 502 中断(本轮头条)
 
 

+ 120 - 0
docs/tdd/orchestration/report-test-2026-11-26-R374-0030.md

@@ -0,0 +1,120 @@
+# 浠艾福(XAF)测试闭环报告 · R374(错峰档 · 30 分档 · langgraph + 浏览器 E2E 专题)
+
+| 项 | 值 |
+|---|---|
+| 轮次 | **R374**(上一已提交汇报 R373) |
+| 执行时间 | 2026-11-26T00:01~00:16 (GMT+8) |
+| 角色 | 软件测试专家团主理人 · 陆谨(测试负责人) |
+| 档位 | 错峰档(30 分档)· 专题① langgraph 远端 pytest ② 浏览器 E2E |
+| 执行档 | review(内网探针 / 健康检查 / 日志直读;未授权联网压测与公网维度) |
+| 工作分支 | **cfclub**(启动核验 + 收尾复核) |
+| 起始 sha | `b7408b4da` → 同步后 `6766d4934`(S0 后远端 +3 提交,已 `pull --rebase` 归零) |
+| 门禁结论 | ⛔ **不通过(有条件 · 可测性缺口轮)** — 两专题均因**派发凭据缺失**未实测,非代码回归 |
+
+## 0. 结论速览
+| # | 项目 | 结果 |
+|---|---|---|
+| 1 | S0 启动前置检查(60s 硬预算) | ✅ 分支 cfclub / tracked 脏 0 / 差距 0 0(中途远端 +3 已 rebase 归零) |
+| 2 | S1 互斥门 | ✅ PASS(`state.json` 距上次 8487 min,无他轮在产) |
+| 3 | S3 精简盘点 | ✅ `--status` / `--resume --dry-run` / git log;`--changes`、`--clean-check` 由 0 分标准轮承接 |
+| 4 | S3.5 触发式复测门 | ⚠️ `RETEST_REQUIRED`(exit 2)— 6 项 carry、多数 retest 项因通道不可派发降级 |
+| 5 | 专题① langgraph | ⚠️ **服务侧健康 ✅ / pytest 未实测(通道凭据缺失)** |
+| 6 | 专题② 浏览器 E2E | ⚠️ **三节点网络可达(401)/ 派发未实测(凭据缺失)** |
+| 7 | 意外收获 | ✅ **生产网关 502 已自愈**:`/api/system/health`=200、`/admin` `/frontend`=302 |
+
+> 本轮为**错峰档**:S2 失败补跑由 0 分标准轮承担,本档跳过;盘点为精简变体。
+
+## 1. 历史审查记录(记忆召回)
+| 项 | 内容 |
+|---|---|
+| 上次审查 | R373(2026-11-24 09:5x~10:1x,`b7408b4da` 收口)。结论:**不通过·有条件·环境劣化轮** |
+| 遗留缺口(本档相关) | ① 生产网关 502 全链路中断;② lg@251 44/44 全绿→5 红(`test_auto_tag` ×5,根因 `ConnectError` 上游不可达,429=0 排除配额族);③ 189/204 浏览器节点 `fetch failed` 通道不可达 |
+| 本次是否改善 | **生产网关 ✅**(502→200)。**lg@251 ✅**(节点零 4xx/5xx、ConnectError 未复现,但 51 例未实跑不得记为通过)。**浏览器节点 ⚠️**(fetch failed→401 网络恢复,派发仍缺凭据) |
+| 说明 | 本节仅作对照;本轮结论全部重新取证(三节点 API 探活 + lg `/api/v1/logs` 直读 + 生产四路径探针)。 |
+
+## 2. 分支守卫(最高优先级)
+| 检查项 | 结果 |
+|---|---|
+| 启动分支 / tracked 脏 | `cfclub` ✅ / **0**(历史 `.r*` untracked 未触碰、未 add) |
+| 启始差距 | `0 0`;远端 +3 → `0 3` → `git pull origin cfclub --rebase` 成功 → **`0 0`** |
+| 分支纪律 | 全程 cfclub,无 checkout 覆盖、无 stash、无 force-push;他人 WIP 只报不动 |
+| 新增远端提交 | `6766d4934` bump / `a4f86d797` fix(survey) MemberChipPicker 成员键 / `b1db4f9ab` docs 补交方案 |
+
+## 3. 专题① langgraph(部署 192.168.16.251)
+### 3.1 探针结果
+| 探针 | 目标 | 结果 | 判定 |
+|---|---|---|---|
+| 服务健康 | `:9000/health` | **200** `{"status":"ok"}` | ✅ 存活(**恢复信号出现**) |
+| 业务健康 | `:9000/api/v1/health` | **200** | ✅ |
+| OpenAPI | `:9000/openapi.json` | 200(40 paths) | ✅ 路由完整 |
+| opencode 通道 | `opencode.iwintrue.com/api` | **000**(连接失败) | ❌ 不可达 |
+| 机器级配置 | `config/machine.json` | **不存在**(仅 `.example`) | ❌ 无节点凭据 |
+| 凭据环境变量 | `OPENCODE_ADMIN_PASSWORD`/`OPENCODE_PASSWORD`/`CFC_OPENCODE_PASSWORD` | 全 **EMPTY** | ❌ 无注入 |
+| SSH 直连 | `iwt@192.168.16.251` | `Permission denied (publickey,…)` | ❌ 无密钥 |
+
+### 3.2 节点日志直读定性(替代 pytest 计数)
+`GET :9000/api/v1/logs?limit=300` → 窗口 242 条,其中 `/api` 前缀 6 条:业务调用 **3 条全 200**(`/api/v1/health` 5942ms、`/api/v1/logs` ×2);其余 3 条为 `GET /api/.env`、`/api/v1/.env`、`/api/v2/.env` **404 扫描噪声**(外部探针,非业务)。**429 = 0 / 401 = 0 / 5xx = 0 / ConnectError 未见**。
+> R373 的 5 红根因(`ConnectError: All connection attempts failed`,`prompt_service.py:118` / `middleware.py:113`)本窗口**零复现**;`/api/v1/health` 5942ms 属冷启首次调用,仍正常 200 → **该环境故障已自愈**。
+
+### 3.3 51 例 pytest 执行判定
+**未执行**,理由:① 必须在**远端节点**执行(硬约束),本地不跑;② 远端执行需 opencode session,而 opencode 主机 000 + `machine.json` 缺失 + env 凭据空 + SSH 无密钥 → **无任何可用执行通道**。
+**定性**:⚠️ **承袭·未实测(派发通道凭据缺失)**。服务可达≠用例通过,B-325-1(`EXIT=124` 进程驻留)、B-325-2(429 配额族,429=0 已排除)、B-255-1(`ModuleNotFoundError: src.qna`)三项**维持未闭环**。
+
+## 4. 专题② 浏览器 E2E
+| 节点 | 角色约束 | `/api` 探针 | 根路径 | 判定 |
+|---|---|---|---|---|
+| `192.168.16.189:4090` | 仅 admin-desktop | **401**(要求认证) | 200 | ⚠️ 网络可达、无凭据 |
+| `192.168.16.204:4091` | 仅 frontend-mobile | **401** | 200 | ⚠️ 同上 |
+| `127.0.0.1:4091`(本机) | 仅 frontend-mobile | **401** | 200 | ⚠️ 同上 |
+
+- **改善**:R373 记录的 `fetch failed`(连接失败)本轮已消失 → 网络层恢复;`401` 是 opencode 认证门,说明 HTTP 服务在听。
+- **阻塞**:建立 session 需 Basic 凭据,与专题①同源(`machine.json` 缺失、env 全空)。按约束**不重复派发**、不猜测口令,单任务并发未启用。
+- **结论**:⚠️ **承袭·未实测(通道凭据缺失)**。admin-desktop(189)与 frontend-mobile(204/本机)两路径本轮均无执行数据。
+
+## 5. 生产环境探针(对照 R373 的 502)
+| 路径 | 本轮 | R373 | 变化 |
+|---|---|---|---|
+| `/api/system/health` | **200** | 502 | ✅ 恢复 |
+| `/api/shop/sort` | 404 | 502 | ⚠️ 网关恢复,但 404(历史 4/4 绿,需研发确认路由变更) |
+| `/frontend` | 302 | 302 | 持平 |
+| `/admin` | 302 | 302 | 持平 |
+
+> 生产后端已恢复可服务。`/api/shop/sort` 由 502 转 404 属**路由不存在**,与网关无关,纳入下一档 API 契约专题复核。
+
+## 6. 覆盖缺口清单
+| # | 缺口类型 | 现状 | 风险 | 建议测试设计 | 优先级 | 闭环方式 |
+|---|---|---|---|---|---|---|
+| G-374-1 | 环境/凭据 | `machine.json` 不存在,env 凭据全空 | 所有远程派发(lg pytest、E2E、后端 JUnit)永久不可执行 | 负责人补 `config/machine.json`(3 节点 base_url + 凭据) | **P0** | 补齐后 `--inspect` 节点配额非零 → 复跑 51 例 |
+| G-374-2 | 功能/lg | B-325-1 进程驻留 `EXIT=124` 未复测 | 长跑测试无法判定成败 | 远端 `timeout 900 pytest tests -q` 并对 summary 判定 | P1 | 通道恢复后执行 |
+| G-374-3 | 功能/lg | B-255-1 `ModuleNotFoundError: src.qna` 收集期 error | 0 例执行,pytest 假绿风险 | 收集期先跑 `--co` 校验;缺失模块单列阻塞 | P1 | 同上 |
+| G-374-4 | 功能/E2E | admin-desktop / frontend-mobile 双路径未实测 | 小程序 Web 版回归盲区 | 189 单任务 admin 20 例 + 204/本机 frontend 20 例(串行、每节点 1 任务) | P1 | 通道恢复后按节点派发 |
+| G-374-5 | 契约 | `/api/shop/sort` 502→404 | 商城排序接口可能已下线/改路由 | 对照 `API_REFERENCE.md` 校验路径,已废弃按 410 口径登记 | P2 | 下一档 API 契约专题 |
+
+**域结论速览**:单元/组件(苏雅)不在本档;集成/接口(柯砚)本档外(`/api/shop/sort` 404 已登记 G-374-5);系统/验收(白樾)⚠️ 未实测(凭据缺失);测试保障(闻朔)标准轮承接;性能(骆骋)未授权未联网;安全(关屿)仅观测——日志外部 `.env` 扫描 404×99,无敏感暴露;兼容/体验(阮清)未实测(同 E2E 通道);流程/度量/代码(何序)分支纪律 ✅ / 报告可追溯 ✅ / 凭据治理 ❌(G-374-1)。
+
+## 7. 五要素问题清单
+**P-374-1 · 机器级 opencode 配置缺失导致全链不可派发**
+1. **问题描述**:`skills/tdd-orchestrator/config/machine.json` 不存在,`--status` 报 `session_connections=0 / opencode_clients=0` 并降级单机模式;三个已知凭据环境变量均空。
+2. **测试 bug 点**:非用例缺陷,属**测试基础设施缺陷**;体现为三节点 `/api` 全 401 而无法建 session、`--resume` 恢复候选恒 0。
+3. **最优修改方案**:负责人在本机按 `machine.json.example` 落地 `machine.json`,填入 `lan-189`(`http://192.168.16.189:4090/api`,`axon/*`)、`web-4091`(`http://127.0.0.1:4091/api`)、`pub-iwintrue`(`opencode.iwintrue.com/api`,`etotem/deepseek`)三节点连接;凭据只走本地配置/env,不写报告。
+4. **修改目的**:恢复远程派发能力,使 lg pytest 与浏览器 E2E 从「承袭·未实测」转为可执行,消除 P0 可测性缺口。
+5. **闭环方式**:`--inspect` 输出节点会话数/上限/配额非零 → 复跑 51 例 pytest(`timeout` 强杀)+ 189/204 各 20 例 E2E → 有实测数据方可判通过。
+
+**P-374-2 · `/api/shop/sort` 由 502 转 404 未定性**
+1. **问题描述**:生产 `POST /api/shop/sort` 本轮 404(R372 4/4 绿、R373 502)。
+2. **测试 bug 点**:`tests/e2e/api/shop-sort-api.spec.js`(R372 通过集)本轮不可执行,无断言覆盖。
+3. **最优修改方案**:比对路径在 `docs/superpowers/api/API_REFERENCE.md` 与后端 `@PostMapping` 清单的存在性;已废弃登记 410 并同步 spec,未废弃按契约缺口提研发。
+4. **修改目的**:区分「接口下线」与「路由回退」,避免 404 被误读为网关故障延续。
+5. **闭环方式**:下一档 API 契约专题跑该 spec,断言 200 或按既定 410 口径通过。
+
+## 8. 门禁结论
+**⛔ 不通过(有条件 · 可测性缺口轮)**
+- **判定依据**:两专题核心用例(lg 51 例 pytest、admin/frontend E2E 各 20 例)**执行量为 0**,主因 `machine.json` 缺失 + 凭据未注入(P0)。按「未实测不得计入通过」铁律,不可判通过。
+- **非代码回归**:窗口 `src` 无 AI/后端提交(gate `window_src_changed=false`),lg 节点日志 429/401/5xx 全 0,生产健康 200 —— 无证据指向代码劣化。
+- **可放行条件(复评)**:① `machine.json` 落地且 `--inspect` 节点配额非零;② lg 51 例有实测数字(含 B-325-1 强杀后 summary 判定);③ E2E 两节点各出执行量;④ `/api/shop/sort` 定性结论。
+- **本轮零副作用**:未改代码、未改 `state.json`、未 mark-*/deploy-done、未 add `.r*` 产物、未 checkout/stash 他人改动。
+
+## 9. 下一档交接
+- **0 分标准轮**:承接 S2 失败补跑 + 全量盘点(`--changes --days 7`、`--clean-check`)+ 双端 Jest 基线复跑。
+- **API 契约档**:G-374-5 `/api/shop/sort` 定性;生产其余路径契约复核(网关已恢复)。
+- **本档遗留**:G-374-1 为**跨档 P0**,未解除前所有远程派发档均只能产出「承袭·未实测」,建议优先补配置。

+ 123 - 0
docs/tdd/orchestration/report-test-2026-11-26-R375-0024.md

@@ -0,0 +1,123 @@
+# 浠艾福(XAF)测试闭环报告 · R375(标准轮 · 0 分档 · 全量盘点)
+
+| 项 | 值 |
+|---|---|
+| 轮次 | **R375**(上一已提交汇报 R374) |
+| 执行时间 | 2026-11-26T00:24~00:46 (GMT+8) |
+| 角色 | 软件测试专家团主理人 · 陆谨(测试负责人) |
+| 档位 | 标准轮(0 分档)· 承担 S2 失败补跑 + S3 全量盘点(`--changes`/`--clean-check`/场景覆盖) |
+| 执行档 | review(离线编译 + 双端 Jest + 内网探针;未授权公网压测/装依赖) |
+| 工作分支 | **cfclub**(启动核验 + 收尾复核) |
+| 起始 sha | `91b215491`(S0 三查全绿 `0 0`);收尾 sha 见 §8 |
+| 门禁结论 | ⛔ **不通过(有条件 · 稳态承袭 + FE 红集口径扩大)** — 零新增产品运行时回归 |
+
+## 0. 结论速览
+| # | 项目 | 结果 |
+|---|---|---|
+| 1 | S0 启动前置检查(60s 硬预算) | ✅ 分支 `cfclub` / tracked 脏 **0** / 差距 **0 0**(12s 完成) |
+| 2 | S1 互斥门 | ✅ PASS(`state.json` 距上次 8510 min,无他轮在产) |
+| 3 | S2 失败补跑 | ✅ **不触发**:上轮 `report-test` R374 距今 0.1h < `report_stale_hours=2` |
+| 4 | S3 全量盘点 | ✅ `--status` / `--inspect` / `--resume --dry-run` / `--changes` / `--clean-check` / `--sc-evidence` 全跑 |
+| 5 | S3.5 复测门 | ⚠️ `--retest-gate` exit 0(26 carry / 39 retest),但**「窗口零 src」判定与事实不符**(窗口含 2 个 fix + 6 个 feat 提交)→ 三项稳态**主动补证实跑**(见 §3.3) |
+| 6 | 实测面 | 后端 `clean test-compile` ✅ SUCCESS(636 test-classes);web Jest **179=169/10**;fe Jest **787=720/51/16** |
+| 7 | 唯一实质变化 | 🔴 **fe 红集 4 → 51**(+95 例),6 套件全为 **TDD-RED 契约先行**,非运行时回归(§4.2) |
+| 8 | 未实测项 | 浏览器 E2E(三节点不可达)、langgraph pytest(30 分档职责 + 通道不可达)→ 标「承袭·未实测」 |
+
+## 1. 历史审查记录(记忆召回)
+| 项 | 内容 |
+|---|---|
+| 上次标准轮 | R373(2026-11-24 ~11-25,`b7408b4da` 收口):**不通过·有条件·环境劣化轮**(生产网关 502、lg 上游 ConnectError) |
+| 上次错峰档 | R374(本日 00:01~00:16,`6766d4934`):两专题均因**派发凭据缺失**未实测;生产网关 502 **已自愈** |
+| 遗留缺口 | ① G9 web 行覆盖 <20%;② web S1-1 契约 10 红;③ fe R203/RED-A7/AC-R1/R2 共 4 红;④ P0 匿名鉴权(R368 修复保持);⑤ B-325-2/B-365-1 lg 配额族;⑥ B-325-1 lg 进程不退出;⑦ B-260-1 法务页 404;⑧ G-304-1 越权 8 点位;⑨ B-359-1 189 分支漂移;⑩ 后端全量连库未实测 |
+| 本次是否改善 | ① 未变(L11.46% 承袭);② 未变(10 红点位同);③ **劣化**(4→51,属测试资产先行);④ 未变;⑤⑥ 本轮未实测;⑦ 未变;⑧ 未实测;⑨ 未实测;⑩ 未变 |
+| 说明 | 本节只作对照,本轮全部结论重新取证(编译/Jest/探针/盘点命令实跑) |
+
+## 2. 分支守卫
+| 检查项 | 结果 |
+|---|---|
+| 启动 | `cfclub` / tracked 脏 **0** / `HEAD...origin/cfclub` = **0 0** |
+| 窗口新增远端提交 | `9dff61c8e`/`91b215491` R374 汇报、`10d72131e` bump、`a4f86d797` fix(survey) MemberChipPicker、`b1db4f9ab` docs、`6766d4934` bump、`b7408b4da` R373、`0fad1a877` fix(shop) 优惠券、`976088c8b`/`965e0977f`/`462215beb` RED 契约单测、`9f543ccf`/`ab1f7595`/`9b69a41f`/`3dfb6db6`/`d2c97e37`/`410ae449` feat(ai.aiyunyi) |
+| 纪律 | 全程 cfclub;无 checkout 覆盖、无 stash、无 force-push;732 处 untracked(`.r229/`…)**未 add 未触碰** |
+| 侧记 | 首次误用 `--project cfc` 使脚本在 `d:/cfc/cfc/.tdd/` 生成默认配置(1 文件),**已即时删除**,未进索引;改正为 `--project d:/cfc` |
+
+## 3. S3 全量盘点(标准轮口径)
+### 3.1 状态机
+`--status --top 12 --role 测试`:GREEN **5 键**(`admin.auth.login`、`dan.assessment.getActiveMaterial`、`guide.trainingPlan.getPlanDetail`、`health.report.createReport`、`health.report.upload`);部署在途 pending 0 / confirmed 0;运行模式 **MULTI_AGENT**(session_connections=11 / opencode_clients=13)。
+
+### 3.2 变更感知 / 目录校验 / 场景证据
+| 命令 | 结果 |
+|---|---|
+| `--changes --days 7` | 变更集中在 `[其他]` 84 个 + docs 若干;**新增能力键 0(需求侧 0→0、契约侧 0→0)** → 无新建任务溯源,S8 收敛为 0 |
+| `--clean-check` | ⚠️ 732 处**未追踪**产物(`.r229/`…),**tracked 区 0 脏** → 合规(产物永不 add) |
+| `--sc-evidence` | 243 SC / **strict_pass 23** / `worktree_clean=true` / anomalies **0**(口径核对,不重跑测试) |
+| `--resume --dry-run` | 恢复候选 **0**;三会话 `web-4091`/`web-189-4090`/`opencode-iwintrue` 全 **不可达/未启用** |
+| `--blockers --due --role 测试` | 「当前无已登记阻塞」(state 侧无 blocker 记录,实际缺陷以报告/blockers.md 承袭) |
+
+### 3.3 S3.5 复测门(含一次口径纠偏)
+- `--retest-gate`:total 65 = **carry 26 / retest 39**,exit 0;5 项稳态(clean test-compile / 双端 Jest / 静态页探活 / SRS 闸门 / 覆盖率分子分母)判 `carry`,理由均为「窗口零 src 提交且上次汇报 0.1h < 6h」。
+- **纠偏**:窗口实际含 `0fad1a877 fix(shop)`、`a4f86d797 fix(survey)`、6×`feat(ai.aiyunyi)`,即 **src 有变动**;carry 的前半句条件不成立。故对 3 项可离线实测的稳态(编译、双端 Jest、静态页探活)**主动补跑取证**,覆盖率随 web Jest 一并产出。此项差异记入 §8 待核实。
+
+## 4. 实测面(review 档,全部离线)
+### 4.1 稳态项(本轮实跑)
+| 项 | 结果 | 对比上轮 |
+|---|---|---|
+| 后端 `mvn -o clean test-compile` | ✅ **SUCCESS**:`-q` 日志 0 字节(无 ERROR)、`target/classes` 00:26 更新、`target/test-classes` **636 个 .class**(00:32 完成) | 承袭 EXIT0 第 42 轮 |
+| web Jest(cfc-web) | **179 = 169 过 / 10 红 / 0 跳**(25 套件 3 红,315.7s) | 179=169/10 **逐位一致** |
+| web 覆盖率 | **S 11.47% / B 8.56% / F 8.63% / L 11.46%** | 与 R373 逐位同(**G9 承袭第 79 轮**) |
+| fe Jest(cfc-frontend) | **787 = 720 过 / 51 红 / 16 跳**(55 套件 6 红,173.5s) | **基线 692=676/4/12 → +95 例 / +47 红** |
+| 静态页探活 | `/api/system/health` 200(0.44s,二次 200/0.55s)、`/admin` 200、`/frontend` 200(`-L` 跟随) | 502 未复现 |
+| SRS 闸门 | CLOSED(窗口无 SRS 需求区段变更) | 一致 |
+
+### 4.2 fe 红集扩大定性(本轮核心结论)
+6 个失败套件与归因(逐条取失败断言原文):
+
+| 套件 | 红 | 失败形态 | 定性 |
+|---|---|---|---|
+| `aiyunyi/aiyunyi.videoPage.contract.test.js` | — | `pages/health/ai-video-detect.vue` **必须存在 → false**;模板必须含 `<web-view :src>`;`utils/api.js` 必须导出 `getPath` | **契约先行**(提交 `659cdfab7` 明写「实现未落地,预期 14 红」) |
+| `pages/health/aiyunyi.detectPage.contract.test.js` | — | 同上族(页面/模板/方法须存在) | 契约先行 |
+| `pages/health/aiyunyi.reportDetail.contract.test.js` | — | 同上族 | 契约先行 |
+| `pages/signature/signature.consignee.test.js` | — | `methods.onConfirm` 须为 function、模板须含 `<hand-signature` | 契约先行(`584e0a0b2` 起的既有红) |
+| `pages/growth-main/growthHistory.dayGroupView.test.js` | — | `flat.length` 期望 6 实得 7(`RED-A7` 无有效业务日跳过) | 契约先行(行为级 RED) |
+| `pages/diet/recommendation.viewKeyAndDelete.test.js` | — | `vm.recommendation.id` 期望 11 实得 undefined | 行为级,**需核实**是否真回归 |
+
+**判定**:51 红中 ≥47 为「断言『某文件/模板/方法应当存在或应当删除』」→ 属 TDD-RED 契约待实现,**不是运行时回归**;口径扩大直接由窗口新增 RED 契约资产(`659cdfab7`,11-25 05:27,晚于 R373 实跑时点)解释。**红线遵守:不把「红数上升」写成「质量劣化」**,同时**不把「契约先行」当成「可以不算红」**。
+
+### 4.3 未实测项(如实标注)
+| 项 | 原因 | 标注 |
+|---|---|---|
+| 浏览器 E2E(189 admin / 204 或本机 frontend) | `--resume --dry-run` 三会话全 `不可达/未启用`;远端派发无凭据 | **承袭·未实测**(R374 同因) |
+| langgraph pytest@251 | 属 30 分档专题;且远端通道不可达 | **承袭·未实测** |
+| 后端全量 `mvn test` + JaCoCo | 未起 9082,无 DB | **承袭·未实测** |
+| 性能/压测、依赖漏洞扫描 | execute 档,未授权联网 | **未授权未执行** |
+
+## 5. 覆盖矩阵(20 类,三态)
+| 类 | 态 | 证据 |
+|---|---|---|
+| 单元 / 覆盖率 / 变异 | 已发现 | 后端 test-compile 636 类;web 179 例 L11.46%;fe 787 例;**变异测试未发现** |
+| 集成 / 接口 / 契约 | 已发现 | 后端 `*ContractTest` 224 类;本轮 fe/ web 契约套件红集即契约层证据;API 全量属 API 契约档 |
+| 系统 E2E / UAT / BDD | 待核实 | 资产 601 例在库,**本轮未执行**(通道不可达) |
+| 冒烟 / 回归 / 探索性 | 已发现 | 冒烟=探针 200×4;回归=双端 Jest + 编译;探索性未发现 |
+| 性能 / 可靠性 / 兼容 / 可用性 / 无障碍 | 待核实 | `nonfunc-perf-compat.spec.js` 在库(R371 实测过),本轮未执行 |
+| 安全(SAST/DAST/依赖) | 待核实 | 越权 G-304-1 承袭,依赖扫描未授权 |
+| 流程 / 度量 / 代码审查 | 已发现 | 本轮 S0–S11 全跑 + 四项指标(编译/双端/覆盖率/探针) |
+
+## 6. 五要素问题清单
+| # | ① 问题 | ② 测试 bug 点 | ③ 最优修改方案 | ④ 目的 | ⑤ 闭环 |
+|---|---|---|---|---|---|
+| 1 | fe Jest 红集 4→51,6 套件红 | `aiyunyi.videoPage.contract.test.js`、`detectPage`/`reportDetail`、`signature.consignee`、`growthHistory.dayGroupView:287`、`diet.recommendation:221` | 按 `659cdfab7` 契约补实现:`pages/health/ai-video-detect.vue`、`utils/api.js#getPath`、`HandSignature#onConfirm`;`groupByDate` 过滤无效业务日 | 让 95 例新增契约可绿,恢复「红=缺陷」信号 | 复跑 `npx jest`,6 套件转绿且总数仍 787 |
+| 2 | web S1-1 契约 10 红(Families 三视图) | `views/FamiliesPlanEntry.spec.js:59`(`代生成方案` 应删除)、`FamiliesReportEntry`、`Families.actionMenu` | 删残留文案/入口,或按契约迁移到 FamilyWorkbench | 消除长期 10 红噪声 | 复跑 web Jest,仅覆盖缺口红 |
+| 3 | G9 web 行覆盖 11.46% < 20% | `cfc-web/src`(244/2128 行) | Families/FamilyWorkbench 高频路径补组件交互与边界断言 | 提升缺陷逃逸拦截率 | `L≥20%` 且不低于 244/2128 |
+| 4 | `--retest-gate` 稳态 carry 依据「窗口零 src」与实际不符 | `tdd_orchestrate.py` retest-gate 窗口计算 | 窗口起点改用「上次**同档**实跑报告」时间,或输出窗口提交清单供核对 | 避免稳态项被错误承袭 | 改造后同窗口输出应判 3 项 `retest` |
+| 5 | `--inspect`/`--blockers` 未带 `--role` 时直接报错退出 | `tdd_orchestrate.py` 参数校验 | 缺省 role 时回退 config 的 `project_roles.test_lead`,或提示补参而非报错 | 降低无人值守试错成本 | 无 `--role` 调用返回有效输出 |
+| 6 | clean-check 报 732 处「不干净」但全为 untracked 产物 | `.r229/`…`.r*` | 校验口径区分 tracked/untracked,或加 `--ignore-untracked` | 「不干净=未完成」判据不被噪声淹没 | 输出 `tracked_clean=true` 单行结论 |
+
+## 7. 门禁结论
+⛔ **不通过(有条件通过方向)**
+- ✅ 分支纪律(0 0、tracked 零脏、732 untracked 未触碰)|后端 clean test-compile SUCCESS|web Jest + 覆盖率逐位零漂移|静态页 4 探全 200(502 未复现)|SRS CLOSED|SC 口径 243/23 无异常|**零新增产品运行时缺陷**
+- ❌ G2(fe 51 红 + web 10 红)|G8(越权 G-304-1 承袭)|G9(L11.46% 第 79 轮)|G11(E2E/lg/全量连库未实测)
+- ⚠️ B-325-1/B-325-2/B-365-1/B-260-1/B-359-1 均**本轮未实测**,按「承袭·未实测」入账,**不得记为已通过**
+
+## 8. 收尾
+- 报告:`docs/tdd/orchestration/report-test-2026-11-26-R375-0024.md`(单文件 `git add`,commit+push,收尾 `--clean-check`)
+- **待核实**:① `--retest-gate` 窗口判定逻辑(问题 4);② `diet.recommendation:221` 是否真回归;③ fe 覆盖率为本轮未采集(fe Jest 未带 `--coverage`)
+- 未授权/未实测项已逐条标注;无人值守全程静默无提问。

+ 2787 - 0
docs/爱云医接入/爱云医接口契约-完整版.md

@@ -0,0 +1,2787 @@
+
+================================================================================================
+### POST /member/user/identify
+**接口名**:获取token | 节点ID:390823191 | 状态:released
+
+**描述**:
+终端用户登录:用手机号换取平台访问令牌。会员不存在时平台会自动建档,不报错。
+
+返回的 accessToken 有效期 30 分钟,refreshToken 30 天;userId 用于生成后续请求的 X-User-Id-Encrypt。
+
+调用约定:所有请求必须带 X-App-Key、X-Timestamp(毫秒,与服务器时差 5 分钟内)、X-Api-Sign 三个头;签名串固定为 appKey={AppKey}&timestamp={毫秒},用租户 RSA 私钥做 SHA256withRSA 签名后 Base64 编码。登录后调业务接口再加两个头:Authorization: Bearer {accessToken}、X-User-Id-Encrypt(用租户 RSA 公钥加密 userId,PKCS#1 填充)。
+
+**请求参数**
+  【header】
+    X-App-Key : string ="app-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (默认:app-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
+    X-Timestamp : string ="1761735120036" (默认:1761735120036)
+    X-Api-Sign : string ="Base64(SHA256withRSA(签名串)),示例已省略" (默认:Base64(SHA256withRSA(签名串)),示例已省略)
+
+**请求体**
+  Content-Type: application/json
+    mobile: string **必填** — 手机号
+  示例:
+    {
+    "mobile": "15601691300"
+  }
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      accessToken: string **必填** — token
+      refreshToken: string **必填** — 刷新token
+      userId: integer **必填** — 用户 ID
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "accessToken": "string",
+          "refreshToken": "string",
+          "userId": 0
+      },
+      "msg": "string"
+  }
+
+================================================================================================
+### POST /member/user/refresh
+**接口名**:刷新 token | 节点ID:406348767 | 状态:released
+
+**描述**:
+刷新访问令牌。
+
+正确用法(实测确认):Authorization 必须携带**仍然有效的 accessToken**,请求体传 refreshToken,成功返回新的令牌对。若把 refreshToken 放到 Authorization,会返回 {"code":401,"msg":"RefreshToken 不能用于业务访问"}。
+
+⚠️ 由此带来的限制:accessToken 一旦过期就无法再调用本接口刷新,只能重新走登录接口换取。对接方建议实现为"令牌临期主动刷新、过期则回落到重新登录"。
+
+根因说明:安全链的免登录白名单登记的是 /open-api/auth/refresh,而本接口实际路径是 /open-api/member/user/refresh,两者不一致,导致刷新请求落到了需要 Token 的业务链上。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      accessToken: string **必填**
+      refreshToken: string **必填**
+      userId: integer **必填**
+    msg: string **必填**
+  示例:
+    {
+      "type": "object",
+      "properties": {
+          "code": {
+              "type": "integer"
+          },
+          "data": {
+              "type": "object",
+              "properties": {
+                  "accessToken": {
+                      "type": "string",
+                      "title": "token"
+                  },
+                  "refreshToken": {
+                      "type": "string",
+                      "title": "刷新token"
+                  },
+                  "userId": {
+                      "type": "integer",
+                      "title": "用户 ID"
+                  }
+              },
+              "required": [
+                  "accessToken",
+                  "refreshToken",
+                  "userId"
+              ],
+              "x-apifox-orders": [
+                  "accessToken",
+                  "refreshToken",
+                  "userId"
+              ]
+          },
+          "msg": {
+              "type": "string"
+          }
+      },
+      "required": [
+          "code",
+          "data",
+          "msg"
+      ],
+      "x-apifox-orders": [
+          "code",
+          "data",
+          "msg"
+      ]
+  }
+
+================================================================================================
+### GET /product/spu/page
+**接口名**:查询商品列表(分页) | 节点ID:390823192 | 状态:released
+
+**描述**:
+查询当前租户已上架的服务商品(分页)。返回 spuId、商品名称、价格、销量等。
+
+注意:商品需平台按租户配置后才会出现在结果里,未配置时返回空列表属正常现象。下单需要的是 SKU id,不是 spuId,请用商品详情接口取 skuId。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    pageNo (必填) : integer
+    pageSize (必填) : integer — 最大值 100
+    ids : array<string> — 商品 SPU 编号数组
+    categoryId : integer — 分类编号
+    categoryIds : array<string> — 分类编号数组
+    keyword : any — 关键字
+    sortField : any — 排序字段
+    sortAsc : boolean — 排序方式
+
+**请求体**
+  Content-Type: application/json
+    pageNo: integer **必填**
+    pageSize: integer **必填** — 最大值 100
+    ids: array<integer> — 商品 SPU 编号数组
+    categoryId: integer — 分类编号
+    categoryIds: array<integer> — 分类编号数组
+    keyword: string — 关键字
+    sortField: string — 排序字段
+    sortAsc: boolean — 排序方式
+
+**响应**
+  200 成功: 成功
+    code: integer<int64> — 业务状态码,0 表示成功
+    data: object
+      list: array<object> — 商品列表
+          id: integer<int64> — 商品 SPU 编号
+          name: string — 商品名称
+          introduction: string — 商品简介
+          categoryId: integer<int64> — 分类编号
+          picUrl: string — 主图 URL
+          sliderPicUrls: array<string> — 轮播图
+          variety: integer<int64> — 商品种类
+          specType: boolean — 是否多规格
+          price: number — 价格,单位分
+          marketPrice: number — 市场价,单位分
+          stock: integer<int64> — 库存
+          barCode: string — 条形码
+          salesCount: integer<int64> — 销量
+          deliveryTypes: array<integer> — 配送方式
+      total: integer<int64> — 总条数
+    msg: string — 提示信息,成功时为空
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "list": [
+              {
+                  "id": 733,
+                  "name": "API测试商品1",
+                  "introduction": "API测试商品1,普通用户请勿购买使用,只针对合作伙伴接口测试调试使用",
+                  "categoryId": 86,
+                  "picUrl": "https://minioapi.aicds.com.cn/mall-microapp/3f0bebc37695afaf4761389c66b3eaf36f6c454634fd1afe0ada12d4461831b3.jpg",
+                  "sliderPicUrls": [
+                      "https://minioapi.aicds.com.cn/mall-microapp/3f0bebc37695afaf4761389c66b3eaf36f6c454634fd1afe0ada12d4461831b3.jpg"
+                  ],
+                  "variety": 0,
+                  "specType": true,
+                  "price": 100,
+                  "marketPrice": 100,
+                  "stock": 99997,
+                  "barCode": null,
+                  "salesCount": 801,
+                  "deliveryTypes": [
+                      1
+                  ]
+              }
+          ],
+          "total": 1
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### GET /product/spu/get-detail
+**接口名**:获得商品 SPU 明细 | 节点ID:390823193 | 状态:released
+
+**描述**:
+按 spuId 获取服务商品明细,包含该商品下的 SKU 列表。创建检测服务包时传的 skuId 来自这里。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    id : any
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer<int64> — 业务状态码,0 表示成功
+    data: any
+    msg: string — 提示信息,成功时为空
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "id": 733,
+          "name": "API测试商品1",
+          "introduction": "API测试商品1,普通用户请勿购买使用,只针对合作伙伴接口测试调试使用",
+          "description": "<p>API测试商品1</p>",
+          "categoryId": 86,
+          "variety": 0,
+          "picUrl": "https://minioapi.aicds.com.cn/mall-microapp/3f0bebc37695afaf4761389c66b3eaf36f6c454634fd1afe0ada12d4461831b3.jpg",
+          "sliderPicUrls": [
+              "https://minioapi.aicds.com.cn/mall-microapp/3f0bebc37695afaf4761389c66b3eaf36f6c454634fd1afe0ada12d4461831b3.jpg"
+          ],
+          "specType": true,
+          "price": 100,
+          "marketPrice": 100,
+          "stock": 99997,
+          "barCode": null,
+          "skus": [
+              {
+                  "id": 136,
+                  "properties": [
+                      {
+                          "propertyId": 1,
+                          "propertyName": "默认",
+                          "valueId": 1,
+                          "valueName": "默认"
+                      }
+                  ],
+                  "price": 100,
+                  "marketPrice": 100,
+                  "vipPrice": null,
+                  "picUrl": "",
+                  "stock": 100001,
+                  "weight": 0.0,
+                  "volume": 0.0,
+                  "barCode": ""
+              }
+          ],
+          "salesCount": 801
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### POST /trade/order/create
+**接口名**:创建检测服务包 | 节点ID:390823205 | 状态:released
+
+**描述**:
+创建检测服务包(权益发放型下单)。入参为 items[{skuId, count}],服务端自行按 skuId 解析所属商品并生成套餐实例,返回 successList[].packageIds。
+
+重要:packageIds 是「套餐实例 id」,后续查询子项、发起检测都用它,不要传商品 spuId。套餐数据分四层:商品(SPU) → 套餐模板 → 套餐实例 → 套餐子项。
+
+本接口不走支付,调用成功即产出套餐,是否对某租户开放由平台配置。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    items: array<object> **必填**
+        skuId: integer **必填** — 商品 SKUID
+        count: integer **必填** — 购买数量
+  示例:
+    {
+    "items": [
+      {
+        "skuId": 0,
+        "count": 0
+      }
+    ]
+  }
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      totalCount: integer **必填**
+      successCount: integer **必填**
+      errorCount: integer **必填**
+      successList: array<object> **必填**
+          skuId: integer
+          packageIds: array<integer>
+      errorList: array<string> **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "totalCount": 1,
+          "successCount": 1,
+          "errorCount": 0,
+          "successList": [
+              {
+                  "skuId": 136,
+                  "packageIds": [
+                      888
+                  ]
+              }
+          ],
+          "errorList": []
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### POST /trade/order/detection-package-refund
+**接口名**:退款 | 节点ID:390823206 | 状态:developing
+
+**描述**:
+检测套餐退款。
+
+⚠️ 实测发现健壮性问题:请求体传空对象 {} 时接口返回 {"code":0},但经数据库复核**未产生任何数据变更**。说明该接口对入参缺少必要校验,会给出"成功"的假象。对接方在平台补齐校验与契约文档之前,不要把本接口纳入正式流程;调用后必须以查询套餐状态的结果为准,不能以本接口的 code 判断是否退款成功。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    packageIds: array<integer> **必填** — 检测包id集合
+    refundReason: string **必填** — 退款原因
+    refundSource: integer **必填** — 用户主动退款, 1:管理员退款, 2:系统自动退款, 3:接口调用退款
+    batchNo: string **必填** — 批次号
+  示例:
+    {
+    "packageIds": [
+      0, 
+      10,
+      20
+    ],
+    "refundReason": "refundReason_264e46eec489",
+    "refundSource": 0,
+    "batchNo": "batchNo_ac9b97855443"
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### POST /product/detection-user/create
+**接口名**:创建检测用户 | 节点ID:390823194 | 状态:released
+
+**描述**:
+创建检测人(本人或家庭成员)。检测人是实际接受检测的对象,报告按检测人归档。
+
+⚠️ 响应结构待平台补充确认。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    userId: integer **必填** — 用户id
+    relation: integer **必填** — 0: "自己", 1: "父亲", 2: "母亲", 3: "配偶", 4: "儿子" ,  5: "女儿",  6: "朋友",
+    realName: string **必填** — 真实名称
+    userPhone: string **必填** — 用户手机号
+    userAge: integer **必填** — 用户年龄
+    userSex: integer **必填** —  0:未知 1:男 2:女
+    userHeight: integer **必填** — 用户身高
+    userWeight: integer **必填** — 用户体重
+    userBlood: string **必填** — aborh
+    userBirthday: string **必填** — 用户出生日
+    isPlasticSurgery: integer **必填** — 0:否1是
+    remark: string **必填** — 备注
+    url: string **必填** — url
+    smoker: integer **必填** —  0-否 1-是
+    medication: integer **必填** — 0-否 1-是
+    diabetic: integer **必填** — 0-否 1- 一型糖尿病 2- 二型糖尿病
+  示例:
+    {
+    "userId": 0,
+    "relation": 0,
+    "realName": "realName_f262524d7d4e",
+    "userPhone": "userPhone_8b6d1076ccfb",
+    "userAge": 0,
+    "userSex": 0,
+    "userHeight": 0,
+    "userWeight": 0,
+    "userBlood": "userBlood_247b275d2b53",
+    "userBirthday": "2025-10-30",
+    "isPlasticSurgery": 0,
+    "remark": "remark_56f4df0882d2",
+    "url": "url_ac1f5c12d6c5",
+    "smoker": 0,
+    "medication": 0,
+    "diabetic": 0
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### PUT /product/detection-user/update
+**接口名**:更新检测用户 | 节点ID:390823195 | 状态:released
+
+**描述**:
+更新检测人信息(姓名、性别、出生日期等)。
+
+⚠️ 响应结构待平台补充确认。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+  示例:
+    {
+    "id": 0,
+    "userId": 0,
+    "tenantName": "tenantName_a7eb84d6b085",
+    "relation": 0,
+    "realName": "realName_e90c7dd1fb2c",
+    "userPhone": "userPhone_efe44a9d2adc",
+    "userAge": 0,
+    "userSex": 0,
+    "userHeight": 0,
+    "userWeight": 0,
+    "userBlood": "userBlood_1229f4cdd11d",
+    "userBirthday": "2025-10-30",
+    "isPlasticSurgery": 0,
+    "remark": "remark_8e688d20c159",
+    "url": "url_a68508480c4c",
+    "smoker": 0,
+    "medication": 0,
+    "diabetic": 0
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### DELETE /product/detection-user/delete
+**接口名**:删除检测用户 | 节点ID:390823196 | 状态:released
+
+**描述**:
+删除检测人。
+
+⚠️ 响应结构待平台补充确认;删除为逻辑删除,已产生的报告记录保留。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    id : any — id
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### GET /product/detection-user/get
+**接口名**:获得检测用户 | 节点ID:390823197 | 状态:released
+
+**描述**:
+按 id 获取单个检测人信息。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    id : any
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: null **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": null,
+      "msg": "string"
+  }
+
+================================================================================================
+### GET /product/detection-user/page
+**接口名**:获得检测用户分页 | 节点ID:390823198 | 状态:released
+
+**描述**:
+分页获取当前用户名下的检测人列表。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    userId: integer **必填** — 用户id
+    realName: string **必填** — 真实姓名
+    userPhone: string **必填** — 用户手机号
+    pageNo: integer **必填** — 页码
+    pageSize: integer **必填**
+  示例:
+    {
+    "userId": 0,
+    "realName": "realName_943b5a76136a",
+    "userPhone": "userPhone_738bce8b2ecf",
+    "pageNo": 0,
+    "pageSize": 0
+  }
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: null **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": null,
+      "msg": "string"
+  }
+
+================================================================================================
+### GET /detection/package/get-items
+**接口名**:查询检测明细 | 节点ID:404226314 | 状态:released
+
+**描述**:
+查询检测套餐的子项列表。入参 packageId 传套餐实例 id(来自创建套餐返回的 packageIds,或套餐分页接口的 id),不是商品 spuId。
+
+返回字段:id(子项 id,发起检测时用它定位具体子项)、packageId、inspectionType(0 普通 / 1 AI 视频检测 / 2 AI 视频检测高精度 / 3 癌症)、detectionTime(未检为 null)、skuGeneticPanelId、skuGeneticPanelName、sort(展示顺序)、status(0 待使用 / 1 检测中 / 2 已完成 / 3 已过期)。
+
+推荐对接方式:每次用户要检测时先取子项列表,挑一个 status=0 的可用子项,用它的 id 走检测流程(inspectionType 0/3 走录入检测数据,1/2 先获取 AI 实时检测路径再检测),平台完成后自动置为已完成;无可用子项即表示套餐已用完或已过期。单次套餐同样适用,只是返回一条子项。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    packageId (必填) : integer — 检测套餐 id,来自检测套餐分页查询的 packageId
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: array<object> **必填**
+        id: integer **必填** — packageItemId
+        packageId: integer **必填** — packageId
+        inspectionType: integer **必填** — 检测类型,0普通,3 癌症;1 AIBMP,2AIBMPPRO,1 和 2 获取检测路径检测;0,3 录入检测数据
+        detectionTime: null **必填**
+        skuGeneticPanelId: integer **必填**
+        skuGeneticPanelName: string **必填**
+        sort: integer **必填**
+        status: integer **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": [
+          {
+              "id": 852,
+              "packageId": 859,
+              "inspectionType": 0,
+              "detectionTime": null,
+              "skuGeneticPanelId": 88,
+              "skuGeneticPanelName": "API测试商品1",
+              "sort": 0,
+              "status": 0
+          },
+          {
+              "id": 853,
+              "packageId": 859,
+              "inspectionType": 2,
+              "detectionTime": null,
+              "skuGeneticPanelId": 88,
+              "skuGeneticPanelName": "API测试商品1",
+              "sort": 0,
+              "status": 0
+          }
+      ],
+      "msg": ""
+  }
+
+================================================================================================
+### GET /detection/package/getPath
+**接口名**:获取AI 实时检测路径 | 节点ID:406351229 | 状态:released
+
+**描述**:
+获取 AI 实时检测路径,用于 AI 视频类检测的前置步骤。
+
+实测必填两个入参:detectionPackageItemId(套餐子项 id)与 detectionReportUserId(检测报告关联用户 id)。缺 detectionPackageItemId 时返回 {"code":400,"msg":"请求参数缺失:detectionPackageItemId"}。
+
+接口已实现并可用(经无损探测确认请求可进到业务层)。
+
+命名说明:本接口路径用驼峰 getPath,与其余 kebab-case 风格不一致,属历史遗留。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    detectionPackageItemId (必填) : any — 检测套餐子项 id
+    detectionReportUserId (必填) : any — 检测报告关联用户 id
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      path: string **必填** — 检测页面URL
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "path": "string"
+      },
+      "msg": "string"
+  }
+
+================================================================================================
+### GET /detection/package/page
+**接口名**:查询检测套餐分页 | 节点ID:390823199 | 状态:released
+
+**描述**:
+分页查询当前用户购买的检测套餐实例。返回的 id 即套餐实例 id,可作为查询子项接口的 packageId 入参。
+
+套餐实例状态 status:-1 已取消 / 0 未支付 / 1 待激活 / 2 待使用 / 3 检测中 / 4 已完成 / 5 已过期。type:-1 多项检测套餐 / 0 单项普通检测套餐。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    name : any — 套餐名称,可不传
+    pageNo (必填) : integer
+    pageSize (必填) : integer
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      list: array<object> **必填**
+          id: integer
+          name: string
+          price: integer
+          spuId: integer
+          skuId: integer
+          description: string
+          picUrl: string
+          status: integer — 状态:-1 已取消 0 未支付 1 待激活 2 待使用 3 检测中 4 已完成 5 已过期
+          detectionCount: integer
+          type: integer — 套餐类型:-1多项检测套餐 0 普通检测套餐 1 AIHRM 2AIHRM-PRO
+          deadline: integer
+          createTime: integer
+          detectionUserId: integer
+          detectionReportUserId: integer
+          orderId: integer
+          userId: string
+      total: integer **必填**
+    msg: string **必填**
+  示例:
+    {
+  	"code": 0,
+  	"data": {
+  		"list": [{
+  			"id": 860,
+  			"name": "API测试商品1",
+  			"price": 1.00,
+  			"spuId": 733,
+  			"skuId": 135,
+  			"description": "<p>API测试商品1</p>",
+  			"picUrl": "https://minioapi.aicds.com.cn/mall-microapp/3f0bebc37695afaf4761389c66b3eaf36f6c454634fd1afe0ada12d4461831b3.jpg",
+  			"status": 2,
+  			"detectionCount": 1,
+  			"type": -1,
+  			"deadline": 1799807374000,
+  			"createTime": 1768271374000,
+  			"detectionUserId": 4372,
+  			"detectionReportUserId": 2316,
+  			"orderId": 1768271374285,
+  			"userId": "2007745651864969217"
+  		}],
+  		"total": 1
+  	},
+  	"msg": ""
+  }
+
+================================================================================================
+### GET /detection/package/get-user-info
+**接口名**:查询检测用户信息 | 节点ID:390823200 | 状态:released
+
+**描述**:
+查询检测用户信息(含其套餐概况)。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    packageId (必填) : any — 检测包id
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      id: integer **必填** — /detection/package/getPath的输入参数
+      detectionUserId: integer **必填**
+      userId: string **必填**
+      tenantName: null **必填**
+      relation: integer **必填**
+      area: null **必填**
+      realName: string **必填**
+      userPhone: string **必填**
+      userAge: integer **必填**
+      userSex: integer **必填**
+      userHeight: integer **必填**
+      userWeight: integer **必填**
+      userBlood: string **必填**
+      userBirthday: array<integer> **必填**
+      isPlasticSurgery: integer **必填**
+      remark: string **必填**
+      createTime: integer **必填**
+      url: string **必填**
+      smoker: integer **必填**
+      medication: integer **必填**
+      diabetic: integer **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "id": 2382,
+          "detectionUserId": 4386,
+          "userId": "2014560441291714561",
+          "tenantName": null,
+          "relation": 0,
+          "area": null,
+          "realName": "测试",
+          "userPhone": "13800138000",
+          "userAge": 42,
+          "userSex": 1,
+          "userHeight": 170,
+          "userWeight": 70,
+          "userBlood": "B",
+          "userBirthday": [
+              1983,
+              10,
+              30
+          ],
+          "isPlasticSurgery": 0,
+          "remark": "remark_56f4df0882d2",
+          "createTime": 1770137240000,
+          "url": "url_ac1f5c12d6c5",
+          "smoker": 0,
+          "medication": 0,
+          "diabetic": 0
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### GET /detection/package/get-item-page
+**接口名**:查询检测明细分页 | 节点ID:390823201 | 状态:obsolete
+
+**描述**:
+⚠️ 已废弃,请勿调用。本接口(分页版子项查询)已由 /detection/package/get-items 取代——后者不分页、直接返回子项数组,且单次套餐与多次套餐用同一套逻辑通吃。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    packageId (必填) : integer
+    pageNo (必填) : integer
+    pageSize (必填) : integer
+
+**请求体**
+  Content-Type: application/json
+    packageId: integer **必填** — 检测包id
+    pageNo: integer **必填** — 页码
+    pageSize: integer **必填** — 页数
+  示例:
+    {
+    "packageId": 10,
+    "pageNo": 0,
+    "pageSize": 5
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### PUT /detection/package/enter/detection_user
+**接口名**:激活/录入 检测用户 | 节点ID:390823202 | 状态:released
+
+**描述**:
+激活或录入检测用户信息。
+
+⚠️ 响应结构待平台补充确认。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    id: integer **必填** — 激活的 packageId
+    detectionUserId: integer **必填**
+  示例:
+    {
+    "id": 0,
+    "detectionUserId": 0
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### PUT /detection/package/enter/detection_data
+**接口名**:录入检测数据 | 节点ID:390823203 | 状态:released
+
+**描述**:
+录入检测数据(照片与语音)。
+
+命名说明:open-api 侧统一为 enter/detection_data;小程序与硬件用的 app-api 侧是 enter/detection_data-s 与 enter/detection_data/public,两者路径不同但业务一致。
+
+⚠️ 响应结构待平台补充确认。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+
+**请求体**
+  Content-Type: application/json
+    detectionUserId: integer **必填** — 检测用户id
+    detectionReportUserId: integer **必填** — 查询检测用户信息返回的 id
+    realName: string,null — 用户真实姓名
+    detectionPackageId: integer **必填** — 检测套餐id
+    detectionPackageItemId: integer **必填** — 检测套餐明细id
+    basicUrlList: array<object> **必填** — 基本图片(12张)
+        id: integer **必填** — index
+        url: string **必填** — 图片地址
+        type: integer **必填** — 固定值 0
+        isQualified: integer **必填** — 上传时空值
+    familyHistoryUrlList: array,null **必填** — 家族病史Url(语音)
+        id: integer
+        url: string — 地址
+        type: integer — 固定值 1
+        isQualified: integer
+    diseaseUrlList: array,null **必填** — 已知病症Url(语音)
+        id: integer
+        url: string — 地址
+        type: integer — 固定值 2
+        isQualified: integer
+    reportUrlList: array,null **必填** — 病历/化验报告/检查报告 url
+        id: integer
+        url: string
+        type: integer — 固定值 3
+        isQualified: integer
+    attachmentUrlList: array,null **必填** — 身体身表异常部位 url
+        id: integer
+        url: string — 地址
+        type: integer — 固定值 4
+        isQualified: integer — 上传时空值
+    remark: null — 备注
+    knownDisease: null — 个人已知病症
+    specialNote: null — 特别说明
+    type: integer **必填** — 0 普通  3癌症
+    deviceNo: string — 设备号
+  示例:
+    {
+    "detectionUserId": 0,
+    "detectionReportUserId": 0,
+    "realName": "realName_585a91c769b9",
+    "detectionPackageId": 0,
+    "detectionPackageItemId": 0,
+    "basicUrlList": [
+      {
+        "id": 0,
+        "url": "url_d2462f4e160b",
+        "type": 0,
+        "isQualified": 0
+      }
+    ],
+    "familyHistoryUrlList": [
+      {
+        "id": 0,
+        "url": "url_af40ab5c6865",
+        "type": 0,
+        "isQualified": 0
+      }
+    ],
+    "diseaseUrlList": [
+      {
+        "id": 0,
+        "url": "url_0cd57c4e818c",
+        "type": 0,
+        "isQualified": 0
+      }
+    ],
+    "reportUrlList": [
+      {
+        "id": 0,
+        "url": "url_a80256eb5102",
+        "type": 0,
+        "isQualified": 0
+      }
+    ],
+    "attachmentUrlList": [
+      {
+        "id": 0,
+        "url": "url_34dd94351715",
+        "type": 0,
+        "isQualified": 0
+      }
+    ],
+    "remark": "remark_5cd7eff9d3e4",
+    "knownDisease": "knownDisease_5b68d244d0d3",
+    "specialNote": "specialNote_61b8cb169cf4",
+    "uuid": "uuid_e9705f46f50d",
+    "type": 0,
+    "source": "source_850343c76afd",
+    "deviceNo": "deviceNo_1826f8b253c0"
+  }
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {}
+
+================================================================================================
+### GET /product/report/page
+**接口名**:获得检测报告列表 | 节点ID:406136291 | 状态:developing
+
+**描述**:
+分页获取检测报告列表,按检测人维度归档。
+
+⚠️ 实测已知问题:同时携带 Authorization 与 X-User-Id-Encrypt 时,该接口仍返回 {"code":1011011002,"msg":"用户未登录"},而同通道的其他接口均正常,说明报告分页的用户上下文打通方式与其他接口不同。正式对接前请联系平台确认正确调用方式。需要报告数据时,可先用检测套餐用户信息接口取到报告 id,再走报告详情接口。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    userId (必填) : integer — 用户 ID
+    pageNo (必填) : integer
+    pageSize (必填) : integer
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      list: array<object> **必填**
+          id: integer **必填** — 获取检测报告的输入参数
+          detectionId: null **必填**
+          source: null **必填**
+          detectionName: string **必填**
+          price: null **必填**
+          enterTime: integer **必填**
+          base: null **必填**
+          tumor: null **必填**
+          tenantName: null **必填**
+          detectedTime: null **必填**
+          userId: integer **必填**
+          userName: null **必填**
+          detectionUserId: null **必填**
+          detectionReportUserId: null **必填**
+          createTime: integer **必填**
+          remark: null **必填**
+          status: integer **必填**
+          tumorLocation: null **必填**
+          knownDisease: null **必填**
+          specialNote: null **必填**
+          basicUrlList: null **必填**
+          familyHistoryUrlList: null **必填**
+          diseaseUrlList: null **必填**
+          reportUrlList: null **必填**
+          attachmentUrlList: null **必填**
+          detectionUser: null **必填**
+          reportDiseaseRespList: array<object> **必填**
+              id: integer **必填**
+              detectionReportId: integer **必填**
+              diseaseId: null **必填**
+              diseaseType: integer **必填**
+              diseaseName: string **必填**
+              diseaseNameCn: null **必填**
+              diseaseNameEn: null **必填**
+              content: null **必填**
+              img: null **必填**
+              createTime: integer **必填**
+              diseaseDetailList: null **必填**
+          reportHealthDataList: null **必填**
+          orderId: null **必填**
+          orderDetectionId: null **必填**
+          spuId: null **必填**
+          picUrl: null **必填**
+          type: integer **必填**
+          reportLastId: null **必填**
+          signatureUrl: null **必填**
+          detectionPackageId: null **必填**
+          detectionPackageItemId: null **必填**
+      total: integer **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "list": [
+              {
+                  "id": 1172,
+                  "detectionId": null,
+                  "source": null,
+                  "detectionName": "检测报告",
+                  "price": null,
+                  "enterTime": 1712727703000,
+                  "base": null,
+                  "tumor": null,
+                  "tenantName": null,
+                  "detectedTime": null,
+                  "userId": 436,
+                  "userName": null,
+                  "detectionUserId": null,
+                  "detectionReportUserId": null,
+                  "createTime": 1712727703000,
+                  "remark": null,
+                  "status": 0,
+                  "tumorLocation": null,
+                  "knownDisease": null,
+                  "specialNote": null,
+                  "basicUrlList": null,
+                  "familyHistoryUrlList": null,
+                  "diseaseUrlList": null,
+                  "reportUrlList": null,
+                  "attachmentUrlList": null,
+                  "detectionUser": null,
+                  "reportDiseaseRespList": [
+                      {
+                          "id": 5214,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "心血管系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5215,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "脑部与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5216,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "消化系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5217,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "呼吸系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5218,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "泌尿系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5219,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "男科系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5220,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "女性妇科疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5221,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "内分泌代谢免疫淋巴系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5222,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "椎体骨关节相关疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5223,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "精神与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5224,
+                          "detectionReportId": 1172,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "身体综合疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      }
+                  ],
+                  "reportHealthDataList": null,
+                  "orderId": null,
+                  "orderDetectionId": null,
+                  "spuId": null,
+                  "picUrl": null,
+                  "type": 0,
+                  "reportLastId": null,
+                  "signatureUrl": null,
+                  "detectionPackageId": null,
+                  "detectionPackageItemId": null
+              },
+              {
+                  "id": 1171,
+                  "detectionId": null,
+                  "source": null,
+                  "detectionName": "检测报告",
+                  "price": null,
+                  "enterTime": 1712708495000,
+                  "base": null,
+                  "tumor": null,
+                  "tenantName": null,
+                  "detectedTime": null,
+                  "userId": 436,
+                  "userName": null,
+                  "detectionUserId": null,
+                  "detectionReportUserId": null,
+                  "createTime": 1712708495000,
+                  "remark": null,
+                  "status": 0,
+                  "tumorLocation": null,
+                  "knownDisease": null,
+                  "specialNote": null,
+                  "basicUrlList": null,
+                  "familyHistoryUrlList": null,
+                  "diseaseUrlList": null,
+                  "reportUrlList": null,
+                  "attachmentUrlList": null,
+                  "detectionUser": null,
+                  "reportDiseaseRespList": [
+                      {
+                          "id": 5202,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "心血管系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5203,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "脑部与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5204,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "消化系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5205,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "呼吸系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5206,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "泌尿系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5207,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "男科系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5208,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "女性妇科疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5209,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "内分泌代谢免疫淋巴系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5210,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "椎体骨关节相关疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5211,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "精神与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5212,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "身体综合疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5213,
+                          "detectionReportId": 1171,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "皮肤周身疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      }
+                  ],
+                  "reportHealthDataList": null,
+                  "orderId": null,
+                  "orderDetectionId": null,
+                  "spuId": null,
+                  "picUrl": null,
+                  "type": 0,
+                  "reportLastId": null,
+                  "signatureUrl": null,
+                  "detectionPackageId": null,
+                  "detectionPackageItemId": null
+              },
+              {
+                  "id": 1170,
+                  "detectionId": null,
+                  "source": null,
+                  "detectionName": "检测报告",
+                  "price": null,
+                  "enterTime": 1712654479000,
+                  "base": null,
+                  "tumor": null,
+                  "tenantName": null,
+                  "detectedTime": null,
+                  "userId": 436,
+                  "userName": null,
+                  "detectionUserId": null,
+                  "detectionReportUserId": null,
+                  "createTime": 1712654479000,
+                  "remark": null,
+                  "status": 0,
+                  "tumorLocation": null,
+                  "knownDisease": null,
+                  "specialNote": null,
+                  "basicUrlList": null,
+                  "familyHistoryUrlList": null,
+                  "diseaseUrlList": null,
+                  "reportUrlList": null,
+                  "attachmentUrlList": null,
+                  "detectionUser": null,
+                  "reportDiseaseRespList": [
+                      {
+                          "id": 5191,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "心血管系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5192,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "脑部与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5193,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "消化系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5194,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "呼吸系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5195,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "泌尿系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5196,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "男科系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5197,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "女性妇科疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5198,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "内分泌代谢免疫淋巴系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5199,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "椎体骨关节相关疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5200,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "精神与神经系统疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      },
+                      {
+                          "id": 5201,
+                          "detectionReportId": 1170,
+                          "diseaseId": null,
+                          "diseaseType": 0,
+                          "diseaseName": "身体综合疾病",
+                          "diseaseNameCn": null,
+                          "diseaseNameEn": null,
+                          "content": null,
+                          "img": null,
+                          "createTime": 1763456591000,
+                          "diseaseDetailList": null
+                      }
+                  ],
+                  "reportHealthDataList": null,
+                  "orderId": null,
+                  "orderDetectionId": null,
+                  "spuId": null,
+                  "picUrl": null,
+                  "type": 0,
+                  "reportLastId": null,
+                  "signatureUrl": null,
+                  "detectionPackageId": null,
+                  "detectionPackageItemId": null
+              }
+          ],
+          "total": 3
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### GET /product/report/get
+**接口名**:获得检测报告 | 节点ID:390823204 | 状态:released
+
+**描述**:
+按报告 id 获取检测报告详情。指标数据在 reportDiseaseRespList(长度为 1 的数组)的 diseaseDetailList 中,每项含 diseaseDetailName(英文标识)、diseaseDetailNameCn(中文名)、accuracy(检测值)、diseaseLevel(等级)。
+
+空值处理规则(重要):accuracy 为空时平台端展示为参考值提示、diseaseLevel 为空时展示「未检出」。合作方自渲染时必须复用同一套空值规则,不要自行填 0,否则会与平台端展示不一致。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    id (必填) : integer — 报告 Id
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    code: integer **必填**
+    data: object **必填**
+      id: integer **必填**
+      detectionId: null **必填**
+      source: null **必填**
+      detectionName: string **必填**
+      price: null **必填**
+      enterTime: integer **必填**
+      base: null **必填**
+      tumor: null **必填**
+      tenantName: null **必填**
+      detectedTime: null **必填**
+      userId: integer **必填**
+      userName: null **必填**
+      detectionUserId: null **必填**
+      detectionReportUserId: null **必填**
+      createTime: integer **必填**
+      remark: null **必填**
+      status: integer **必填**
+      tumorLocation: null **必填**
+      knownDisease: null **必填**
+      specialNote: null **必填**
+      basicUrlList: null **必填**
+      familyHistoryUrlList: null **必填**
+      diseaseUrlList: null **必填**
+      reportUrlList: null **必填**
+      attachmentUrlList: null **必填**
+      detectionUser: null **必填**
+      reportDiseaseRespList: array<object> **必填**
+          id: integer **必填**
+          detectionReportId: integer **必填**
+          diseaseId: null **必填**
+          diseaseType: integer **必填**
+          diseaseName: string **必填**
+          diseaseNameCn: null **必填**
+          diseaseNameEn: null **必填**
+          content: null **必填**
+          img: null **必填**
+          createTime: integer **必填**
+          diseaseDetailList: array<object> **必填**
+              createTime: integer **必填**
+              updateTime: integer **必填**
+              creator: null **必填**
+              updater: null **必填**
+              deleted: boolean **必填**
+              id: integer **必填**
+              detectionReportId: integer **必填**
+              detectionReportDiseaseId: integer **必填**
+              diseaseId: null **必填**
+              diseaseDetailId: null **必填**
+              diseaseDetailName: string **必填**
+              diseaseDetailNameCn: null **必填**
+              diseaseDetailNameEn: null **必填**
+              content: null **必填**
+              region: null **必填**
+              regionSort: null **必填**
+              background: null **必填**
+              accuracy: integer **必填**
+              diseaseDevelopmentStageMin: integer **必填**
+              diseaseDevelopmentStageMax: integer **必填**
+              diseaseLevel: null **必填**
+              advices: null **必填**
+              introduction: null **必填**
+      reportHealthDataList: array<object> **必填**
+          createTime: integer
+          updateTime: integer
+          creator: null
+          updater: null
+          deleted: boolean
+          id: integer
+          detectionReportId: integer
+          name: null
+          value: string
+      orderId: null **必填**
+      orderDetectionId: null **必填**
+      spuId: null **必填**
+      picUrl: null **必填**
+      type: integer **必填**
+      reportLastId: null **必填**
+      signatureUrl: null **必填**
+      detectionPackageId: null **必填**
+      detectionPackageItemId: null **必填**
+    msg: string **必填**
+  示例:
+    {
+      "code": 0,
+      "data": {
+          "id": 1950,
+          "detectionId": null,
+          "source": "M167260120FEG3JM",
+          "detectionName": null,
+          "price": null,
+          "enterTime": null,
+          "base": null,
+          "tumor": null,
+          "tenantName": null,
+          "detectedTime": null,
+          "userId": 968830977,
+          "userName": null,
+          "detectionUserId": 4375,
+          "detectionReportUserId": 2349,
+          "createTime": 1768891949000,
+          "remark": null,
+          "status": 2,
+          "tumorLocation": null,
+          "knownDisease": null,
+          "specialNote": null,
+          "basicUrlList": null,
+          "familyHistoryUrlList": null,
+          "diseaseUrlList": null,
+          "reportUrlList": null,
+          "attachmentUrlList": null,
+          "detectionUser": null,
+          "reportDiseaseRespList": [
+              {
+                  "id": 13855,
+                  "detectionReportId": 1950,
+                  "diseaseId": 39,
+                  "diseaseType": 2,
+                  "diseaseName": "AI心率血压健康监测pro",
+                  "diseaseNameCn": null,
+                  "diseaseNameEn": "AiBPM-PRO",
+                  "content": null,
+                  "img": null,
+                  "createTime": 1768891949000,
+                  "diseaseDetailList": [
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369866,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "PHYSICAL_SCORE",
+                          "diseaseDetailNameCn": "身体指标",
+                          "diseaseDetailNameEn": "Physical Score",
+                          "content": "2598",
+                          "region": null,
+                          "regionSort": null,
+                          "background": null,
+                          "accuracy": 3.67,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369847,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "GENDER",
+                          "diseaseDetailNameCn": "预测性别",
+                          "diseaseDetailNameEn": "Predicted Gender",
+                          "content": "2579",
+                          "region": null,
+                          "regionSort": null,
+                          "background": null,
+                          "accuracy": 1.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369836,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HR_BPM",
+                          "diseaseDetailNameCn": "脉搏心率",
+                          "diseaseDetailNameEn": "Pulse Rate 140 (bpm)",
+                          "content": "2568",
+                          "region": 1,
+                          "regionSort": 1,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/44ac39706fccad5edc61ee302e77b5d67d20563a4727f1ff12980dc6424d0bf4.png",
+                          "accuracy": 77.18,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369839,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_SYSTOLIC",
+                          "diseaseDetailNameCn": "收缩压(高压)",
+                          "diseaseDetailNameEn": "Systolic Blood Pressure (mmHg)",
+                          "content": "2571",
+                          "region": 1,
+                          "regionSort": 2,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/c86131c4f92a5334cbe5cae1a29f5fe6eff742d15763a2351839f88ea288ab08.png",
+                          "accuracy": 128.78,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369840,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_DIASTOLIC",
+                          "diseaseDetailNameCn": "舒张压(低压)",
+                          "diseaseDetailNameEn": "Diastolic Blood Pressure (mmHg)",
+                          "content": "2572",
+                          "region": 1,
+                          "regionSort": 3,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/7923e9242b6cf0ddfcf37ca86c162f66196ebcbab5c6f797a96983c1bb6db8bb.png",
+                          "accuracy": 83.43,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369837,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "IHB_COUNT",
+                          "diseaseDetailNameCn": "心率不齐",
+                          "diseaseDetailNameEn": "Irregular Heartbeats",
+                          "content": "2569",
+                          "region": 1,
+                          "regionSort": 4,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/10c07fd17d25fdbe8e6a0ab2a4262cd112f52dbcf39e1dab8f495f78b5e4a8a1.png",
+                          "accuracy": 1.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369841,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HRV_SDNN",
+                          "diseaseDetailNameCn": "心率变异性",
+                          "diseaseDetailNameEn": "Heart Rate Variability (SDNN)",
+                          "content": "2573",
+                          "region": 1,
+                          "regionSort": 5,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/efc1d1457ff2c0ef31bd0f3f0f4ff0b6f2361b838694e8fb9c62430eddf5a836.png",
+                          "accuracy": 23.87,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369838,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BR_BPM",
+                          "diseaseDetailNameCn": "呼吸频率",
+                          "diseaseDetailNameEn": "Breathing Rate (brpm)",
+                          "content": "2570",
+                          "region": 1,
+                          "regionSort": 6,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/38dc13aec7c571624b0c9acd66fb52b7d92c0c6aec673c1fa80311238cd64ded.png",
+                          "accuracy": 8.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369855,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HPT_RISK_PROB",
+                          "diseaseDetailNameCn": "高血压风险",
+                          "diseaseDetailNameEn": "Hypertension risk",
+                          "content": "2587",
+                          "region": 1,
+                          "regionSort": 7,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/a449d12e8867c24106f348eed0a5979c413effdb26746e00256dddf7e7c29748.png",
+                          "accuracy": 11.33,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369842,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_RPP",
+                          "diseaseDetailNameCn": "心脏工作量",
+                          "diseaseDetailNameEn": "Cardiac Workload",
+                          "content": "2574",
+                          "region": 1,
+                          "regionSort": 8,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/7b4d873fabac7f1c60a6356c21ceedb88bf419b81b380a0d05dbe85fd09e87cb.png",
+                          "accuracy": 4.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369853,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_HEART_ATTACK",
+                          "diseaseDetailNameCn": "心脏病发作风险",
+                          "diseaseDetailNameEn": "Heart Attack Risk",
+                          "content": "2585",
+                          "region": 1,
+                          "regionSort": 9,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/f6a6dc54c6b01e7cc6c223d097fe8916b619e7e4a3db73217aa3b25e6d9bf424.png",
+                          "accuracy": 0.16,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369843,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_TAU",
+                          "diseaseDetailNameCn": "血管容量",
+                          "diseaseDetailNameEn": "Vascular Capacity",
+                          "content": "2575",
+                          "region": 1,
+                          "regionSort": 10,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/9cda2b57091f76abc7d58f0216cf7ab99e03f55f4224479f90059d8757dee742.png",
+                          "accuracy": 1.66,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369852,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_CVD",
+                          "diseaseDetailNameCn": "心血管疾病风险",
+                          "diseaseDetailNameEn": "Cardiovascular Disease Risk",
+                          "content": "2584",
+                          "region": 1,
+                          "regionSort": 11,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/5e775c27b50fc0b49a31ddb737ef7be91c7472f233300497542984457b525fb6.png",
+                          "accuracy": 1.09,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369854,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BP_STROKE",
+                          "diseaseDetailNameCn": "中风风险",
+                          "diseaseDetailNameEn": "Stroke Risk",
+                          "content": "2586",
+                          "region": 1,
+                          "regionSort": 12,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/44b3c7e7eac574061ee4884c98ed21425de86b622c8af4d44a7703b21a06f14a.png",
+                          "accuracy": 0.79,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369863,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "VITAL_SCORE",
+                          "diseaseDetailNameCn": "生命体征评分",
+                          "diseaseDetailNameEn": "Vitals",
+                          "content": "2595",
+                          "region": 1,
+                          "regionSort": 13,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/f66ea3fd1aae1c1852945317000f510b5eacc5b6a990fc66e54b673190082843.png",
+                          "accuracy": 4.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369862,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "MFBG_RISK_PROB",
+                          "diseaseDetailNameCn": "空腹血糖风险",
+                          "diseaseDetailNameEn": "Risk of Fasting Blood Glucose Level > 5.5 mmol/L",
+                          "content": "2594",
+                          "region": 2,
+                          "regionSort": 1,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/8e4a211743158c4a879d0604f310629b03446b0cb5048c0f5080ff9b0c8e4ec2.png",
+                          "accuracy": 30.97,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369856,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "DBT_RISK_PROB",
+                          "diseaseDetailNameCn": "2型糖尿病风险",
+                          "diseaseDetailNameEn": "Type 2 Diabetes Risk",
+                          "content": "2588",
+                          "region": 2,
+                          "regionSort": 2,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/17ce3a1b33f5b9f22b372b0991fcded7f892b435544372a68f3503141580687b.png",
+                          "accuracy": 8.65,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369861,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HBA1C_RISK_PROB",
+                          "diseaseDetailNameCn": "血红蛋白A1C风险",
+                          "diseaseDetailNameEn": "Risk of HbA1c Level > 5.7%",
+                          "content": "2593",
+                          "region": 2,
+                          "regionSort": 3,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/f80b406ed1498441f92b20a57a0869976098967ccbab8d2262743130c8d3ce97.png",
+                          "accuracy": 32.85,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369857,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HDLTC_RISK_PROB",
+                          "diseaseDetailNameCn": "高胆固醇血症风险",
+                          "diseaseDetailNameEn": "Hypercholesterolemia risk",
+                          "content": "2589",
+                          "region": 2,
+                          "regionSort": 4,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/7a3dbac4d65a914e0a981551e301eda95638411fde10c57fbd8c84693c758e46.png",
+                          "accuracy": 59.26,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369859,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "FLD_RISK_PROB",
+                          "diseaseDetailNameCn": "脂肪肝风险",
+                          "diseaseDetailNameEn": "Fatty Liver Disease Risk",
+                          "content": "2591",
+                          "region": 2,
+                          "regionSort": 5,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/cb1637584e3058a5a71c34a74aab4e83b5ecb941a697beafaf37aa19a68f953c.png",
+                          "accuracy": 50.16,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369858,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "TG_RISK_PROB",
+                          "diseaseDetailNameCn": "高甘油三酯血症风险",
+                          "diseaseDetailNameEn": "Hypertriglyceridemia risk",
+                          "content": "2590",
+                          "region": 2,
+                          "regionSort": 6,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/fb4d28e4e10ae0634ac1f99ed2350e2ef7a5165fd0ba2fb978c940b5276c3bd9.png",
+                          "accuracy": 50.99,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369867,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "RISKS_SCORE",
+                          "diseaseDetailNameCn": "身体疾病风险",
+                          "diseaseDetailNameEn": "Risks Score",
+                          "content": "2599",
+                          "region": 2,
+                          "regionSort": 7,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/9d36dfeeeef128e0bf0114a2095dfbe1b0711b3a868bd69bdb191a8ba285f942.png",
+                          "accuracy": 4.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369860,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "OVERALL_METABOLIC_RISK_PROB",
+                          "diseaseDetailNameCn": "整体代谢健康风险",
+                          "diseaseDetailNameEn": "Overall Metabolic Health Risk",
+                          "content": "2592",
+                          "region": 2,
+                          "regionSort": 9,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/7adfde31be09952eed10e39c7827fd247547da17912f08a096d71e6bd61d2b02.png",
+                          "accuracy": 36.08,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369844,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "MSI",
+                          "diseaseDetailNameCn": "精神压力指数",
+                          "diseaseDetailNameEn": "NuraLogix Mental Stress Index",
+                          "content": "2576",
+                          "region": 3,
+                          "regionSort": 1,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/6771b7649b9e0f31ef7090412169227b93c0bb6583878ca9a6b340de042f532e.png",
+                          "accuracy": 3.57,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369865,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "MENTAL_SCORE",
+                          "diseaseDetailNameCn": "心理健康评分",
+                          "diseaseDetailNameEn": "Mental Score",
+                          "content": "2597",
+                          "region": 3,
+                          "regionSort": 4,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/d2e5b349caa24dcb89e0ba7aef3d896ec2d84a6eec00dc663be328d784c28bf6.png",
+                          "accuracy": 3.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369846,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "AGE",
+                          "diseaseDetailNameCn": "皮肤年龄",
+                          "diseaseDetailNameEn": "Facial Topographical Age",
+                          "content": "2578",
+                          "region": 4,
+                          "regionSort": 1,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/843d1cb38813a243b39b55af751c51b70d734dead07002c9b2e20c97b63eefc7.png",
+                          "accuracy": 45.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369845,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "BMI",
+                          "diseaseDetailNameCn": "身体体重指数",
+                          "diseaseDetailNameEn": "Body Mass Index",
+                          "content": "2577",
+                          "region": 4,
+                          "regionSort": 2,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/c72ecda494d5e72ddfda810ff9f3cdf39c0415406c20de80c8c3ed05b0a23f02.png",
+                          "accuracy": null,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369850,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "ABSI",
+                          "diseaseDetailNameCn": "身体形态指标",
+                          "diseaseDetailNameEn": "Body Shape Index",
+                          "content": "2582",
+                          "region": 4,
+                          "regionSort": 3,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/c4cfb9fb39b8ac4c340286959765d3ba79a9d6bb8757524e5145dc8742ad01ba.png",
+                          "accuracy": 7.81,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369848,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HEIGHT",
+                          "diseaseDetailNameCn": "AI预测身高",
+                          "diseaseDetailNameEn": "Predicted Height (cm)",
+                          "content": "2580",
+                          "region": 4,
+                          "regionSort": 4,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/b16482980db3a0919586493d664bb874b204c876c5f80571a5bf511b9a837ea3.png",
+                          "accuracy": 1.76,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369849,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "WEIGHT",
+                          "diseaseDetailNameCn": "AI预测体重",
+                          "diseaseDetailNameEn": "Predicted Weight (kg)",
+                          "content": "2581",
+                          "region": 4,
+                          "regionSort": 5,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/188cdc9e50dfe6ab8e0a0125b4a411de902fb08a7de25a5667f765fa285129ef.png",
+                          "accuracy": 80.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369869,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "WAIST_CIRCUM",
+                          "diseaseDetailNameCn": "腰围",
+                          "diseaseDetailNameEn": "Waist Circumference",
+                          "content": "2601",
+                          "region": 4,
+                          "regionSort": 6,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/a1cc168c0fb71fa1ba39d31fc00312e5586995fa89949447e1868336e840424e.png",
+                          "accuracy": 90.52,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369851,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "WAIST_TO_HEIGHT",
+                          "diseaseDetailNameCn": "腰围身高比",
+                          "diseaseDetailNameEn": "Waist-to-Height Ratio",
+                          "content": "2583",
+                          "region": 4,
+                          "regionSort": 7,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/0fd2ed9d9ffd6fd6aae99deaa12f3d537a92958932fa5b57462c32ae3dd76aeb.png",
+                          "accuracy": 51.43,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369864,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "PHYSIO_SCORE",
+                          "diseaseDetailNameCn": "生理健康评分",
+                          "diseaseDetailNameEn": "Physiological Score",
+                          "content": "2596",
+                          "region": 4,
+                          "regionSort": 8,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/d5a56133eb3c80ec65058e7191a3cf6580d6fcd804e084b7ab33cf55dadaee04.png",
+                          "accuracy": 3.00,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369835,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "SNR",
+                          "diseaseDetailNameCn": "信噪比",
+                          "diseaseDetailNameEn": "Signal-to-Noise Ratio (SNR)",
+                          "content": "2567",
+                          "region": 5,
+                          "regionSort": 1,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/72b2c99127393943e1e12df08ae34b5b62b738aa6b34fab107bb9b0cb3c57fcd.png",
+                          "accuracy": 4.02,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      },
+                      {
+                          "createTime": 1768891949000,
+                          "updateTime": 1768891949000,
+                          "creator": null,
+                          "updater": null,
+                          "deleted": false,
+                          "id": 369868,
+                          "detectionReportId": 1950,
+                          "detectionReportDiseaseId": 13855,
+                          "diseaseId": null,
+                          "diseaseDetailId": null,
+                          "diseaseDetailName": "HEALTH_SCORE",
+                          "diseaseDetailNameCn": "总体健康评分",
+                          "diseaseDetailNameEn": "General Wellness Score",
+                          "content": "2600",
+                          "region": 5,
+                          "regionSort": 2,
+                          "background": "https://minioapi.aicds.com.cn/mall-microapp/8acec522141b9edc9f4a7de96fc159f1787bdc4813110b4e5f84f83dd84d88c3.png",
+                          "accuracy": 70.67,
+                          "diseaseDevelopmentStageMin": null,
+                          "diseaseDevelopmentStageMax": null,
+                          "diseaseLevel": null,
+                          "advices": null,
+                          "introduction": null
+                      }
+                  ]
+              }
+          ],
+          "reportHealthDataList": null,
+          "orderId": null,
+          "orderDetectionId": null,
+          "spuId": null,
+          "picUrl": null,
+          "type": 2,
+          "reportLastId": null,
+          "signatureUrl": null,
+          "detectionPackageId": 883,
+          "detectionPackageItemId": 901
+      },
+      "msg": ""
+  }
+
+================================================================================================
+### GET /product/report/get-content
+**接口名**:获得疾病解决方案 | 节点ID:410254402 | 状态:released
+
+**描述**:
+获取指标对应的疾病解决方案与解读文案,供合作方自渲染指标详情页时复用平台文案。
+
+实测入参为 id(疾病/指标定义编号),不是指标英文名;缺参返回 {"code":400,"msg":"请求参数缺失:id"}。
+
+**请求参数**
+  【header】
+    Authorization : string ="Bearer {accessToken}" — 在 Refresh 中这里添 RefreshToken,其他API 填 Token (默认:Bearer {accessToken})
+  【query】
+    id (必填) : any — 疾病/指标定义编号
+
+**请求体**
+  Content-Type: application/json
+    (no schema)
+
+**响应**
+  200 成功: 成功
+    (no schema)
+  示例:
+    {"code":401,"data":null,"msg":"Token 已过期,请刷新"}
+---
+
+## 附录 B:平台确认补充(2026-11-25 · 先锋健康测试环境凭证联调确认)
+
+> 来源:先锋健康对接群,爱云医平台技术回复原文整理。**本附录为权威口径,覆盖附录 A 中相应条目。**
+
+### B.1 商品与检测包(修正附录 A 的理解)
+
+| 项 | 平台权威口径 |
+|---|---|
+| **商品配置** | **全部由平台后台配置**,租户不需要也无法自行配置。商品在平台侧是**全局 SPU**,按租户挂 **SKU 行**来开放 |
+| **当前状态** | 测试凭证所属租户(先锋健康·编号 6)**尚未挂 SKU**,`spu/page` 返回空**是预期、非故障**。平台配好样例商品后会直接下发 `spuId + skuId + keyword` 清单 |
+| **skuId 获取** | `spu/page` 返回的是 **spuId 不是 skuId**;要 `skuId` 须调 **`GET /product/spu/get-detail`**,读 `skus[].id`(附录 A §商品明细已含,此处强调必调) |
+| **keyword** | 对商品名模糊匹配;**建议直接用清单里的 spuId 精确取**,勿靠 keyword 猜 |
+
+### B.2 `inspectionType` 真实归属(关键修正)
+
+- **类型不在商品上,在检测包子项上**:`spu/page` 返回体里**没有 `inspectionType` 字段**;商品级 `inspectionType` 统一返回 `-1`(含义=「多项检测套餐商品」)。
+- **一律以 `get-items` 返回的子项 `inspectionType` 为准**:
+
+| 子项 `inspectionType` | 含义 | 链路 |
+|---|---|---|
+| `0` | 照片类(AI 疾病/全科筛查) | `enter/detection_data` 提交图片 |
+| `1` | 视频类·普通(AIBMP) | `getPath` → H5 采集页 |
+| `2` | 视频类·高精度(AIBMP-PRO) | `getPath` → H5 采集页 |
+| `3` | 癌症/肿瘤早筛(**照片链路**,报告含肿瘤发展阶段) | `enter/detection_data` 提交图片 |
+
+> ⚠️ 区分两个易混字段:**`get-items` 子项的 `inspectionType`**(0/1/2/3,判断链路用这个)**≠ `enter/detection_data` 请求体里的 `type`**(0 普通 / 3 癌症,提交时用)。
+
+### B.3 次数 / 有效期 / 子项数
+
+- **次数** = 商品 `detectionCount` × 下单 `count`。参考现网值:单次筛查类=1;心率血压年度监测=200;高精度AI生命体征监测(年)=365。
+- **有效期** = 商品 `effectiveDays`,**起算点=建包时刻**:`deadline = 建包时间 + effectiveDays`。筛查类多为 365 天,也有 30 天,以平台下发的商品清单为准。
+- **子项数** = 商品绑定的检测套餐模板明细条数。单项商品 1 子项;**组合商品 2 子项**(典型组合 `0` 照片类 + `2` 高精度视频类,一次下单两个子项各自独立检测、各自出报告)。
+
+### B.4 状态口径(轮询依据)
+
+| 对象 | 状态枚举 |
+|---|---|
+| **子项** `detectionPackageItem.status` | `0` 待使用 / `1` 检测中 / `2` 已完成 / `3` 已过期 |
+| **检测包** `detectionPackage.status` | `-1` 已取消 / `0` 未支付 / `1` 待激活 / `2` 待使用 / `3` 检测中 / `4` 已完成 / `5` 已过期 |
+
+### B.5 三个「待确认」接口的真实返回体(消除 R5)
+
+| 接口 | 真实返回 `data` |
+|---|---|
+| `POST /trade/order/create` | **对象**:`{"totalCount":1,"successCount":1,"errorCount":0,"successList":[{"skuId":123,"packageIds":[456]}],"errorList":[{"skuId":124,"errorMsg":"..."}]}`;`detectionPackageId` 从 `successList[].packageIds` 取(**数组**,count>1 时多个) |
+| `POST /product/detection-user/create` | **直接是 Long**:`{"code":0,"data":789,"msg":""}`,`data` 即 `detectionUserId` |
+| `PUT /detection/package/enter/detection_user` | `{"code":0,"data":true,"msg":""}`,**仅布尔,无业务结构** |
+| `PUT /detection/package/enter/detection_data` | `{"code":0,"data":true,"msg":""}`,**仅布尔** |
+| `detectionPackageItemId` | 从 `get-items` 列表项 `id` 取;同返回带 `inspectionType / status / skuGeneticPanelId / skuGeneticPanelName / sort / detectionTime` |
+
+- **完成判断**:轮询 `get-items` 对应子项 `status`(`1` 检测中 → `2` 已完成),完成后 `report/get` 取详情。
+
+### B.6 视频检测链路(消除 R7)
+
+- `getPath` **两入参必填**:`detectionPackageItemId` + `detectionReportUserId`。
+- 返回 `data.path` 是第三方采集页 URL,**按子项类型分两套域名**:
+  - `inspectionType=1`:`https://dev-xymeas.aicds.com.cn?userId=&familyId=&tenantId=&detectionPackageId=&detectionPackageItemId=&detectionReportUserId=`
+  - `inspectionType=2`:`https://dev-nls.aicds.com.cn/?detectionUserId=&tenantId=&age=&height=&weight=&gender=&smoker=&medication=&diabetic=&orderId=&skuId=&spuId=&detectionPackageId=&detectionPackageItemId=&detectionReportUserId=&istest=`
+  - ⚠️ **不是 `devh5.aicds.com.cn`**(那是平台信息填写页域名,与视频采集无关)。
+- **测试/生产不是两个域名**:两环境都指向上面两个采集页域名,靠 **`istest` 参数区分(1=测试库,2=正式库)**,`istest` 由平台按环境注入,租户**不用处理、也不用配两套 URL**。
+- **无需微信授权/登录态**:身份完全靠 URL 参数携带(`userId / familyId / detectionUserId` + 人口学字段)。
+- **`path` 里没有鉴权 token**,参数是**明文业务 ID**。请**整串原样透传**:不改参数、不截断、不转发到外部渠道。
+- **报告回传无回调**:视频采集完成后由算法方回传平台入库,租户只轮询 `get-items` 子项 `status`(`1`→`2`)即完成,再 `report/get`。**建议轮询间隔 30~60 秒**。
+- **小程序 `web-view` 需加域名白名单**:`dev-xymeas.aicds.com.cn` + `dev-nls.aicds.com.cn`(体验/正式同域名)。
+
+### B.7 `uploadFile` 图片上传接口(文档漏项已补录)
+
+- **路径**:`POST /app-api/detection/package/enter/upload`(⚠️ **注意是 `/app-api/` 前缀,非 `/open-api/`**)。
+- **鉴权**:**免登录(服务端 PermitAll)**,**不需要** `Authorization` 和 `X-User-Id-Encrypt`。
+- **请求**:`Content-Type: multipart/form-data`;参数 `file`(必填,文件体)、`path`(选填,存储路径/文件名,如 `a.jpg`)。
+- **返回**:`{"code":0,"data":"https://minioapi.aicds.com.cn/....jpg","msg":""}` —— `data` 就是**图片 URL 字符串**,直接填进 `enter/detection_data` 的 `*UrlList[].url`。
+- **大小上限**:单文件 100MB,单次请求总量 500MB(服务端 multipart 配置)。服务端**不校验扩展名**,格式按算法侧支持范围,**建议 jpg/png,单张控制在 10MB 以内**。
+- **能否直接用租户对象存储公网 URL**:**技术上可以**。`enter/detection_data` 的 `basicUrlList / familyHistoryUrlList / diseaseUrlList / reportUrlList / attachmentUrlList` **只存 URL 字符串**,平台**不校验域名、不转存**。但**算法侧必须能公网拉通**,拉不到就是**检测失败且不回滚**,排查成本高。
+  - **建议**:**联调阶段先走平台 `uploadFile` 把链路跑通**;正式上线若要改外链,**提前把样例 URL 给平台验证一次可达性再切**。
+  - → **我方决策**:联调用 `uploadFile`;外链 OSS 可达性验证放二期(对应风险 R1)。
+
+### B.8 两个已知问题(平台主动避雷)
+
+1. **`report/page` 仍在修**:带齐 `Authorization + X-User-Id-Encrypt` 仍返回 `1011011002 用户未登录`。**先用 `report/get` 按报告 id 取详情,不要依赖 page 列表**。(证实附录 A §R3 缺陷,第一版只走 `report/get` 正确)
+2. **`refresh` 过期后无法刷新**:accessToken 过期后只能重新登录(白名单路径与实际路径不一致,平台在修)。**带有效 accessToken 调 refresh 能返回新令牌,但过期后不行**。→ 租户 token 管理按 **30 分钟有效期直接重登**处理。

+ 190 - 0
docs/爱云医接入/爱云医联调启动Checklist-20261125.md

@@ -0,0 +1,190 @@
+# 爱云医 AI 检测接入 · 联调启动 Checklist
+
+> 文档编号:XAF-AICDS-002 | 版本:v1.0 | 日期:2026-11-25 | 作者:齐活林(交付总监)审定
+> 依据:`docs/2026-11-24-爱云医AI检测接入方案.md`(v1.1)+ `docs/爱云医接入/爱云医接口契约-完整版.md`(**附录 B 为权威口径**)
+> 前置成果:测试凭证已到手(先锋健康·devadmin·租户编号 6);账户模型/响应结构/上传方式/视频域名均已平台确认
+> **用途**:商品清单到手后,按本清单逐步联调;每步含「预期结果」与「失败时的下一步」。
+
+---
+
+## 0. 使用说明与前置门槛
+
+| 项 | 说明 |
+|---|---|
+| **适用范围** | 测试环境(`https://devadmin.aicds.com.cn/open-api`)联调验证 |
+| **联调前提** | 后端实现(S-cfc-446~452、489 族)已部署到测试环境;前端(S-cfc-453~457)可在开发者工具/真机运行 |
+| **凭证** | 见运营保管处(**勿入 git**);app-key / API Secret / RSA 公私钥 |
+| **阻塞项** | 若 §1 任一未解锁,**后续全部无法进行**——不要试图绕过 |
+| **记录纪律** | 每一步把「实际返回体」粘到 `docs/爱云医接入/联调记录-20261125.md`(后续核对用) |
+
+---
+
+## 1. 解锁清单(联调前必须完成,逐项打勾)
+
+### 1.1 商品清单(**最高优先级**)
+- [ ] 平台已在测试租户下配置三类样例商品,并下发 `spuId + skuId + keyword` 清单
+- [ ] 联调执行者已知悉:`spu/page` **不再返回空**即算就绪
+- [ ] 记录:清单中的 `spuId / skuId / 检测类型(子项 inspectionType 0/1/2/3)`
+
+### 1.2 小程序后台域名白名单
+- [ ] `webview` 业务域名已加:**`dev-xymeas.aicds.com.cn`**
+- [ ] `webview` 业务域名已加:**`dev-nls.aicds.com.cn`**
+- [ ] request 合法域名已加:**`devadmin.aicds.com.cn`**(若前端直连;本方案走后端代理则非必需,但建议一并加上)
+- [ ] **上传域名**:本方案照片上传由后端转发(小程序只连自家域名),故小程序**不需要**加 `minioapi.aicds.com.cn`——已确认
+
+### 1.3 后端环境变量(运营注入,值见保管处)
+- [ ] `AIYUNYI_APP_KEY`
+- [ ] `AIYUNYI_RSA_PRIVATE_KEY`(**PKCS#8 完整 848 字符,勿截断、勿删换行**)
+- [ ] `AIYUNYI_RSA_PUBLIC_KEY`
+- [ ] `AIYUNYI_ACCOUNT_PHONE`(先锋健康租户短信登录手机号)
+- [ ] `AIYUNYI_BASE_URL=https://devadmin.aicds.com.cn/open-api`
+- [ ] 验证:`/api/aiyunyi/**` 接口已由 `JwtInterceptor` 放行(**登录后带小程序 token 可访问**)
+
+---
+
+## 2. 单接口冒烟(按依赖顺序,逐条勾选)
+
+> 每步在**后端日志**保留请求/响应;失败先看第 8 节故障表。
+
+### 2.1 登录与签名(链路第一环,必做)
+- [ ] **S1 登录**:调 `POST /open-api/member/user/identify`(手机号=租户短信验证码手机)→ 预期 `code:0` + `accessToken` + `refreshToken`
+  - 说明:测试环境可用`test-mode`/免验证码登录;取到 `accessToken`(**30 分钟**)+ `userId`(字符串)
+- [ ] **S2 签名自检**:抓包确认 `X-Api-Sign` = `Base64(SHA256withRSA(私钥, "appKey={KEY}&timestamp={毫秒}"))`
+  - 预期:服务端无签名错误(`401/403` 不应出现);若 401 先查**时间戳时差≤5min**
+- [ ] **S3 加密自检**:抓包确认业务接口带 `Authorization: Bearer {accessToken}` + `X-User-Id-Encrypt` = `Base64(RSA公钥加密(userId))`
+- [ ] **S4 过期策略验证**:人为等 accessToken 过期或注入过期 token → 预期后端**自动重新 identify 重登**(契约 B.8②:过期不可刷新,按 30min 重登)
+- [ ] **S5 商品可读**:调 `GET /open-api/product/spu/page`(用清单 spuId 精确取)→ 预期**返回非空**(S5 返空=商品未挂 SKU,回 §1.1)
+- [ ] **S6 取 skuId**:调 `GET /open-api/product/spu/get-detail` → 预期返回 `skus[].id`(下单用这个 id)
+- [ ] **S7 报告可达**:用任一已有 `reportId` 调 `GET /open-api/product/report/get?id=xxx` → 预期 `reportDiseaseRespList[].diseaseDetailList[]` 有数据(S7 不跑通=报告链路异常)
+
+### 2.2 套餐与检测人(数据准备)
+- [ ] **S8 下单建包**:调 `POST /open-api/trade/order/create`,body `items:[{skuId, count}]`(照片类 count=1)→ 预期 `successList[].packageIds` 为数组,取 `packageIds[0]`
+- [ ] **S9 建检测人**:调 `POST /open-api/product/detection-user/create`(租户 userId + 检测人 relation/realName/userPhone/userAge/...)→ 预期 `data` 是 **Long 数字 = detectionUserId**
+- [ ] **S10 激活**:调 `PUT /detection/package/enter/detection_user`,body `{id: packageId, detectionUserId}` → 预期 `{"code":0,"data":true}`
+- [ ] **S11 取检测报告用户**:调 `get-user-info` 或 `package/page` → 取 `detectionReportUserId`
+- [ ] **S12 取子项**:调 `GET /detection/package/get-items?packageId=xxx` → 预期列表带 `id / inspectionType / status / skuGeneticPanelId`;记 `detectionPackageItemId` 与 `inspectionType`
+
+---
+
+## 3. 照片路径端到端联调(主链路,联调首日重点)
+
+> 目标:**12 张基本图 + 1 张化验报告** → 提交 → 轮询 → 拿到非空指标报告。
+> 素材准备:`inspectionType=0` 的照片类子项对应的标准化照片(按爱云医拍摄要求:体质/四肢/面部等,具体以平台商品说明为准)+ 1 张化验单。
+
+- [ ] **P1 上传图片(走 uploadFile)**:小程序拍照/选图 → 后端 `POST /api/aiyunyi/upload`(multipart,`file` 必填)→ 转发平台 `POST /app-api/detection/package/enter/upload`
+  - 预期:返回 `data` 是 `https://minioapi.aicds.com.cn/....jpg` 字符串(**每张一张一传,共 13 次:12 基本图 + 1 化验单**)
+  - 规格:单文件 ≤100MB(建议 ≤10MB)、jpg/png;全部 URL 记入记录文件
+- [ ] **P2 提交检测数据**:调 `PUT /detection/package/enter/detection_data`
+  - body:`detectionUserId / detectionReportUserId / detectionPackageId / detectionPackageItemId / realName / type:0`
+  - `basicUrlList`:12 张(`type:0`,`isQualified` 留空)
+  - `reportUrlList`:化验单 URL(`type:3`)
+  - `familyHistoryUrlList / diseaseUrlList / attachmentUrlList`:第一版**留空数组或 null**
+  - 预期:`{"code":0,"data":true,"msg":""}`(**仅布尔,无业务结构——提交成功不代表检测完成**)
+- [ ] **P3 轮询子项状态**:每 30~60s 调 `get-items`,盯对应子项 `status`:`0 待使用 → 1 检测中 → 2 已完成`(3=过期)
+  - 预期:状态从 1 变 **2**(照片类通常数分钟;超 30 分钟仍 1 则联系平台)
+- [ ] **P4 取报告 id**:从套餐用户信息/本地映射表取报告 id(**不用 `report/page`**——R3 平台仍在修)
+- [ ] **P5 取报告详情**:调 `GET /product/report/get?id={报告id}`
+  - 预期:`reportDiseaseRespList[].diseaseDetailList[]` 含 `diseaseDetailName / diseaseDetailNameCn / accuracy / diseaseLevel`
+  - ⚠️ **空值规则**(契约):`accuracy` 空=平台展示「参考值」、`diseaseLevel` 空=展示「未检出」;**自渲染时勿填 0**
+- [ ] **P6 指标解读(二期)**:`GET /product/report/get-content?id={疾病/指标定义编号}` → 复用平台文案
+- [ ] **P7 映射落库**:核对本地 `aiyunyi_mapping` 记录了 `member_id / family_id / detectionUserId / packageId / packageItemId / reportId / inspectionType / status`
+- [ ] **P8 幂等复测**:同一成员**重复发起一次识别** → 预期复用已建检测人与未用子项,**不重复建人、不重复下单**
+
+**照片路径通过标准**:P1~P8 全绿,且 `report/get` 取到**非空 diseaseDetailList**。
+
+---
+
+## 4. 视频路径端到端联调(第二优先)
+
+> 目标:进入 `<web-view>` 采集页 → 采集完成 → 轮询 → 拿到报告。
+> 素材:小程序真机(web-view 需真机验证)+ 601s 采集时长耐心。
+
+- [ ] **V1 类型判定**:`get-items` 子项 `inspectionType=1`(AIBMP)或 `2`(AIBMP-PRO)→ 走视频分支
+- [ ] **V2 取采集页 URL**:调 `GET /detection/package/getPath`,**两入参必填** `detectionPackageItemId + detectionReportUserId`
+  - 预期 `data.path` 形如:
+    - `inspectionType=1`:`https://dev-xymeas.aicds.com.cn?userId=&familyId=&tenantId=&detectionPackageId=&detectionPackageItemId=&detectionReportUserId=`
+    - `inspectionType=2`:`https://dev-nls.aicds.com.cn/?detectionUserId=&tenantId=&age=&height=&weight=&gender=&smoker=&medication=&diabetic=&orderId=&skuId=&spuId=&detectionPackageId=&detectionPackageItemId=&detectionReportUserId=&istest=`
+  - ❌ **不是 `devh5.aicds.com.cn`**(那是平台信息填写页)
+- [ ] **V3 H5 打开**:小程序 `<web-view :src="path">` 打开(真机)
+  - 预期:打开**采集页**;**免微信授权/登录**,身份靠 URL 参数
+  - ⚠️ **整串原样透传**:不改参数、不截断、不转发外部渠道
+- [ ] **V4 采集完成**:用户按页面指引完成采集 → 回到小程序
+  - 预期:**无需接任何回调**;算法方回传平台入库
+- [ ] **V5 轮询**:每 30~60s 调 `get-items`,盯子项 `status` `1 → 2`
+- [ ] **V6 取报告**:`report/get?id={报告id}` → 预期指标非空
+- [ ] **V7 映射落库**:核对 `aiyunyi_mapping` 视频链路字段
+
+**视频路径通过标准**:V1~V7 全绿,真机可打开采集页并拿到报告。
+
+---
+
+## 5. 前端验收(小程序开发者工具 + 真机)
+
+- [ ] **F1 入口**:`report-upload` 页「上传方式」区出现第三张卡片「**AI 快速识别**」
+- [ ] **F2 拦截**:未选成员/未勾声明时点卡片 → 提示拦截(复用现有逻辑)
+- [ ] **F3 选素材**:三种来源(相机/图库/微信聊天记录)均能选图上传
+- [ ] **F4 进度**:上传与轮询期间进度面板显示「识别中」,**不白屏、不崩溃**
+- [ ] **F5 跳转**:完成后跳 `ai-report-detail` 报告页,渲染原始结构(diseaseDetailNameCn + accuracy + diseaseLevel,**空值不填 0**)
+- [ ] **F6 视频**:`inspectionType=1/2` 进入 `ai-video-detect` `<web-view>` 内嵌页,返回后可看到报告
+- [ ] **F7 状态列表**:历史 AI 识别记录可按「进行中/已完成」展示
+
+---
+
+## 6. 异常分支验证(每项都要走到)
+
+| # | 场景 | 预期反馈 |
+|---|---|---|
+| **E1** | 商品未挂 SKU(`spu/page` 空) | 提示「该服务尚未开通」,**不是报错/白屏** |
+| **E2** | 子项无 `status=0`(次数用尽/过期) | 提示「检测次数已用完,请重新购买」 |
+| **E3** | 上传超规格(>100MB 或非图片) | 提示换图重试 |
+| **E4** | `enter/detection_data` 提交失败 | 明确提示 + 允许重试(不静默吞) |
+| **E5** | 轮询超时(30 分钟未完成) | 提示「识别时间较长,请稍后在记录中查看」,进列表可查 |
+| **E6** | accessToken 过期 | 后端静默重登,**用户无感**(S4 已验证) |
+| **E7** | `report/get` 报告 id 不存在/空 | 提示「报告暂未生成」而非空页面 |
+| **E8** | H5 采集页打开失败/域名未配白名单 | 明确提示 + 记录失败 URL(回 §1.2) |
+
+---
+
+## 7. 收口与转生产
+
+- [ ] **T1 联调记录归档**:`docs/爱云医接入/联调记录-20261125.md` 补齐所有实际返回体
+- [ ] **T2 契约勘误**:若实测与附录 B 有出入(路径/字段/阈值),**先改契约附录 B 再改实现**
+- [ ] **T3 密钥转正**:联系平台签发**生产环境凭证**(app-key + RSA 密钥对 + 生产 base-url)
+- [ ] **T4 域名切换**:生产 `request`/`webview` 白名单、`application.yml` `aiyunyi.base-url` 切换
+- [ ] **T5 商品正式化**:确认生产租户商品已挂 SKU;联调用的租户短信手机号换成正式运营手机号
+- [ ] **T6 上报与汇报**:汇总联调结论到 TDD 闭环汇报(`docs/tdd/orchestration/report-*.md`)
+- [ ] **T7 OSS 外链二期**:待生产稳定后,再评估外链 OSS 方案(需先给平台样例 URL 验证可达性)
+
+---
+
+## 8. 故障速查表(按现象定位)
+
+| 现象 | 根因 | 处置 |
+|---|---|---|
+| `401` + 签名错 | 时间戳与服务器时差 >5min,或签名串格式错 | 校时间戳;签名串确认 `appKey={KEY}&timestamp={毫秒}` |
+| `1011011002 用户未登录` | `report/page` 平台缺陷 | 改用 `report/get`(R3,平台在修) |
+| refresh 返回 401 / `RefreshToken 不能用于业务访问` | accessToken 已过期 | 过期不可刷新,直接重新 identify(B.8②) |
+| `spu/page` 返回空 | 租户未挂 SKU(**预期,非故障**) | 回 §1.1 找平台下发清单 |
+| `getPath` 打开的是信息填写页 | 用了 `devh5` 域名 | 用 `dev-xymeas`(1) / `dev-nls`(2) |
+| uploadFile 上传失败 | 超 100MB / 请求体格式 | 压缩到 ≤10MB、确认 multipart |
+| 提交成功但状态一直 1 | 平台算法排队/素材不合规 | 等至 30min;仍 1 则联系平台(附 packageItemId) |
+| 小程序 `web-view` 打不开 | 域名未加白名单 | 回 §1.2 加两域名 |
+
+---
+
+## 9. 联调顺序总图(一屏速览)
+
+```
+§1 解锁清单(商品/域名/密钥)
+  └─► §2.1 登录与签名(S1~S7)
+        └─► §2.2 套餐与检测人(S8~S12)
+              ├─► §3 照片路径(P1~P8)← 联调首日重点
+              │     └─► §5 前端验收(F1~F7)
+              ├─► §4 视频路径(V1~V7)
+              └─► §6 异常分支(E1~E8)
+                    └─► §7 收口与转生产(T1~T7)
+                      (故障随时回查 §8)
+```
+
+> **联调首日最小闭环**:§1(商品清单到手)→ §2.1(S1~S7 全绿)→ §2.2(S8~S12)→ §3 照片路径 P1~P8 → §5 F1~F5。
+> 满足即宣告测试环境照片链路跑通;视频路径与异常分支次日补。

+ 222 - 0
scripts/import_rmg365.py

@@ -0,0 +1,222 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+从 rmg365.cn 导入商品到 CFC 小程序商品列表(products 表)。
+
+特性:
+  - 幂等:以 products.external_source='rmg365' + external_id 判重,已存在则跳过
+  - 自托管图片:下载到 /data/cfc-uploads/<YYYY/MM/DD>/,nginx 经 /uploads/ 直接服务
+  - 富文本详情:把 detailImages 拼成 <img> HTML 存入 description(与存量商品一致)
+  - 溯源:external_source/external_id/external_data 保留源端信息
+
+用法:
+  python3 import_rmg365.py --dry-run   # 只预览计划与 SQL,不改动任何数据
+  python3 import_rmg365.py             # 下载图片并插入 products(status=on_shelf)
+
+回滚:
+  DELETE FROM products WHERE external_source='rmg365';
+"""
+import argparse
+import json
+import os
+import sys
+import urllib.request
+import uuid
+from datetime import datetime
+
+import pymysql
+
+API_BASE = "https://server.mrg365.shop/api/app"
+UPLOAD_ROOT = "/data/cfc-uploads"      # WebConfig: upload.base-dir
+URL_PREFIX = "/uploads"                # nginx alias /uploads/ -> /data/cfc-uploads/
+EXTERNAL_SOURCE = "rmg365"
+VENDOR_NAME = "平台官方"
+
+DB = dict(
+    host="mysql-internet-cn-north-1-23feae22680e4dfa.rds.jdcloud.com",
+    port=3306,
+    user="cfc",
+    password=os.environ.get("CFC_DB_PASSWORD", ""),
+    database="zxyj",
+    charset="utf8mb4",
+)
+
+ALLOWED_EXT = (".jpg", ".jpeg", ".png", ".webp", ".gif")
+
+
+def log(msg):
+    print(msg, flush=True)
+
+
+def http_get_json(url):
+    with urllib.request.urlopen(url, timeout=30) as r:
+        return json.loads(r.read())
+
+
+def fetch_all():
+    """拉取列表 + 逐个详情,返回 [{list, detail}, ...](保持源端顺序)。"""
+    listing = http_get_json(f"{API_BASE}/product/list")
+    if listing.get("code") != 0:
+        raise RuntimeError(f"product/list 返回异常: {listing.get('message')}")
+    items = listing.get("data") or []
+    log(f"[拉取] 列表共 {len(items)} 个商品")
+    result = []
+    for p in items:
+        pid = p["id"]
+        det = http_get_json(f"{API_BASE}/product/detail/{pid}")
+        d = det.get("data") or {}
+        result.append({"list": p, "detail": d})
+        log(f"[拉取] {pid} {p['name']} detailImages={len(d.get('detailImages') or [])}")
+    return result
+
+
+def ext_of(url):
+    path = url.split("?")[0]
+    ext = os.path.splitext(path)[1].lower()
+    return ext if ext in ALLOWED_EXT else ".jpg"
+
+
+def download_image(url, subdir):
+    """下载单张图片,返回 (绝对路径, 相对URL)。"""
+    dest_dir = os.path.join(UPLOAD_ROOT, subdir)
+    os.makedirs(dest_dir, exist_ok=True)
+    fname = f"{uuid.uuid4()}{ext_of(url)}"
+    dest_abs = os.path.join(dest_dir, fname)
+    with urllib.request.urlopen(url, timeout=60) as r:
+        data = r.read()
+    with open(dest_abs, "wb") as f:
+        f.write(data)
+    rel = f"{URL_PREFIX}/{subdir}/{fname}"
+    return dest_abs, rel
+
+
+def build_record(item, subdir, sort_order, dry_run):
+    p = item["list"]
+    d = item["detail"]
+
+    price = int(round(float(p["currentPrice"]) * 100))          # 元 -> 分
+    stock = int(p.get("stock") or 0)
+    gallery = list(dict.fromkeys([p["coverImg"]] + (p.get("images") or [])))  # 去重保序
+    details = list(dict.fromkeys(d.get("detailImages") or []))
+
+    if dry_run:
+        # 预览阶段不下载,仅生成占位相对路径用于展示
+        cover_rel = f"{URL_PREFIX}/{subdir}/<cover>{ext_of(p['coverImg'])}"
+        gallery_rels = [f"{URL_PREFIX}/{subdir}/<g{i}>{ext_of(u)}" for i, u in enumerate(gallery)]
+        detail_rels = [f"{URL_PREFIX}/{subdir}/<d{i}>{ext_of(u)}" for i, u in enumerate(details)]
+    else:
+        _, cover_rel = download_image(p["coverImg"], subdir)
+        gallery_rels = []
+        for i, u in enumerate(gallery):
+            if i == 0:
+                gallery_rels.append(cover_rel)  # 首图复用已下载封面
+            else:
+                _, r = download_image(u, subdir)
+                gallery_rels.append(r)
+        detail_rels = []
+        for u in details:
+            _, r = download_image(u, subdir)
+            detail_rels.append(r)
+        log(f"[图片] {p['name']}: 封面+gallery {len(gallery_rels)} 张,详情 {len(detail_rels)} 张")
+
+    if detail_rels:
+        description = "".join(
+            f'<p><img src="{r}" alt="" style="max-width:100%;"/></p>' for r in detail_rels
+        )
+    else:
+        description = None
+
+    external_data = json.dumps({"list": p, "detail": d}, ensure_ascii=False)
+
+    return {
+        "name": p["name"],
+        "description": description,
+        "intro": None,
+        "cover_image": cover_rel,
+        "images": json.dumps(gallery_rels, ensure_ascii=False),
+        "price": price,
+        "stock": stock,
+        "product_type": "physical",
+        "status": "on_shelf",
+        "delivery_method": 1,
+        "category_id": None,
+        "vendor_name": VENDOR_NAME,
+        "sort_order": sort_order,
+        "external_source": EXTERNAL_SOURCE,
+        "external_id": str(p["id"]),
+        "external_data": external_data,
+    }
+
+
+INSERT_SQL = """
+INSERT INTO products
+  (name, description, intro, cover_image, images, price, stock, product_type,
+   status, delivery_method, category_id, vendor_name, sort_order,
+   external_source, external_id, external_data, member_eligible, points_multiplier)
+VALUES
+  (%(name)s, %(description)s, %(intro)s, %(cover_image)s, %(images)s, %(price)s, %(stock)s,
+   %(product_type)s, %(status)s, %(delivery_method)s, %(category_id)s, %(vendor_name)s,
+   %(sort_order)s, %(external_source)s, %(external_id)s, %(external_data)s, 'none', 1.00)
+"""
+
+
+def main():
+    ap = argparse.ArgumentParser()
+    ap.add_argument("--dry-run", action="store_true", help="仅预览,不下载/不写库")
+    args = ap.parse_args()
+    dry = args.dry_run
+    subdir = datetime.now().strftime("%Y/%m/%d")
+
+    log(f"=== rmg365 -> CFC 商品导入 {'(DRY-RUN 预览)' if dry else '(正式执行)'} ===")
+    items = fetch_all()
+
+    conn = pymysql.connect(**DB)
+    try:
+        with conn.cursor() as cur:
+            cur.execute("SELECT COALESCE(MAX(sort_order),0) FROM products")
+            max_sort = int(cur.fetchone()[0] or 0)
+
+            created, skipped, failed = 0, 0, 0
+            seq = 0
+            for item in items:
+                ext_id = str(item["list"]["id"])
+                name = item["list"]["name"]
+                cur.execute(
+                    "SELECT id FROM products WHERE external_source=%s AND external_id=%s",
+                    (EXTERNAL_SOURCE, ext_id),
+                )
+                row = cur.fetchone()
+                if row:
+                    log(f"[跳过] 已存在 id={row[0]} external_id={ext_id} {name}")
+                    skipped += 1
+                    continue
+
+                seq += 1
+                rec = build_record(item, subdir, max_sort + seq, dry)
+                cur.execute(INSERT_SQL, rec)
+                new_id = None if dry else cur.lastrowid
+                log(f"[{'预览' if dry else '写入'}] id={new_id} sort={rec['sort_order']} "
+                    f"price={rec['price']} stock={rec['stock']} {name}")
+                log(f"        cover={rec['cover_image']}")
+                log(f"        images={rec['images']}")
+                log(f"        desc_len={len(rec['description'] or '')}")
+                created += 1
+
+            if dry:
+                conn.rollback()
+                log("--- DRY-RUN:已回滚,未写入任何数据 ---")
+            else:
+                conn.commit()
+                log("--- 已提交 ---")
+
+            log(f"=== 完成:新建 {created},跳过 {skipped},失败 {failed} ===")
+    finally:
+        conn.close()
+
+
+if __name__ == "__main__":
+    try:
+        main()
+    except Exception as e:
+        log(f"[错误] {type(e).__name__}: {e}")
+        sys.exit(1)