Download week06.py, save it in an exercise folder, and run python week06.py --lesson 3. This single practice uses a temporary state.json file, standard-library Python, a small processor, and seconds of runtime. It performs no model inference or external action and removes the temporary folder afterward.
The compact function selects facts, decisions, tentative, revoked, open_questions, and sources, then deep-copies them. A list comprehension identifies the retained keys; a dictionary comprehension maps each key to its state value. The for _ in range(3) loop repeats three times; underscore indicates the iteration index is deliberately unused. Each round writes JSON and reads it back into a fresh object.
Assertions require decisions.output to remain local, tentative.format to remain table, send_by_email to remain revoked, format not to appear in decisions, and the turn reference to survive. PASS confirms those exact invariants after three rounds and reloads. This is deterministic structured compaction, not an unmeasured claim that a free-form model summary is faithful. The downloadable artifact provides an executable baseline against which a later model-assisted summarizer can be evaluated honestly.