This document records the stabilization direction for Memory Layer before larger knowledge graph, code structure graph, specialized curation, and code-analysis work.
Every baseline refactor should keep these checks green:
cargo fmt --checkcargo test --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningsnpm --prefix web cinpm --prefix web run build
If a check cannot be green, the commit or issue must explain the blocker and the follow-up required to restore it.
- Keep release metadata, package versions, and licensing consistent.
- Keep memory versioning semantics centralized and applied across reads, imports, exports, stats, search, and TUI views.
- Split large runtime modules only after the behavior they currently own is covered by tests.
- Make the agent-linked watcher manager the primary automation model and keep legacy per-project watchers as compatibility mode.
- Add graph and curation foundations incrementally, with schemas, provenance, evaluation fixtures, and migrations before replacing existing behavior.
The existing memory_relations table is an active-memory relation graph, not a
complete knowledge graph. Future graph work should add first-class concepts for:
- entities and claims
- code symbols and references
- typed edges with confidence and provenance
- version-aware graph updates
- evaluation fixtures for extraction, relation detection, replacement, and retrieval quality
The first graph-facing work should be additive. Existing memory APIs and CLI commands should remain compatible until the replacement path has coverage and a documented migration.
The detailed graph and curation direction lives in Graph And Curation Foundations.