Document task privacy action hints in OpenAPI

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-06 23:25:27 -05:00
commit 2b187dff3e
2 files changed
+31

No files matched your search

@@ -238,6 +238,19 @@ function loadSpecRoutes() {
}
describe("openapi routes", () => {
it("documents manager-only task privacy hints without protected scope identity", () => {
const spec = buildOpenApiSpec() as any;
const operation = spec.paths["/api/issues/{id}/privacy-constraints"].get;
const schema = operation.responses["200"].content["application/json"].schema;
expect(schema.properties).toEqual({
publicBlockedBy: { type: "string", enum: ["parent", "project"], nullable: true },
leavesPersonalProject: { type: "boolean" },
});
expect(schema.required).toEqual(["publicBlockedBy", "leavesPersonalProject"]);
expect(operation.responses["403"]).toBeDefined();
expect(operation.responses["404"]).toBeDefined();
});
it("documents strict run-attributed feedback without a read endpoint", () => {
const { spec } = loadSpecRoutes();
const path = spec.paths["/api/companies/{companyId}/agent-commentary"];
+18
View File
@@ -4325,6 +4325,24 @@ registry.registerPath({
responses: { 200: r.ok(), 401: r.unauthorized },
});
registry.registerPath({
method: "get",
path: "/api/issues/{id}/privacy-constraints",
tags: ["issues"],
summary: "Get task privacy action constraints for an authorized manager",
description: "Returns action hints without disclosing protected parent or project identity. Visibility writes recheck the current rules under the privacy-tree lock.",
request: { params: z.object({ id: z.string() }) },
responses: {
200: r.ok(z.object({
publicBlockedBy: z.enum(["parent", "project"]).nullable(),
leavesPersonalProject: z.boolean(),
}).strict()),
401: r.unauthorized,
403: r.forbidden,
404: r.notFound,
},
});
registry.registerPath({
method: "get",
path: "/api/issues/{id}/access-grants",