Weavatrix Git

io.github.sergii-ziborov由 GitHub 帳號 sergii-ziborov 發布v0.3.1更新於 Oct 24, 2026

Fast, bounded, read-only Git evidence for local AI coding agents.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

一個本機唯讀 MCP 伺服器,讓 AI 程式開發助理從程式碼倉庫取得有界的 Git 證據,不呼叫 git 指令,也不修改任何內容。

可以做什麼
檢視倉庫識別與 HEAD:符號 HEAD、精確目標物件 ID、雜湊類型與 pack 數量,以及工作區安全狀態與未追蹤、被忽略檔案計數。讀取歷史:分頁的提交 ID、樹、父提交、簽章、時間戳與摘要。比較版本:分頁列出新增、刪除、修改與類型變更的路徑及新舊物件 ID。取得不可變快照:某個版本的標準路徑、模式、類型與物件 ID 清單。所有清單工具都回傳下一頁游標、精確物件 ID 與截斷旗標,非 UTF-8 路徑以精確位元組保留。
適用情境
當助理需要根據本機 Git 倉庫的歷史、差異、狀態或檔案清單進行推理,並希望得到確定性的唯讀證據而不是呼叫 git 指令時使用。適合稽核與程式碼審查類工作流程,這類情境更重視有界且精確的答案,而非完整的 Git 用戶端功能。
執行需求
以本機 stdio 程序執行,透過 npx 從 npm 套件啟動(Node.js 負責選擇並啟動適用於 Windows x64、Linux x64/ARM64 或 macOS x64/ARM64 的內建原生二進位檔);也可用帶 mcp 特性的 Cargo 安裝。必須以絕對路徑參數傳入目標倉庫路徑。未宣告任何帳號、API 金鑰或環境變數,也不使用網路存取。
安裝前請注意
設計上唯讀:README 說明沒有寫入 API、沒有 checkout、沒有掛鉤、過濾器或網路操作,因此無法提交、推送或修改倉庫。它直接解析倉庫儲存,遇到不支援的資料會回傳型別化錯誤而非近似答案。部分 Git 功能被刻意排除,包括淺複製與 replace 物件語意、子模組工作區狀態與修訂表達式語法,因此結果可能與完整 Git 用戶端不同。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Weavatrix Git,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Weavatrix Git

[CI] [crates.io] [npm] [docs.rs] [MIT]

Part of the Weavatrix ecosystem: bounded Git evidence for AI software agents.

weavatrix-git gives AI coding agents fast, bounded, read-only Git evidence. The Rust crate, CLI, MCP server, and npm package are the same contract: parse repository storage directly. No git subprocess, C library, hooks, filters, network access, checkout, or mutation. There is no write API in any surface.

On the checked-in exact-parity benchmark, 1,000 warm history entries took 0.355 ms with Weavatrix, 0.884 ms with gix, and 1.552 ms with libgit2. Across eight repositories, Weavatrix won all five measured p50 contracts. These are engine measurements from release builds; the MCP transport is deliberately not hidden inside the claim.

Run the MCP server

No Rust toolchain is required:

bash
npx -y [email protected] --repository /absolute/path/to/repository

Generic stdio client configuration:

json
{  "mcpServers": {    "weavatrix-git": {      "command": "npx",      "args": [        "-y",        "[email protected]",        "--repository",        "/absolute/path/to/repository"      ]    }  }}

The npm package contains verified native binaries for Windows x64, Linux x64 and ARM64, and macOS x64 and ARM64. Node only selects and launches the matching binary; repository parsing and MCP handling stay in safe Rust.

Tools for agents

MCP toolEvidence returned
git_headrepository identity, hash kind, symbolic HEAD, exact target ID, pack count
git_historypaginated commit IDs, trees, parents, signatures, timestamps, summaries
git_diffpaginated added/deleted/modified/type-changed paths with old/new object IDs
git_statustracked index and worktree state; untracked files stay on Repository::worktree_safety()
git_snapshotcanonical immutable path, mode, kind, and object-ID manifest for a revision
git_worktree_safetyClean / IgnoredOnly / HasUntracked / DirtyTracked / Unknown; untracked and ignored counts

Every list tool returns nextCursor, exact object IDs, and a truncated flag. Non-UTF-8 paths retain their exact bytes in pathHex; display text is never silently presented as exact evidence.

Runtime limits

