Fix workspace policy loading
This commit is contained in:
@@ -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" }),
|
||||
}),
|
||||
}),
|
||||
}));
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user