Skip to content

fix(cascade): repair knowledge topic SQLite parity#343

Draft
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/cascade-knowledge-topic-parity
Draft

fix(cascade): repair knowledge topic SQLite parity#343
SiyaoZheng wants to merge 1 commit into
EverMind-AI:mainfrom
SiyaoZheng:fix/cascade-knowledge-topic-parity

Conversation

@SiyaoZheng

@SiyaoZheng SiyaoZheng commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Repair the SQLite side of a knowledge-topic cascade write when LanceDB already contains the current content hash.

The handler writes each knowledge topic to both LanceDB and SQLite. If the LanceDB upsert succeeds but the SQLite upsert fails, the retry currently sees the matching LanceDB digest and skips the topic forever. That leaves SQLite missing or stale even though the cascade row is retried.

This change builds the SQLite payload before the digest fast path, verifies that the corresponding SQLite row exists and matches, and repairs only the SQLite side when necessary. The normal unchanged-topic path remains a no-op.

Area

  • Architecture method
  • Benchmark
  • Use case
  • Documentation
  • Developer experience
  • CI, build, or release

Verification

uv run pytest tests/unit/test_memory/test_cascade/test_handler_knowledge_topic.py -q
8 passed

make ci
1501 unit tests passed; 78 integration tests passed (6 deselected);
lint, architecture contracts, OpenAPI drift, package build, and wheel smoke test passed

Checklist

  • I kept the change scoped to the relevant area.
  • I am opening this from a separate branch, not pushing directly to main.
  • No documentation change is required because the public API and configuration are unchanged.
  • I added or updated tests when the change affects behavior.
  • I did not commit secrets, .env files, dependency folders, or generated output.
  • Active relative links in Markdown files resolve.

Notes for Reviewers

The regression test covers both a missing SQLite row and a stale SQLite row while LanceDB already has the matching digest.

By submitting this pull request, I agree that my contribution is licensed under the Apache License 2.0.

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