feat(impact): --action rename with call-site checklist (closes #241) - #247
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
impact_engine.analyze_impact(action="delete"|"modify") already did most of what a "safe to change" sandbox needs — the actual blast-radius traversal is action-agnostic (uses `if action == "delete"` guards that simply no-op for other values, no engine changes needed here). What was missing: rename, the most common refactor an AI agent performs, and the one most likely to be done unsafely without a checklist. `impact . --check impact --name X --action rename --new-name Y` now returns `rename_checklist` (every statically-resolved call site: file, line, caller) plus an explicit `rename_caveat` — this is static analysis only, it does NOT catch dynamic import(), reflection, string-keyed dispatch, or the name appearing in comments/docs. `--action rename` without `--new-name` errors immediately instead of silently running as if it were a no-op action. Verified end-to-end on a real workspace: renaming a symbol with 4 real call sites produced the correct checklist with file/line/caller for each, and the missing --new-name case errors clearly instead of proceeding.
|
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.



Closes #241.
Summary
impact . --check impact --name X --action rename --new-name Yreturnsrename_checklist(file/line/caller per real call site) + explicitrename_caveatabout dynamic/string-based references not being covered.--action renamewithout--new-nameerrors immediately instead of silently proceeding as a no-op.analyze_impact's traversal was already action-agnostic; this is purely output enrichment in the command layer.Test plan
pytest tests/test_impact_command.py— 3/3 new testspytest tests/test_impact_command.py tests/test_issue195_consolidation.py tests/test_command_registry.py— all pass--new-nameerrors clearly