
Weavatrix Refactor
io.github.Weavatrix由 GitHub 帳號 Weavatrix 發布v1.0.11更新於 Oct 24, 2026
Transactional refactoring extension with 11 evidence-backed tools, previews, and rollback.
概覽
讓編碼助理規劃、預覽並執行跨檔案重構(例如重新命名),並支援回復。
- 可以做什麼
- Weavatrix Refactor 是面向編碼助理的本機 MCP 伺服器,用於在程式碼儲存庫中執行有證據支撐的重構。它透過儲存庫圖查找符號,產生帶內容雜湊的逐位元組精確編輯計畫,回報無法證明的同名出現位置,並且只在明確且與雜湊綁定的確認後才寫入。它的十一個工具涵蓋重新命名流程、簽章變更、符號編輯、批次取代、匯入整理、檔案移動、刪除就緒評估、計畫套用以及上次套用的回復。
- 適用情境
- 當助理需要進行跨檔案程式碼修改(例如重新命名符號、變更簽章或移動檔案),而且你希望先預覽、再以可回復的交易方式執行,而不是直接編輯時,適合使用它。當你希望名稱有歧義時回傳候選識別碼而不是被猜測時,它也有用。
- 執行需求
- 以本機程序在使用者機器上執行,透過 npm 的 npx 啟動或以 Cargo 安裝,並需要傳入儲存庫的絕對路徑。僅支援桌面端,沒有遠端端點。寫入原始碼檔案需要將環境變數 WEAVATRIX_ALLOW_SOURCE_EDITS 設為 1;未設定時重構工具維持僅預覽。未宣告任何身分驗證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Weavatrix Refactor,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Weavatrix Refactor
[CI] [npm] [crates.io] [docs.rs] [MIT]
The explicit source-write layer of the Weavatrix ecosystem; Core remains read-only.
Refactor across files without letting the agent guess.
Weavatrix Refactor is a native MCP server for coding agents. It finds a symbol through the repository graph, previews byte-exact edits, reports every same-named occurrence it could not prove, and writes only after an explicit, hash-bound confirmation.
The useful difference is not “AI can rename a word.” It is that the agent gets evidence before the write and a recoverable transaction after it.
Install
Run the native binary through npm:
Or install it with Cargo:
An MCP client can start it directly. Prefer an absolute path, or Cursor's
${workspaceFolder} so the write server never follows the host process cwd:
Leave WEAVATRIX_ALLOW_SOURCE_EDITS unset for preview-only sessions. Preview is a read; only a
confirmed apply or rollback requires the gate. Refactor does not expose Core's
open_repo, so it cannot silently retarget mid-session; the launch root is the
only repository it will edit.
Install as a plugin
The repository also ships one plugin bundle for Cursor, Codex, Claude Code, and Grok Build. The plugin starts the extension-only profile, so it contributes the 11 Refactor methods without repeating Weavatrix Core's 43 read-only method definitions. Install the separate Weavatrix plugin when both surfaces are needed.
The bundled skill is optional and activates only for explicitly requested refactoring work. Its entry point stays short; each method has an individual reference card that is loaded only when needed.
- Cursor: search for Weavatrix Refactor after marketplace approval.
- Codex: add the
Weavatrix/weavatrix-refactormarketplace from.agents/plugins, then addweavatrix-refactor@weavatrix-refactor. - Claude Code: add the same repository marketplace from
.claude-plugin, then installweavatrix-refactor@weavatrix-refactor. - Grok Build: run
grok plugin marketplace add Weavatrix/weavatrix-refactor, open/marketplace, and install it.
The plugin opens WEAVATRIX_ALLOW_SOURCE_EDITS=1, but every write still needs
the exact preview's short-lived, plan-bound single-use token.
For a rename task, expose only the two tools the agent needs:
The rename profile keeps rename_symbol and rollback_last_apply; every
unrelated graph and refactor tool is absent and cannot be called. Omit the
option (or use --profile=refactor) for all 11 Refactor methods. The narrower
catalog reduces repeated agent context; it does not weaken preview hashes, the
write gate, the confirmation token, or rollback checks.
When Weavatrix Core is already installed as a separate MCP, expose only the 11 methods that Refactor adds:
The refactor profile is the default for MCP and list-tools, including the
marketplace plugin. The former full compatibility profile has been removed
and is rejected by both commands: Refactor no longer republishes Core methods.
Install Weavatrix Core as its own MCP when read-only repository intelligence is
also needed.
A safe cross-file rename in three calls
Suppose two files declare resolveTarget. A bare name is ambiguous, so the server refuses to
pick one and returns exact ids:
Retry with the intended id. The result is still read-only: it contains the edit plan, content hashes, the proven edit count, and the references the backend refused to guess at.
After reviewing the plan, repeat the same operation with the same inputs and its token:
This exact flow is exercised against the real stdio MCP server. The repository fixture requires seven edits across three files, preserves four traps (a longer identifier, string, comment, and unrelated shadow), and must still compile; it scores 12/12.
What is automatic today
The eleven tools do not all claim the same level of automation:
Refactor uses the Rust Weavatrix graph internally for evidence but never
exports Core methods. Install the separate Weavatrix plugin for read-only
repository intelligence. The Refactor MCP owns exactly its 11 extension
methods; --profile=rename is an optional narrower two-method workflow.
Safety model and exact limits
- Ambiguous names fail with candidate ids instead of selecting the first match.
PARTIALmeans the graph proved the edits in the plan but did not prove that no other semantic references exist.uncertainReferencesnames the places requiring review.- Every file in a plan carries a content hash. A changed working tree makes the preview stale instead of applying the old coordinates.
- Apply requires
WEAVATRIX_ALLOW_SOURCE_EDITS=1plus a short-lived, single-use token bound to that repository and exact recomputed plan. rollback_last_applyrefuses to overwrite files that drifted after the transaction.- Multi-file writes are journaled and crash-recoverable. They are not observationally atomic to unrelated processes: another process may briefly observe an intermediate filesystem state.
Only edits with proven provenance are applied. A lexical or graph backend is deliberately more conservative than a language server and must not be read as a claim of full compiler semantics.
Measured benchmark, with unlike layers kept separate
The checked-in August 2026 benchmark uses equivalent adversarial TypeScript, Rust, and Python
fixtures. Each has seven required edits, four traps, and a build/test gate. Protocol runs count
exact o200k_base initialization, catalog, request, and response tokens. Agent runs use the
actual cumulative usage reported by Codex CLI with pinned gpt-5.6-sol / medium reasoning.
No byte proxy or estimated tokens-per-second conversion is used.
The new rename-only profile kept all nine protocol runs at 12/12 while reducing fixed MCP context from 9,331 to 485 tokens. Its guided TypeScript agent A/B is:
The full agent matrix is 12/12 in all 27 TypeScript/Rust/Python runs; every run also completed
operationally and passed the sanitized edit-channel audit. The deterministic protocol
matrix also exposed a language-specific Serena defect: its suggested find_symbol →
rename_symbol flow scored 7/12 on TypeScript in all three runs, while Rust and Python passed.
It also found and drove fixes for Rust macro calls and Python f-string/module-level call evidence.
On this toy TypeScript repository naked Codex is still faster and cheaper than the narrowed profile. Weavatrix's demonstrated value is preview-before-write, named uncertainty, stale-plan refusal, explicit authorization, and rollback—not a universal small-repository token win.
See the full methodology, all language medians, raw-result links, and limitations.
Contract
The 11 Refactor tool names, schemas, and result states are frozen in
contract/refactor-tools.v1.json. All refactor operations are
native Rust; the host uses the read-only
weavatrix-rust engine
internally for graph evidence without exporting its methods on the default
surface.
Versions 0.1.x used the JavaScript engine. That line continues as
weavatrix-refactor-js and keeps a
separate state directory, token store, and rollback journal.
License
MIT.
來源:README.md,提交 236668e
工具
0版本歷史
1- v1.0.11最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分