RemaGraph

凡走過必留下痕跡 — 輕量 MCP 工具,記錄 AI coding agent 的任務殘跡
v0.2.0-alpha Apache-2.0 Python ≥3.11 MCP stdio 216 tests ✅ mypy ✅ ruff ✅
216
通過測試
9
源碼模組
14
v2 完成項目

Phase 1 — 公開前必做

CONTRIBUTING.md + PR template
PyPI publish pipeline (trusted publishing)
docs/architecture.md
A3 路徑穿越防禦 (regex + resolve)
A1 Rate limiting (thread-safe token bucket)
A2 task_id/agent_id 格式驗證
D1 mypy strict CI gate
O5 Migration 框架啟用

Phase 2 — 短期補上

O1 Audit rotation (按月分檔)
O3 max_db_size (100MB soft limit)
O2 cleanup_superseded() (90天清理)
ADR 0001 (docs/decisions/)
Dependabot 策略補強 (labels + reviewers)
PPLX 對抗式審查 — 全數修復

治理檢查清單

P0 — 基礎必備狀態
P0-1版本控制 + git 流程 全 [x]
P0-2License + SPDX Apache-2.0
P0-3測試 + 覆蓋率 + 冒煙 216 tests, ≥80%
P0-4對抗式審查 PPLX 已完成
P0-5Secret 管理 gitleaks + pre-commit
P0-6決策文件 README + docs/
P0-7依賴管理 Dependabot + pip-audit
P1 — 規模化準備狀態
P1-1mypy + ruff strict CI [x]
P1-2Dependabot [x]
P1-3ADR 決策紀錄 [x] ADR 0001
P1-4CONTRIBUTING + PR template [x]
P1-5CHANGELOG [x]
P1-6PyPI publish pipeline [x]

模組架構

server.py — MCP entrypoint + rate limiter
store.py — SQLite 讀寫 + process_store 流程
models.py — Pydantic schema + validators
arbitration.py — 五條仲裁規則 + supersede/invalidate
dedup.py — model2vec 語意去重
search.py — FTS5 BM25 全文檢索
db.py — SQLite 連線 + schema + migration + max_db_size
audit.py — audit.jsonl 寫入 + rotation

五條仲裁規則

#1 summary ≥ 30 字元
#2 learnings 至少一筆非空
#3 handoff_note ≥ 20(僅 task_handoff)
#4 model2vec cosine ≥ 0.90 去重
#5 agent_id 格式 + Lazy Registration
等待 V3
S1 sqlite-vec 語意搜尋 / T1 Unix socket daemon
S2 Hybrid search / S3 中文分詞 / S4 升維

技術棧

執行期

Python ≥3.11
FastMCP (mcp SDK)
SQLite + FTS5 (trigram)
model2vec (potion-multilingual-128M)
Pydantic v2

開發

uv (套件管理)
ruff (lint + format)
mypy (type check, strict)
pytest + pytest-cov
mutmut (mutation testing)

CI/CD

GitHub Actions (currently disabled)
gitleaks (secret scan)
pip-audit (dependency scan)
Dependabot (weekly)
Branch protection (test gate)

最近 commits

SHA訊息日期
a7e18abdocs: update all docs for v2 release2026-07-22
130469afeat: complete v2 Phase 1+2 — security, reliability, governance hardening2026-07-22
99596fedocs: add v2 roadmap blueprint with PPLX governance alignment2026-07-22
e112b03chore: close all P0 items — branch protection + stale branch cleanup2026-07-22
f478079fix: resolve mid-stop agent artifacts2026-07-21