Skip to content

feat: opt-in versioned memory preset (M18) - #12

Merged
Krokz merged 3 commits into
devfrom
feature/m18-memory-preset
Sep 23, 2026
Merged

Krokz merged 3 commits into
devfrom
feature/m18-memory-preset

Conversation

@Krokz

@Krokz Krokz commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • define_schema with only preset="memory" (MCP, REST, service) adopts v1 of an optional memory preset: Decision, Insight, Task, Question, each with STRING id key and title, body, status, scope.
  • Adoption is additive and repeatable. It creates missing tables and adds missing properties with typed defaults. It never drops, renames or retypes. Key/type mismatches, relationship-name clashes and near-duplicate tables are reported and left unchanged; allow_similar creates beside a near-duplicate.
  • The adopted version is recorded in _grag_meta (preset.memory.version). Adoption refuses a newer recorded version. Non-additive migration steps run once when crossing their version and must be idempotent, because export does not carry _grag_meta.
  • An existing table's FTS index is rebuilt after commit when adoption adds text columns. DROP_FTS_INDEX only runs in auto-transaction mode.
  • CLI: grag memory adopt [--allow-similar] [--json] and grag init --memory-preset. The client refuses owners without the new memory_preset health capability before sending anything.
  • The schema revision and describe_schema output are unchanged. The preset report appears only in the define_schema footer.
  • Docs cover the architecture principle, the schema reference section, CLI/MCP references, the memory guide and all four skill-reference copies.

Surface cost

define_schema advertised schema: 1,490 → 1,658 B (+168 B), from the preset param, optional table lists and one docstring sentence. Instructions are unchanged. The discovery budget test still passes.

Test plan

  • tests/test_presets.py: fresh adoption, rerun, FTS coverage across reopen (mutation-checked), conflicts re-reported, downgrade refusal, migration crossing, validation, MCP, CLI, init, old-owner refusal
  • Full suite, ruff, mypy locally

🤖 Generated with Claude Code

@Krokz
Krokz merged commit d27a003 into dev Sep 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant