mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-16 03:31:44 +01:00
Implement delegated recovery backend contract
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
f51cba33fa
commit
82d4e4162b
12 files changed
+672
-1
No files matched your search
@@ -293,6 +293,7 @@ export const ISSUE_ORIGIN_KINDS = [
|
||||
"harness_liveness_escalation",
|
||||
"issue_productivity_review",
|
||||
"stranded_issue_recovery",
|
||||
"delegated_recovery",
|
||||
"task_watchdog",
|
||||
TASK_WATCHDOG_PRODUCT_BUG_ORIGIN_KIND,
|
||||
] as const;
|
||||
|
||||
@@ -1572,6 +1572,7 @@ export {
|
||||
updateIssueSchema,
|
||||
issueExecutionPolicySchema,
|
||||
issueExecutionStateSchema,
|
||||
delegateIssueRecoveryActionSchema,
|
||||
resolveIssueRecoveryActionSchema,
|
||||
issueReviewRequestSchema,
|
||||
issueExecutionWorkspaceSettingsSchema,
|
||||
@@ -1668,6 +1669,7 @@ export {
|
||||
type CreateAcceptedPlanDecomposition,
|
||||
type CreateIssueLabel,
|
||||
type UpdateIssue,
|
||||
type DelegateIssueRecoveryAction,
|
||||
type ResolveIssueRecoveryAction,
|
||||
type CheckoutIssue,
|
||||
type AddIssueComment,
|
||||
|
||||
@@ -384,6 +384,7 @@ export {
|
||||
issueExecutionPolicySchema,
|
||||
issueExecutionStateSchema,
|
||||
issueRecoveryActionReadModelSchema,
|
||||
delegateIssueRecoveryActionSchema,
|
||||
resolveIssueRecoveryActionSchema,
|
||||
issueReviewRequestSchema,
|
||||
issueExecutionWorkspaceSettingsSchema,
|
||||
@@ -441,6 +442,7 @@ export {
|
||||
type UpdateIssue,
|
||||
type IssueExecutionWorkspaceSettings,
|
||||
type IssueRecoveryActionReadModel,
|
||||
type DelegateIssueRecoveryAction,
|
||||
type ResolveIssueRecoveryAction,
|
||||
type CheckoutIssue,
|
||||
type AddIssueComment,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { MAX_ISSUE_REQUEST_DEPTH } from "../index.js";
|
||||
import {
|
||||
addIssueCommentSchema,
|
||||
createIssueSchema,
|
||||
delegateIssueRecoveryActionSchema,
|
||||
issueBlockedInboxAttentionSchema,
|
||||
resolveIssueRecoveryActionSchema,
|
||||
respondIssueThreadInteractionSchema,
|
||||
@@ -142,6 +143,26 @@ describe("issue validators", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts delegated recovery action requests for the CEO target", () => {
|
||||
const actionId = "11111111-1111-4111-8111-111111111111";
|
||||
expect(
|
||||
delegateIssueRecoveryActionSchema.parse({
|
||||
actionId,
|
||||
target: "ceo",
|
||||
}),
|
||||
).toEqual({
|
||||
actionId,
|
||||
target: "ceo",
|
||||
});
|
||||
|
||||
expect(
|
||||
delegateIssueRecoveryActionSchema.safeParse({
|
||||
actionId,
|
||||
target: "cto",
|
||||
}).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("allows restored recovery resolutions to return the source issue to todo", () => {
|
||||
expect(
|
||||
resolveIssueRecoveryActionSchema.parse({
|
||||
|
||||
@@ -317,6 +317,13 @@ export const issueRecoveryActionReadModelSchema = z.object({
|
||||
|
||||
export type IssueRecoveryActionReadModel = z.infer<typeof issueRecoveryActionReadModelSchema>;
|
||||
|
||||
export const delegateIssueRecoveryActionSchema = z.object({
|
||||
actionId: z.string().uuid(),
|
||||
target: z.enum(["ceo"]),
|
||||
}).strict();
|
||||
|
||||
export type DelegateIssueRecoveryAction = z.infer<typeof delegateIssueRecoveryActionSchema>;
|
||||
|
||||
const RESOLVE_ISSUE_RECOVERY_ACTION_OUTCOMES = [
|
||||
"restored",
|
||||
"false_positive",
|
||||
|
||||
Reference in new issue
Block a user