평가 캐시와 개인정보 마스킹 보강
This commit is contained in:
parent
f0771db919
commit
6a81ec596c
11 changed files with 737 additions and 14 deletions
|
|
@ -9,6 +9,7 @@ from unittest.mock import patch
|
|||
from .deps import Principal, Role
|
||||
from . import session_persistence
|
||||
from .routes import sessions
|
||||
from .services import evaluator
|
||||
from .services import persona as persona_service
|
||||
from .services import state_machine
|
||||
from .store import InProcSession
|
||||
|
|
@ -44,6 +45,29 @@ class FakeAcquire:
|
|||
|
||||
|
||||
class EvaluationPersistenceMappingTest(unittest.TestCase):
|
||||
def test_fast_evaluator_masks_client_reply_before_prompting(self) -> None:
|
||||
card = persona_service.P1
|
||||
state = state_machine.init_state(params=card.openness_params())
|
||||
ctx = sessions.orchestrator.prepare_turn(
|
||||
session_id="eval-mask-session",
|
||||
case_id="eval-mask-case",
|
||||
card=card,
|
||||
state=state,
|
||||
learner_text="오늘 상담에서 집중해 보겠습니다.",
|
||||
)
|
||||
|
||||
messages = evaluator.build_fast_messages(
|
||||
ctx,
|
||||
"저는 김서연 씨고 한신대학교 상담심리학과 학생이에요.",
|
||||
)
|
||||
blob = "\n".join(message.content for message in messages)
|
||||
|
||||
self.assertNotIn("김서연", blob)
|
||||
self.assertNotIn("한신대학교", blob)
|
||||
self.assertNotIn("상담심리학과", blob)
|
||||
self.assertIn("[NAME]", blob)
|
||||
self.assertIn("[ORG]", blob)
|
||||
|
||||
def test_feedback_rows_preserve_review_scalar_contract(self) -> None:
|
||||
evaluation = {
|
||||
"loop": "fast",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue