Spaces:
Sleeping
Sleeping
| from app.schemas.commit_adaptation import CommitAdaptationReview, InteractionQuote, MemoryProposal | |
| def test_commit_adaptation_review_round_trips_valid_payload(): | |
| review = CommitAdaptationReview( | |
| memory_proposals=[ | |
| MemoryProposal( | |
| proposal_id="p1", | |
| destination="student", | |
| kind="preferred_name", | |
| statement="The student prefers to be called Anshuman.", | |
| interaction_ids=["interaction-1"], | |
| evidence_quotes=[InteractionQuote(interaction_id="interaction-1", quote="call me Anshuman")], | |
| confidence=0.95, | |
| ) | |
| ], | |
| inferred_persona_text="Introduce concepts incrementally.", | |
| ) | |
| assert review.memory_proposals[0].destination == "student" | |
| assert review.inferred_persona_text == "Introduce concepts incrementally." | |
| def test_memory_proposal_rejects_unknown_destination(): | |
| import pytest | |
| from pydantic import ValidationError | |
| with pytest.raises(ValidationError): | |
| MemoryProposal( | |
| proposal_id="p1", | |
| destination="global", # not a valid Literal value | |
| kind="x", | |
| statement="x", | |
| interaction_ids=[], | |
| evidence_quotes=[], | |
| confidence=0.5, | |
| ) | |