세션 평가와 교수자 분석 보강

This commit is contained in:
Yun Chan 2026-07-01 12:10:52 +09:00
parent 5c4ac04e06
commit fe2796f05a
51 changed files with 4928 additions and 240 deletions

View file

@ -39,6 +39,13 @@ _APPROPRIATENESS_SCORE = {
}
def _coerce_error_message(error: BaseException | str) -> str:
if isinstance(error, BaseException):
message = str(error).strip()
return message or error.__class__.__name__
return str(error).strip() or "unknown session evaluation error"
@dataclass(slots=True)
class CaseContext:
case_id: str
@ -114,7 +121,7 @@ class SessionEvaluationWrite:
scope=scope,
stage=stage,
payload={},
error=str(error),
error=_coerce_error_message(error),
)
def cache_record(self) -> dict[str, Any]:
@ -1254,9 +1261,8 @@ async def load_session_evaluation(
session_id,
)
if row is None:
return (
_EVALUATION_CACHE.get(session_id) if runtime_fallback_allowed() else None
), False
cached = _EVALUATION_CACHE.get(session_id) if runtime_fallback_allowed() else None
return cached, cached is None
return {
"status": row["status"],
"source": row["source"],