Repository navigation
feat(check_dataset_allowlist): cover simulate_if_needed call sites - #329
Merged
Merged
Conversation
Leg 2 of the dataset-allowlist guard AST-scans for should_simulate(...) call sites to prove a capped run cannot rmtree committed files. PyAutoArray's new one-line wrapper simulate_if_needed(dataset_path, simulator) reaches the same rmtree, so scripts swept onto it must stay covered. The scan now matches both names (DELETING_CALLS), taking the first positional argument or the dataset_path= keyword. Tests show the old 8-line block and the swept one-liner resolve to the same call-site path, the keyword form resolves, and a swept script that reaches tracked files still fails the gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8NyQo2s3YUk8eUrrB3
…ewall) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8NyQo2s3YUk8eUrrB3
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.
Phase 2 of PyAutoLabs/PyAutoArray#669.
Summary
Leg 2 of the dataset-allowlist guard scans the code for
should_simulate(...)call sites, to prove a capped run cannotrmtreecommitted dataset files. PyAutoArray's new one-line wrappersimulate_if_needed(dataset_path, simulator)reaches the samermtree, so scripts swept onto it must stay covered.DELETING_CALLS = ("should_simulate", "simulate_if_needed").should_simulate_sitesmatches both names.dataset_path=keyword. A call with neither is ignored, as before.This works with or without the PyAutoArray release: it only parses source text.
Testing
New tests in
tests/test_dataset_allowlist_capped_deletion.py:should_simulate+subprocess.runblock and the swept one-liner give the same(line, path)call site.dataset_path=keyword form resolves.simulate_if_needed()call with no path is ignored.__Env__token still fails the gate.Full suite: 559 passed, 10 failed. The same 10 failures (
test_add_notebook_quotes,test_generate_validates_project,test_strip_env_declarations) occur onmainwithout this change.Merge mode: human
/prm.Generated by Claude Code