From beaa163ca8c72337a9edf75f7c027bbd5a962f02 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 1 Sep 2026 09:12:24 +1000 Subject: [PATCH] Fix the two record defects from #52 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit assignat.xlsx.yml said 14 further sheets and listed 15; fifteen is right (18 in the workbook, 3 distinct sheets read). The miscount came from subtracting the four schema.sheets entries rather than the three distinct names, since Data is declared twice. committed_referenced() carried a basename fallback whose condition was a strict superset of the first branch's, so it could only be evaluated where it could not hold — dead code that read as protection. Deleted rather than widened: a basename match would count a same-named file in another directory as referenced and quietly hide orphans. Regression-checked by scanning the same local clones with both versions: audit.json identical apart from the timestamp. See #52. Co-Authored-By: Claude Fable 5 --- lectures/assignat.xlsx.yml | 2 +- scripts/build_audit.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lectures/assignat.xlsx.yml b/lectures/assignat.xlsx.yml index 91b6de0..dd144e0 100644 --- a/lectures/assignat.xlsx.yml +++ b/lectures/assignat.xlsx.yml @@ -94,7 +94,7 @@ schema: dtypes: [float64] known_nulls_total: 0 description: monthly index aligned with the P:Q block above - # 14 further sheets ship with the workbook and are not read by any lecture: + # 15 further sheets ship with the workbook and are not read by any lecture: # Intro, Fig6, Data2, Denomina, Dom-nat, Exchge, Exchge2, Exchge3, # Inflatio, Metal, Mint, Ramel, Ramel2, Revoluti, Post-95. # Kept as the authors assembled them -- they are the working provenance for diff --git a/scripts/build_audit.py b/scripts/build_audit.py index 26bca89..6ef40d2 100644 --- a/scripts/build_audit.py +++ b/scripts/build_audit.py @@ -306,7 +306,6 @@ def committed_referenced(repo: str, committed: list[str], all_refs: list[dict]): """Which committed data files does some lecture actually read?""" referenced = set() for path in committed: - base = Path(path).name for r in all_refs: if r["pattern"] == "embedded": continue # a %%file cell shadows, it does not reference @@ -319,9 +318,6 @@ def committed_referenced(repo: str, committed: list[str], all_refs: list[dict]): elif r.get("gh_repo", "").lower() == repo.lower(): if r.get("path", "").strip("/") == path: referenced.add(path) - elif r["pattern"] == "local-path" and r["repo"] == repo and \ - Path(r["target"]).name == base: - referenced.add(path) return referenced