세션 계약 SSOT 정리

This commit is contained in:
Yun Chan 2026-06-27 18:47:55 +09:00
parent 1881fe50bd
commit 17b114f647
8 changed files with 43 additions and 47 deletions

View file

@ -1305,8 +1305,11 @@ export interface components {
session_id: string;
/** Session No */
session_no: number;
/** Stage */
stage: string;
/**
* Stage
* @enum {string}
*/
stage: "라포" | "탐색" | "개입" | "정리";
/** Started At */
started_at: string;
/**
@ -1762,8 +1765,11 @@ export interface components {
review_ready: boolean;
/** Session Id */
session_id: string;
/** Stage */
stage: string;
/**
* Stage
* @enum {string}
*/
stage: "라포" | "탐색" | "개입" | "정리";
/** Started At */
started_at: string;
/**
@ -1785,8 +1791,11 @@ export interface components {
* @enum {string}
*/
speaker: "learner" | "client";
/** Stage */
stage: string;
/**
* Stage
* @enum {string}
*/
stage: "라포" | "탐색" | "개입" | "정리";
/** Text */
text: string;
/** Turn Seq */
@ -1941,8 +1950,11 @@ export interface components {
session_id: string;
/** Session No */
session_no: number;
/** Stage */
stage: string;
/**
* Stage
* @enum {string}
*/
stage: "라포" | "탐색" | "개입" | "정리";
};
/** TeacherDashboardResponse */
TeacherDashboardResponse: {
@ -2207,8 +2219,11 @@ export interface components {
* @default false
*/
safety_flagged: boolean;
/** Stage */
stage: string;
/**
* Stage
* @enum {string}
*/
stage: "라포" | "탐색" | "개입" | "정리";
/** Turn Seq */
turn_seq: number;
};

View file

@ -165,7 +165,7 @@ export const authApi = {
withdrawConsent: () => api.del<ConsentResponse>("/auth/consent"),
};
export type SessionStage = "라포" | "탐색" | "개입" | "정리";
export type SessionStage = ApiSchema<"SessionStartResponse">["stage"];
/** GET /personas — personas.py PersonaSummary */
export type PersonaSummary = ApiSchema<"PersonaSummary">;
@ -178,15 +178,7 @@ export type PersonaDraftPayload = ApiSchema<"PersonaDraftPayload">;
export type PersonaDraftDetail = ApiSchema<"PersonaDraftDetail">;
/** POST /sessions — sessions.py SessionStartResponse */
export interface SessionStartResponse {
session_id: string;
case_id: string;
session_no: number;
stage: SessionStage;
effective_openness: number;
recall_summary: string | null;
degraded: boolean;
}
export type SessionStartResponse = ApiSchema<"SessionStartResponse">;
/** POST /sessions/{id}/turn — sessions.py TurnResponse */
export type TurnResponse = ApiSchema<"TurnResponse">;
@ -201,20 +193,7 @@ export type LearnerSessionsResponse = ApiSchema<"LearnerSessionsResponse">;
export type SessionDetailTurn = ApiSchema<"SessionDetailTurn">;
export interface SessionDetailResponse {
session_id: string;
case_id: string;
persona_code: string;
persona_name: string;
theory_mode: string;
status: "active" | "ended";
stage: SessionStage;
effective_openness: number;
started_at: string;
ended_at: string | null;
turns: SessionDetailTurn[];
review_ready: boolean;
}
export type SessionDetailResponse = ApiSchema<"SessionDetailResponse">;
export type ReviewClient = ApiSchema<"ReviewClient">;
export type ReviewTechnique = ApiSchema<"ReviewTechnique">;

View file

@ -587,7 +587,7 @@ export default function Session() {
setStage(detail.stage);
setOpenness(detail.effective_openness);
setUtterances(
detail.turns.map((turn) => ({
(detail.turns ?? []).map((turn) => ({
id: nextId(),
speaker: turn.speaker === "client" ? "client" : "learner",
text: turn.text,