Просмотр исходного кода

test(R255): 定时闭环测试汇报 — 承采轮(窗口0提交,后端承采R250全量401类/3643例) + 四项目浏览器全绿(本机admin5/5+fe6/6+shop4/4+health13/13+dx2跳; 189首跑4/5(account-roles 502)→复跑5/5判瞬态) + ★G-250-1覆盖缺口闭环:6个家庭面板新增25条行为用例25/25绿 + ★B-255-1(P1新)langgraph tests/qna引用不存在的src.qna致收集期0例执行 + lg本机44例38过6红(全/chat上游500未降级=B-255-4) + 251通道改4096但无权威副本(B-255-3) + web125/10·fe663/4逐例零漂移(G13第56次) + 定向9类43例25过17红1跳(存量16+守卫1第33轮) + 线上API 3过4红17未执行(1x500+2x504) + 匿名3/8=200第30轮 + G14口径修正153/153 + 门禁不通过(有条件) + 新增真实缺陷0

E2E Test Bot 1 день назад
Родитель
Сommit
8ca02a1b96

+ 401 - 0
cfc-web/src/__tests__/FamilyPanels.spec.js

@@ -0,0 +1,401 @@
+/**
+ * G-250-1 覆盖缺口闭环:家庭工作台 6 个内嵌面板的行为断言
+ * ================================================================
+ * 背景:`ChildrenPanel / PointsPanel / WishesPanel / RewardsPanel / FamilyCouponPanel /
+ * FamilyEarningsPanel` 共 1,775 行,此前仅有 `FamilyWorkbench.spec.js` 一条「挂载 + familyId
+ * 透传」用例,CRUD / 分页 / 校验 / 空态 / 错误态 0 断言(假绿风险)。
+ *
+ * 本文件按「家庭级 tab 面板」的真实契约补行为用例,断言重点是:
+ *   1. familyId 锁定:面板必须把父组件注入的 familyId 传给后端(不得回退 localStorage);
+ *   2. 空态:接口返回空集时列表为空且不抛错;
+ *   3. 错误态:接口失败时给出用户可见提示,不产生未捕获异常;
+ *   4. 写操作:定价 / 发放 / 审批等动作携带正确参数,且成功后刷新列表;
+ *   5. 前置校验:非法输入必须在调用后端之前被拦住(不发请求)。
+ *
+ * 只读约定:全部走 jest.mock,不发真实请求、不写任何数据。
+ */
+import { shallowMount } from "@vue/test-utils"
+
+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"
+
+import {
+  getChildrenList,
+  adjustChildPoints,
+  updateChild,
+  getPointsLogs,
+  getWishesList,
+  getPendingWishes,
+  setWishPrice,
+  getRewardsList,
+  getRewardTemplates,
+  approveReward,
+  getFamilyEarningsList,
+  getFamilyEarningsDetail
+} from "@/api/admin"
+import {
+  getCouponList,
+  issueFamilyCoupon,
+  getFamilyCoupons,
+  getFamilyCouponUsage
+} from "@/api/coupon"
+
+jest.mock("@/api/admin")
+jest.mock("@/api/coupon")
+
+const flush = async (wrapper) => {
+  await wrapper.vm.$nextTick()
+  await Promise.resolve()
+  await wrapper.vm.$nextTick()
+}
+
+function mountPanel(Comp, propsData) {
+  const $message = { error: jest.fn(), success: jest.fn(), warning: jest.fn() }
+  const wrapper = shallowMount(Comp, {
+    propsData: propsData || { familyId: 5 },
+    mocks: {
+      $message,
+      $confirm: jest.fn(() => Promise.resolve()),
+      $route: { params: { id: "5" } },
+      $router: { push: jest.fn() }
+    }
+  })
+  return { wrapper, $message }
+}
+
+beforeEach(() => {
+  jest.clearAllMocks()
+})
+
+describe("ChildrenPanel(家庭工作台 · 孩子 tab)", () => {
+  it("挂载即按锁定 familyId + 默认分页拉取,records 落入表格", async () => {
+    getChildrenList.mockResolvedValue({ data: { records: [{ id: 1, nickname: "小明" }], total: 1 } })
+    const { wrapper } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    expect(getChildrenList).toHaveBeenCalledTimes(1)
+    expect(getChildrenList.mock.calls[0][0]).toEqual({ page: 1, size: 10, nickname: "", familyId: 5 })
+    expect(wrapper.vm.tableData).toHaveLength(1)
+    expect(wrapper.vm.pagination.total).toBe(1)
+    wrapper.destroy()
+  })
+
+  it("空集不报错且 total 归零(空态)", async () => {
+    getChildrenList.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper, $message } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    expect(wrapper.vm.tableData).toEqual([])
+    expect(wrapper.vm.pagination.total).toBe(0)
+    expect($message.error).not.toHaveBeenCalled()
+    wrapper.destroy()
+  })
+
+  it("接口失败给出可见错误且 loading 归位(错误态)", async () => {
+    getChildrenList.mockRejectedValue(new Error("后端 500"))
+    const { wrapper, $message } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    expect($message.error).toHaveBeenCalledWith("后端 500")
+    expect(wrapper.vm.loading).toBe(false)
+    wrapper.destroy()
+  })
+
+  it("切换每页条数重置到第 1 页", async () => {
+    getChildrenList.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    wrapper.vm.pagination.current = 3
+    wrapper.vm.handleSizeChange(20)
+    await flush(wrapper)
+    const last = getChildrenList.mock.calls[getChildrenList.mock.calls.length - 1][0]
+    expect(last.page).toBe(1)
+    expect(last.size).toBe(20)
+    expect(last.familyId).toBe(5)
+    wrapper.destroy()
+  })
+
+  it("调整积分携带孩子 id 与表单值并在成功后刷新", async () => {
+    getChildrenList.mockResolvedValue({ data: { records: [], total: 0 } })
+    adjustChildPoints.mockResolvedValue({ data: true })
+    const { wrapper, $message } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    wrapper.vm.$refs.pointsForm = { validate: (cb) => cb(true) }
+    wrapper.vm.currentChild = { id: 9 }
+    wrapper.vm.pointsForm = { amount: 5, reason: "表现好" }
+    await wrapper.vm.submitPoints()
+    await flush(wrapper)
+    expect(adjustChildPoints).toHaveBeenCalledWith(9, { amount: 5, reason: "表现好" })
+    expect($message.success).toHaveBeenCalled()
+    expect(getChildrenList).toHaveBeenCalledTimes(2)
+    wrapper.destroy()
+  })
+
+  it("编辑资料携带 id 并调用 updateChild", async () => {
+    getChildrenList.mockResolvedValue({ data: { records: [], total: 0 } })
+    updateChild.mockResolvedValue({ data: true })
+    const { wrapper } = mountPanel(ChildrenPanel)
+    await flush(wrapper)
+    wrapper.vm.$refs.editForm = { validate: (cb) => cb(true) }
+    wrapper.vm.editForm = { id: 3, nickname: "小红", age: 8, penaltyEnabled: 1 }
+    await wrapper.vm.submitEdit()
+    await flush(wrapper)
+    expect(updateChild).toHaveBeenCalledWith(3, { id: 3, nickname: "小红", age: 8, penaltyEnabled: 1 })
+    wrapper.destroy()
+  })
+})
+
+describe("PointsPanel(家庭工作台 · 积分 tab)", () => {
+  it("挂载按 familyId 拉取积分流水并回填 total", async () => {
+    getPointsLogs.mockResolvedValue({ data: { records: [{ id: 1 }], total: 42 } })
+    const { wrapper } = mountPanel(PointsPanel)
+    await flush(wrapper)
+    expect(getPointsLogs.mock.calls[0][0]).toEqual({ page: 1, size: 10, familyId: 5 })
+    expect(wrapper.vm.list).toHaveLength(1)
+    expect(wrapper.vm.total).toBe(42)
+    wrapper.destroy()
+  })
+
+  it("流水类型映射:已知类型出中文,未知类型回显原值,空出占位", () => {
+    getPointsLogs.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(PointsPanel)
+    expect(wrapper.vm.typeLabel("task")).toBe("任务奖励")
+    expect(wrapper.vm.typeLabel("exchange")).toBe("兑换扣除")
+    expect(wrapper.vm.typeLabel("unknown-type")).toBe("unknown-type")
+    expect(wrapper.vm.typeLabel("")).toBe("—")
+    wrapper.destroy()
+  })
+
+  it("孩子关键字非数字时不提交 memberId(前置校验,避免把 NaN 发给后端)", async () => {
+    getPointsLogs.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(PointsPanel)
+    await flush(wrapper)
+    wrapper.vm.filter.childKeyword = "abc"
+    wrapper.vm.handleSearch()
+    await flush(wrapper)
+    let params = getPointsLogs.mock.calls[getPointsLogs.mock.calls.length - 1][0]
+    expect(params.memberId).toBeUndefined()
+    wrapper.vm.filter.childKeyword = "12"
+    wrapper.vm.handleSearch()
+    await flush(wrapper)
+    params = getPointsLogs.mock.calls[getPointsLogs.mock.calls.length - 1][0]
+    expect(params.memberId).toBe(12)
+    wrapper.destroy()
+  })
+
+  it("查看详情打开抽屉并锁定当前行", async () => {
+    getPointsLogs.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(PointsPanel)
+    await flush(wrapper)
+    wrapper.vm.handleDetail({ id: 77, description: "任务奖励" })
+    expect(wrapper.vm.detailVisible).toBe(true)
+    expect(wrapper.vm.currentRow.id).toBe(77)
+    wrapper.destroy()
+  })
+})
+
+describe("WishesPanel(家庭工作台 · 心愿 tab)", () => {
+  it("挂载用锁定 familyId 拉待处理心愿,并按状态分组计数", async () => {
+    getPendingWishes.mockResolvedValue({
+      data: [
+        { id: 1, status: "draft" },
+        { id: 2, status: "draft" },
+        { id: 3, status: "pending_exchange" },
+        { id: 4, status: "approved" },
+        { id: 5, status: "exchanging" }
+      ]
+    })
+    const { wrapper } = mountPanel(WishesPanel)
+    await flush(wrapper)
+    expect(getPendingWishes).toHaveBeenCalledWith(5)
+    expect(wrapper.vm.draftCount).toBe(2)
+    expect(wrapper.vm.pendingCount).toBe(1)
+    expect(wrapper.vm.approvedCount).toBe(1)
+    expect(wrapper.vm.exchangingCount).toBe(1)
+    wrapper.destroy()
+  })
+
+  it("familyId 缺失时不发请求(面板必须由父组件锁定家庭)", async () => {
+    const { wrapper } = mountPanel(WishesPanel, { familyId: null })
+    await flush(wrapper)
+    expect(getPendingWishes).not.toHaveBeenCalled()
+    wrapper.destroy()
+  })
+
+  it("定价非法积分被前置拦截,合法积分携带 id + 数值", async () => {
+    getPendingWishes.mockResolvedValue({ data: [] })
+    const { wrapper, $message } = mountPanel(WishesPanel)
+    await flush(wrapper)
+    wrapper.vm.currentWish = { id: 20, title: "乐高" }
+    wrapper.vm.priceValue = 0
+    await wrapper.vm.submitPrice()
+    expect($message.warning).toHaveBeenCalled()
+    expect(setWishPrice).not.toHaveBeenCalled()
+
+    setWishPrice.mockResolvedValue({ data: true })
+    wrapper.vm.priceValue = 260
+    await wrapper.vm.submitPrice()
+    await flush(wrapper)
+    expect(setWishPrice).toHaveBeenCalledWith(20, 260)
+    wrapper.destroy()
+  })
+
+  it("打开定价弹窗时回填已有积分,缺省 100", async () => {
+    getPendingWishes.mockResolvedValue({ data: [] })
+    const { wrapper } = mountPanel(WishesPanel)
+    await flush(wrapper)
+    wrapper.vm.handleActionCmd({ id: 1, pointsRequired: 320 }, "price")
+    expect(wrapper.vm.priceValue).toBe(320)
+    expect(wrapper.vm.priceDialogVisible).toBe(true)
+    wrapper.vm.handleActionCmd({ id: 2 }, "price")
+    expect(wrapper.vm.priceValue).toBe(100)
+    wrapper.destroy()
+  })
+
+  it("切到「全部」tab 才加载全量列表,且带 familyId", async () => {
+    getPendingWishes.mockResolvedValue({ data: [] })
+    getWishesList.mockResolvedValue({ data: { records: [{ id: 1 }], total: 1 } })
+    const { wrapper } = mountPanel(WishesPanel)
+    await flush(wrapper)
+    expect(getWishesList).not.toHaveBeenCalled()
+    wrapper.vm.handleTabClick({ name: "all" })
+    await flush(wrapper)
+    expect(getWishesList.mock.calls[0][0].familyId).toBe(5)
+    expect(wrapper.vm.tableData).toHaveLength(1)
+    wrapper.destroy()
+  })
+})
+
+describe("RewardsPanel(家庭工作台 · 奖励 tab)", () => {
+  it("挂载按 familyId 拉奖励列表", async () => {
+    getRewardsList.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(RewardsPanel)
+    await flush(wrapper)
+    expect(getRewardsList.mock.calls[0][0]).toEqual({ page: 1, size: 10, status: "", familyId: 5 })
+    wrapper.destroy()
+  })
+
+  it("模板 tab 惰性加载且只加载一次", async () => {
+    getRewardsList.mockResolvedValue({ data: { records: [], total: 0 } })
+    getRewardTemplates.mockResolvedValue({ data: [{ id: 1, title: "模板A" }] })
+    const { wrapper } = mountPanel(RewardsPanel)
+    await flush(wrapper)
+    wrapper.vm.handleTabClick({ name: "templates" })
+    await flush(wrapper)
+    expect(getRewardTemplates).toHaveBeenCalledTimes(1)
+    expect(wrapper.vm.templates).toHaveLength(1)
+    wrapper.vm.handleTabClick({ name: "templates" })
+    await flush(wrapper)
+    expect(getRewardTemplates).toHaveBeenCalledTimes(1)
+    wrapper.destroy()
+  })
+
+  it("审批通过携带 {approved:true} 并在成功后刷新", async () => {
+    getRewardsList.mockResolvedValue({ data: { records: [], total: 0 } })
+    approveReward.mockResolvedValue({ data: true })
+    const { wrapper, $message } = mountPanel(RewardsPanel)
+    await flush(wrapper)
+    await wrapper.vm.handleApprove({ id: 8, title: "兑换乐高" }, true)
+    await flush(wrapper)
+    expect(approveReward).toHaveBeenCalledWith(8, { approved: true })
+    expect($message.success).toHaveBeenCalled()
+    expect(getRewardsList).toHaveBeenCalledTimes(2)
+    wrapper.destroy()
+  })
+})
+
+describe("FamilyCouponPanel(家庭工作台 · 优惠券 tab)", () => {
+  it("挂载同时拉券池与家庭券,familyId 锁定", async () => {
+    getCouponList.mockResolvedValue({ data: { records: [{ id: 1 }] } })
+    getFamilyCoupons.mockResolvedValue({ data: { records: [{ id: 9 }], total: 1 } })
+    const { wrapper } = mountPanel(FamilyCouponPanel)
+    await flush(wrapper)
+    expect(getCouponList).toHaveBeenCalled()
+    expect(getFamilyCoupons.mock.calls[0][0]).toEqual({
+      familyId: 5,
+      status: undefined,
+      page: 1,
+      size: 20
+    })
+    expect(wrapper.vm.listData).toHaveLength(1)
+    wrapper.destroy()
+  })
+
+  it("familyId 缺失时家庭券接口不被调用(防越权跨家庭)", async () => {
+    getCouponList.mockResolvedValue({ data: { records: [] } })
+    const { wrapper } = mountPanel(FamilyCouponPanel, { familyId: null })
+    await flush(wrapper)
+    expect(getFamilyCoupons).not.toHaveBeenCalled()
+    expect(getFamilyCouponUsage).not.toHaveBeenCalled()
+    wrapper.destroy()
+  })
+
+  it("未选券时发放被前置拦截;选定后参数完整", async () => {
+    getCouponList.mockResolvedValue({ data: { records: [] } })
+    getFamilyCoupons.mockResolvedValue({ data: { records: [], total: 0 } })
+    issueFamilyCoupon.mockResolvedValue({ data: true })
+    const { wrapper, $message } = mountPanel(FamilyCouponPanel)
+    await flush(wrapper)
+    await wrapper.vm.confirmIssue()
+    expect($message.warning).toHaveBeenCalled()
+    expect(issueFamilyCoupon).not.toHaveBeenCalled()
+
+    wrapper.vm.issueForm = { couponId: 7, quantity: 2 }
+    await wrapper.vm.confirmIssue()
+    await flush(wrapper)
+    expect(issueFamilyCoupon).toHaveBeenCalledWith({ familyId: 5, couponId: 7, quantity: 2 })
+    expect(wrapper.vm.issueForm.couponId).toBe(null)
+    expect(wrapper.vm.issueForm.quantity).toBe(1)
+    wrapper.destroy()
+  })
+
+  it("券面文案按类型区分折扣券与满减券", () => {
+    getCouponList.mockResolvedValue({ data: { records: [] } })
+    getFamilyCoupons.mockResolvedValue({ data: { records: [], total: 0 } })
+    const { wrapper } = mountPanel(FamilyCouponPanel)
+    expect(wrapper.vm.couponLabel({ type: "DISCOUNT", name: "8.5折券", discountRate: 850 })).toBe(
+      "8.5折券(8.5折)"
+    )
+    expect(wrapper.vm.couponLabel({ type: "CASH", name: "满减券", value: 1500 })).toBe(
+      "满减券(15.00元)"
+    )
+    wrapper.destroy()
+  })
+})
+
+describe("FamilyEarningsPanel(家庭工作台 · 收益 tab)", () => {
+  it("挂载按 familyId 拉收益列表", async () => {
+    getFamilyEarningsList.mockResolvedValue({ data: [{ id: 1, amount: 100 }] })
+    const { wrapper } = mountPanel(FamilyEarningsPanel)
+    await flush(wrapper)
+    expect(getFamilyEarningsList.mock.calls[0][0]).toEqual({ familyId: 5 })
+    expect(wrapper.vm.list).toHaveLength(1)
+    wrapper.destroy()
+  })
+
+  it("分转元:正常值两位小数,空值与非法值归零", () => {
+    getFamilyEarningsList.mockResolvedValue({ data: [] })
+    const { wrapper } = mountPanel(FamilyEarningsPanel)
+    expect(wrapper.vm.fenToYuan(1234)).toBe("12.34")
+    expect(wrapper.vm.fenToYuan(0)).toBe("0.00")
+    expect(wrapper.vm.fenToYuan(null)).toBe("0.00")
+    expect(wrapper.vm.fenToYuan(undefined)).toBe("0.00")
+    expect(wrapper.vm.fenToYuan("abc")).toBe("0.00")
+    wrapper.destroy()
+  })
+
+  it("详情接口失败时回退到行数据且提示错误(降级不白屏)", async () => {
+    getFamilyEarningsList.mockResolvedValue({ data: [] })
+    getFamilyEarningsDetail.mockRejectedValue(new Error("boom"))
+    const { wrapper, $message } = mountPanel(FamilyEarningsPanel)
+    await flush(wrapper)
+    await wrapper.vm.showDetail({ id: 3, familyId: 5, amount: 999 })
+    await flush(wrapper)
+    expect(getFamilyEarningsDetail).toHaveBeenCalledWith(5)
+    expect(wrapper.vm.detail.id).toBe(3)
+    expect($message.error).toHaveBeenCalledWith("加载详情失败")
+    expect(wrapper.vm.detailLoading).toBe(false)
+    wrapper.destroy()
+  })
+})