The MCP binary uses mcport's controlled, Tokio-free runtime:

  • 256 KiB maximum request and 1 MiB maximum response;
  • four in-flight handlers and bounded request/output queues;
  • 30-second handler deadline with cooperative cancellation checks;
  • panic isolation and atomic response-overflow errors;
  • bounded Git object, history, tree, bitmap, reflog, and index reads;
  • optional progress notifications and configurable response batching.

Defaults are suitable for interactive stdio. --help exposes overrides for byte budgets, concurrency, queues, deadline, and batch size. The server writes only newline-delimited UTF-8 JSON-RPC to stdout; diagnostics go to stderr.

Native Cargo installation is also available:

bash
cargo install weavatrix-git --version 0.3.3 --features mcp \  --bin weavatrix-git-mcpweavatrix-git-mcp --repository /absolute/path/to/repository

Why a separate crate?

A scanner discovers files. A code graph models relationships. This crate owns version-control evidence. Keeping that boundary independent lets any Rust application reuse Git intelligence without importing a larger product.

Supported contract

AreaSupport
Layoutsworktree, bare, .git indirection, linked worktree commondir
HashesSHA-1 and SHA-256 object identifiers
Refsloose, symbolic, detached HEAD, packed refs, reflogs
Objectscommit, tree, blob, annotated tag
Loose storagebounded zlib/DEFLATE decoded by this crate
Packed storagePACK v2/v3, index v2, OFS_DELTA, REF_DELTA
Object lookupalternates, classic MIDX, caches, shared zero-copy snapshots
Commit accelerationmonolithic and split commit-graph chains
Path accelerationchanged-path Bloom filters v1/v2
Reachabilitypack and MIDX EWAH bitmaps with RIDX ordering
IndexDIRC v2/v3/v4, auto-refreshing shared snapshots
Queriestyped reads, lazy revwalk, history, tracked status, worktree safety, tree diff
Immutable viewscanonical commit snapshots with path, mode, and object evidence
Scale-outparallel open, revision-aware timelines, change sets, correlation
Extensionordered, thread-safe, read-only custom ODB backends

All public reads are in-process. Library code contains no subprocess fallback. Unsupported data returns a typed error rather than an approximate answer.

Rust library

rust
use weavatrix_git::{PathBloom, Repository};
fn main() -> Result<(), Box<dyn std::error::Error>> {    let repository = Repository::open(".")?;    let head = repository.resolve("HEAD")?;
    for id in repository.revwalk().push_head()?.take(100) {        println!("{}", id?);    }
    if repository.commit_maybe_changed_path(head, b"src/lib.rs")?        == Some(PathBloom::DefinitelyNot)    {        println!("the commit definitely did not change src/lib.rs");    }
    if let Some(objects) = repository.bitmap_reachable(head)? {        println!("{} reachable objects", objects.len());    }    Ok(())}

Custom stores use the same object contract:

rust
use std::sync::Arc;use weavatrix_git::{Limits, MemoryObjectBackend, Repository};
let backend = Arc::new(MemoryObjectBackend::default());let repository =    Repository::open_with_backends(".", Limits::default(), vec![backend])?;# Ok::<_, weavatrix_git::GitError>(repository)

For cross-repository analysis, RepositorySet keeps object stores isolated and returns deterministic serial or parallel results:

rust
use weavatrix_git::{HistoryOptions, RepositorySet};
let repositories = RepositorySet::open_parallel([    ("service", "/code/service"),    ("client", "/code/client"),])?;let histories =    repositories.histories_from_parallel("HEAD", HistoryOptions::default())?;let snapshots = repositories.snapshots_parallel("HEAD")?;let timeline = repositories.timeline("HEAD", HistoryOptions::default())?;let shared = repositories.shared_commits(HistoryOptions::default())?;# Ok::<_, weavatrix_git::GitError>((histories, snapshots, timeline, shared))

The diagnostic CLI uses the library:

text
weavatrix-git [-C repository] headweavatrix-git [-C repository] log [revision] [max-count]weavatrix-git [-C repository] cat <object>weavatrix-git [-C repository] diff <old-commit> <new-commit>

Architecture

text
Repository  +-- refs + reflog  +-- commit-graph chain + changed-path Bloom  +-- index -> tracked status  +-- custom ODB backends  +-- object directories + alternates        +-- loose object -> bounded zlib        +-- MIDX -> pack -> bounded delta chain        +-- pack/MIDX bitmap -> reachable object IDs

Limits bounds object bytes, cache bytes, delta/ref/tree depth, tree and index entries, reflog/history length, parent count, and bitmap expansion. The crate forbids unsafe Rust. The default library feature set remains dependency-free; only the separate mcp feature adds mcport.

The source tree follows explicit modular boundaries:

LayerResponsibility
modelobject IDs, typed Git objects, errors, and validation contracts
storageloose/pack/MIDX/commit-graph decoding, bounded inflate and caches
repositoryrefs, history, diffs, status, snapshots, trees, and revwalks
workspacedeterministic multi-repository queries and correlation
mcpoptional read-only protocol adapter over the library
facade / CLIstable Rust exports and diagnostic command entry points

The checked-in strict architecture contract rejects files over 300 physical lines, functions over 100 physical lines, runtime cycles, mixed foo.rs plus foo/ module ownership, and any dependency from the protocol-independent library into the optional MCP adapter. It has no baseline or exceptions.

Correctness

The suite creates real Git repositories and verifies:

  • loose and aggressively packed OFS/REF delta objects;
  • SHA-1 and SHA-256 repositories;
  • bare and linked-worktree layouts;
  • classic MIDX lookup;
  • multi-layer split commit-graphs and changed-path Bloom answers;
  • pack and MIDX bitmap reachability against git rev-list --objects;
  • index v2 and v4, reflog order, revwalk hide/reset, and tracked status;
  • deterministic parallel and cross-repository results;
  • immutable revision snapshots, merged timelines, and batch change sets;
  • hostile format and configured-limit failures.

Current core line coverage is 85.27%. CI runs Rust 1.88 on Linux, Windows, and macOS, Clippy with warnings denied, coverage, audit, docs, and package verification.

Performance

Release measurements on Windows, 2026-07-27. Every row materializes the result and proves exact identifier, path, object-byte, or status parity before timing:

Exact-parity operationweavatrix-git p50git.exe p50
6,000-object bitmap reachability0.431 ms72.656 ms
one-entry index read0.033 ms60.758 ms
clean tracked status0.186 ms72.735 ms
cached commit lookup0.001 ms65.267 ms
1,000-commit history, reused repository0.086 ms66.961 ms

Direct in-process comparison on the same packed 2,000-commit fixture:

Exact-parity operationWeavatrix p50gix 0.86 p50git2 0.21 p50
1,000-commit history, warm0.355 ms0.884 ms1.552 ms
1,000-commit history, reopen2.521 ms3.940 ms10.483 ms
1,000 cached object reads0.082 ms0.068 ms5.640 ms
history plus 1,000 raw objects0.494 ms0.992 ms1.375 ms

On a separate 10,000-path index, warm reads measured 1.160/1.100/1.489 ms respectively; reopen measured 5.225/7.745/11.251 ms. The benchmark rotates engine order and proves exact history IDs, raw object bytes, and canonical index paths before timing. See BENCHMARKS.md.

On eight independent repositories with 8,000 selected commits, Weavatrix measured 5.667 ms serial history, 4.080 ms parallel history, 11.810 ms reopen, 4.148 ms shared-commit correlation, and 1.736 ms immutable manifests. It won all five p50 contracts against gix and libgit2; exact per-repository history order, shared locations, paths, and object IDs were proven first.

Position among alternatives

Capabilityweavatrix-gitGit CLIgixlibgit2
In-processyesnoyesyes
Pure safe Rustyesnoyesno, C core
Crate dependencieszeron/amany modular cratesnative library
Object/delta cachesyesyesyesyes
MIDX and reachability bitmap readsyesyesyesyes
Split commit-graph and path Bloom readsyesyesyescommit-graph
Custom read-only ODByesn/astore abstractionsyes
Lazy revwalk, reflog, index, tracked statusyesyesyesyes
First-class cross-repository evidence queriesyesapplication codeapplication codeapplication code
Canonical immutable commit manifestyesapplication codetraversal APItree walk API
Network and mutationnoyesyesyes

The deliberate remaining exclusions are pack index v1, reftable, incremental MIDX chains, split/sparse index extensions, shallow and replace-object semantics, revision-expression grammar, untracked/ignore/filter-aware status, submodule worktree status, network operations, and mutation.

Use Git, gix, or libgit2 for a complete client. Use this crate when bounded local evidence, a small audit surface, deterministic reads, and zero dependencies matter.

License

MIT

來源:README.md,提交 0be1ebc

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分