Skip to content

fix(memory): make observation removal atomic and invalidate stale indexes - #305

Draft
kevintseng wants to merge 1 commit into
mainfrom
fix/observation-integrity
Draft

fix(memory): make observation removal atomic and invalidate stale indexes#305
kevintseng wants to merge 1 commit into
mainfrom
fix/observation-integrity

Conversation

@kevintseng

Copy link
Copy Markdown
Contributor

Summary

  • Run observation removal under one immediate SQLite transaction, including the indexed-text read, FTS update and obsolete-vector deletion.
  • Preserve all original state on index failure; keep missing-entity and missing-observation no-op responses.
  • Keep archived entities out of FTS when their observations are edited.
  • Add seven isolated regression cases and update compiled output and the Unreleased note.

Verification

  • Before the fix: the new seven-case suite reported four failures, exposing vector retention and non-atomic deletion.
  • Final commit 6efdf61: 78 focused/adjacent tests passed; typecheck passed.
  • npm run verify:release passed on the identical source tree before commit, including generated-output parity and 17 entry-point starts.
  • A targeted mutation removing vector invalidation made the regression suite fail; source was restored and the worktree is clean.
  • Independent full-diff review and replay passed, including archived FTS row assertions and simplification review.

Scope

This fixes synchronous observation-removal consistency. Pending asynchronous embedding freshness is a separate follow-up. No schema migration, production data repair, version bump or release is included. Full-suite/coverage results are left to CI.

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