test: restore task 2 review coverage

This commit is contained in:
2026-08-08 17:10:15 +02:00
parent 76bc94d5da
commit f7b9f3276b
3 changed files with 187 additions and 2 deletions
+25
View File
@@ -139,6 +139,18 @@ function legacyV1Yaml(source = validYaml): string {
.replace("schema_version: 3", "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: 3", "schema_version: 2");
}
const runFile = promisify(execFile);
const temporaryRoots: string[] = [];
@@ -639,6 +651,19 @@ test("does not acquire a session revision lease for a migration_required workspa
});
});
test("lists a schema v2 descriptor as migration_required and refuses to acquire it", async () => {
const remote = await fixture(legacyV2Yaml());
const registry = new WorkspaceRegistry(config(join(remote.root, "registry"), remote.remote));
await registry.bootstrap();
await expect(registry.list()).resolves.toMatchObject([
{ id: "psd-clinical", state: "migration_required" },
]);
await expect(registry.acquireSessionRevision("psd-clinical")).rejects.toMatchObject({
code: "workspace_invalid",
});
});
test("lists operational descriptors retained after their workspace was removed from the active revision", async () => {
const remote = await fixture();
const root = join(remote.root, "registry");