feat(clean_slate): write-site dataset provenance, orphan reporting, gc phase, tests - #170
Merged
Merged
Conversation
…c phase, tests (#169) - new bin/dataset_provenance.py: AST, order-sensitive write-site classifier (REGENERABLE / DOWNLOADED / ORPHAN) — deletion requires positive write evidence; name mentions never classify; reads cannot launder into writes (path-shaped derivation guard); one-level interprocedural resolution for the simulators/util.py idiom; network-binding files blanket-protect their datasets - clean_slate phase 1b delegates to the helper (hard-fail, no fallback), reports orphans (kept), prunes emptied dataset dirs - size warning aggregated per dataset dir (apparent-size), one line per dir - new phases: untracked .ipynb_checkpoints sweep (__pycache__ deliberately kept — import-speed cache) and per-repo git gc --auto (skipped in dry-run) - wake_up.md guardrail wording made honest: clean-slate deletes untracked regenerable datasets; orphans are reported for a human call - tests: 12 new (14 total) covering never-delete-tracked, start_here writers, the sdp81 read-vs-write doctrine case, download protection, orphan reporting, per-dir warnings, empty-dir pruning, checkpoints/pycache, dry-run, helper hard-fail, unparseable-script tolerance Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcPSpRG8YqseMwRdJEK28m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final leg of the PyAutoMind dataset-bulk series: the wake_up cleanup now actually reclaims regenerated dataset bulk — safely, everywhere it runs, with tests. Closes #169.
The #167 rule (name+type literals in a
simulator*file) missed every dataset written by a non-simulator script: the HowTo repos were a 100% miss andstart_here.py-written dirs survived every sweep. The replacement judges by write site, never name mention:bin/dataset_provenance.py— stdlib AST analyzer, order-sensitive: it tracks which dataset path each variable holds at each point and whether that variable reaches a write call (output_to_fits,json.dump,open(..., "w"), or a same-repo helper whose body writes the parameter — one level of interprocedural resolution for thesimulators/util.pyidiom). Verdicts:REGENERABLE(deleted),DOWNLOADED(network-binding files blanket-protect their datasets — real cached data, kept silently),ORPHAN(no writer — kept and reported for a human call). Deletion requires positive evidence; reads cannot launder into writes (derivations are followed only through path-shaped expressions — the sdp81start_here.pybinds the real dataset it reads three lines from the simulated one it writes, and the analyzer keeps them apart).aplt.fits_arrayis deliberately not a write: dropping one auxiliary product into a real dataset folder is not generating the dataset (this exact case would have condemnedcosmos_web_ring, real JWST data)..ipynb_checkpointssweep (__pycache__deliberately kept — import cache); new per-repogit gc --autophase (the HowTo repos had 42 MB of never-packed loose objects before this week's one-off gc).Validation
DRY_RUN=1acceptance: newly catchessimulated_lens/simulated_galaxy/csv_api_example/start_here_example/howtolens/howtogalaxy(~8 MB across repos today); reportsdataset/imaging/tutorialas orphan; none of the never-touch set (smacs0723,a2744,weak/a2744_pyrrg,multi/rxj1131,sdp81,uv_wavelengths) classifies as regenerable.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AcPSpRG8YqseMwRdJEK28m