평가 캐시와 개인정보 마스킹 보강

This commit is contained in:
Yun Chan 2026-06-28 20:12:20 +09:00
parent f0771db919
commit 6a81ec596c
11 changed files with 737 additions and 14 deletions

View file

@ -13,7 +13,7 @@ from typing import Optional
from . import db, session_persistence
from .deps import Principal
from .runtime_policy import require_runtime_fallback_allowed, runtime_fallback_allowed
from .services import orchestrator, state_machine
from .services import guardrail, orchestrator, state_machine
from .store import InProcSession, TurnRecord, store
_STAGE_LABELS = {
@ -130,6 +130,7 @@ async def record_completed_turn(
context=f"{context_prefix} turn append",
)
if result.client_reply:
client_mask = guardrail.mask_pii(result.client_reply)
await append_completed_turn(
sess,
TurnRecord(
@ -137,7 +138,7 @@ async def record_completed_turn(
speaker="client",
stage=stage_label(result.state_after.stage),
text=result.client_reply,
text_masked=result.client_reply,
text_masked=client_mask.text_masked,
llm_provider=result.llm_provider,
model=result.model,
tokens_in=result.tokens_in,