Repository navigation
v1.0.4
v1.0 — capture, store, retrieve, eval
matha is a local MCP server that gives AI coding agents persistent project memory: intent, business rules, prior corrections ("decisions"), danger zones, contracts, and an admin-declared boundary layer — all scored against what you're about to touch and delivered under a token budget. No enforcement ceremony, no cloud, no API key.
This is the first tagged GitHub release. It covers the full v1.0 roadmap (phases 1–5) plus two field-driven fixes on top of the v1.0.0 milestone.
Retrieval core
S × L × C × Rscoring: hierarchical structural path match, BM25 lexical relevance, confidence weighting, recency decay — severity gated so a lexical-only hit can never read as CRITICAL.- Token-budgeted
matha_brief(~1,500 tokens), criticals always ranked into the budget first. - Consolidated MCP surface:
matha_brief,matha_match(scope now optional — passintentalone for a keyword-only search, never critical),matha_record,matha_refresh, plus thematha_contextprompt. - Golden-set eval harness gating CI: recall@5 ≥ 0.8, false-critical ≤ 0.05, brief within budget.
Capture quality & coverage
- Incremental codemap: a persisted commit cursor means every refresh scans only new commits — bounded, recency-weighted first analysis (~18 months / ~10k commits) on large/existing repos.
- Auto-refresh on read — the codemap can't silently go stale.
possiblyStaleflagging (code changed after a record was written) with a rank penalty, surfaced everywhere, never hidden.- Near-duplicate write rejection,
matha catchup(unaccounted work since the last recorded decision). - Agent writes are capped at
probableconfidence —confirmedis reserved for human surfaces (matha after,matha review).
Lifecycle & curation
matha_recordlifecycle verbs:violation,supersede,retire— decision content stays append-only; lifecycle is the designed exception.matha review— a human triage queue for unconfirmed and possibly-stale records.- Admin-declared boundaries (
matha boundary add/list) — CLI-only, pinned, non-decaying, always CRITICAL on a direct path hit. matha check --diff <base>— advisory CI check,--strictto fail the build on criticals.matha export --md(deterministic, PR-diffable) andmatha ui(single self-contained HTML report).matha onboardandmatha hooks --installfor existing codebases and Claude Code session-start wiring.
Fixed after v1.0.0, folded into this release
- Windows CI:
matha init --fromsilently returned empty fields on CRLF-checked-out files — JS regex.never matches\r. Fixed at the source; added.gitattributesso no future text fixture can hit this class of bug. .gitignorescope:.matha/cortex/holds both auto-regenerated files (analysis.json,stability.json,co-changes.json— the real source of cross-branch merge conflicts) and constant, human-authored files written once at init (boundaries.json,ownership.json,shape.json).matha initnow ignores exactly the three regenerated files, not the whole directory.- Dependency trim: swapped
@inquirer/promptsfor the scoped@inquirer/input(matha only ever usesinput()), droppingchardet/external-editorfrom the tree entirely.
262 tests passing. Full history in docs/analysis/03-target-architecture.md.