← Table of Contents · Page 673 of 868

PROJECT ONE - A MINIMAL HARNESS

Part 11 of 11

CHECK YOUR UNDERSTANDING • Why does the permission gate convert a path to its full final form before checking it? ◦ Answer: Because a crafted path such as ../secret.txt can look harmless at first glance but climb out of the allowed folder, and the full final path shows where it truly points. • Name the three beats of the loop and say where each appears in main_loop.py. ◦ Answer: Think is the call to call_model, act is the call to run_tool inside the try block, and observe is the line that appends the tool result to the messages. • What is the purpose of the step limit? ◦ Answer: It guarantees the loop ends even if the model never says it is finished, so a mistake cannot run forever and waste money. • Why does the lab use a mock model instead of a real one at this stage? ◦ Answer: A mock model behaves the same every time and needs no account, so any failure must come from the harness code, which is what you are learning to test. • Which flaw did we plant in write_report, and when will you fix it? ◦ Answer: It silently overwrites an existing report with no check and no record, and you will find and fix it in Chapter 67.
Advertisement
Read Aloud:
0:00 / 0:00