Repository navigation
Emit clean frontier from --codemod-plan-out and add script/layer guards to promote_hidden_imports - #642
Merged
Conversation
…romotion on script setup and declared layer boundaries
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
Two high-leverage codemod improvements from Toad bench feedback:
--codemod-plan-out(codemod_runtime.py,cli.py):FindingRecipePlan.exportable_plan_document: returns the full document when unblocked, the unique clean trajectory frontier branch (len(branches) == 1and non-empty), or the proved conflict-free candidate batch (document.has_recipes) when sibling findings haveneeds_input/needs_operation/ conflicts.CodemodSynthesisExecution.run()writesexportable_plan_documentto--codemod-plan-outand returns0(while still reporting everyneeds_input/needs_operationsibling in stdout JSON), and still refuses--codemod-applyor empty/ambiguous exports.promote_hidden_importsscript-guard & layer-boundary awareness (declared_root.py,hidden_imports.py):import_runtime_setup_change+_ModuleTopLevelSetupChangesto detect bothsys.pathandos.environ(os.environ[...] = ...,setdefault/update/pop/clear,os.putenv/unsetenv) at module top level (including insideif __name__ == "__main__":) and inside functions before the import. Live Toad verification:tools/qt_drive.py(25 hidden imports),tools/drive_sweep.py, andtools/physical_ui_remote.pyall refuse cleanly naming the exact setup line.[tool.nominal-refactor-advisor] forbidden-imports = [{ from = "...", to = "..." | [...] }](ForbiddenImportEdge,DeclaredRoot.forbidden_imports_for) enforced in bothHiddenImportPlanandCompactHiddenImportPlanacross direct, transitive scanned, external (top_level_imported_modules), and reverse-importer edges (CrossesForbiddenImportEdge).Verification
tests/test_hidden_imports.py,tests/test_hidden_import_cuts.py,tests/test_type_only_readers.py,tests/test_refactor_advisor.py -k "synthesized_plan or finding_backed_codemod_plan or blocks_unproved_finding_backed_plan or shared_typed_execution_lifecycle") + 72test_repository_*guards + touched-line NRA self-scan ondesktop.