세션 평가·라이브코치·교수자 분석 라운드 마감 + 문서 정리 + 코드품질 리팩터

- 누적 작업트리 커밋: 회기 평가 복구·durable 저장, 라이브 코치 이력/근거, 교수자 학생분석, 음성 비언어 메타, PII 마스킹, 운영 티켓/헬스 등
- 문서: 완료 기록 docs/archive/ 냉동 보관, docs/ 단일 인덱스(docs/README.md)+통합 TODO(docs/TODO.md)로 정리
- 리팩터(행위 보존): Stage enum SSOT(taxonomy 소유·state_machine re-export), store recent/masked_turns 중복 제거, speaker_ko_label 단일 헬퍼, _list_sessions N+1 제거(state/turns 배치 + 턴평가 하이드레이션 배치)
- 검증: 백엔드 pytest 352 passed, _list_sessions E2E chromium-single-run 2 passed
This commit is contained in:
Yun Chan 2026-07-02 02:50:36 +09:00
parent 7c41c3ce79
commit 778e8526d4
108 changed files with 6457 additions and 455 deletions

View file

@ -225,6 +225,11 @@ CREATE POLICY p_feedback_update ON app.feedback_scores FOR UPDATE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_feedback_delete ON app.feedback_scores;
CREATE POLICY p_feedback_delete ON app.feedback_scores FOR DELETE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
-- ── normalized turn evaluation tables: 원시 평가는 evaluator/admin만 직접 접근 ──
ALTER TABLE app.turn_technique ENABLE ROW LEVEL SECURITY;
@ -238,6 +243,11 @@ CREATE POLICY p_turn_technique_insert ON app.turn_technique FOR INSERT WITH CHEC
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_turn_technique_delete ON app.turn_technique;
CREATE POLICY p_turn_technique_delete ON app.turn_technique FOR DELETE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
ALTER TABLE app.turn_client_state ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_turn_client_state_select ON app.turn_client_state;
@ -250,6 +260,11 @@ CREATE POLICY p_turn_client_state_insert ON app.turn_client_state FOR INSERT WIT
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_turn_client_state_delete ON app.turn_client_state;
CREATE POLICY p_turn_client_state_delete ON app.turn_client_state FOR DELETE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
ALTER TABLE app.supervisor_comment ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS p_supervisor_comment_select ON app.supervisor_comment;
@ -262,6 +277,11 @@ CREATE POLICY p_supervisor_comment_insert ON app.supervisor_comment FOR INSERT W
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_supervisor_comment_delete ON app.supervisor_comment;
CREATE POLICY p_supervisor_comment_delete ON app.supervisor_comment FOR DELETE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
-- ── session_review_status: 교수자 회기 단위 작업 상태. 학습자 직접 열람 없음 ──
ALTER TABLE app.session_review_status ENABLE ROW LEVEL SECURITY;
@ -295,6 +315,11 @@ CREATE POLICY p_alternative_utterance_insert ON app.alternative_utterance FOR IN
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
DROP POLICY IF EXISTS p_alternative_utterance_delete ON app.alternative_utterance;
CREATE POLICY p_alternative_utterance_delete ON app.alternative_utterance FOR DELETE USING (
app.is_ai_context()
OR app.current_role_name() IN ('admin','instructor')
);
-- ── case_profile / pinned_fact: 학습자=본인 케이스만(cross-trainee 누수 차단 T4) ──
ALTER TABLE app.case_profile ENABLE ROW LEVEL SECURITY;