관리자 감정 관측 기록과 조회 API 추가

This commit is contained in:
Yun Chan 2026-09-23 04:45:50 +09:00
parent d22cd9883d
commit acb0d26338
16 changed files with 1445 additions and 18 deletions

View file

@ -25,6 +25,7 @@ from .session_persistence import ensure_review_tables
from .services.jev_client import jev_client
from .runtime_schema import (
CALIBRATION_TRANSFER_SCHEMA_CONTRACT,
CLIENT_AFFECT_TRACE_SCHEMA_CONTRACT,
CONTINUOUS_IMPROVEMENT_SCHEMA_CONTRACT,
DELIBERATE_PRACTICE_SCHEMA_CONTRACT,
MEASUREMENT_SCHEMA_CONTRACT,
@ -90,6 +91,7 @@ async def lifespan(app: FastAPI):
supervision_research_schema_ready = False
continuous_improvement_schema_ready = False
multimodal_alliance_schema_ready = False
client_affect_trace_schema_ready = False
app.state.upload_database_proof = None
try:
await init_pool()
@ -102,6 +104,10 @@ async def lifespan(app: FastAPI):
await ensure_notification_tables()
await ensure_protocol_tables()
async with acquire(role="admin") as conn:
client_affect_trace_schema_ready = await schema_contract_ready(
conn,
CLIENT_AFFECT_TRACE_SCHEMA_CONTRACT,
)
measurement_schema_ready = await schema_contract_ready(
conn,
MEASUREMENT_SCHEMA_CONTRACT,
@ -134,6 +140,14 @@ async def lifespan(app: FastAPI):
conn,
MULTIMODAL_ALLIANCE_SCHEMA_CONTRACT,
)
if runtime_schema_bootstrap_required(
CLIENT_AFFECT_TRACE_SCHEMA_CONTRACT,
ready=client_affect_trace_schema_ready,
):
logger.warning(
"감정 관측 trace 스키마가 불완전해 Jev 전이 trace를 저장할 수 없음; "
"infra/db/init/23_client_affect_trace.sql 적용 필요"
)
if runtime_schema_bootstrap_required(
MEASUREMENT_SCHEMA_CONTRACT,
ready=measurement_schema_ready,