Same inputs, same report
Run the September report twice from scratch and compare fingerprints, then see what one hand edit does to them.
2 parts · 3 and 10 min · part 2 on a computer
Free course. Your Maestro, an AI, .
Before you start this module, think back to the gate you built at the end of Module 2: when report.run() rejected November's broken file, what happened to reports/latest.json, and which step in report.py kept that file safe?
Guarding the door against bad files is half the job. The other half begins next month, when a teammate runs the report while you are away, or when you rerun September six months from now on another machine. You need the report to be reproducible: starting from the same input files and running the same code produces the exact same result for anyone who runs it.
Fingerprints and silent hand edits
Comparing two output files line by line by eye is slow, and a single changed digit is easy to miss. In repro.py, the fingerprint() function runs the report inside a clean temporary folder created by fresh_copy(), reads reports/history.csv as raw bytes, and takes the first 12 characters of its SHA-256 hash:
with open(os.path.join(base, "reports", "history.csv"), "rb") as f: return hashlib.sha256(f.read()).hexdigest()[:12]That 12-character string is a fingerprint of reports/history.csv. As long as every character, digit, and newline in the file is identical, two runs in separate folders print the exact same fingerprint. If even one digit changes anywhere in the file, the fingerprint changes completely.
Reproducibility holds only when the input files stay untouched and every step lives in the Glossary word. In everyday reporting, the most common leak is a quick hand edit right before a run. Suppose someone opens the Glossary word in an editor and changes order S-0903 on September 9 from 250 to 205 because a manager mentioned an adjustment in chat.
When report.py runs on that edited copy, contract.py sees a unique order ID, a September date, an allowed East region, and a non-negative number. The run succeeds, the East total in reports/history.csv drops from 650.00 to 605.00, and the file gets a new fingerprint. Nothing in reports/runs.csv or in the project folder records that a person changed a number by hand. Next month, when a colleague reruns September from the original data/sales_2026-09.csv, their report will disagree with yours and neither of you will have a record of why. If you want to talk through why contract.py lets the edited 205 amount pass without a warning, ask your Maestro.
Why a matching fingerprint can still be wrong
A matching fingerprint proves that two runs are consistent, while saying nothing about whether the math is accurate. If report.py had a bug that doubled every North order, two clean runs would still produce the exact same wrong reports/history.csv and the exact same fingerprint. Reproducibility guarantees that the same inputs and steps always give the same output; the tests and finance Glossary word you built earlier are what verify that the numbers are right.
Running a script twice in the same folder on your own machine can also fool you. If you already edited your local copy of data/sales_2026-09.csv by hand, running report.py twice on that folder will give you the same fingerprint both times, even though someone else starting from a clean copy of the project will get a different result.
Try it
Run repro.py to see Run 1 and Run 2 print identical fingerprints from two fresh folders. Then add a third run at the bottom of repro.py: create a new folder with fresh_copy(), replace "S-0903,2026-09-09,East,250" with "S-0903,2026-09-09,East,205" inside that folder's data/sales_2026-09.csv, and print its fingerprint.
A good place to stop. Up next: the workbench · 10 min · on a computer
Check your output: Run 1 and Run 2 should print the exact same 12-character fingerprint, and the third run should print a completely different one. Every run passed contract.py, yet the hand-edited input produced a different reports/history.csv with no trace of the change. If your third run prints the same fingerprint as the first two, share your code with your Maestro to check which folder it edited.