
Curate-Ipsum
io.github.egoughnour由 GitHub 帳號 egoughnour 發布v2.5.1更新於 Oct 24, 2026
Code synthesis through belief revision, mutation testing, and verification
概覽
本機 MCP 伺服器,透過變異測試、圖形分析、形式化驗證與修補程式合成,產出經過驗證的程式碼變更。
- 可以做什麼
- 執行單元測試、整合測試與變異測試,偵測測試框架,解析或建立程式碼區域
- 記錄斷言與證據、修訂理論,並檢視穩固度、來源與信念穩定性
- 回復到先前的狀態、復原操作、分析失敗並列出歷史紀錄
- 擷取呼叫圖、計算分割、查詢可達性與階層,並執行圖形查詢
- 使用 Z3 或 angr 後端驗證性質,並透過預算升級編排驗證流程
- 從 LLM 候選產生修補程式、檢視或取消合成任務,並以 RAG 建立索引與檢索程式碼
- 適用情境
- 當你希望助理不只產生看似合理的程式碼,而是執行變異測試、以形式化方式檢查性質,並反覆調整修補程式直到附帶驗證證據時使用。適合在本機程式碼庫上工作、能負擔驗證迴圈所需設定與運算資源的開發者。
- 執行需求
- 以 stdio 在本機執行,可從 PyPI(pip 或 uvx)或 Docker 映像安裝。PyPI 方式需要 Python,Docker 映像已內建嵌入模型。選用環境變數可設定圖形後端(CURATE_IPSUM_GRAPH_BACKEND)、資料目錄(MUTATION_TOOL_DATA_DIR)、日誌等級(MUTATION_TOOL_LOG_LEVEL)、嵌入模型(EMBEDDING_MODEL)以及 ChromaDB 主機(CHROMA_HOST)。完整驗證堆疊需以 Docker Compose 啟動 Chroma 與 angr。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Curate-Ipsum,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Curate-Ipsum
A graph-spectral MCP server for verified code synthesis through belief revision
[PyPI] [MCP Registry] [Claude Desktop] [License: MIT] [Python]
[Top Language] [Code Size] [Last Commit] [Repo Size]
Curate-Ipsum bridges the gap between LLM-generated code (fast, plausible, unverified) and formally verified patches (slow, correct, trustworthy). It treats mutation testing as one component of a larger system for maintaining robust, self-healing codebase metadata that supports reachability analysis, symbolic execution, and automated test generation.
Install
Claude Desktop / MCP Client
Add to your claude_desktop_config.json:
Or with Docker (embedding model pre-loaded, no Python needed):
MCP Tools
Curate-Ipsum exposes 30 tools over the MCP stdio transport, organised into six groups:
Testing — run_unit_tests, run_integration_tests, run_mutation_tests, get_run_history, get_region_metrics, detect_frameworks, parse_region, check_region_relationship, create_region
Belief Revision — add_assertion, contract_assertion, revise_theory, get_entrenchment, list_assertions, get_theory_snapshot, store_evidence, get_provenance, why_believe, belief_stability
Rollback & Failure — rollback_to, undo_last_operations, analyze_failure, list_world_history
Graph-Spectral — extract_call_graph, compute_partitioning, query_reachability, get_hierarchy, find_function_partition, incremental_update, persistent_graph_stats, graph_query
Verification — verify_property (Z3/angr), verify_with_orchestrator (CEGAR budget escalation), list_verification_backends
Synthesis & RAG — synthesize_patch (CEGIS + genetic + LLM), synthesis_status, cancel_synthesis, list_synthesis_runs, rag_index_nodes, rag_search, rag_stats
Current Status
Last Updated: 2026-02-08
The Problem
LLMs produce code that is:
- ✅ Syntactically valid (usually)
- ✅ Statistically plausible
- ❌ Semantically correct (sometimes)
- ❌ Type-safe (by accident)
- ❌ Formally verified (never)
Current approaches either trust LLM output blindly or reject it entirely. Neither is optimal.
The Solution
Use LLMs for cheap candidate generation, then invest computational resources to achieve formal guarantees:
Key Differentiators from State of the Art
vs. Traditional Mutation Testing (Stryker, mutmut, cosmic-ray)
vs. LLM Code Generation (Copilot, Claude, GPT)
vs. Program Synthesis (Sketch, Rosette, SyGuS)
vs. Symbolic Execution (KLEE, S2E)
Novel Contributions
-
Graph-Spectral Code Decomposition
- Fiedler vector partitioning for optimal reachability
- Hierarchical SCC condensation
- Planar subgraph identification → O(1) Kameda queries
- Kuratowski subgraphs as atomic non-planar units
-
Belief Revision for Synthesis
- AGM-compliant theory revision
- Entrenchment ordering for minimal contraction
- Provenance DAG for failure mode analysis
- Rollback sharpens validity (failures refine the universal model)
-
Implicit Region Detection
- Spectral anomalies reveal undertested code
- Cross-framework mutation resistance identifies critical regions
- Historical mutability guides partition optimization
-
Mathematical Constraint Reformulation
- Boolean-intractable → differential/root-finding
- SymPy path condition encoding
- Hybrid SMT + numerical solving
Architecture
Roadmap
Phase 1: Foundation ✅
- MCP server infrastructure
- Stryker report parsing
- Run history and PID metrics
- Flexible region model (hierarchical: file → class → function → lines)
- mutmut parser integration
- Framework auto-detection
- Unified parser interface
Phase 2: Graph Infrastructure ✅
- Graph models (CodeGraph, Node, Edge)
- Call graph extraction (AST-based)
- ASR extractor (import/class analysis)
- Dependency graph extraction (module-level imports)
- Laplacian construction from call/dependency graphs
- Fiedler vector computation (scipy.sparse.linalg)
- Recursive Fiedler partitioning with virtual sink/source
- SCC detection and hierarchical condensation
- Planar subgraph identification (Boyer-Myrvold)
- Kameda preprocessing for O(1) reachability
- MCP tools (extract, partition, reachability, hierarchy, find)
Phase 3: Multi-Framework Orchestration ✅
- Unified mutation framework interface
- cosmic-ray parser
- poodle parser
- universalmutator parser
Phase 4: Belief Revision Engine ✅
- py-brs library integration (AGM core)
- Evidence adapter (mutation results → beliefs)
- Theory manager for curate-ipsum
- AGM contraction (py-brs v2.0.0 released)
- Entrenchment calculation (py-brs v2.0.0)
- Provenance DAG storage and queries
- Failure mode analyzer
- Rollback mechanism
Phase 5: Synthesis Loop ✅
- CEGIS implementation with LLM seeding
- Genetic algorithm with AST-aware crossover
- Entropy monitoring and diversity injection
- Counterexample-directed mutation
- CEGAR budget escalation (10s → 30s → 120s)
Phase 6: Verification Backends ✅
- Z3 integration for SMT solving (default backend)
- angr Docker symbolic execution (expensive tier)
- CEGAR orchestrator with budget escalation
- Verification harness builder (C source generation)
- Mock backend for testing
- Alternative solvers (CVC5, Boolector)
- SymPy path condition encoding
Phase 7: Graph Persistence ✅
- Abstract GraphStore ABC
- SQLite graph store (primary)
- Kuzu graph store (optional)
- Synthesis result persistence
- Kameda & Fiedler persistence
- Incremental update engine
Phase 8: RAG / Semantic Search ✅
- ChromaDB vector store integration
- sentence-transformers embedding provider (all-MiniLM-L6-v2)
- Graph-expanded RAG pipeline (vector top-k → neighbor expansion → rerank)
- Decay scoring for temporal relevance
- CEGIS integration for context-aware synthesis
Phase 9: Production Hardening ✅
- CI/CD (GitHub Actions — lint, test matrix, integration, lockfile)
- Release pipeline (tag push → PyPI + GHCR + MCP registry)
- uv lockfile (149 packages)
- pre-commit hooks (ruff format + lint + lock check)
- MCP bundle packaging (server.json, smithery.yaml, manifest.json)
- HTML/SARIF reporting
- IDE extensions (VSCode)
- Regression detection and alerting
Future Work
Advanced Orchestration (Deferred)
- Implicit region detection (spectral anomalies)
- Non-contradictory framework assignment
- Cross-framework survival analysis
Semantic Search & RAG
- Code Graph RAG for semantic search
- Semantic search index (ChromaDB)
- RAG retrieval pipeline with graph expansion
- Text-to-Cypher queries
Quick Start
Configuration
All configuration is via environment variables (see .env.example):
For the full service stack (ChromaDB + angr runner):
Documentation
Planning & Design
- Phase 2 Plan - Active: Graph-spectral infrastructure (9 steps)
- Progress - Current status, what's done, what's next
- Decisions - Architectural decisions with reasoning (D-001 through D-008)
- M1 Multi-Framework Plan - Region model & parser design (done)
- BRS Integration Plan - Belief revision integration
- BRS v2 Refactoring Plan - Modular architecture
- ROADMAP - Full milestone tracker
Architecture
- Architectural Vision - Graph-spectral framework
- Synthesis Framework - CEGIS/CEGAR/genetic approach
- Belief Revision - AGM theory and provenance
Reference
- Summary - Functionality catalog
- Potential Directions - Enhancement roadmap
- Synergies - Tool ecosystem integration
- CONTEXT - Session context for AI assistants
- DOCS_INDEX - Documentation quick reference
Key References
- Alchourrón, Gärdenfors, Makinson (1985). On the Logic of Theory Change
- Fiedler (1973). Algebraic Connectivity of Graphs
- Kameda (1975). On the Vector Representation of Reachability in Planar Directed Graphs
- Solar-Lezama (2008). Program Synthesis by Sketching (CEGIS)
- Clarke et al. (2000). Counterexample-Guided Abstraction Refinement (CEGAR)
License
MIT License - see LICENSE
來源:README.md,提交 6c0f4a3
工具
0版本歷史
1- v2.5.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分