mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 11:01:16 +01:00
Preserve deliberate assignee blocks and operator stops during dependency and run-release recovery. Attribute native waits to their bound owner. Ignore unrelated edits and shared-workspace exports from another issue. Continue after genuine dependency changes while preserving independently authorized user input. Keep the original contributor's implementation and review history. Add native ownership, unrelated-edit, later readiness, and shared-workspace regressions. The shared-workspace loop was reproduced before the fix. Co-Authored-By: Devin Foley <devin@paperclip.ing> Co-Authored-By: Paperclip <noreply@paperclip.ing>
23 lines
1.4 KiB
TypeScript
23 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isOperatorStoppedRunRow } from "./postgres.js";
|
|
|
|
describe("isOperatorStoppedRunRow", () => {
|
|
it.each([
|
|
[{ status: "cancelled", errorCode: "cancelled", resultJson: { cancelledByActorType: "user" } }, true],
|
|
[{ status: "cancelled", errorCode: "cancelled", resultJson: { cancelledByActorType: "board" } }, true],
|
|
[{ status: "cancelled", errorCode: "agent_paused", resultJson: null }, true],
|
|
[{ status: "cancelled", errorCode: "operator_interrupted", resultJson: {} }, true],
|
|
[{ status: "cancelled", errorCode: "cancelled", resultJson: { stopReason: "cancelled" } }, false],
|
|
[{ status: "cancelled", errorCode: "issue_terminal_status", resultJson: null }, false],
|
|
[{ status: "cancelled", errorCode: "cancelled", resultJson: { cancellation: {
|
|
source: "operator", expected: true, initiator: { type: "user" }, reason: "Stop", recordedAt: "2026-10-15T06:00:00Z",
|
|
} } }, true],
|
|
[{ status: "cancelled", errorCode: "operator_interrupted", resultJson: { cancelledByActorType: "user", cancellation: {
|
|
source: "queued_message", expected: true, initiator: { type: "user" }, reason: "New message", recordedAt: "2026-10-15T06:00:00Z",
|
|
} } }, false],
|
|
[{ status: "failed", errorCode: "agent_paused", resultJson: { cancelledByActorType: "user" } }, false],
|
|
])("classifies %j as %s", (row, expected) => {
|
|
expect(isOperatorStoppedRunRow(row as never)).toBe(expected);
|
|
});
|
|
});
|