Skip to content

feat(impact): --action rename with call-site checklist (closes #241) - #247

Merged
Wolfvin merged 1 commit into
mainfrom
feat/issue-241-impact-rename-simulation
Jul 12, 2026
Merged

feat(impact): --action rename with call-site checklist (closes #241)#247
Wolfvin merged 1 commit into
mainfrom
feat/issue-241-impact-rename-simulation

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #241.

Summary

  • impact . --check impact --name X --action rename --new-name Y returns rename_checklist (file/line/caller per real call site) + explicit rename_caveat about dynamic/string-based references not being covered.
  • --action rename without --new-name errors immediately instead of silently proceeding as a no-op.
  • No engine changes — 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 tests
  • pytest tests/test_impact_command.py tests/test_issue195_consolidation.py tests/test_command_registry.py — all pass
  • Manual verification on real workspace: rename simulation for a symbol with 4 real call sites produced the correct checklist; missing --new-name errors clearly

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Wolfvin
Wolfvin merged commit 712c4a5 into main Jul 12, 2026
1 of 7 checks passed
@Wolfvin
Wolfvin deleted the feat/issue-241-impact-rename-simulation branch July 12, 2026 12:56
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.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(impact): friendly 'simulate change' entry point, extend beyond delete to rename

1 participant