| """The synthetic training dataset (training/make_dataset.py) stays well-formed."""
|
| from server.schema import ActionPlan
|
| from training.make_dataset import SEEDS, to_record
|
|
|
|
|
| def test_enough_seeds():
|
| assert len(SEEDS) >= 20
|
|
|
|
|
| def test_seed_shape_and_validity():
|
| for now, thread, plan in SEEDS:
|
| assert isinstance(now, str) and isinstance(thread, str)
|
|
|
| ActionPlan(**plan)
|
|
|
|
|
| def test_to_record_builds_chat_triple():
|
| now, thread, plan = SEEDS[0]
|
| rec = to_record(now, thread, plan)
|
| roles = [m["role"] for m in rec["messages"]]
|
| assert roles == ["system", "user", "assistant"]
|
|
|
|
|
| def test_covers_hard_cases():
|
| """Sanity that the expansion includes empties, conflicts, clarifications, images."""
|
| plans = [p for _, _, p in SEEDS]
|
| assert any(p["events"] == [] for p in plans)
|
| assert any(p["conflicts"] for p in plans)
|
| assert any(p["proposed_times"] for p in plans)
|
| assert any(p.get("needs_clarification") for p in plans)
|
| threads = [t for _, t, _ in SEEDS]
|
| assert any("[image:" in t for t in threads)
|
|
|