project-nomad/admin/app
John Cortright 50b42fe367 fix(kb): make purge self-healing and allowlist the orphan sweep's roots
purgeIndexedSource() deleted Qdrant points before removing the
KbIngestState row. If the row-delete failed or the process died in
between, the source vanished from Qdrant's orphan-detection signal but
the ghost state row stayed forever — nothing else ever revisits a row
with no matching file and no matching Qdrant source. Reversing the
order means a failure instead leaves points in Qdrant, which the next
sync's reverse orphan sweep will find and retry; both steps are
already idempotent, so a retry from either partial state is safe.

Also switch scanAndSyncStorage()'s orphan-candidate filter from
denylisting known non-scanned roots (README.md/docs) to allowlisting
the two roots _discoverKbFiles() actually scans (kb_uploads, zim),
via a new shared _kbScanRoots() helper. A denylist silently treats any
future source root outside kb_uploads/zim as an orphan the first time
it's added — the same class of bug the denylist itself was written to
fix for docs.
2026-09-29 15:54:41 -07:00
..
controllers feat(AI): give chat a sampler instead of the backend's defaults 2026-09-29 15:54:41 -07:00
data refactor(drug-reference): make collections JSON the single source for curated data (#1130) 2026-08-04 03:38:35 +00:00
exceptions fix(Docs): documentation renderer fixes 2025-12-23 16:00:33 -08:00
jobs fix(drug-reference): backfill the missing dataset install row on boot 2026-09-29 15:54:41 -07:00
middleware fix(API): skip compression for Server-Sent Events (#798) 2026-05-20 10:16:00 -07:00
models feat(kb): per-file active toggle + collection grouping/bulk toggle (#1286) 2026-09-29 15:54:41 -07:00
services fix(kb): make purge self-healing and allowlist the orphan sweep's roots 2026-09-29 15:54:41 -07:00
utils fix(rag): reap orphaned qdrant sources during sync (#1170) 2026-09-29 15:54:41 -07:00
validators feat(AI): give chat a sampler instead of the backend's defaults 2026-09-29 15:54:41 -07:00