Skip to content

🐛 A memory's vector is identified the way its graph record is, by type and id - #124

Closed
ebigunso wants to merge 1 commit into
mainfrom
fix/2026-09-21/vector-point-identity
Closed

ebigunso wants to merge 1 commit into
mainfrom
fix/2026-09-21/vector-point-identity

Conversation

@ebigunso

Copy link
Copy Markdown
Owner

A fix on main, found while cleaning up the scene slice.

The failure
The graph identifies a memory by object type and id, and ids are caller-supplied (ADR-I-0020). The vector side used the id alone (plus the surface). An application that derives one UUID from one external id for a conversation's thread and for its episode is plausible, and then:

  • the two vectors overwrote each other, so one of the memories could no longer be found by content, with no error;
  • forgetting or superseding one deleted the other's vector, so an explicit forget of one memory silently erased another.

The change

  • The shared point key includes the object type; payload and point id agree.
  • The vector delete port takes a typed object reference, and both adapters delete only exact type and id pairs. No bare-id delete remains on the vector side.
  • One regression through the public facade on the embedded stores (write both, find both; forget the episode, still find the thread), and the shared delete contract now checks crossed pairs on every surface.
  • One step added to the existing live Qdrant job so the service adapter's delete contract test, which is crate-private and was not selected before, runs where a Qdrant service exists.

Blast radius
Vector points written with the old ids are no longer reached by an upsert for the same memory; they remain readable through their payload. There are no consumers, so there is no migration and no shim; a store is rebuilt by a fresh namespace or a replay. The companion evaluation repository's frozen embeddings are keyed by text hash and its graph snapshots hold no point ids, so neither is affected.

Evidence: internal Tier D review approved with no findings and its own census of every vector-side reader and delete path. fmt, check, clippy with warnings denied and the full suite pass for the worker and independently for the reviewer; the live service delete test is this PR's Qdrant job.

This PR is outside the merges the decider pre-authorized and waits for approval. The scene stack (#117 to #123) was cut before it and will merge main forward once it lands.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings September 20, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The identity and deletion paths are consistently updated across both adapters with appropriate regression and live-service coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes vector identity collisions by keying and deleting vectors using object type and ID.

Changes:

  • Adds object type to vector point identities.
  • Makes deletion operate on typed object references across both Qdrant adapters.
  • Adds facade, adapter-contract, and live-service regression coverage.
File Description
src/​usecases/​vector_indexing.rs Passes typed references to deletion.
src/​usecases/​retrieve.rs Updates test-store delegation.
src/​usecases/​remember.rs Updates test-store contract.
src/​usecases/​correct_forget.rs Records and forwards typed deletions.
src/​test_support.rs Updates the temporary vector store.
src/​ports/​vector_candidate.rs Defines typed deletion semantics.
src/​memory.rs Adds the facade-level collision regression test.
src/​adapters/​qdrant/​store.rs Implements exact typed deletion and parity tests.
src/​adapters/​qdrant/​payload.rs Includes object type in point IDs.
src/​adapters/​qdrant_edge/​mod.rs Implements typed filtered deletion.
.github/​workflows/​pr_validation.yaml Runs the live service deletion contract.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ebigunso

Copy link
Copy Markdown
Owner Author

Superseded by #150: this fix was merged into the stack there (with its reconciliation against the scene surfaces the stack added) and reviewed by both tiers. Closing at the decider's direction.

@ebigunso ebigunso closed this Sep 23, 2026
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.

2 participants