G0~G8 성과·동맹 측정 OS 작업 일괄 고정
8월 7일까지 워킹트리에만 남아 있던 미커밋 작업을 커밋한다. 여러 사본 폴더(worktree·clone)에 흩어져 있던 중간 스냅샷을 정리하기 전에 원본을 git 이력으로 고정하는 것이 목적이다. - contracts/routes/services: measurement, outcome_trajectory, rupture_repair, deliberate_practice, calibration_transfer, supervision_research, multimodal_alliance, continuous_improvement 계열 신규 모듈과 테스트 - infra/db/init: 07~16 마이그레이션(측정 기반~calibration transfer 실행) - apps/web: 세션 리뷰 카드·관리 화면·E2E 스펙 추가 - docs/ops: G0~G8 라이브 통합·배포·롤백 증거 문서와 evidence JSON/PNG - scripts: smoke·ledger·릴리스 에이전트·NAS 프리뷰 운영 스크립트 engine.public 로그 .bak과 apps/web/test-results 산출물은 커밋에서 제외했다.
This commit is contained in:
parent
93dd8f82d7
commit
16e791e044
390 changed files with 243188 additions and 499 deletions
|
|
@ -68,12 +68,15 @@ export async function withGlobalEngineConfigLock<T>(
|
|||
}
|
||||
}
|
||||
|
||||
const E2E_COHORT_ID = "e2e-hanshin";
|
||||
|
||||
export async function signInAsLearner(page: Page) {
|
||||
const res = await page.request.post("/api/auth/dev-login", {
|
||||
data: {
|
||||
email: uniqueE2EEmail("learner", "hs.ac.kr"),
|
||||
role: "learner",
|
||||
display_name: "E2E Learner",
|
||||
cohort_ids: [E2E_COHORT_ID],
|
||||
},
|
||||
});
|
||||
expect(res.ok(), await res.text()).toBeTruthy();
|
||||
|
|
@ -93,6 +96,7 @@ export async function signInAsTeacher(page: Page) {
|
|||
email: uniqueE2EEmail("teacher", "hs.ac.kr"),
|
||||
role: "teacher",
|
||||
display_name: "E2E Teacher",
|
||||
cohort_ids: [E2E_COHORT_ID],
|
||||
},
|
||||
});
|
||||
expect(res.ok(), await res.text()).toBeTruthy();
|
||||
|
|
@ -167,6 +171,75 @@ export async function fetchAvailablePersona(page: Page, index = 0): Promise<E2EP
|
|||
return personas[index] ?? personas[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* 새 회기의 첫 발화 전에 append-only Alliance pre 기준을 잠근다.
|
||||
* 실제 API를 사용하는 세션 E2E가 제품의 fail-closed 진입 계약을 우회하지 않게 한다.
|
||||
*/
|
||||
export async function completeAlliancePreCheckpoint(page: Page) {
|
||||
const heading = page.getByRole("heading", {
|
||||
name: "첫 발화 전에 내 기준을 잠급니다",
|
||||
});
|
||||
await expect(heading).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
for (const axis of ["목표", "과업", "유대"] as const) {
|
||||
/* elapsed/HMR 갱신으로 checkpoint subtree가 교체될 수 있다. 매 poll마다 현재
|
||||
label 좌표를 다시 얻어 실제 포인터로 누르고, 새 DOM의 checked 상태를 읽는다.
|
||||
input property를 직접 쓰거나 제품 gate를 우회하지 않는다. */
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
const group = page.getByRole("group", { name: new RegExp(`^${axis}`) });
|
||||
const selected = group.getByRole("radio", { name: "3 보통이다" });
|
||||
if (await selected.isChecked().catch(() => false)) return true;
|
||||
|
||||
const label = selected.locator("xpath=ancestor::label[1]");
|
||||
const box = await label.boundingBox().catch(() => null);
|
||||
if (!box) return false;
|
||||
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
|
||||
return page
|
||||
.getByRole("group", { name: new RegExp(`^${axis}`) })
|
||||
.getByRole("radio", { name: "3 보통이다" })
|
||||
.isChecked()
|
||||
.catch(() => false);
|
||||
},
|
||||
{
|
||||
message: `${axis} 동맹 기준이 실제 포인터 입력으로 선택되어야 한다`,
|
||||
timeout: 15_000,
|
||||
intervals: [50, 100, 200, 400],
|
||||
},
|
||||
)
|
||||
.toBe(true);
|
||||
}
|
||||
|
||||
const saved = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return (
|
||||
response.request().method() === "POST" &&
|
||||
url.pathname.includes("/sessions/") &&
|
||||
url.pathname.includes("/alliance-pulses")
|
||||
);
|
||||
}, { timeout: 15_000 });
|
||||
const submit = page.getByRole("button", {
|
||||
name: "기준 잠그고 첫 발화 준비",
|
||||
});
|
||||
await submit.scrollIntoViewIfNeeded();
|
||||
const currentSubmit = page.getByRole("button", {
|
||||
name: "기준 잠그고 첫 발화 준비",
|
||||
});
|
||||
await expect(currentSubmit).toBeEnabled();
|
||||
const submitBox = await currentSubmit.boundingBox();
|
||||
expect(submitBox, "Alliance pre 저장 버튼 좌표").not.toBeNull();
|
||||
await page.mouse.click(
|
||||
(submitBox?.x ?? 0) + (submitBox?.width ?? 0) / 2,
|
||||
(submitBox?.y ?? 0) + (submitBox?.height ?? 0) / 2,
|
||||
);
|
||||
const response = await saved;
|
||||
expect(response.ok(), await response.text()).toBeTruthy();
|
||||
await expect(
|
||||
page.locator('.sx-page--active textarea[aria-label="학습자 발화 입력"]'),
|
||||
).toBeEnabled({ timeout: 15_000 });
|
||||
}
|
||||
|
||||
export async function expectNoHorizontalOverflow(page: Page) {
|
||||
await expect
|
||||
.poll(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue