p = "output/summary.md" s = open(p, encoding="utf-8").read() def rep(old, new): global s assert s.count(old) == 1, old s = s.replace(old, new) rep("All figures come from output/build_task1.py, which also checks them against a hand calculation (assertions passed).", "All figures come from output/build_task1.py, run from the workspace root. It checks every metric against a hand calculation and checks the reconciliation and RF05 range below; all assertions passed on the last run (revision 2).") rep("In every file, included + excluded = raw.", "In every file, included + excluded = raw for both row counts and amounts. build_task1.py checks this with assertions, and also checks that exceptions.csv lists exactly the excluded rows.") rep("- Refunds take the product of their linked October paid order. Duplicate or invalid refund rows have no product assigned.", "- For information, each refund row shows the product of its linked October paid order, including excluded rows such as R03, R04 and R07. R05 (N9999) has no linked order, so its product is left blank.\n- In exceptions.csv, `recorded_amount_cad` is the amount on the excluded source row. It is not a change to the reported totals. `effect_on_totals` shows which rows are simply not counted and which leave a total provisional (R06).") s += """ ## Revision 2 (review pass) The figures are unchanged. Changes were to file clarity and to checks now done by the script. The original submission is kept in output/original_submission_v1/. See output/CHANGELOG.md. """ open(p, "w", encoding="utf-8").write(s) print("ok")