mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 10:48:12 +02:00
Grade clarification lists, obsolete unstarted wakes, and refusal cancellation from persisted evidence. Preserve execution and ownership assertions, add boundary regressions, and version the affected eval definitions. Co-Authored-By: Paperclip <noreply@paperclip.ing>
24 lines
1.4 KiB
TypeScript
24 lines
1.4 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { isBlockedUnstartedWake, isTerminalUnstartedWake } from "./non-execution-wake.js";
|
|
it("recognizes only explicitly suppressed wakes that never started execution", () => {
|
|
const run = { status: "cancelled", errorCode: "issue_dependencies_blocked", startedAt: null };
|
|
expect(isBlockedUnstartedWake(run)).toBe(true);
|
|
for (const patch of [{ startedAt: "2026-09-18" }, { startedAt: undefined }, { errorCode: "user_cancelled" }, { status: "failed" }]) {
|
|
expect(isBlockedUnstartedWake({ ...run, ...patch })).toBe(false);
|
|
}
|
|
});
|
|
|
|
it("requires an unstarted terminal suppression on the same terminal task", () => {
|
|
const run = { status: "cancelled", errorCode: "issue_terminal_status", startedAt: null, contextSnapshot: { issueId: "child" } };
|
|
for (const status of ["done", "cancelled"]) {
|
|
expect(isTerminalUnstartedWake(run, [{ id: "child", status }])).toBe(true);
|
|
}
|
|
for (const patch of [{ startedAt: "2026-09-27T09:16:00Z" }, { startedAt: undefined },
|
|
{ errorCode: "cancelled" }, { status: "failed" }, { contextSnapshot: undefined },
|
|
{ contextSnapshot: { issueId: "other" } }]) {
|
|
expect(isTerminalUnstartedWake({ ...run, ...patch }, [{ id: "child", status: "done" }])).toBe(false);
|
|
}
|
|
expect(isTerminalUnstartedWake(run, [])).toBe(false);
|
|
expect(isTerminalUnstartedWake(run, [{ id: "child", status: "in_progress" }])).toBe(false);
|
|
});
|