fleet-kb: ship the fleet_kb chunk-table DDL as an idempotent package (nix-config#1875) #2832
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!2832
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kb/NCFG-1875-fleet-kb-ddl"
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?
Kanban nix-config#1875 (child 1 of Objectives#1824).
Deliverable The fleet_kb store DDL exists as an idempotent, packaged schema — not hand-run psql — so a re-apply is a no-op and a fresh host converges.
packages/fleet-kb-schema.sql— thechunktable: corpus, source, anchor, body, commit, indexed_at, content_hash, GENERATED tsv,vector(1024), jsonbmeta; natural key(corpus, source, anchor); tsv GIN, embedding HNSW, meta GIN, (corpus, source) and indexed_at btree; corpus vocabulary + sha256 shape as named CHECKs added by pg_catalog probe (Postgres has no ADD CONSTRAINT IF NOT EXISTS).packages/fleet-kb-schema.nix— store path$out/share/fleet-kb/schema.sql, same directory-output shape aspackages/yan-rag-schema.nix.Host wiring (
overlays/fleet-kb.nix,hosts/vpn/default.nix,extensions,ensureDatabases) is #1877 and is untouched here; ingest/tools are #1876.Proved on vpn against a real postgresql_15 + pgvector 0.8.6 cluster started from the store, using the PACKAGED file: applies cleanly 3x in a row (rc 0; rows 2 -> 2 -> 2 across applies 2 and 3),
\d chunklists all 11 columns + the tsv GIN and embedding HNSW indexes, both CHECKs reject a bad corpus and a truncated hash, and EXPLAIN takes the tsv GIN, the meta GIN (containment) and the HNSW index paths. Full log in the card.20ea75061516e3c1bd50