개선관리 요구사항과 Google 로그인을 완료
This commit is contained in:
parent
cc0a15b7c6
commit
2a39636163
112 changed files with 10166 additions and 527 deletions
|
|
@ -603,6 +603,34 @@ test.describe("session review", () => {
|
|||
await expect(page.getByText("방어를 낮춘 감정 반영")).toBeVisible();
|
||||
await expect(page.getByText("개입 전 준비도 확인")).toBeVisible();
|
||||
await expect(page.locator(".sr-chart__svg")).toBeVisible();
|
||||
const firstSessionChecklist = page.locator(
|
||||
".sr-card--first-session-checklist",
|
||||
);
|
||||
await expect(firstSessionChecklist).toContainText(
|
||||
"첫 회기 라포·개방질문 체크리스트",
|
||||
);
|
||||
await expect(firstSessionChecklist).toContainText(
|
||||
"first-session-rapport-open-question.v1",
|
||||
);
|
||||
await expect(firstSessionChecklist).toContainText("라포 형성 반영");
|
||||
await expect(firstSessionChecklist).toContainText("한 초점 개방질문");
|
||||
await expect(firstSessionChecklist.getByText("근거 확인")).toHaveCount(2);
|
||||
await expect(firstSessionChecklist).toContainText(
|
||||
"임상 평가나 성적 판정이 아닙니다.",
|
||||
);
|
||||
const checklistEvidence = firstSessionChecklist.getByRole("button", {
|
||||
name: "라포 형성 반영 근거 2번 발화로 이동",
|
||||
});
|
||||
await expect(checklistEvidence).toBeVisible();
|
||||
const checklistEvidenceHeight = await checklistEvidence.evaluate((button) =>
|
||||
Math.ceil(button.getBoundingClientRect().height),
|
||||
);
|
||||
expect(checklistEvidenceHeight).toBeGreaterThanOrEqual(44);
|
||||
await checklistEvidence.click();
|
||||
await expect(page.locator("#sr-panel-transcript")).toBeVisible();
|
||||
await expect(page.locator(".sr-turn--active")).toContainText(
|
||||
"혼자서 버티고 있었다는 느낌",
|
||||
);
|
||||
await openReviewTab(page, "워크시트");
|
||||
await expect(page.getByText("사례개념화 워크시트")).toBeVisible();
|
||||
await expect(page.locator(".sr-ws-input").first()).toBeVisible();
|
||||
|
|
@ -612,31 +640,35 @@ test.describe("session review", () => {
|
|||
await expectNoHorizontalOverflow(page);
|
||||
});
|
||||
|
||||
test("keeps masked API transcript while naturalizing transcript placeholders", async ({
|
||||
test("renders role-safe counselor and client tokens without exposing mask syntax", async ({
|
||||
page,
|
||||
}) => {
|
||||
await routeLearnerReviewUser(page);
|
||||
await routePrepostMeasures(page);
|
||||
const sessionId = "review-placeholder-display";
|
||||
const sessionId = "00000000-0000-4000-8000-000000000112";
|
||||
const response = filledReviewResponse(sessionId);
|
||||
response.turns[0] = {
|
||||
...response.turns[0],
|
||||
text: "저는 [NAME]이고 [ORG]에서 상담받고 있어요.",
|
||||
text: "저는 [CLIENT]이고 [ORG]에서 상담받고 있어요.",
|
||||
};
|
||||
response.turns[1] = {
|
||||
...response.turns[1],
|
||||
text: "[COUNSELOR]가 [CLIENT]의 말을 천천히 되짚었습니다.",
|
||||
};
|
||||
response.summary =
|
||||
"평가 AI는 [NAME]가 [ORG]에서 보인 조심스러운 반응을 분석했습니다.";
|
||||
"평가 AI는 [CLIENT]가 [ORG]에서 보인 반응과 [COUNSELOR]의 반영을 분석했습니다.";
|
||||
response.goodMoments[0] = {
|
||||
...response.goodMoments[0],
|
||||
title: "[NAME]가 보인 강점",
|
||||
body: "[ORG] 장면에서 내담자 [NAME]을 기다렸습니다.",
|
||||
title: "[COUNSELOR]가 보인 강점",
|
||||
body: "[ORG] 장면에서 [CLIENT] 반응을 기다렸습니다.",
|
||||
};
|
||||
response.growthPoints[0] = {
|
||||
...response.growthPoints[0],
|
||||
title: "[NAME] 반응을 서두르지 않기",
|
||||
body: "[ORG] 장면에서 내담자 [NAME]을 한 번 더 확인합니다.",
|
||||
body: "[ORG] 장면에서 익명 인물의 반응을 한 번 더 확인합니다.",
|
||||
};
|
||||
response.nextLine = "[NAME]의 말을 [ORG] 맥락에서 다시 확인할까요?";
|
||||
response.clientFeedback = "[NAME] 이야기를 [ORG]에서 안전하게 다뤘어요.";
|
||||
response.nextLine = "[CLIENT]의 말을 [ORG] 맥락에서 다시 확인할까요?";
|
||||
response.clientFeedback = "[CLIENT] 이야기를 [ORG]에서 안전하게 다뤘어요.";
|
||||
if (!response.caseWorksheet) {
|
||||
throw new Error("filled review fixture must include a worksheet");
|
||||
}
|
||||
|
|
@ -644,7 +676,7 @@ test.describe("session review", () => {
|
|||
{
|
||||
turnId: "t1",
|
||||
speaker: "client",
|
||||
quote: "저는 [NAME]이고 [ORG]에서 상담받고 있어요.",
|
||||
quote: "저는 [CLIENT]이고 [ORG]에서 상담받고 있어요.",
|
||||
},
|
||||
];
|
||||
await page.route(`**/api/sessions/${sessionId}/review`, async (route) => {
|
||||
|
|
@ -660,37 +692,48 @@ test.describe("session review", () => {
|
|||
const reviewResponse = await reviewResponsePromise;
|
||||
await expectResponseOk(reviewResponse);
|
||||
const apiReview = await reviewResponse.json();
|
||||
expect(apiReview.turns[0].text).toContain("[NAME]");
|
||||
expect(apiReview.turns[0].text).toContain("[CLIENT]");
|
||||
expect(apiReview.turns[1].text).toContain("[COUNSELOR]");
|
||||
expect(apiReview.growthPoints[0].title).toContain("[NAME]");
|
||||
|
||||
const transcript = page.locator(".sr-card--transcript");
|
||||
await expect(transcript).toContainText(
|
||||
"저는 익명 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
"저는 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
);
|
||||
await expect(transcript).toContainText(
|
||||
"상담자가 내담자의 말을 천천히 되짚었습니다.",
|
||||
);
|
||||
await expect(transcript).not.toContainText("[NAME]");
|
||||
await expect(transcript).not.toContainText("[COUNSELOR]");
|
||||
await expect(transcript).not.toContainText("[CLIENT]");
|
||||
const summary = page.locator(".sr-summary");
|
||||
await expect(summary).toContainText(
|
||||
"평가 AI는 익명 내담자가 소속 기관에서 보인 조심스러운 반응을 분석했습니다.",
|
||||
"평가 AI는 내담자가 소속 기관에서 보인 반응과 상담자의 반영을 분석했습니다.",
|
||||
);
|
||||
await expect(summary).not.toContainText("[NAME]");
|
||||
await expect(summary).not.toContainText("[ORG]");
|
||||
await openReviewTab(page, "피드백");
|
||||
const feedback = page.locator("#sr-panel-feedback");
|
||||
await expect(feedback).toContainText("익명 내담자가 보인 강점");
|
||||
await expect(feedback).toContainText("상담자가 보인 강점");
|
||||
await expect(feedback).toContainText("소속 기관 장면에서 내담자 반응을 기다렸습니다.");
|
||||
await expect(feedback).toContainText("익명 인물 반응을 서두르지 않기");
|
||||
await expect(feedback).toContainText(
|
||||
"익명 내담자의 말을 소속 기관 맥락에서 다시 확인할까요?",
|
||||
"내담자의 말을 소속 기관 맥락에서 다시 확인할까요?",
|
||||
);
|
||||
await expect(feedback).not.toContainText("[NAME]");
|
||||
await expect(feedback).not.toContainText("[COUNSELOR]");
|
||||
await expect(feedback).not.toContainText("[CLIENT]");
|
||||
await expect(feedback).not.toContainText("[ORG]");
|
||||
await openReviewTab(page, "워크시트");
|
||||
const worksheetPanel = page.locator("#sr-panel-worksheet");
|
||||
const worksheetEvidence = worksheetPanel.locator(".sr-ws-evidence").filter({
|
||||
hasText: "저는 익명 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
hasText: "저는 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
});
|
||||
await expect(worksheetEvidence).toContainText(
|
||||
"저는 익명 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
"저는 내담자이고 소속 기관에서 상담받고 있어요.",
|
||||
);
|
||||
await expect(worksheetPanel).not.toContainText("[NAME]");
|
||||
await expect(worksheetPanel).not.toContainText("[CLIENT]");
|
||||
await expect(worksheetPanel).not.toContainText("[ORG]");
|
||||
});
|
||||
|
||||
|
|
@ -726,4 +769,288 @@ test.describe("session review", () => {
|
|||
await expect(prepostCard.getByRole("alert")).toContainText("기존 값을 비우려면 새 점수를 입력해 주세요.");
|
||||
await expect(prepostCard.getByRole("button", { name: "점수 저장" })).toBeDisabled();
|
||||
});
|
||||
|
||||
test("keeps learner inputs and privacy controls while disabled AI feedback makes no derived requests", async ({
|
||||
page,
|
||||
}) => {
|
||||
await routeLearnerReviewUser(page);
|
||||
await routePrepostMeasures(page);
|
||||
const sessionId = "feedback-disabled-review";
|
||||
const base = filledReviewResponse(sessionId);
|
||||
const derivedRequests: string[] = [];
|
||||
const derivedRequestCounts = {
|
||||
rupture: 0,
|
||||
outcomeTrajectory: 0,
|
||||
deliberatePractice: 0,
|
||||
calibrationSupervisor: 0,
|
||||
multimodalDerived: 0,
|
||||
sessionEvaluation: 0,
|
||||
liveCoach: 0,
|
||||
share: 0,
|
||||
};
|
||||
let calibrationInputReads = 0;
|
||||
let multimodalPrivacyReads = 0;
|
||||
|
||||
page.on("request", (request) => {
|
||||
const url = new URL(request.url());
|
||||
const path = url.pathname;
|
||||
if (path.includes(`/sessions/${sessionId}/ruptures`)) {
|
||||
derivedRequestCounts.rupture += 1;
|
||||
}
|
||||
if (path.includes(`/sessions/${sessionId}/outcome-trajectory`)) {
|
||||
derivedRequestCounts.outcomeTrajectory += 1;
|
||||
}
|
||||
if (path.endsWith("/practice/learners/me") || path.includes("/practice/attempts/")) {
|
||||
derivedRequestCounts.deliberatePractice += 1;
|
||||
}
|
||||
if (
|
||||
path.includes("/internal/") &&
|
||||
(path.includes("/calibration/") || path.includes("/transfer-suites")) ||
|
||||
path.endsWith("/calibration/reviews") ||
|
||||
/\/calibration\/learners\/(?!me$)/.test(path)
|
||||
) {
|
||||
derivedRequestCounts.calibrationSupervisor += 1;
|
||||
}
|
||||
if (
|
||||
url.pathname.endsWith(`/sessions/${sessionId}/multimodal-alliance`) &&
|
||||
url.searchParams.get("include_derived") !== "false"
|
||||
) {
|
||||
derivedRequestCounts.multimodalDerived += 1;
|
||||
}
|
||||
if (path.includes(`/eval/sessions/${sessionId}`)) {
|
||||
derivedRequestCounts.sessionEvaluation += 1;
|
||||
}
|
||||
if (path.includes(`/sessions/${sessionId}/live-coach`)) {
|
||||
derivedRequestCounts.liveCoach += 1;
|
||||
}
|
||||
if (path.endsWith(`/sessions/${sessionId}/share`)) {
|
||||
derivedRequestCounts.share += 1;
|
||||
}
|
||||
if (Object.values(derivedRequestCounts).some((count) => count > 0)) {
|
||||
derivedRequests.push(`${request.method()} ${url.pathname}${url.search}`);
|
||||
}
|
||||
});
|
||||
|
||||
await page.route(`**/api/sessions/${sessionId}/review`, async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
...base,
|
||||
sessionNo: 2,
|
||||
learnerFeedbackEnabled: false,
|
||||
reviewReady: false,
|
||||
degraded: false,
|
||||
supervisorState: "피드백 비활성",
|
||||
summary:
|
||||
"관리자가 이 계정의 AI 학습 피드백을 비활성화했습니다. 회기 축어록과 학습자 입력은 그대로 보존됩니다.",
|
||||
caseWorksheet: {
|
||||
...base.caseWorksheet,
|
||||
status: "saved_by_learner",
|
||||
generatedBy: "learner",
|
||||
savedAt: "2026-08-27T01:02:03Z",
|
||||
sections: [
|
||||
{
|
||||
key: "learner-notes",
|
||||
title: "내 기록",
|
||||
items: [
|
||||
{
|
||||
key: "presenting-complaint",
|
||||
label: "주호소",
|
||||
value: "학습자가 직접 저장한 원문",
|
||||
evidence: [],
|
||||
confidence: "none",
|
||||
emptyReason: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
limitations: ["학습자 작성"],
|
||||
},
|
||||
}),
|
||||
});
|
||||
});
|
||||
await page.route("**/api/calibration/learners/me**", async (route) => {
|
||||
calibrationInputReads += 1;
|
||||
const url = new URL(route.request().url());
|
||||
expect(url.searchParams.get("session_id")).toBe(sessionId);
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
learner_id: "00000000-0000-0000-0000-000000000101",
|
||||
requested_view: "learner",
|
||||
clinical_claim_allowed: false,
|
||||
prediction_histories: [],
|
||||
calibration_assessments: [],
|
||||
transfer_suites: [],
|
||||
teacher_reviews: [],
|
||||
actual_executions: [],
|
||||
actual_transfer_assessments: [],
|
||||
}),
|
||||
});
|
||||
});
|
||||
await page.route(
|
||||
`**/api/sessions/${sessionId}/multimodal-alliance**`,
|
||||
async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname.includes("/raw-audio/")) {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "audio/webm",
|
||||
body: "",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (url.pathname.endsWith("/raw-audio")) {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
items: [
|
||||
{
|
||||
audio_asset_id: "00000000-0000-4000-8000-000000000901",
|
||||
session_id: sessionId,
|
||||
media_type: "audio/webm",
|
||||
byte_size: 8192,
|
||||
duration_ms: 12000,
|
||||
retained_until: "2026-09-26T01:02:03Z",
|
||||
created_at: "2026-08-27T01:02:03Z",
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
multimodalPrivacyReads += 1;
|
||||
expect(url.searchParams.get("include_derived")).toBe("false");
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
session_id: sessionId,
|
||||
learner_id: "00000000-0000-0000-0000-000000000101",
|
||||
clinical_claim_allowed: false,
|
||||
consent_snapshots: [
|
||||
{
|
||||
consent_snapshot_id: "00000000-0000-4000-8000-000000000902",
|
||||
sequence_no: 1,
|
||||
consent_status: "granted",
|
||||
retain_audio: true,
|
||||
retain_derived_features: false,
|
||||
transcript_retained: true,
|
||||
retention_days: 30,
|
||||
policy_version: "vignette.multimodal-consent.v1",
|
||||
reason_code: null,
|
||||
created_at: "2026-08-27T01:02:03Z",
|
||||
},
|
||||
],
|
||||
timelines: [],
|
||||
word_timestamps: [],
|
||||
voice_events: [],
|
||||
measurements: [],
|
||||
fusion_decisions: [],
|
||||
deletion_requests: [],
|
||||
}),
|
||||
});
|
||||
},
|
||||
);
|
||||
await page.route(`**/api/sessions/${sessionId}/alliance-pulses`, async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
items: [
|
||||
{
|
||||
pulse_id: "00000000-0000-4000-8000-000000000903",
|
||||
checkpoint: "post",
|
||||
status: "ready",
|
||||
learner_locked_at: "2026-08-27T01:02:03Z",
|
||||
revealed_at: "2026-08-27T01:03:03Z",
|
||||
error_code: null,
|
||||
self_scores: { goal: 0.8, task: 0.6, bond: 1.0 },
|
||||
measurements: [
|
||||
{
|
||||
perspective: "independent_observer",
|
||||
rationale: "학습자에게 노출되면 안 되는 AI 비밀 근거",
|
||||
evidence: [{ text: "AI 비밀 근거" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto(`/learn/session/${sessionId}/review`);
|
||||
await expect(page.locator(".sr-overview")).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByRole("button", { name: "공유 URL 복사" })).toHaveCount(0);
|
||||
await expect(page.locator(".ap-card")).toContainText("저장한 내 치료 동맹 자기평가");
|
||||
await expect(page.locator(".ap-card")).toContainText("목표80점");
|
||||
await expect(page.locator(".ap-comparison")).toHaveCount(0);
|
||||
await expect(page.getByText("AI 비밀 근거", { exact: false })).toHaveCount(0);
|
||||
|
||||
await openReviewTab(page, "피드백");
|
||||
await expect(
|
||||
page.getByRole("heading", {
|
||||
name: "내가 관찰한 현재 상태를 직접 기록합니다",
|
||||
}),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("heading", {
|
||||
name: "먼저 예측하고 잠그는 내 기록만 보존합니다",
|
||||
}),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("heading", {
|
||||
name: "동의·보존·삭제 범위를 직접 관리합니다",
|
||||
}),
|
||||
).toBeVisible();
|
||||
await expect(page.getByText(/학습자 본인 계정에서만 접근 가능/)).toBeVisible();
|
||||
await expect(page.locator(".rr-card, .dp-card")).toHaveCount(0);
|
||||
await expect(
|
||||
page.locator(
|
||||
".ot-timeline-wrap, .ct-calibration, .ct-transfer, .mma-clock, .mma-axis-board",
|
||||
),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
page.locator(
|
||||
".sr-card--chart, .sr-card--flow, .sr-card--rubric, .sr-card--first-session-checklist, .sr-feedback",
|
||||
),
|
||||
).toHaveCount(0);
|
||||
|
||||
const privacyDelete = page.getByRole("button", {
|
||||
name: "선택 데이터 삭제 요청",
|
||||
});
|
||||
await privacyDelete.scrollIntoViewIfNeeded();
|
||||
const privacyDeleteHeight = await privacyDelete.evaluate((button) =>
|
||||
Math.ceil(button.getBoundingClientRect().height),
|
||||
);
|
||||
expect(privacyDeleteHeight).toBeGreaterThanOrEqual(44);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
await openReviewTab(page, "워크시트");
|
||||
await expect(page.locator(".sr-ws-input").first()).toHaveValue(
|
||||
"학습자가 직접 저장한 원문",
|
||||
);
|
||||
await openReviewTab(page, "축어록");
|
||||
await expect(page.locator(".sr-card--transcript")).toContainText(
|
||||
"다른 친구들이랑 비교할 때마다",
|
||||
);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
||||
expect(calibrationInputReads).toBeGreaterThanOrEqual(1);
|
||||
expect(multimodalPrivacyReads).toBeGreaterThanOrEqual(1);
|
||||
expect(derivedRequestCounts).toEqual({
|
||||
rupture: 0,
|
||||
outcomeTrajectory: 0,
|
||||
deliberatePractice: 0,
|
||||
calibrationSupervisor: 0,
|
||||
multimodalDerived: 0,
|
||||
sessionEvaluation: 0,
|
||||
liveCoach: 0,
|
||||
share: 0,
|
||||
});
|
||||
expect(derivedRequests).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue