fix(storage): add explicit split-store consolidation#425
Conversation
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e9756090e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3e97560 to
2297c45
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2297c454f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82cfa9b9bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| trust_score = CASE WHEN COALESCE(( | ||
| SELECT s.last_feedback_at FROM source.memory_facts s WHERE s.content = t.content | ||
| ), -1) > COALESCE(t.last_feedback_at, -1) THEN ( | ||
| SELECT s.trust_score FROM source.memory_facts s WHERE s.content = t.content | ||
| ) ELSE t.trust_score END, |
There was a problem hiding this comment.
Preserve newer explicit trust updates
When the duplicate source fact was changed through MemoryStore::update_fact with a new trust but no feedback, last_feedback_at stays null while updated_at advances. This merge only imports source trust when the source feedback timestamp is newer, so it keeps the target's stale trust even though the source is the newer fact; that silently drops legitimate trust edits during consolidation.
Useful? React with 👍 / 👎.
| INSERT OR IGNORE INTO memory_fact_entities(fact_id, entity_id) | ||
| SELECT fm.target_id, em.target_id | ||
| FROM source.memory_fact_entities sfe | ||
| JOIN consolidation_fact_map fm ON fm.source_id = sfe.fact_id | ||
| JOIN consolidation_entity_map em ON em.source_id = sfe.entity_id; |
There was a problem hiding this comment.
Recompute fact vectors after entity merges
When source-only entity links are inserted for an overlapping fact, the fact's hrr_vector remains whatever the target shard had. The later bank rebuild uses the existing vector bytes rather than recomputing them, so semantic/vector retrieval ignores the source entities after consolidation; this affects overlaps where the two shards learned different entities for the same fact content.
Useful? React with 👍 / 👎.
Summary
Safety
Verification