From ea1a0d50d3c2ff640c61d5bba4bf215af9185891 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Tue, 27 Oct 2026 11:48:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=EC=B9=AD=20=EC=9D=B4=EB=A0=A5=20E2E?= =?UTF-8?q?=EB=A5=BC=20=ED=98=84=ED=96=89=20=EB=9D=BC=EC=9D=B4=EC=84=A0?= =?UTF-8?q?=EC=8A=A4=20=EA=B7=BC=EA=B1=B0=20=EC=A0=95=EC=B1=85=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=98=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2026-08-28부터 live coach 근거는 라이선스 A/B·외부 사용 허용 출처만 노출하고 D등급 0615 워크북은 어떤 입력에서도 들어오지 않는다(API 단위 테스트가 이미 고정). E2E만 워크북을 기대해 08-18 선택자 오류 뒤에 숨어 실패하고 있었다. 근거가 있고 워크북은 없음을 단언하고, 응답의 첫 근거가 새로고침 뒤 이력에 그대로 보존·표시되는지 원래 검증을 유지한다. 파일 전체 15 passed(실엔진 openai). --- apps/web/e2e/session-persistence.spec.ts | 39 +++++++++++++++--------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/apps/web/e2e/session-persistence.spec.ts b/apps/web/e2e/session-persistence.spec.ts index 1cd7679..f1cf03b 100644 --- a/apps/web/e2e/session-persistence.spec.ts +++ b/apps/web/e2e/session-persistence.spec.ts @@ -1005,21 +1005,29 @@ test.describe("session persistence", () => { const coachSuggestion = (await coachResponse.json()) as LiveCoachEvent["suggestion"]; expect(coachSuggestion.status).toBe("ready"); expect(coachSuggestion.latency_ms ?? 0).toBeGreaterThan(0); - const workbookSource = coachSuggestion.sources?.find( - (source) => source.source_id === "workbook_0615_case_conceptualization", - ); - expect(workbookSource, "live coach response should include the licensed workbook source pack").toBeTruthy(); - expect(workbookSource?.version).toBe("2026-06-15"); - expect(workbookSource?.citation ?? "").toContain("0615"); + // 2026-08-28 라이선스 정책 변경(apps/api/app/services/live_coach.py + // _local_reference_grounding / _external_safe_grounding) 이후 live coach + // 근거는 라이선스 A/B이면서 external_llm_ok=true인 출처만 노출된다. 응답 + // 스키마(LiveCoachSource)에는 license_class·external_llm_ok 필드가 노출되지 + // 않으므로, 여기서는 노출된 필드만으로 "D등급(워크북)이 섞이지 않는다"는 + // 정책만 검증한다. + expect(coachSuggestion.sources?.length ?? 0).toBeGreaterThan(0); + expect( + coachSuggestion.sources?.some( + (source) => source.source_id === "workbook_0615_case_conceptualization", + ), + ).toBe(false); + const groundedSource = coachSuggestion.sources![0]; await expect(page.locator(".sx-coach-card").getByText(coachSuggestion.title)).toBeVisible({ timeout: 30_000, }); await page.locator(".sx-coach-card").getByRole("button", { name: "근거 보기" }).click(); const evidenceDialog = page.locator(".sx-coach-modal [role='dialog']"); await expect(evidenceDialog).toBeVisible({ timeout: 15_000 }); - await expect(evidenceDialog).toContainText(workbookSource!.title); - await expect(evidenceDialog).toContainText("2026-06-15"); - await expect(evidenceDialog).toContainText("0615"); + await expect(evidenceDialog).toContainText(groundedSource.title); + if (groundedSource.version) { + await expect(evidenceDialog).toContainText(groundedSource.version); + } await evidenceDialog.getByRole("button", { name: "닫기" }).click(); await expect(evidenceDialog).toHaveCount(0); @@ -1039,9 +1047,9 @@ test.describe("session persistence", () => { expect( persistedCoachEvent?.suggestion.sources?.some( (source) => - source.source_id === workbookSource!.source_id && - source.version === workbookSource!.version && - (source.citation ?? "").includes("0615"), + source.source_id === groundedSource.source_id && + source.version === groundedSource.version && + (source.citation ?? "") === (groundedSource.citation ?? ""), ), "DB-backed live coach history should preserve source pack metadata", ).toBe(true); @@ -1072,9 +1080,10 @@ test.describe("session persistence", () => { await coachMark.click(); const historyDialog = page.locator(".sx-coach-history [role='dialog']"); await expect(historyDialog).toBeVisible({ timeout: 15_000 }); - await expect(historyDialog).toContainText(workbookSource!.title); - await expect(historyDialog).toContainText("2026-06-15"); - await expect(historyDialog).toContainText("0615"); + await expect(historyDialog).toContainText(groundedSource.title); + if (groundedSource.version) { + await expect(historyDialog).toContainText(groundedSource.version); + } }); test("persists voice nonverbal metadata into DB-backed review @single-run", async ({ page }) => {