feat: enhance local knowledge retrieval
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
embeddingDiagnosticResultSchema,
|
||||
embeddingIndexJobSchema,
|
||||
embeddingIndexStatusSchema,
|
||||
knowledgeEmbeddingIndexSnapshotSchema,
|
||||
embeddingSafeErrorSchema,
|
||||
isEmbeddingIndexJobActive
|
||||
} from './embedding-contracts'
|
||||
@@ -130,4 +131,22 @@ describe('embedding contracts', () => {
|
||||
}).success
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it('validates library-scoped embedding coverage totals', () => {
|
||||
const base = {
|
||||
knowledgeBaseId: '11111111-1111-4111-8111-111111111111',
|
||||
enabled: true,
|
||||
coverage: { total: 4, indexed: 2, missing: 1, error: 1 },
|
||||
indexStatus: { job: null }
|
||||
}
|
||||
expect(
|
||||
knowledgeEmbeddingIndexSnapshotSchema.safeParse(base).success
|
||||
).toBe(true)
|
||||
expect(
|
||||
knowledgeEmbeddingIndexSnapshotSchema.safeParse({
|
||||
...base,
|
||||
coverage: { total: 4, indexed: 2, missing: 2, error: 1 }
|
||||
}).success
|
||||
).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user