Skip to content

fix(embeddings): recover durable backlog without starving recall - #1956

Merged
BYK merged 1 commit into
mainfrom
fix/embedding-queue-recovery
Oct 1, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/embedding-queue-recovery

Conversation

@BYK

@BYK BYK commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Recover durable temporal embedding work across upgrades and restarts without delaying foreground recall or mixing tenants.

Changes

  • Recover missing queue metadata, triggers, and vec0 storage after interrupted upgrades; retain valid old vectors until atomic replacement.
  • Prioritize live work while giving historical work a fair share. Bound admission to a 512-row window plus 16 fair claims, isolate failed rows with durable retry deadlines, and wake the scheduler for new live work.
  • Limit temporal embedding sources to 512 KiB. Keep oversized messages FTS-searchable while retiring queued, parked, and already-indexed oversized work with owner and tenant revalidation.
  • Scope project and session cleanup to confirmed owners, protect source-window checkpoints, reject unsafe backup destinations, and sanitize vector-worker diagnostics.
  • Cancel parked startup backfills during shutdown, abort foreground work before waiting on them, and use one shutdown deadline before closing SQLite.

Validation

  • env -u LORE_ALLOW_REMOTE_MANAGEMENT pnpm test: 11,874 root tests passed, 229 skipped (524 files passed, 17 skipped); 576 UI tests passed (36 files).
  • Workspace typecheck, lint, format check, production build, and gateway bundle passed. Lint reported non-failing warnings.
  • Sync property suite: 5 tests passed on each of 10 consecutive runs.
  • Real-path shutdown regressions passed with the fix and failed when their guards were removed. Separate frozen-tree correctness and security reviews returned MERGE on cdb9210d (base d7897f7a).

Devin Review

@BYK BYK self-assigned this Sep 29, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ Patch coverage is 95.33% (878 of 921 changed executable lines covered; target 80%).
Project statement coverage is 85.25% (up 0.25 percentage points from base (d7897f7) to head (cdb9210)).

Changed files with executable lines (14)
File Patch coverage Changed executable lines
packages/core/src/embedding/backfill.ts 96.51% 359/372 covered; missed: 333, 334, 398, 399, 400, 410, 420, 804, 807, 1080, 1081, 1563, 1742; partial branches: 289, 390, 402, 408, 412, 418, 422, 653, 694, 720, 721, 737, 744, 771, 783, 803, 827, 828, 843, 1032, 1054, 1060, 1076, 1096, 1108, 1118, 1210, 1230, 1233, 1266, 1270, 1272, 1275, 1317, 1367, 1368, 1396, 1419, 1452, 1454, 1462, 1463, 1478, 1493, 1500, 1507, 1524, 1526, 1635, 1639, 1652, 1724
packages/core/src/temporal-embedding-queue.ts 96.77% 180/186 covered; missed: 285, 342, 356, 600, 625, 626; partial branches: 128, 284, 341, 355, 546, 596, 629, 691, 780, 786, 884, 903
packages/core/src/db.ts 88.07% 96/109 covered; missed: 3439, 3440, 3441, 3949, 3950, 3951, 3974, 3998, 3999, 4000, 4791, 4792, 4793; partial branches: 3433, 3895, 3973, 3977
packages/core/src/data.ts 97.17% 103/106 covered; missed: 860, 959, 1402; partial branches: 855, 954, 1401, 1417, 1428, 1432
packages/gateway/src/pipeline.ts 73.91% 17/23 covered; missed: 1195, 4819, 4832, 4835, 4838, 4839; partial branches: 1194
packages/core/src/embedding/documents.ts 90.91% 10/11 covered; missed: 145; partial branches: 143, 144, 148, 153, 154
packages/core/src/embedding/pool.ts 100.00% 63/63 covered; partial branches: 375, 382, 857
packages/core/src/db/reader.ts 85.71% 6/7 covered; missed: 48
packages/core/src/db/vec-store.ts 100.00% 1/1 covered
packages/core/src/embedding/runtime.ts 100.00% 1/1 covered
packages/core/src/sync-data.ts 100.00% 1/1 covered
packages/core/src/temporal-embedding-admission.ts 100.00% 29/29 covered
packages/core/src/temporal.ts 100.00% 1/1 covered
packages/core/src/vector-pool.ts 100.00% 11/11 covered
Coverage diff
@@            Coverage Diff             @@
##          main     #1956       +/-##
==========================================
+ Coverage    85.00%    85.25%    +0.25%
==========================================
  Files          318       318         —
  Tracked lines     49482     50299      +817
  Branches     40478     41272      +794
==========================================
+ Hits         42061     42882      +821
+ Misses        7421      7417        -4
- Partials      4285      4354       +69

Generated by Coverage Action

sentry[bot]

This comment was marked as resolved.

@BYK
BYK force-pushed the fix/embedding-queue-recovery branch from 0d382ec to b3aac1a Compare October 1, 2026 09:34
devin-ai-integration[bot]

This comment was marked as resolved.

Comment thread packages/core/src/db.ts
@BYK
BYK force-pushed the fix/embedding-queue-recovery branch from b3aac1a to cdb9210 Compare October 1, 2026 14:14
@BYK
BYK merged commit 941a926 into main Oct 1, 2026
36 of 37 checks passed
@BYK
BYK deleted the fix/embedding-queue-recovery branch October 1, 2026 15:07
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-01 15:08 UTC

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