Fix workspace policy loading

This commit is contained in:
2026-08-13 23:24:45 +02:00
parent 10edca5a09
commit 25b2835e73
8 changed files with 92 additions and 17 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ test("bootstrap mode locks catalog metadata and saves only the local bootstrap d
expect(screen.getByLabelText("Description")).toBeDisabled();
await user.clear(screen.getByLabelText("Vector collection"));
await user.type(screen.getByLabelText("Vector collection"), "research_docs");
await user.type(screen.getByLabelText("Vector collection"), "research-docs");
await user.click(screen.getByRole("button", { name: "Save draft" }));
expect(onSaveDraft).toHaveBeenCalledWith(expect.objectContaining({
@@ -75,7 +75,7 @@ test("bootstrap mode locks catalog metadata and saves only the local bootstrap d
workspaceId: "bootstrap-slot",
workspace: expect.objectContaining({
semantic_index: expect.objectContaining({
vector_store: expect.objectContaining({ collection: "research_docs" }),
vector_store: expect.objectContaining({ collection: "research-docs" }),
}),
}),
}));
+1 -1
View File
@@ -47,7 +47,7 @@ function validate(workspace: CanonicalWorkspace): FieldErrors {
if (dwhPort) errors["dwh.port"] = dwhPort;
const dwhTimeout = positiveInteger(workspace.dwh.timeout_ms, "DWH timeout");
if (dwhTimeout) errors["dwh.timeout"] = dwhTimeout;
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(workspace.semantic_index.vector_store.collection)) errors["vector.collection"] = "Use a collection identifier";
if (!/^[a-z][a-z0-9-]{2,62}$/.test(workspace.semantic_index.vector_store.collection)) errors["vector.collection"] = "Use a canonical collection name";
if (!workspace.llm_policy.allowed.length || workspace.llm_policy.allowed.some((model) => !/^[^/\s]+\/[^/\s]+$/.test(model))) {
errors["llm.allowed"] = "Use provider/model entries separated by commas";
}
+2 -2
View File
@@ -48,7 +48,7 @@ const bootstrapWorkspace = {
},
semantic_index: {
...readyWorkspace.semantic_index,
vector_store: { ...readyWorkspace.semantic_index.vector_store, collection: "bootstrap_slot" },
vector_store: { ...readyWorkspace.semantic_index.vector_store, collection: "bootstrap-slot" },
},
};
@@ -107,7 +107,7 @@ test("saves a bootstrap draft locally for a configuration_required slot", async
await user.click(await screen.findByRole("button", { name: "Bootstrap slot" }));
await user.clear(screen.getByLabelText("Vector collection"));
await user.type(screen.getByLabelText("Vector collection"), "bootstrap_docs");
await user.type(screen.getByLabelText("Vector collection"), "bootstrap-docs");
await user.click(screen.getByRole("button", { name: "Save draft" }));
await waitFor(() => expect(screen.getByText("Draft saved in this browser.")).toBeVisible());