Skip to content

Simplify memory core and protect snapshots and concurrent reads - #7

Merged
Ninadnj merged 3 commits into
mainfrom
feat/simple-reliable-core
Sep 16, 2026
Merged

Ninadnj merged 3 commits into
mainfrom
feat/simple-reliable-core

Conversation

@Ninadnj

@Ninadnj Ninadnj commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Returned Python entries previously exposed live store state: changing a result could bypass revisions and leave text inconsistent with its search vector. Concurrent reads could also observe a change whose disk save later failed.

This candidate makes returned entries independent snapshots and serializes operations within each store object. Record rules and JSON persistence now have explicit modules; MemoryStore continues to own memory operations, retrieval and transactions. Existing format-3 data and IDs remain compatible.

Other changes:

  • Keep startup handoff selection and recall on one snapshot during other writers' corrections.
  • Treat literal tokenizer markers as ordinary memory text, including statistics and budgeted MCP output.
  • Default new stores to offline hashing, preserve saved backend configuration, and report invalid choices.
  • Replace dedup_threshold with deduplicate=False; make agent keyword-only in the Python write APIs.
  • Share rendering tags, avoid copying histories just to count entries, and add consistent lint/format checks.
  • Document architecture, write/read flow, tradeoffs, migration and verification for v0.4.0rc2.

Validation on macOS / Python 3.12:

  • 330 tests passed with MCP 2.2.0; only the optional semantic-model module skipped.
  • 304 tests passed in the minimal environment, with 9 optional checks skipped (including exact-tokenizer cases).
  • 89 focused tests passed with MCP 1.30.0, including the real two-process demo.
  • All 30 task fixtures validated; published retrieval JSON/Markdown reproduced exactly.
  • Wheel/sdist build, fresh wheel installation, lint, formatting and documentation links passed.

The new regression suite reproduced failures before implementation. Retrieval quality is unchanged; semantic-model and live-agent performance remain unverified. See docs/migration-v0.4.md before upgrading Python callers.

The pre-merge fixes add ten regression cases (9 failed before the fixes, all 10 now pass), covering cross-instance startup consistency, literal markers, persisted-memory budgets, and MCP roundtrips.

@Ninadnj
Ninadnj marked this pull request as ready for review September 16, 2026 09:19
@Ninadnj
Ninadnj merged commit f241dd2 into main Sep 16, 2026
8 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