
Wisegit
io.github.Sandip124由 GitHub 帳號 Sandip124 發布v0.1.1更新於 Nov 3, 2026
Extracts decision intent from git history and protects intentional code from AI modification.
概覽
本機 MCP 伺服器,從 git 歷史擷取決策意圖並提供凍結評分,讓助理在改程式碼前尊重刻意為之的實作。
- 可以做什麼
- 檢視檔案的決策清單,含凍結評分、意圖歷史、復原等級與覆寫狀態
- 查詢單一函式的評分與訊號明細,或完整的依時間排序決策紀錄
- 依關鍵字搜尋過往決策,並找出解決類似問題的既有函式
- 預測修改某函式會影響哪些函式,並讀取檔案周邊的撰寫慣例
- 列出理論缺口與分支合併歷史,並為凍結函式建立覆寫紀錄
- 借助宿主模型為低資訊量的提交補擷取意圖
- 適用情境
- 適合歷史悠久或遺留程式碼庫,其中過往的修正、變通做法與刻意的設計容易被 AI 誤判為無用程式碼。當你希望助理在重構或「找 bug」前先確認哪些是刻意為之,最值得安裝。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 20 或更新版本。初始化會索引儲存庫的 git 歷史,並建立本機 SQLite 資料庫與專案設定檔。選用的 issue 補充需要 GitHub 或 GitLab 權杖;選用的本機模型擷取需要 Ollama 執行個體。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Wisegit,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
wisegit
[npm] [MCP Registry] [License: MIT]
"Don't take a fence down until you know the reason it was put up." — G.K. Chesterton
wisegit is a local MCP server that extracts decision intent from git history and protects intentional code from AI modification.
When Claude Code (or any MCP-compatible agent) is about to edit a file, wisegit injects a decision manifest showing which functions are frozen, stable, or open — so the AI respects what was intentional, not just what compiles.
Zero config. Zero external services. Everything local.
Install
Published on
- npm: @sandip124/wisegit
- MCP Registry: io.github.Sandip124/wisegit
- GitHub: Sandip124/wisegit
The Problem
LLMs have no concept of intentional code. A manually-tested fix and a broken stub look identical — both are just text. Real scenario:
- You fix a Stripe race condition with
sleep(350)— manually tested, committed. - Next session: "find bugs." Claude removes
sleep(350)— looks like dead code. - Production incident.
Root cause: git history contains proof of intention. Nobody extracts it.
How It Works
- Indexes your git history — walks every commit, parses diffs at the AST level (function boundaries, not line counts)
- Classifies commits — STRUCTURED (
fix:,feat:), DESCRIPTIVE (plain sentences), or NOISE (wip,x) - Extracts intent — rule-based for structured/descriptive commits, LLM for noise (Phase 2)
- Computes freeze scores — 0–1 per function, derived from protection signals (git, issue, code structure, test, structural, Naur, Aranda) minus adaptive obsolescence penalty (8 signals, entropy-calibrated). Age uses Weibull survival [18]; expertise uses DOE model [19]
- Serves decision manifests via MCP — Claude Code calls
get_file_decisionsbefore editing any file
What the AI Sees
- FROZEN (score >= 0.80): Do not modify without explicit user approval
- STABLE (score 0.50-0.79): Proceed with caution, review intent first
- OPEN (score < 0.50): Safe to modify freely
Quick Start
Prerequisites
- Node.js >= 20
That's it. No Docker, no PostgreSQL, no external services.
1. Set Up a Repository (one command)
This single command:
- Creates a local SQLite database at
~/.wisegit/wisegit.db - Indexes your entire git history (462 commits in ~13 seconds)
- Creates
.mcp.jsonfor Claude Code auto-discovery - Creates
CLAUDE.mdrules that instruct AI to check before editing - Adds
.mcp.jsonto.gitignore
2. Enrich with Issue Context (optional)
This fetches referenced issues (e.g., #134 in commit messages), detects Won't Fix / By Design decisions, and boosts freeze scores for functions linked to those issues.
3. Done
Open the repo in Claude Code. It will automatically:
- Start the wisegit MCP server (via
.mcp.json) - Read the protection rules (via
CLAUDE.md) - Call
get_file_decisionsbefore editing any file
MCP Tools
MCP Resource: wisegit://manifest/{filePath} — decision manifest as auto-discoverable resource
MCP Prompt: check_before_edit — mandatory workflow prompt that returns the decision manifest before editing any file
LLM Intent Extraction Strategy
wisegit uses a smart fallback chain for extracting intent from NOISE commits:
Inside Claude Code, call extract_intent to retroactively recover intent for NOISE commits — uses Claude itself, no Ollama installation needed.
CLI Commands
Configure for Claude Code
Option A: Per-repo (recommended)
Run npx @sandip124/wisegit setup in any repo. It creates .mcp.json automatically.
Option B: Global registration
Option C: Manual .mcp.json
Create .mcp.json in your repo root:
Supported Languages
More languages can be added via Tree-sitter grammar configs in src/ast/languages/.
Issue Enrichment
A commit saying fix: handle null token #134 points to an issue containing reproduction steps, root cause, and explicit decision rationale — everything the commit message never says.
Supported platforms: GitHub, GitLab (Azure DevOps, Jira, Bitbucket planned)
Auth tokens: GITHUB_TOKEN / GH_TOKEN for GitHub, GITLAB_TOKEN for GitLab. Never stored by wisegit.
Issue-derived freeze signals
Freeze Score Signals
The freeze score is never stored directly — it's derived by replaying the event stream for each function. Signal categories:
Freeze score formula:
Protection signals produce the base score (weighted average of present signal categories, not additive sum); obsolescence signals produce the penalty. Obsolescence weights are adaptive — calibrated per-repository using Shannon entropy and Bayesian feedback. Falls back to hardcoded defaults when < 20 functions have signals. Age signal uses Weibull survival model [18] (k=0.7, lambda=2.4y); contributor expertise uses DOE model [19] (4 variables: contribution share, recency, duration, frequency).
Academic grounding: 24 published papers. See REFERENCE.md for full citations.
Cross-Repo Validation
Tested on 3 real-world open-source codebases:
Flask's core APIs (__init__, run, wsgi_app, url_for) correctly scored FROZEN (0.87+). Express routing primitives (paramCallback, Route, Router) correctly scored FROZEN/STABLE. Scores adapt to each codebase's history rather than producing uniform distributions.
See REFERENCE.md for detailed validation findings and implementation changes.
Legacy Codebase Evolution
wisegit is designed for codebases that have accumulated years of intentional decisions. The freeze score doesn't mean "never change this" — it means "understand these decisions before you change it."
Progressive migration, not shiny rewrites. Per Távora [12]: the business rules in messy code are correct and valuable. The technical debt is in the structure, not the decisions. wisegit protects the decisions while you fix the structure.
See REFERENCE.md for the full legacy evolution section with academic grounding (24 published papers).
Team Support
wisegit uses a three-layer architecture — no separate "team mode" needed:
JSONL format — one JSON object per line. Concurrent appends produce no git merge conflicts.
After a teammate pushes .wisegit/ changes, run wisegit sync to import them into your local cache.
See TEAM-ROADMAP.md for the full team architecture design.
Architecture
Environment Variables
Security
- Everything runs locally — only issue enrichment makes outbound API calls (opt-in via
wisegit enrich) - Append-only event store — decisions are never deleted, only added
- SQLite database stored at
~/.wisegit/wisegit.db— no network exposure - MCP tool inputs validated with strict Zod schemas (path traversal protection, length limits)
- Error messages sanitized before returning to MCP clients
- File writes check for symlinks before writing
- Config files parsed with allowlisted keys only (no prototype pollution)
Roadmap
- Phase 1 — Event store, AST chunking, commit classification, intent extraction, MCP server, CLI
- Phase 1.5 — Issue enrichment (GitHub, GitLab) with Won't Fix/By Design detection, freeze boost signals
- Phase 2 — Full freeze score: call graph + PageRank, theory gap detection (Naur death, forgotten patterns), co-change signals, Aranda signals, Ollama client, Go + Rust support
- Phase 4 — Override system (mandatory reason, time-boxed expiry, audit trail), branch context preservation (post-merge hook, snapshot storage, recovery)
- Phase A — Shared team knowledge layer:
.wisegit/directory with JSONL files for enrichments, overrides, branch contexts, and team config - Phase B — Team-aware manifests: theory holder tracking, risk levels (healthy/fragile/critical), team status + health commands
- Phase C — AI-era adaptations: commit origin detection (HUMAN/AI_REVIEWED/AI_UNREVIEWED), origin-weighted freeze scores
- Phase D — Override approval workflow, team health metrics
- Phase E — Adaptive obsolescence calibration: 8 obsolescence signals, entropy-calibrated weights, Bayesian feedback,
wisegit calibrateCLI
License
MIT
來源:README.md,提交 75fab44
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分