LMLExplore never waits for its dependencies: it may build material that Mathlib, Tau Ceti or LML later provide. This scan finds such material after each dependency sync, so that LMLExplore can delete its copy and use the upstream version. It also catches duplicates of material that already existed upstream, which review cannot see for Tau Ceti and LML: the review engine only gives reviewers Mathlib's source.
The design follows Tau Ceti's Mathlib overlap scanner (scan, then one issue per finding, then one
refactor pull request per issue). Because LMLExplore moves its pins only at syncs, each scan simply
covers the range between the previous pins and the current ones, for every upstream marked
overlap = true in tauceti.toml.
Run these from an up-to-date checkout of main, right after a sync has landed.
-
Check out the dependencies at their new pins:
scripts/build.sh
-
Collect the material to compare (mechanical, a few seconds):
python3 scripts/overlap/collect.py
It prints the bundle directory it created under
.lake/overlap-scan/. By default it compares with the previous sync, the previous commit that changedlake-manifest.json; use--sinceto choose another LMLExplore commit, or--old PACKAGE=REVto override one upstream's previous pin. -
Have an agent run the scan, which only writes
result.jsonin the bundle:claude "Follow scripts/overlap/scan.md with the bundle <bundle directory>" -
Read
result.json, then publish one issue per finding (labelledupstream-overlap). Findings that already have an issue are skipped:python3 scripts/overlap/publish.py <bundle directory> # dry run python3 scripts/overlap/publish.py <bundle directory> --apply # create the issues
-
Resolve each issue with a refactor pull request, which goes through normal review:
claude "Follow scripts/overlap/fix.md for issue #<number>"
collect.py: lists the declarations each upstream added or changed between its two pins (ignoring moves and private declarations), and LMLExplore's new and current declarations.scan.md: instructions for the read-only scan.publish.py: turns the scan result into issues.fix.md: instructions for resolving one issue.