
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 分