fix: retire active pgvector artifacts
This commit is contained in:
@@ -160,6 +160,38 @@ const writerBindings: RuntimeBindings = {
|
||||
},
|
||||
};
|
||||
|
||||
const workspaceV3 = parseWorkspaceYaml(`workspace:
|
||||
schema_version: 3
|
||||
id: psd-clinical
|
||||
name: Policlinico San Donato
|
||||
language: it
|
||||
dwh:
|
||||
engine: postgres
|
||||
database: warehouse
|
||||
schema: datawarehouse
|
||||
timeout_ms: 8000
|
||||
supported_transports: [postgres_direct, rest_api]
|
||||
semantic_index:
|
||||
vector_store:
|
||||
engine: qdrant
|
||||
collection: psd-clinical
|
||||
dimensions: 1024
|
||||
distance: cosine
|
||||
embedding:
|
||||
provider: ollama_internal
|
||||
model: qwen3-embedding:0.6b
|
||||
dimensions: 1024
|
||||
llm_policy:
|
||||
allowed: [zai/glm-5.2]
|
||||
`);
|
||||
|
||||
const bindingsV3: RuntimeBindings = {
|
||||
dwh: bindings.dwh,
|
||||
vector: { transport: "rest_api", missing: [], values: {} },
|
||||
vectorWriter: { transport: "rest_api", missing: [], values: {} },
|
||||
embedding: { transport: "rest_api", missing: [], values: {} },
|
||||
};
|
||||
|
||||
function successfulAdapters(overrides: Partial<DiagnosticAdapters> = {}): DiagnosticAdapters {
|
||||
return {
|
||||
probeConnector: vi.fn(async (request) => ({
|
||||
@@ -843,6 +875,63 @@ test("constructs the production diagnoser with the configured timeout and inject
|
||||
expect(adapters.probeEmbedding).toHaveBeenCalledWith(expect.objectContaining({ timeoutMs: 1234 }));
|
||||
});
|
||||
|
||||
test("diagnoses a schema-v3 workspace through internal Qdrant and embedding config without workspace semantic bindings", async () => {
|
||||
const adapters = successfulAdapters({
|
||||
inspectVector: vi.fn(async () => ({
|
||||
collection: "psd-clinical",
|
||||
dimensions: 1024,
|
||||
distance: "cosine",
|
||||
})),
|
||||
probeEmbedding: vi.fn(async () => ({ available: true, dimensions: 1024 })),
|
||||
});
|
||||
|
||||
const result = await createProductionWorkspaceDiagnoser(1234, adapters, {
|
||||
internalQdrantUrl: "http://qdrant:6333",
|
||||
internalEmbeddingUrl: "http://embedding:11434",
|
||||
internalEmbeddingModel: "qwen3-embedding:0.6b",
|
||||
internalEmbeddingDimensions: 1024,
|
||||
})(workspaceV3, bindingsV3, { writeProbe: false });
|
||||
|
||||
expect(result.activatable).toBe(true);
|
||||
expect(adapters.inspectVector).toHaveBeenCalledWith(expect.objectContaining({
|
||||
transport: "rest_api",
|
||||
baseUrl: "http://qdrant:6333",
|
||||
collection: "psd-clinical",
|
||||
dimensions: 1024,
|
||||
distance: "cosine",
|
||||
timeoutMs: 1234,
|
||||
}));
|
||||
expect(adapters.probeEmbedding).toHaveBeenCalledWith(expect.objectContaining({
|
||||
baseUrl: "http://embedding:11434",
|
||||
model: "qwen3-embedding:0.6b",
|
||||
timeoutMs: 1234,
|
||||
}));
|
||||
expect(adapters.probeConnector).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
test("fails closed for schema-v3 when internal semantic diagnostics do not match descriptor identity", async () => {
|
||||
const adapters = successfulAdapters({
|
||||
inspectVector: vi.fn(async () => ({
|
||||
collection: "wrong-collection",
|
||||
dimensions: 1024,
|
||||
distance: "cosine",
|
||||
})),
|
||||
probeEmbedding: vi.fn(async () => ({ available: true, dimensions: 1024 })),
|
||||
});
|
||||
|
||||
const result = await createProductionWorkspaceDiagnoser(1234, adapters, {
|
||||
internalQdrantUrl: "http://qdrant:6333",
|
||||
internalEmbeddingUrl: "http://embedding:11434",
|
||||
internalEmbeddingModel: "qwen3-embedding:0.6b",
|
||||
internalEmbeddingDimensions: 1024,
|
||||
})(workspaceV3, bindingsV3, { writeProbe: false });
|
||||
|
||||
expect(result.activatable).toBe(false);
|
||||
expect(result.diagnostics).toContainEqual(expect.objectContaining({
|
||||
code: "semantic_index_incompatible",
|
||||
}));
|
||||
});
|
||||
|
||||
test("retries bounded cleanup after a write-probe removal times out", async () => {
|
||||
const adapters = successfulAdapters({
|
||||
removeDiagnosticRecord: vi.fn(() => new Promise<void>(() => undefined)),
|
||||
|
||||
Reference in New Issue
Block a user