fix: align workspace diagnostic contracts

This commit is contained in:
2026-08-04 00:37:57 +02:00
parent f6494fd8ef
commit 565e93a456
12 changed files with 346 additions and 42 deletions
+19
View File
@@ -98,6 +98,7 @@ test("requires explicit vector database and schema identities with strict diagno
+ " method: POST\n"
+ " path: /rpc/diagnostic_vector_probe\n"
+ " auth: bearer\n"
+ " response: { operation: operation }\n"
+ " embedding:\n"
+ " method: GET\n"
+ " path: /models\n"
@@ -134,6 +135,24 @@ test("requires explicit vector database and schema identities with strict diagno
.toThrow(/response field/i);
});
test("requires a reversible writer probe to declare the response operation it verifies", () => {
const writerProbe = validYaml.replace("llm_policy:\n", `diagnostics:
vector_rest:
metadata:
method: GET
path: /metadata
auth: bearer
response: { collection: collection, dimensions: dimensions, distance: distance }
reversible_probe:
method: POST
path: /diagnostic-probe
auth: bearer
llm_policy:
`);
expect(() => parseWorkspaceYaml(writerProbe)).toThrow(/response|operation/i);
});
test("keeps v1 descriptors readable but requires explicit migration before v2 operations", () => {
const v1WithoutVectorIdentity = validYaml.replace("schema_version: 2", "schema_version: 1").replace(
" database: postgres\n schema: vectors\n", "",