feat: complete catalog-driven preprocessing
Publish documentation / publish (push) Successful in 2m12s
Publish documentation / publish (push) Successful in 2m12s
This commit is contained in:
@@ -19,11 +19,6 @@ const validYaml = `workspace:
|
||||
id: psd-clinical
|
||||
name: Policlinico San Donato
|
||||
language: it
|
||||
dwh:
|
||||
engine: postgres
|
||||
database: postgres
|
||||
schema: datawarehouse
|
||||
supported_transports: [postgres_direct]
|
||||
`;
|
||||
|
||||
function withFilesystemEvidence(source: string, id = "psd-clinical"): string {
|
||||
@@ -34,119 +29,12 @@ function withFilesystemEvidence(source: string, id = "psd-clinical"): string {
|
||||
`);
|
||||
}
|
||||
|
||||
function withDwhRestTransport(source: string): string {
|
||||
return source.replace(
|
||||
"supported_transports: [postgres_direct]",
|
||||
"supported_transports: [postgres_direct, rest_api]",
|
||||
);
|
||||
}
|
||||
|
||||
function withDwhRestDiagnostic(source: string): string {
|
||||
return withDwhRestTransport(source).concat(`diagnostics:
|
||||
dwh_rest:
|
||||
method: GET
|
||||
path: /health
|
||||
auth: none
|
||||
response:
|
||||
database: database
|
||||
schema: schema
|
||||
`);
|
||||
}
|
||||
|
||||
function withEmbeddingDiagnostic(source: string): string {
|
||||
return source.concat(`diagnostics:
|
||||
embedding:
|
||||
method: GET
|
||||
path: /models
|
||||
auth: none
|
||||
response:
|
||||
model: model
|
||||
dimensions: dimensions
|
||||
`);
|
||||
}
|
||||
|
||||
function withDwhRestAndEmbeddingDiagnostics(source: string): string {
|
||||
return withDwhRestTransport(source).concat(`diagnostics:
|
||||
dwh_rest:
|
||||
method: GET
|
||||
path: /health
|
||||
auth: none
|
||||
response:
|
||||
database: database
|
||||
schema: schema
|
||||
embedding:
|
||||
method: GET
|
||||
path: /models
|
||||
auth: none
|
||||
response:
|
||||
model: model
|
||||
dimensions: dimensions
|
||||
`);
|
||||
}
|
||||
|
||||
function withVectorRestTransport(source: string): string {
|
||||
return source.replace(
|
||||
"supported_transports: [pgvector_direct]",
|
||||
"supported_transports: [pgvector_direct, rest_api]",
|
||||
);
|
||||
}
|
||||
|
||||
function withVectorMetadataDiagnostic(source: string): string {
|
||||
return withVectorRestTransport(source).concat(`diagnostics:
|
||||
vector_rest:
|
||||
metadata:
|
||||
method: GET
|
||||
path: /metadata
|
||||
auth: none
|
||||
response:
|
||||
collection: collection
|
||||
dimensions: dimensions
|
||||
distance: distance
|
||||
`);
|
||||
}
|
||||
|
||||
function withReversibleVectorProbe(source: string): string {
|
||||
return withVectorRestTransport(source).concat(`diagnostics:
|
||||
vector_rest:
|
||||
metadata:
|
||||
method: GET
|
||||
path: /metadata
|
||||
auth: none
|
||||
response:
|
||||
collection: collection
|
||||
dimensions: dimensions
|
||||
distance: distance
|
||||
reversible_probe:
|
||||
method: POST
|
||||
path: /probe
|
||||
auth: bearer
|
||||
response:
|
||||
operation: operation
|
||||
`);
|
||||
}
|
||||
|
||||
function legacyV1Yaml(source = validYaml): string {
|
||||
return source
|
||||
.replace(" engine: qdrant\n", " engine: pgvector\n database: postgres\n schema: vectors\n")
|
||||
.replace(" collection: psd-clinical\n", " collection: psd_clinical\n")
|
||||
.replace(" dimensions: 1024", " dimensions: 768")
|
||||
.replace(" provider: ollama_internal", " provider: ollama_compatible")
|
||||
.replace(" model: qwen3-embedding:0.6b", " model: nomic-embed-text-v2-moe")
|
||||
.replace(" dimensions: 1024", " dimensions: 768")
|
||||
.replace("distance: cosine\n", "distance: cosine\n supported_transports: [pgvector_direct]\n")
|
||||
.replace("schema_version: 4", "schema_version: 1");
|
||||
return source.replace("schema_version: 4", "schema_version: 1");
|
||||
}
|
||||
|
||||
function legacyV2Yaml(source = validYaml): string {
|
||||
return source
|
||||
.replace(" engine: qdrant\n", " engine: pgvector\n database: postgres\n schema: vectors\n")
|
||||
.replace(" collection: psd-clinical\n", " collection: psd_clinical\n")
|
||||
.replace(" dimensions: 1024", " dimensions: 768")
|
||||
.replace(" provider: ollama_internal", " provider: ollama_compatible")
|
||||
.replace(" model: qwen3-embedding:0.6b", " model: nomic-embed-text-v2-moe")
|
||||
.replace(" dimensions: 1024", " dimensions: 768")
|
||||
.replace("distance: cosine\n", "distance: cosine\n supported_transports: [pgvector_direct]\n")
|
||||
.replace("schema_version: 4", "schema_version: 2");
|
||||
return source.replace("schema_version: 4", "schema_version: 2");
|
||||
}
|
||||
|
||||
const runFile = promisify(execFile);
|
||||
@@ -605,23 +493,6 @@ test("keeps content-only historical descriptor revisions distinguishable by comm
|
||||
expect(oldPinned.workspace).toEqual(newPinned.workspace);
|
||||
});
|
||||
|
||||
test.each([
|
||||
["adds", validYaml, withDwhRestDiagnostic(validYaml)],
|
||||
["removes", withDwhRestDiagnostic(validYaml), validYaml],
|
||||
])("pulls a curator change that %s a diagnostics branch without API rewrite", async (_operation, baseSource, remoteSource) => {
|
||||
const remote = await fixture(baseSource);
|
||||
const registry = new WorkspaceRegistry(config(join(remote.root, "registry"), remote.remote));
|
||||
await registry.bootstrap();
|
||||
const initial = await registry.read("psd-clinical");
|
||||
writeFileSync(join(remote.source, "psd-clinical", "workspace.yaml"), remoteSource);
|
||||
await git(remote.source, ["add", "psd-clinical/workspace.yaml"]);
|
||||
await git(remote.source, ["commit", "-m", `Registry ${_operation} diagnostic branch`]);
|
||||
await git(remote.source, ["push", "origin", "main"]);
|
||||
|
||||
await registry.pull();
|
||||
const updated = await registry.read("psd-clinical");
|
||||
expect(updated.revision.commit).not.toBe(initial.revision.commit);
|
||||
});
|
||||
test.each([
|
||||
["v1", legacyV1Yaml()],
|
||||
["v2", legacyV2Yaml()],
|
||||
|
||||
Reference in New Issue
Block a user