Preview the exact operation
rename_symbol symbol: src/users.ts#getUser@12 new_name: getCustomer PREVIEW_OK confirmToken: short-lived, plan-bound completeness + uncovered references
Weavatrix Refactor composes the full read-only Core with 11 tools that identify a change, expose uncertainty, preview against the current tree, apply atomically, refresh the graph and roll back.
Install 0.1.5 See every method ↓# preview and analysis remain read-only $ npx -y weavatrix-refactor <repoRoot> # enable only the sessions allowed to apply and roll back source edits $ WEAVATRIX_ALLOW_SOURCE_EDITS=1 npx -y weavatrix-refactor <repoRoot>
rename_symbol and rename_related_symbols own their full two-phase operation. The same method previews first, then applies the exact recomputed plan when called with its single-use confirmation token.
rename_symbol symbol: src/users.ts#getUser@12 new_name: getCustomer PREVIEW_OK confirmToken: short-lived, plan-bound completeness + uncovered references
rename_symbol same symbol + same new_name mode: apply confirm_token: <preview token> APPLIED all files written or all restored durable rollback bundle retained
Coordinated rename: rename_related_symbols validates up to 50 JS/TS renames together, rejects overlaps, chains, swaps, shadowing and any failed sub-rename, then commits the set as one transaction.
Four complete write workflows, four applyable plan producers and three structural review tools. Every uncertainty stays visible instead of being converted into a guessed edit.
rename_symbolCross-language preview/confirm/apply rename using exact JS/TS LSP, schema-aware SQL or strict graph-plus-lexical evidence.
rename_related_symbolsSeveral JS/TS renames in one language-server session, one conflict check and one atomic multi-file transaction.
apply_edit_planGeneric two-phase executor for hash-bound weavatrix.edit-plan.v1 envelopes.
rollback_last_applyRestores the latest pre-apply bundle and refuses to overwrite files that drifted after apply.
change_signatureAdds or removes JS/TS parameters with byte-exact declaration and call-argument surgery; spreads stay uncertain.
edit_symbolReplaces a symbol body or inserts before/after its parser range, with a JS/TS parse gate.
bulk_replaceTwo-stage literal or regex replacement over selected, stable occurrence IDs and exact expected counts.
organize_importsRemoves only provably unused named JS/TS imports; side-effect, default and namespace imports fail safe.
move_fileBuilds a relocate review, import rewrites and architecture projection without pretending file relocation is a text edit.
move_symbolProjects cycles, boundaries, target dependencies and blast radius before a declaration is moved.
delete_readinessReturns safe, unsafe or UNPROVEN with references and dynamic risks; deletion is never automated.
The write layer does not replace Core analysis. It carries the same graph, provenance and revision through the edit and back into verification.
Install the separate package, select its refactor profile, start with WEAVATRIX_ALLOW_SOURCE_EDITS=1, then present the exact single-use token.
Under the repository lock, every file hash and exact before string must still match the preview.
A mid-write failure restores already-written files. The durable rollback bundle remains retryable after an incomplete restore.
Traversal, escaping links, NTFS streams, non-UTF-8 files, invalid ranges, overlaps and split surrogate pairs are rejected before writing.
A backend never claims more certainty than its evidence supports. Graph-plus-lexical rename remains PARTIAL even when every known reference is found.
| Surface | Backend | Applyable proof | Completeness |
|---|---|---|---|
| JavaScript / TypeScript rename | Bundled language server | EXACT_LSP | COMPLETE when boundary is proven |
| SQL tables / fields | Schema-aware scanner | EXTRACTED / LEXICAL_EXACT | Skipped and ambiguous uses reported |
| Python / Rust / Go | Graph + exact lexical location | EXTRACTED / LEXICAL_EXACT | PARTIAL |
| Java / C# / Solidity | Graph + exact lexical location | EXTRACTED / LEXICAL_EXACT | PARTIAL |
| JS/TS signatures and imports | Parser + graph calls/references | EXTRACTED / RESOLVED | Unproven reach stays explicit |
Honest limits: related multi-symbol rename is JS/TS-only; move_file and move_symbol are review/projection tools; exported deletion cannot receive an automatic clean verdict; tests, typechecking, runtime checks and review remain the release authority.