feat(platform): checkpoint current implementation state

This commit is contained in:
2026-04-01 07:42:03 +02:00
parent 3e53471f05
commit 8c5be51251
125 changed files with 10269 additions and 17808 deletions
@@ -116,4 +116,32 @@ describe("assistant project admin delete tools", () => {
error: "Project not found: project_1",
}));
});
it("returns a stable assistant error when the project cannot be resolved before deletion", async () => {
const transaction = vi.fn();
const ctx = createToolContext(
{
project: {
findUnique: vi.fn().mockResolvedValue(null),
findFirst: vi.fn().mockResolvedValue(null),
},
$transaction: transaction,
},
{
userRole: SystemRole.ADMIN,
permissions: [PermissionKey.MANAGE_PROJECTS],
},
);
const result = await executeTool(
"delete_project",
JSON.stringify({ projectId: "missing-project" }),
ctx,
);
expect(JSON.parse(result.content)).toEqual({
error: "Project not found: missing-project",
});
expect(transaction).not.toHaveBeenCalled();
});
});