fleet-kb-index: fix stats() grouping and the text-only write path (nix-config#1876) #2850
No reviewers
Labels
No labels
backlog
bug
enhancement
in-progress
library
needs-rebase
review
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ymrtech/nix-config!2850
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kb/NCFG-1876-kb-stats-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up on #2847 (kanban nix-config#1876), found by exercising the merged package on vpn.
1.
fleet-kb stats/kb_statscrashed —GroupingError: column "chunk.commit" must appear in the GROUP BY clause. The per-source commitment query selected a barecommitbesidemax(indexed_at); it is grouped asmax(commit)now (exact: a source is one file, so its chunks share one commit).2.
--no-embedwrote nothing into an empty store — the no-vector path was anUPDATE, so a text-only run matched zero rows while the summary still reportedchunks=N. Now anINSERT ... ON CONFLICT DO UPDATEthat omitsembedding, so a text-only run populates the table and an existing vector survives a text-only refresh.Evidence (scratch PG 15.19 + pgvector 0.8.6 cluster on vpn, packaged schema applied twice rc=0):
fleet-kb statsreturns total_chunks/embedded/by_corpus/sources JSON (was a traceback).--no-embed --corpus noteon an EMPTY store: 1412 rows written where the old code wrote 0; second runskipped=1412.--no-embedrefresh over 26 embedded skill chunks: 26 rows / 26 embeddings before and after.