feat: complete catalog-driven preprocessing
Publish documentation / publish (push) Successful in 2m12s
Publish documentation / publish (push) Successful in 2m12s
This commit is contained in:
@@ -9,9 +9,9 @@ import {
|
||||
type DiagnosticAdapters,
|
||||
} from "../src/workspaces/diagnostics.js";
|
||||
import type { RuntimeBindings } from "../src/workspaces/runtime-renderer.js";
|
||||
import { parseWorkspaceYaml, resolveDiagnosticUrl } from "../src/workspaces/schema.js";
|
||||
import { parseRuntimeWorkspaceYaml, resolveDiagnosticUrl } from "../src/workspaces/schema.js";
|
||||
|
||||
const workspace = parseWorkspaceYaml(`workspace:
|
||||
const workspace = parseRuntimeWorkspaceYaml(`workspace:
|
||||
schema_version: 4
|
||||
id: psd-clinical
|
||||
name: Policlinico San Donato
|
||||
@@ -81,9 +81,11 @@ test("diagnoses workspace-v4 DWH plus installation-derived Qdrant and Ollama", a
|
||||
role: "dwh", transport: "postgres_direct",
|
||||
resource: { database: "warehouse", schema: "datawarehouse" },
|
||||
}));
|
||||
expect(adapters.inspectQdrant).toHaveBeenCalledWith(expect.objectContaining({
|
||||
baseUrl: "http://qdrant:6333", collection: "psd-clinical",
|
||||
}));
|
||||
expect(adapters.inspectQdrant).toHaveBeenCalledTimes(2);
|
||||
expect(vi.mocked(adapters.inspectQdrant).mock.calls.map(([request]) => request.collection)).toEqual([
|
||||
"psd-clinical-reference",
|
||||
"psd-clinical-memory",
|
||||
]);
|
||||
expect(adapters.probeEmbedding).toHaveBeenCalledWith(expect.objectContaining({
|
||||
baseUrl: "http://embedding:11434", model: "qwen3-embedding:0.6b",
|
||||
}));
|
||||
@@ -107,14 +109,14 @@ test("can delegate the DWH probe to Database Management", async () => {
|
||||
}],
|
||||
});
|
||||
expect(adapters.probeConnector).not.toHaveBeenCalled();
|
||||
expect(adapters.inspectQdrant).toHaveBeenCalledTimes(1);
|
||||
expect(adapters.inspectQdrant).toHaveBeenCalledTimes(2);
|
||||
expect(adapters.probeEmbedding).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
test("reports incompatible internal Qdrant or Ollama metadata", async () => {
|
||||
const vector = await diagnose(successfulAdapters({
|
||||
inspectQdrant: vi.fn(async () => ({
|
||||
collection: "psd-clinical", dimensions: 768, distance: "cosine",
|
||||
inspectQdrant: vi.fn(async (request) => ({
|
||||
collection: request.collection, dimensions: 768, distance: "cosine",
|
||||
})),
|
||||
}))(workspace, bindings, { writeProbe: false });
|
||||
expect(vector.activatable).toBe(false);
|
||||
@@ -163,7 +165,7 @@ test("keeps workspace-v4 DWH SSH diagnostic-only and runtime-inactive", async ()
|
||||
});
|
||||
|
||||
test("uses the workspace-v4 declared DWH REST diagnostic and auth policy", async () => {
|
||||
const restWorkspace = parseWorkspaceYaml(`workspace:
|
||||
const restWorkspace = parseRuntimeWorkspaceYaml(`workspace:
|
||||
schema_version: 4
|
||||
id: psd-clinical
|
||||
name: REST workspace
|
||||
@@ -428,7 +430,7 @@ test("uses a REST secret only as a header and redacts it from failed diagnostics
|
||||
const credentialFile = join(root, "api-key");
|
||||
const canary = "CANARY-REST-AUTH-SECRET";
|
||||
await writeFile(credentialFile, canary);
|
||||
const restDescriptor = parseWorkspaceYaml(`workspace:
|
||||
const restDescriptor = parseRuntimeWorkspaceYaml(`workspace:
|
||||
schema_version: 4
|
||||
id: psd-clinical
|
||||
name: REST auth
|
||||
@@ -548,6 +550,9 @@ test("returns observed normalized Qdrant distance for semantic mismatch classifi
|
||||
|
||||
test("classifies an observed non-cosine Qdrant distance as semantic incompatibility", async () => {
|
||||
const fetchMock = vi.fn()
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({
|
||||
result: { config: { params: { vectors: { size: 1024, distance: "Euclid" } } } },
|
||||
}), { status: 200 }))
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({
|
||||
result: { config: { params: { vectors: { size: 1024, distance: "Euclid" } } } },
|
||||
}), { status: 200 }))
|
||||
|
||||
Reference in New Issue
Block a user