코칭 이력 E2E를 현행 라이선스 근거 정책에 맞춘다
Some checks failed
API contract / OpenAPI type drift (push) Failing after 1m57s

2026-08-28부터 live coach 근거는 라이선스 A/B·외부 사용 허용 출처만 노출하고
D등급 0615 워크북은 어떤 입력에서도 들어오지 않는다(API 단위 테스트가 이미 고정).
E2E만 워크북을 기대해 08-18 선택자 오류 뒤에 숨어 실패하고 있었다. 근거가 있고
워크북은 없음을 단언하고, 응답의 첫 근거가 새로고침 뒤 이력에 그대로 보존·표시되는지
원래 검증을 유지한다. 파일 전체 15 passed(실엔진 openai).
This commit is contained in:
Yun Chan 2026-10-27 11:48:42 +09:00
parent c907f1473e
commit ea1a0d50d3

View file

@ -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 }) => {