fix execution policy decision persistence

This commit is contained in:
dotta 2026-04-07 17:07:10 -05:00
parent a0333f3e9d
commit bce58d353d
9 changed files with 160 additions and 34 deletions

View file

@ -95,6 +95,20 @@ describe("normalizeIssueExecutionPolicy", () => {
expect(result!.mode).toBe("normal");
});
it("rejects approvalsNeeded values above 1", () => {
expect(() =>
normalizeIssueExecutionPolicy({
stages: [
{
type: "review",
approvalsNeeded: 2,
participants: [{ type: "agent", agentId: qaAgentId }],
},
],
}),
).toThrow("Invalid execution policy");
});
it("throws for invalid input", () => {
expect(() => normalizeIssueExecutionPolicy({ stages: [{ type: "invalid_type" }] })).toThrow();
});