fix: preserve evidence revision staleness semantics

This commit is contained in:
2026-08-09 18:45:56 +02:00
parent 266a604892
commit c7a369f436
3 changed files with 49 additions and 5 deletions
+19
View File
@@ -321,6 +321,25 @@ test("returns a 409 field conflict instead of overwriting a changed workspace",
});
});
test("maps a stale registry commit to HTTP 409 without conflict payloads", async () => {
const registry = registryFake({
publish: vi.fn(async () => {
throw new WorkspaceRegistryError("workspace_stale", "Workspace revision is stale");
}),
});
const app = appFor(registry);
const res = await app.inject({ method: "POST", url: "/workspaces/publish", payload: {
action: "update",
workspace,
baseCommit: "c".repeat(40),
baseBlob: "d".repeat(40),
} });
expect(res.statusCode).toBe(409);
expect(res.json()).toEqual({ code: "workspace_stale", message: "Workspace revision is stale." });
});
test("exports generated public artifacts without secret values", async () => {
const app = appFor(registryFake());