from tracely_harness import TracelyReplay, assert_trace_matches production_trace = { "input": "Book a flight to Paris leaving July 32", "steps": [ { "tool": "date_parser", "input": "July 32", "output": None, "error": "date out of range" }, { "tool": "fallback_response", "input": None, "output": "Sorry, I couldn't find flights for that date." } ], "final_response": "Sorry, I couldn't find flights for that date.", "expected_behavior": "Detect bad user input and suggest alternatives: e.g., 'There is no July 32. Did you mean July 31 or August 1?'" } def test_july_32_trace_replay(): result_trace = TracelyReplay.run_from_trace(production_trace) assert_trace_matches(result_trace, production_trace, strict=True) assert "Did you mean" in result_trace["final_response"]