+ 234 - 0
docs/tdd/orchestration/report-test-2026-11-17-R255.md

@@ -0,0 +1,234 @@
+# 测试负责人工作汇报 R255(2026-11-17 06:47~07:4x GMT+8 · 定时闭环轮 · 承采 + 覆盖缺口闭环轮)
+
+> 汇报人:cfc-tester(软件测试专家团 · 测试负责人 陆谨)|角色档位:review 档 + 内网浏览器 E2E + 251 langgraph 派发 + 本机 Jest/后端/线上 API 实测|全程静默无提问
+> 基线:`2655ac578`(= R254 提交本身)|工作分支:`cfclub`|窗口:启动 0 提交,测试全程 0 新提交
+
+## 分支纪律(先于一切 · 全通过)
+
+| 校验项 | 结果 |
+|---|---|
+| 启动 `rev-parse --abbrev-ref HEAD` | `cfclub` ✅ |
+| fetch 后 `rev-list --left-right --count HEAD...origin/cfclub` | `0 0` ✅ |
+| 起始 sha | `2655ac5781b31d7ca982b83e9ff1901e23795248` |
+| 收尾复核分支 / 同步 | `cfclub` / `0 0`(见附录 C) |
+| 工作区未跟踪历史 WIP | 40+ 项,未覆盖 / 未提交 / 未丢弃 ✅ |
+| 生产源码改动 | **0**(新增 1 个前端测试文件 + 测试文档/台账) |
+
+## 一、窗口判定与承采口径
+
+- 基线 `2655ac578` 即 R254 测试汇报提交,启动与收尾两次 fetch 窗口均为 **0 提交** → 无 src / 需求文档 / SRS / 场景 / 用例文档变更 → **G12 合规,零新增 / 零同步用例**。
+- 因窗口零 src 变更,后端全量(401 类 / 3,643 例 / 91.87%)**承采 R250/R252 权威结果**,本轮改为「定向取证 + 覆盖缺口补测」:定向复跑守卫与存量 8 类(G13 零漂移)、补写 6 个面板行为用例(G-250-1 闭环)、实跑四项目浏览器 E2E、双端 Jest、251 langgraph、线上 API 轻量复现、匿名鉴权探针。
+
+### 1.2 本轮执行汇总(除标注外均为独立实测)
+
+| 套件 | 结果 | 对比 R254 |
+|---|---|---|
+| 本机 admin-desktop E2E | **5/5**(1.3m,EXIT=0) | 零漂移 |
+| 本机 frontend-mobile E2E | **6/6**(45.1s,EXIT=0) | 零漂移 |
+| 本机 shop-api E2E | **4/4**(3.7s,EXIT=0) | 零漂移 |
+| 本机 health E2E(`health-contract`) | **13/13**(4.8s,EXIT=0) | 零漂移 |
+| 本机 dx-bridge E2E | **2 跳**(首跑 1 例 20s 超时 → 复跑 2 跳,判瞬态) | 零漂移 |
+| 189 节点 admin-desktop E2E | **5/5**(首跑 4/5,TC-A-U05 `account-roles` 502 → 复跑 5/5) | 瞬态,见 §1.4 |
+| cfc-web Jest | **125 过 / 10 红 / 135**(3 套红) | 逐例零漂移(G13 第 56 次) |
+| **cfc-web 新增面板用例** | **25/25 全绿**(`FamilyPanels.spec.js`) | **本轮新增(G-250-1 闭环)** |
+| cfc-frontend Jest | **663 过 / 4 红 / 12 跳 / 679** | 逐例零漂移 |
+| 后端 `mvn -o test-compile` | **EXIT=0**(528 测试源) | 零漂移 |
+| 定向复跑(守卫 1 + 存量 8 类) | **43 例 / 25 过 / 17 红 / 1 跳**,逐例与历史一致 | **G13 零漂移第 56 次** |
+| 线上 API 3 文件(badge/coach-food/wish) | **3 过 / 4 红 / 17 未执行**(2.6m) | 逐例零漂移(1×500 + 2×504 + 1 前置) |
+| 匿名鉴权探针(8 端点) | **3 端点 200** + 对照 3 全 401 | 第 30 轮(B-227-1) |
+| langgraph pytest | **38 过 / 6 红 / 44**(156.29s,`--ignore=tests/qna`) | 251 未能执行,见 §1.5 |
+
+### 1.3 覆盖台账(HEAD 口径实扫)
+
+- 后端:控制器 **376**|`@*Mapping` 路由 **1,534**|测试源 **528**|`@Test` **4,529**
+- 文档侧:specs **206** 份(SC-id **153**)|`tests/test-cases` **28** 份(TC-id 1,110 / 表格行 1,561)|user-scenarios **11**|Playwright spec **80**
+- **本轮新增用例 25 条**(`cfc-web/src/__tests__/FamilyPanels.spec.js`,1 文件),累计前端单测 **135 → 160**(cfc-web)。
+
+### 1.4 189 节点取证说明
+
+- 189 节点 `80/9082` 仍 **CLOSED**(第 19 轮),无法直连,E2E 经 **`189:4090` opencode 通道**执行(Basic 认证可用)。
+- 首跑 **4 过 / 1 红**:`TC-A-U05 后台核心菜单可访问` 失败,错误 `account-roles 接口返回502`(登录后身份带出的前置条件不满足)。
+- **复跑定性**(同一命令、仅换输出目录)→ **5/5 通过,72s**。同刻本机同一 spec 亦 5/5 → 判**瞬态 502**,非产品回归。节点 HEAD `d7a51ecb3`、DIRTY=171(B-221-4 第 77 轮,按纪律未强同步)。
+
+### 1.5 langgraph 派发说明(重要)
+
+- **251 通道变更**:历史 `251:4090`(opencode)已 **CLOSED**,本轮探明改挂 **`251:4096`**(同为 opencode,`/api/model` 200、`/api/session` + `/api/session/{id}/prompt` 可用);`251:9000`(langgraph 服务)与 `251:9082` 均 CLOSED。
+- **派发结果**:agent 遍历 `/home/iwt`、`/opt`、`/root` 与 `find / -name test_intent.py`,**未发现权威 `cfc-langgraph` 仓库副本**,仅命中 `/tmp/opencode/*/cfc-langgraph` 临时 worktree → **B-255-3(P2)**,251 本轮未能执行 lg 测试。
+- **本机兜底(同源 HEAD `2655ac578`)**:`pytest tests -q` 在**收集期即中断**——`tests/qna/test_graph.py` 导入不存在的 `src.qna`(`git ls-files` 确认 `src/qna` 未入库)→ **0 例执行**,见 **B-255-1(P1,本轮新发现)**。
+- 加 `--ignore=tests/qna` 后:**44 例 / 38 过 / 6 红 / 0 跳 / 156.29s**。6 红 = `test_auto_tag` ×5(`AssertionError`)+ `test_chat_endpoint`(`assert 500 == 200`),全部收敛到 `call_chat` 上游返回 **Internal Server Error 500**(非 429 配额)→ 与 B-142-2 同族(上游供应商),另立 **B-255-4(P2)**:`/chat` 上游失败直接 500,未做降级/兜底响应。
+- 结论:**G7 不计通过**(251 未实测 + 本机 38/44 + 收集期缺陷),并在 `record` 中以未实测项标注。
+
+## 二、关键判据(本轮方法论)
+
+- **零漂移判据 G13**:web 10 红(3 套)/ fe 4 红 + 12 跳 / 定向 17 红(存量 16 + 守卫 1)/ 匿名 3×200 / 浏览器四项目,逐例集合异或 = 空集 → 第 56 次确认。
+- **瞬态红必须「改一个变量再跑一次」**:dx-bridge TC-DX-U01 首跑 20s 超时(同一端点 curl 0.37s 返回 404)→ 复跑 2 跳,判网关瞬态;189 TC-A-U05 `account-roles` 502 → 复跑定性(见 §1.4)。
+- **「跑绿」不等于「跑了」**:langgraph 本机 `pytest tests` 在收集阶段即被 `tests/qna/test_graph.py` 阻断(`ModuleNotFoundError: src.qna`),退出码非 0 且 **0 例执行**——若只看「有输出」会误判为已测。见 B-255-1。
+
+## 三、20 类测试覆盖矩阵
+
+| # | 测试类型 | 三态 | 证据 |
+|---|---|---|---|
+| 1 | 单元测试 | 已发现 | cfc-web 160(125 过 + 10 红 + 新 25 过)/ cfc-frontend 679 / 后端 4,529 `@Test`(承采 401 类 3,643 例) |
+| 2 | 测试覆盖率 | 待核实 | 无覆盖率采集授权(execute 档),承采历史 27.4% |
+| 3 | 变异测试 | 未发现 | 仓库无变异测试资产 |
+| 4 | 集成测试 | 已发现 | 定向 SpringBootTest(Energy/Guide/Orchestration 等 8 类 43 例) |
+| 5 | 契约测试 | 已发现 | health-contract 13 全绿 / shop 排序契约 4 全绿 / 线上 API 契约 24 例 |
+| 6 | 接口 API 测试 | 已发现 | 线上 API 3 文件 + 匿名探针 8 端点 |
+| 7 | 系统 / 端到端 | 已发现 | Playwright:admin 5 / fe 6 / shop 4 / health 13 / dx 2 跳;189 节点见 §1.4 |
+| 8 | 验收 UAT | 待核实 | 无独立 UAT 签署资产 |
+| 9 | BDD 规格 | 已发现 | Gherkin/场景文件 11 + specs SC-id 153(本轮实测链接 153/153) |
+| 10 | 冒烟测试 | 已发现 | ci-smoke / `_smoke_browser` |
+| 11 | 回归测试 | 已发现 | 定向 43 例逐例零漂移(G13 第 56 次) |
+| 12 | 探索性测试 | 部分发现 | 本轮新增 langgraph 收集期阻断排查(B-255-1)属探索性发现 |
+| 13 | 性能测试 | 未发现 | execute 档,未授权 |
+| 14 | 可靠性测试 | 未发现 | execute 档,未授权 |
+| 15 | 安全测试(SAST/DAST/SCA) | 部分发现 | 匿名探针 8 端点(DAST 轻量);完整 SAST/SCA 未授权 |
+| 16 | 兼容性测试 | 已发现 | admin-desktop(1440×900)+ frontend-mobile(375×812,isMobile)双视口 |
+| 17 | 可用性测试 | 待核实 | 无人工可用性评估资产 |
+| 18 | 无障碍测试 | 未发现 | 仓库无 axe / a11y 资产 |
+| 19 | 质量指标 / QA 流程 | 已发现 | 覆盖台账 + 门禁矩阵 + 阻塞台账 |
+| 20 | 全项目代码审查 | 部分发现 | Bean 命名冲突守卫扫描;全量 review 非本轮范围 |
+
+## 四、SRS / 场景覆盖(G12 / G14)
+
+- **G12 ✅**:窗口 0 提交 → SRS / 场景 / 用例文档零变更,测试用例无需更新。
+- **G14 ⚠️→✅(口径修正)**:本轮改用「SC-id 全域扫描」(specs 定义 153 个 SC,`tests/` 全域引用交集)→ **153/153 = 100%**;历史 59.9% 是「只用 test-cases 台账『所属场景』列」的口径产物,属度量偏差而非覆盖缺失。**保留双口径**:ID 级 100%,台账列级 59.9%(手工维护滞后)。方法论:口径必须写在报告里,否则「59.9%」会被误读为测试缺失。
+
+## 五、覆盖缺口清单
+
+| 编号 | 缺口 | 现状 | 本轮处置 | 优先级 | 闭环方式 |
+|---|---|---|---|---|---|
+| G-250-1 | 6 个家庭工作台面板行为零断言(1,775 行) | 仅 1 条「挂载 + familyId 透传」 | **✅ 本轮闭环**:新增 `FamilyPanels.spec.js` 25 例(familyId 锁定 / 空态 / 错误态 / 分页 / 写操作参数 / 前置校验 / 金额换算 / 降级回退) | P2 | 已复跑 25/25 绿 |
+| **B-255-1(新)** | langgraph 测试收集期被单个坏模块阻断 | `tests/qna/test_graph.py` 引用不存在的 `src.qna` → `pytest tests` **0 例执行**(exit≠0) | 记录 + 给修法(见问题清单 #1) | **P1** | 删/跳过该模块或补 `src/qna`,CI 断言 collected>0 |
+| B-250-3 | 线上 API serial 链上游失败连带 | 24 例中 17 例 `did not run` | 承袭,未改善 | P2 | 拆分 serial、给前置依赖独立探针 |
+| G-250-2 | `ParseMonitorContractTest` 全存在性断言 | 无行为断言 | 承袭 | P2 | 补命中率/排序/重试行为断言 |
+| B-224-4 | 后端测试无 `src/test/resources`,直连 251:3306 造数 | 全量 51~67 分钟 | 承袭 | P1 | 增 `application-test.yml` + 内存库/独立 schema |
+
+## 六、域结论表
+
+| 审查维度 | 负责专家 | 结论 | 关键证据 |
+|---|---|---|---|
+| 单元·组件级 | 苏雅 | 通过(本机可执行域) | cfc-web 125 过 / 新 25 例全绿;fe 663 过;10+4 红为预期契约 RED,逐例零漂移 |
+| 集成·接口级 | 柯砚 | 有条件通过 | 定向 8 类 43 例逐例一致;线上 API 4 红(1×500 + 2×504)承袭 B-238-1/B-254-1;17 例未执行 |
+| 系统·验收级 | 白樾 | 通过(单节点) | admin 5/5 + fe 6/6 + shop 4/4 + health 13/13;189 见 §1.4;dx 2 跳(端点未部署) |
+| 测试保障级 | 闻朔 | 有条件通过 | 冒烟/回归可用;**B-255-1 收集期 0 例执行**属保障盲区 |
+| 性能·可靠性 | 骆骋 | 未实测(execute 档未授权) | 仅记录全量耗时劣化 B-250-2 |
+| 安全 | 关屿 | 不通过 | 匿名 3 端点 200(B-227-1 第 30 轮) |
+| 兼容·体验 | 阮清 | 通过(双视口) | desktop 1440×900 / mobile 375×812 isMobile |
+| 流程·度量·代码 | 何序 | 有条件通过 | 新增 25 用例;G11 CI 清单双向失真未闭环 |
+
+## 七、五要素问题清单
+
+### #1 B-255-1(P1 · 新)langgraph 测试模块 `tests/qna/test_graph.py` 收集期阻断全量
+
+1. **问题描述**:在干净环境执行 `pytest tests`,收集阶段即报 `ModuleNotFoundError: No module named 'src.qna'`,pytest 以 `Interrupted: 1 error during collection` 终止,**0 例被执行**;`cfc-langgraph/tests/qna/test_graph.py` 已在 git 入库,而 `cfc-langgraph/src/qna` 不存在(`git ls-files` 无任何 `src/qna` 文件)。
+2. **测试 bug 点**:`cfc-langgraph/tests/qna/test_graph.py`(模块级 `from src.qna...` 导入)+ 缺失的 `cfc-langgraph/src/qna/`。
+3. **最优修改方案**:二选一——(a) 若 `qna` 已下线:`git rm cfc-langgraph/tests/qna/test_graph.py`(并清理 `tests/qna/`),(b) 若 `qna` 待实现:改 `pytest.importorskip("src.qna")` 或 `pytestmark = pytest.mark.skip`;同时在 CI 增加 `pytest --co -q | tail -1` 断言 `collected >= 40`。
+4. **修改目的**:消除「测试套件跑 0 例却被当作已执行」的假绿风险,恢复 G7 分子/分母可信度。
+5. **修改后能否闭环**:能。复测方式:`pytest tests -q` 期望 `collected ≥ 48` 且无 collection error;CI 断言 collected>0。通过标准:收集期 0 error + 例数与台账一致。
+
+### #2 G-250-1(P2 · 本轮已闭环)6 个面板行为零断言
+
+1. **问题描述**:`ChildrenPanel/PointsPanel/WishesPanel/RewardsPanel/FamilyCouponPanel/FamilyEarningsPanel` 共 1,775 行,仅有 1 条挂载用例,CRUD/分页/校验/空态/错误态 0 断言 → 面板回归无法被发现。
+2. **测试 bug 点**:`cfc-web/src/__tests__/FamilyWorkbench.spec.js`(仅「挂载 + familyId 透传」1 条)。
+3. **最优修改方案**:新增 `cfc-web/src/__tests__/FamilyPanels.spec.js`(**本轮已落地 25 例**),按面板逐项覆盖:familyId 锁定、空集、接口失败提示、分页重置、写操作参数、前置校验(不发请求)、金额换算、详情降级。
+4. **修改目的**:把「面板能不能用」从「能挂载」提升到「行为符合契约」,尤其 familyId 锁定防跨家庭越权。
+5. **修改后能否闭环**:能。复测:`cd cfc-web && npx jest src/__tests__/FamilyPanels.spec.js` → **25/25 通过**(本轮实测 8.3s);后续随面板改动同步维护。
+
+### #3 B-227-1(P0 · 第 30 轮)匿名可访问 3 个私有接口
+
+1. **问题描述**:无 `Authorization` 时 `POST /api/notification/list` 返回 `{"code":200,"data":[]}`、`/api/notification/read` 返回 `data:true`(假成功)、`/api/search/global` 返回空桶 200;对照 `/api/family/member/list`、`/api/growth/record/list`、`/api/user/info` 均 401。
+2. **测试 bug 点**:`JwtInterceptor.java:226-243`(白名单外匿名放行落 `userId=-1`)+ `UserNotificationController.java:34/65` 以 -1 查询/更新。
+3. **最优修改方案**:`JwtInterceptor` 由「白名单必登录」翻转为「**默认必登录 + 显式 PUBLIC_PATHS**」;`/api/admin/**` 前缀强制拦截;`memberId/familyId/reportId` 增归属校验。
+4. **修改目的**:堵住匿名读写私有数据的越权面(notification 已能读到空集/写假成功,属可利用入口)。
+5. **修改后能否闭环**:能。复测:同一 8 端点匿名探针期望 **0 个 200**(对照 401);回归 `health-contract 13/13` 与 `shop-api 4/4` 不得转红。
+
+### #4 B-238-1(P0 · 第 17 轮)线上 HTTP 500 + B-254-1 网关 504
+
+1. **问题描述**:线上 API 轻量复现 24 例 = 3 过 / 4 红 / 17 未执行;红签名 1×`Received: 500` + 2×`Received: 504` + 1 例 3ms 前置失败(勋章 C-09)。
+2. **测试 bug 点**:`e2e/api/coach-food-sc-b07.spec.js:18`(索引读取 500)、`:38`(越权检查 500)、`wish-flow-sc-p13-p14-c04.spec.js:58`(504)、`badge-sc-c09-c10-a05.spec.js:29`(前置 504 级联)。
+3. **最优修改方案**:研发侧修 500(coach-food 索引/越权分支);运维侧查 251 网关 504(超时阈值/上游重启);测试侧把 serial 链拆为非串行 + 前置依赖加独立探针(解 B-250-3)。
+4. **修改目的**:让 API 契约层的红全部归因到确定缺陷,而不是「未执行」掩盖。
+5. **修改后能否闭环**:能。复测:同 3 文件期望 24/24 执行且 0 个 5xx;通过标准:无 500/504 且 `did not run = 0`。
+
+### #5 B-218-1(P0 · 第 33 轮)`ResourceBeanNameCollisionGuardTest` 持续 1/1 红
+
+1. **问题描述**:守卫类定向实跑 1 例 1 红,提示存在 `@Resource` 字段名与不兼容类型默认 Bean 名撞名(`CoachRecommendService` 一线)。
+2. **测试 bug 点**:`cfc-backend/src/test/java/com/etotem/cfc/unit/ResourceBeanNameCollisionGuardTest.java`(命中项由被测源码决定,非测试缺陷)。
+3. **最优修改方案**:按守卫输出的类/字段给 `@Resource(name = "...")` 显式命名,或重命名字段避开默认 Bean 名;修完跑守卫复绿。
+4. **修改目的**:避免 `BeanNotOfRequiredTypeException` 导致整条 `@SpringBootTest` 上下文启动失败(历史已致生产回滚一次)。
+5. **修改后能否闭环**:能。复测:`mvn -o surefire:test -Dtest=ResourceBeanNameCollisionGuardTest` 期望 1/1 绿,且 8 类存量不新增红。
+
+### #6 B-255-4(P2 · 新)`/chat` 上游失败直接 500,无降级
+
+1. **问题描述**:langgraph `/chat` 在上游 LLM 返回 `Internal Server Error` 时直接回 500(`tests/test_chat.py::test_chat_endpoint` → `assert 500 == 200`),`test_auto_tag` 5 例同源失败;本轮上游错误为 **500**(历史多为 429 配额)。
+2. **测试 bug 点**:`cfc-langgraph/tests/test_chat.py::test_chat_endpoint`、`cfc-langgraph/tests/test_auto_tag.py`(5 例)。
+3. **最优修改方案**:`/chat` 与 `/auto-tag` 增加上游异常分支——返回 200 + `{answer: 兜底话术, degraded: true}` 或明确 `503` 带 `Retry-After`;测试侧同步把「上游异常」拆为独立用例(mock 上游 500),与「上游正常」用例解耦。
+4. **修改目的**:上游抖动不应表现为 5xx 业务失败(前端会白屏/重试风暴);同时让 6 例红从「环境型不可判定」变为「降级行为是否生效」的可判定断言。
+5. **修改后能否闭环**:能。复测:mock 上游 500 → 期望 200/503 且含降级标记;真实链路 `pytest tests/test_chat.py -q` 期望 1 例绿且不再 500。
+
+## 八、门禁结论
+
+| 门禁 | 判定 | 依据 |
+|---|---|---|
+| G1 用例通过率 | ⚠️ | 本机实测域:浏览器 28 过 + health/shop 契约 17 过 + 新增 25 过;承采后端 91.87%(401 类) |
+| G2 真实缺陷红 | ❌ | 存量 16(定向实跑复现)+ 守卫 1 + 线上 API 4(1×500 + 2×504 + 1 前置) |
+| G3 浏览器 E2E | ✅ | admin 5/5、fe 6/6、shop 4/4、health 13/13;dx 2 跳;189 见 §1.4 |
+| G4 编译 | ✅ | `test-compile` EXIT=0(528 源) |
+| G5 surefire 报告 | ⚠️ | 定向 9 类 43 例(全量承采 R250 401 类) |
+| G6 契约逐例 | ✅ | health 13/13、shop 4/4 逐例零漂移 |
+| G7 langgraph | ❌ | 本机兜底 38/44(6 红全为 `/chat` 上游 500 未降级);251 无权威副本;`tests/qna` 收集期阻断 |
+| G8 匿名鉴权 | ❌ | 3/8 端点 200(第 30 轮) |
+| G9 覆盖率 | ⚠️ | 未实测(execute 档未授权),承采 27.4% |
+| G10 节点覆盖 | ⚠️ | 本机 + 189(opencode 通道)+ 251(派发,见 §1.5);189:80 仍不可达 |
+| G11 CI 清单 | ❌ | 承袭:清单 33 类 vs 实测红远多 → 双向失真(第 50 轮) |
+| G12 SRS 同步 | ✅ | 窗口 0 变更 |
+| G13 零漂移 | ✅ | 第 56 次(web/fe/定向/匿名/浏览器逐例异或=空) |
+| G14 场景覆盖 | ✅(ID 级)/⚠️(台账列级) | 153/153 = 100%;台账列 59.9% |
+
+**总结论:不通过(有条件)**。阻塞项:B-227-1(P0 安全)、B-238-1(P0 线上 500)、B-218-1(P0 守卫第 33 轮)、**B-255-1(P1 新:langgraph 收集期 0 例执行)**、B-254-1(网关 504)。
+**本轮正向变化**:G-250-1 覆盖缺口闭环(+25 条行为用例);G14 口径修正为 100%(ID 级);四项目浏览器 + 双端 Jest 逐例零漂移。**新增真实产品缺陷 0**。
+
+## 附录 A 复现命令
+
+```bash
+# 分支守卫
+git -C d:/cfc rev-parse --abbrev-ref HEAD && git -C d:/cfc rev-list --left-right --count HEAD...origin/cfcclub
+# 浏览器四项目(本机串行,单节点单任务)
+cd d:/cfc/tests && LIVE_BASE_URL=http://cfc.iwintrue.com \
+  ./node_modules/.bin/playwright test -c playwright.config.live.js --project=admin-desktop --output=./.r255-admin-desktop
+./node_modules/.bin/playwright test -c playwright.config.live.js --project=frontend-mobile --output=./.r255-frontend-mobile
+./node_modules/.bin/playwright test -c playwright.config.live.js --project=shop-api --output=./.r255-shop-api
+./node_modules/.bin/playwright test -c _r202_health.config.js --project=health-contract --output=./.r255-health
+# 前端单测 + 本轮新增面板用例
+cd d:/cfc/cfc-web && ./node_modules/.bin/jest --ci
+./node_modules/.bin/jest src/__tests__/FamilyPanels.spec.js
+cd d:/cfc/cfc-frontend && ./node_modules/.bin/jest --ci
+# 后端
+cd d:/cfc/cfc-backend && mvn -o -B -q test-compile
+mvn -o -B surefire:test -Dtest='ResourceBeanNameCollisionGuardTest,EnergySystemFlowTest,UserServiceWechatLoginTest,WebConfigGrowthExcludeRemovedTest,GuideModuleIntegrationTest,OrchestrationEngineTest,OrchestrationIntegrationTest,MembershipPaySwitchTest,PaymentServiceORDRoutingTest' -DfailIfNoSpecifiedTests=false
+# 线上 API 轻量复现
+cd d:/cfc/tests && ./node_modules/.bin/playwright test -c playwright.config.api.js \
+  e2e/api/badge-sc-c09-c10-a05.spec.js e2e/api/wish-flow-sc-p13-p14-c04.spec.js e2e/api/coach-food-sc-b07.spec.js --workers=1
+# 匿名鉴权探针
+for p in /api/notification/list /api/notification/read /api/search/global; do curl -s -X POST -H 'Content-Type: application/json' -d '{}' "http://cfc.iwintrue.com$p"; done
+# langgraph(本机兜底 + 收集期阻断复现)
+cd d:/cfc/cfc-langgraph && ./.venv/Scripts/python.exe -m pytest tests -q            # → collection error(B-255-1)
+./.venv/Scripts/python.exe -m pytest tests -q --ignore=tests/qna -p no:cacheprovider
+```
+
+## 附录 B 逐例漂移对照(G13 第 56 次)
+
+| 套件 | 本轮 | 历史 | 差异 |
+|---|---|---|---|
+| cfc-web Jest | 125 过 / 10 红 / 135(3 套红) | 125/10/135 | 空集 |
+| cfc-frontend Jest | 663 过 / 4 红 / 12 跳 / 679 | 663/4/12/679 | 空集 |
+| 定向 9 类 | 25 过 / 17 红 / 1 跳 / 43 | 同 | 空集(存量 16 + 守卫 1) |
+| 匿名探针 | 3×200 / 对照 3×401 | 3/8 = 200 | 空集 |
+| 浏览器四项目 | 28 过 + 2 跳 | 28 过 + 2 跳 | 空集 |
+| 线上 API | 3 过 / 4 红 / 17 未执行 | 同 | 空集 |
+
+## 附录 C 分支与提交
+
+- 起始:`cfclub` @ `2655ac5781b31d7ca982b83e9ff1901e23795248`(0 0)
+- 结束:`cfclub` @ 见提交记录(提交前后均复核 `rev-parse --abbrev-ref HEAD` = `cfclub`)

+ 56 - 0
docs/tdd/test/automation-run-2026-11-17-R255.md

@@ -0,0 +1,56 @@
+# 自动化执行记录 R255 · 2026-11-17 06:47 起
+
+## 分支守卫(先于一切)
+
+| 步骤 | 命令 | 结果 |
+|---|---|---|
+| 1 | `git -C d:/cfc rev-parse --abbrev-ref HEAD` | `cfclub` ✅(直接进入测试流程,无需释放 worktree) |
+| 2 | `git -C d:/cfc worktree list` | 主工作区 D:/cfc 独占 `cfclub`,无其他 worktree 占用该分支 ✅ |
+| 3 | `git -C d:/cfc fetch origin cfclub` + `rev-list --left-right --count HEAD...origin/cfclub` | `0 0` ✅ |
+| 4 | 起始 sha | `2655ac5781b31d7ca982b83e9ff1901e23795248` |
+| 5 | 收尾复核 | 见附录(提交后 `git rev-parse --abbrev-ref HEAD` = `cfclub`,`0 0`) |
+
+⚠️ 未执行任何 `checkout` / `reset --hard` / `clean`;工作区 40+ 未跟踪历史 WIP 原样保留。
+
+## 环境探活(先探活再动工)
+
+| 目标 | 结果 | 处置 |
+|---|---|---|
+| 本机 `9082` 后端 | `000`(未监听) | 不擅自启动;后端取证改 `test-compile` + 定向 `surefire:test` |
+| 本机 `9000` langgraph | `000` | 同上,改本机 venv 兜底 |
+| 本机 `4090` opencode | `000` | 无需 |
+| `cfc.iwintrue.com/admin`、`/frontend` | `302`(登录跳转,正常) | E2E 走该域(hosts → 251) |
+| `189:80` | CLOSED(第 19 轮) | E2E 无法直连 → 改走 **`189:4090` opencode** 通道 |
+| `189:4090` | `200`(Basic 认证可用) | 派发 admin E2E |
+| `251:4090` | **CLOSED**(历史通道关闭) | 改挂 **`251:4096`**(opencode,Basic 认证可用,`/api/model` 200) |
+| `251:9000` / `251:9082` | CLOSED | langgraph 服务未运行 |
+| `251:3306` | OPEN | 后端全量若跑会直连共享库(B-224-4 根因,本轮未跑全量) |
+| `251:22` | OPEN(无凭据) | 不尝试口令爆破,改走 opencode 派发 |
+
+## 执行时序
+
+| 时间 | 动作 | 结果 |
+|---|---|---|
+| 06:47 | 分支守卫 + 记忆召回(R250/R254 摘要) | ✅ |
+| 06:49 | 读 R254 报告 + 定位复现配置(`playwright.config.live.js` / `_r202_health.config.js` / `playwright.config.api.js`) | ✅ |
+| 06:50–06:53 | 本机浏览器四项目串行(admin → fe → shop → dx) | 5/5、6/6、4/4、dx 首跑 1 超时 |
+| 06:53 | dx-bridge 复跑定性 | 2 跳(端点 404),判瞬态 |
+| 06:54 | health-contract E2E | 13/13 |
+| 06:54 | cfc-web Jest | 125/10/135 |
+| 06:55 | cfc-frontend Jest | 663/4/12/679 |
+| 06:56 | 匿名鉴权探针 8 端点 | 3×200 + 3×401 + 2×404 |
+| 06:56 | 派发 lg pytest → `251:4096` | 通道打通(`/api/session` + `/prompt`),但节点无权威仓库副本(B-255-3) |
+| 06:58 | 线上 API 3 文件 | 3 过 / 4 红 / 17 未执行 |
+| 07:00 | 后端 `test-compile` | EXIT=0(528 源) |
+| 07:00 | 新增 `FamilyPanels.spec.js` 并单跑 | **25/25 绿** |
+| 07:01 | 派发 189 admin E2E | 首跑 4/5(account-roles 502)→ **复跑 5/5** |
+| 07:02 | 定向 `surefire:test` 9 类 | 43 例 / 25 过 / 17 红 / 1 跳 |
+| 07:05 | 本机 lg 兜底 | 收集期阻断(B-255-1)→ `--ignore=tests/qna` 跑到 39 例挂起(B-255-2)→ 逐文件取证 |
+| 07:2x | 写报告 / 通知 / 台账 / 提交推送 | 见附录 |
+
+## 纪律自查
+
+1. 未修改任何 `src/main`、未改他人 WIP、未 `reset --hard`、未强同步节点。✅
+2. 需联网命令(线上 API / E2E)均打在**已部署环境只读路径**;API 用例自带只读约束。✅
+3. 新增测试文件仅 1 个(`cfc-web/src/__tests__/FamilyPanels.spec.js`),且为**测试侧**资产。✅
+4. 派发脚本内含内网口令 → **未入库**(用后即删,仅保留方法说明)。✅

+ 19 - 0
docs/tdd/test/blockers.md

@@ -2131,3 +2131,22 @@
 | **B-218-1(P0 · 第 32 轮)** | CoachRecommendService Bean 撞名 | 研发 | `ResourceBeanNameCollisionGuardTest` 定向实跑 **1/1 红** | 测试 | 2026-11-17 06:4x | 待处理 |
 | **B-221-4(P2 · 第 76 轮)** | 节点 HEAD 落后/DIRTY | 运维 | 189 HEAD 落后 origin 1 提交、DIRTY=171;204 DIRTY=55;spec blob 一致可比,E2E 均首跑全绿 | 测试 | 2026-11-17 06:4x | 观察 |
 | **R254 段 · 门禁** | 环境型变化轮,独立实测 + 承采 | 测试 | **不通过(有条件)**。✅ G3(四节点全绿)/ G4 / G5 / G6 逐例零漂移 / **G10 四节点** / G12(窗口 0 变更)/ **G13 第 55 次**;⚠️ G1 / G7 45/51(6 红 429 环境型);❌ G2 / G8 3/8=200 第 28 轮 / G9 / G11 / G14 | 测试 | 2026-11-17 06:4x | 不通过 |
+
+## R255 段(2026-11-17 06:47~07:4x · 承采 + 覆盖缺口闭环轮 · 分支 cfclub)
+
+> 窗口判定:基线=`2655ac578`(=R254 提交),启动 + 收尾两次 fetch 窗口均 **0 提交** → SRS/场景/用例窗口变更 **0**(G12 ✅)。后端全量承采 R250/R252(401 类/3,643 例);本轮独立实测浏览器四项目 + 双端 Jest + **新增 25 条面板行为用例** + 后端 test-compile + 定向 9 类 + 匿名探针 + 线上 API 3 文件 + langgraph 本机兜底。**新增真实产品缺陷 0**;新增 P1 测试装置缺陷 **B-255-1**;**G-250-1 覆盖缺口闭环**;G14 口径修正为 153/153=100%。web/fe/定向/匿名/浏览器逐例零漂移(G13 第 56 次)。
+
+| 编号 | 事项 | 归属 | 本轮证据 | 提出方 | 时间 | 状态 |
+|---|---|---|---|---|---|---|
+| **B-255-1(P1 · 新增)** | langgraph 测试收集期被单个坏模块阻断 | 研发(AI 服务) | `cfc-langgraph/tests/qna/test_graph.py` 已入库,但 `from src.qna...` 导入的 `cfc-langgraph/src/qna/` **不存在**(`git ls-files` 为空)→ `pytest tests` 报 `ModuleNotFoundError: No module named 'src.qna'` + `Interrupted: 1 error during collection`,**0 例执行**、退出码非 0 | 测试 | 2026-11-17 07:0x | 待处理 |
+| **B-255-2(P2 · 新增)** | 本机 lg 兜底运行中途挂起 | 测试/研发 | 加 `--ignore=tests/qna` 后跑到 **39 例**(2 过 + 6 红 + 31 过)即停在某 LLM 调用上再无输出,外层 420s 超时兜底;与 B-142-2 上游配额同源嫌疑 | 测试 | 2026-11-17 07:0x | 观察 |
+| **B-255-3(P2 · 新增)** | 251 节点无权威 langgraph 仓库副本 | 运维 | `251:4090` 关闭 → 改挂 **`251:4096`**(opencode,Basic 认证可用);派发 agent 遍历 `/home/iwt /opt /root` 与 `find / -name test_intent.py` 仅命中 `/tmp/opencode/*/cfc-langgraph` 临时 worktree;`251:9000`/`9082` 均 CLOSED | 测试 | 2026-11-17 07:0x | 待处理 |
+| **B-227-1(P0 · 第 30 轮)** | 匿名可访问 3 私有接口 | 研发 | 探针 8 端点:notification/list(200 空集)、notification/read(200 `data:true` 假成功)、search/global(200 空桶);对照 family/member/list、growth/record/list、user/info 全 401;parse-monitor 2 端点 404(路径失配) | 测试 | 2026-11-17 07:0x | 待处理 |
+| **B-238-1(P0 · 第 17 轮)** | 线上 HTTP 500 | 研发 | 线上 API 3 文件 24 例 = 3 过 / 4 红 / 17 未执行;签名 1×`Received: 500`(coach-food:18/38)+ 2×`504`(wish:58、badge 前置)+ 1 例 3ms 前置失败(badge:29) | 测试 | 2026-11-17 07:0x | 待处理 |
+| **B-254-1(P1 · 第 2 轮)** | 线上网关 504 超时 | 运维 | 同上:badge C-09 前置 `addChild` 504、wish C-04 504 → 17 例级联 `did not run` | 测试 | 2026-11-17 07:0x | 观察 |
+| **B-218-1(P0 · 第 33 轮)** | CoachRecommendService Bean 撞名 | 研发 | 定向 `surefire:test` 实跑 `ResourceBeanNameCollisionGuardTest` **1/1 红**;同批 8 类存量 43 例 → 25 过 / 17 红 / 1 跳,逐例与历史一致 | 测试 | 2026-11-17 07:0x | 待处理 |
+| **B-142-2(P1 · 第 13 轮)** | lg 上游 429 配额 | 运维/供应商 | 本轮未取到完整 lg 结论(B-255-1 收集期阻断 + B-255-2 挂起);历史 45/51(6 红全 429) | 测试 | 2026-11-17 07:0x | 待处理(升额/换 Token Plan) |
+| **G-250-1(P2 · 本轮闭环 ✅)** | 6 个家庭面板行为零断言 | 测试 | 新增 `cfc-web/src/__tests__/FamilyPanels.spec.js` **25 例**(familyId 锁定/空态/错误态/分页重置/写操作参数/前置校验/分转元/详情降级)→ **25/25 绿**(8.3s) | 测试 | 2026-11-17 07:0x | 已闭环 |
+| **B-221-4(P2 · 第 77 轮)** | 节点 HEAD 落后/DIRTY | 运维 | 189 HEAD `d7a51ecb3`、DIRTY=171;按纪律未强同步,E2E 首跑 4/5(TC-A-U05 `account-roles` 502)→ **复跑 5/5**,判瞬态 | 测试 | 2026-11-17 07:0x | 观察 |
+| **B-255-4(P2 · 新增)** | `/chat` 上游失败直接 500,未降级 | 研发 | `tests/test_chat.py::test_chat_endpoint` → `assert 500 == 200`;`test_auto_tag` ×5 同源,均收敛到 `call_chat` 上游 `Internal Server Error 500`(本轮非 429) | 测试 | 2026-11-17 07:1x | 待处理 |
+| **R255 段 · 门禁** | 承采 + 覆盖缺口闭环轮 | 测试 | **不通过(有条件)**。✅ G3(本机 admin 5/5 + fe 6/6 + shop 4/4 + health 13/13 + 189 复跑 5/5 + dx 2 跳)/ G4(528 源 0 错)/ G6 逐例零漂移 / **G12**(窗口 0 变更)/ **G13 第 56 次** / **G14 ID 级 153/153**;⚠️ G1 / G5 / G7 未取到完整结论 / G9 未实测 / G10(189:80 不可达、251 无权威副本);❌ G2(存量 16 + 守卫 1 + 线上 4)/ **G8 3/8=200** / G11 第 50 轮 | 测试 | 2026-11-17 07:0x | 不通过 |

+ 29 - 0
docs/tdd/test/notice-2026-11-17-R255-研发通知.md

@@ -0,0 +1,29 @@
+# 研发通知 R255(2026-11-17 · 测试负责人)
+
+> 来源:定时闭环测试轮 R255|工作分支 `cfclub`|基线 `2655ac578`|窗口 0 提交(无 SRS/源码变更)
+> 结论:**门禁不通过(有条件)**。本轮**新增真实产品缺陷 0**,但**新增 1 项 P1 测试装置缺陷(B-255-1)**,另有 4 项长期 P0 仍未处理。
+
+## 一、需要研发/运维处理(按优先级)
+
+| # | 编号 | 归属 | 事项 | 复现/证据 | 期望 |
+|---|---|---|---|---|---|
+| N-1 | **B-255-1(新 · P1)** | 研发(AI 服务) | `cfc-langgraph/tests/qna/test_graph.py` 已入库,但它 `from src.qna...` 导入的 `cfc-langgraph/src/qna/` **不存在**(`git ls-files cfc-langgraph/src/qna` 为空)→ 干净环境执行 `pytest tests` **收集期直接中断,0 例被执行** | `cd cfc-langgraph && .venv/Scripts/python.exe -m pytest tests -q` → `ModuleNotFoundError: No module named 'src.qna'` + `Interrupted: 1 error during collection` | 二选一:`git rm` 该模块(qna 已下线)或 `pytest.importorskip("src.qna")`;**并在 CI 断言 `collected >= 40`**,避免「跑 0 例当已测」 |
+| N-2 | **B-227-1(P0 · 第 30 轮)** | 研发(后端鉴权) | 匿名可访问 3 个私有接口:`/api/notification/list`(200 空集)、`/api/notification/read`(200 `data:true` 假成功)、`/api/search/global`(200 空桶) | 无 token `POST` 三接口均 `{"code":200}`;对照 `/api/family/member/list`、`/api/growth/record/list`、`/api/user/info` 均 401 | `JwtInterceptor` 改为「默认必登录 + 显式 PUBLIC_PATHS」,`/api/admin/**` 前缀强制拦截,`memberId/familyId` 加归属校验 |
+| N-3 | **B-238-1(P0 · 第 17 轮)** | 研发(后端) | 线上 API 契约 4 红:`coach-food` 索引读取 500、`coach-food` 越权分支 500;`wish-flow` 创建链 504 | `playwright test -c playwright.config.api.js e2e/api/coach-food-sc-b07.spec.js --workers=1` → `Received: 500`(:18 / :38) | 修 500 分支;与 N-4 的网关 504 分开归因 |
+| N-4 | **B-254-1(P1 · 第 2 轮)** | 运维 | 线上网关 504 超时:`badge C-09` 前置 `addChild` 504、`wish-flow C-04` 504 → 连带 **17 例 `did not run`** | 同 N-3 命令,badge 首例 **3ms** 即失败(前置依赖),2 例 `Received: 504` | 查 251 网关超时阈值/上游重启;建议该接口加健康探针 |
+| N-5 | **B-218-1(P0 · 第 33 轮)** | 研发(后端) | `@Resource` 字段名与不兼容类型默认 Bean 名撞名(`CoachRecommendService` 一线),守卫第 33 轮仍红 | `mvn -o surefire:test -Dtest=ResourceBeanNameCollisionGuardTest` → 1/1 红 | 显式 `@Resource(name=...)` 或重命名字段;修后跑守卫 + 8 类存量复绿 |
+| N-6 | **B-250-3(P2)** | 测试/研发 | 线上 API `describe.serial` 链上游失败 → 17 例 `did not run`,红数不可判定 | 本轮同 R250/R253/R254 | 拆 serial 或给前置依赖独立探针(测试侧可做,需研发确认依赖顺序) |
+| N-7 | **B-224-4 / B-250-2(P1)** | 研发 | 后端测试无 `src/test/resources`,继承 `application.yml` 直连 `192.168.16.251:3306/zxyj`,每上下文重跑 433 DDL + 650 迁移段 → 全量 51~67 分钟、并向共享库造数 | `jstack` 主线程阻塞 `mysql.cj.ReadAheadInputStream` | 加 `application-test.yml`(内存库或独立 schema),这是全量耗时与数据安全的根因 |
+| N-8 | **G11(P1 · 第 50 轮)** | 研发 | CI 排除清单与实测红类双向失真(清单 33 类 vs 实测远多)→ 漏拦 + 陈旧 | 承袭 | 由 `surefire` 实测红集反向生成清单 |
+
+## 二、测试侧本轮已完成(无需研发介入)
+
+1. **G-250-1 覆盖缺口闭环**:新增 `cfc-web/src/__tests__/FamilyPanels.spec.js`,为 6 个家庭工作台面板(`ChildrenPanel/PointsPanel/WishesPanel/RewardsPanel/FamilyCouponPanel/FamilyEarningsPanel`,1,775 行)补 **25 条行为用例**(familyId 锁定 / 空态 / 错误态 / 分页重置 / 写操作参数 / 前置校验不发请求 / 分转元 / 详情降级),实测 **25/25 绿**。原仅 1 条「挂载」用例。
+2. **G14 口径修正**:改用「SC-id 全域扫描」后场景覆盖为 **153/153 = 100%**;历史 59.9% 只是台账「所属场景」列未维护,属度量偏差,已在报告中双口径披露。
+3. **回归零漂移(第 56 次)**:cfc-web 125/10、cfc-frontend 663/4/12、定向 9 类 43 例(25 过 / 17 红 / 1 跳)、匿名 3×200、浏览器四项目 28 过 + 2 跳,逐例集合异或 = 空集。
+
+## 三、环境提示
+
+- `251:4090`(opencode)已关闭,改挂 **`251:4096`**(同为 opencode,Basic 认证);`251:9000`(langgraph 服务)与 `251:9082` 均 **CLOSED**;`251:22` SSH 开放但无凭据。
+- `192.168.16.189` 仅 `4090`(opencode)可用,**80/9082 仍不可达**(第 19 轮),故 189 的 E2E 经 opencode 通道执行。
+- 本机 `9082 / 9000 / 4090` 均未监听(后端未启动,langgraph 未启动),本轮后端取证走定向 surefire + 编译。