mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 20:09:33 +01:00
Preserve remote work when required workspace restore fails (#15479)
Persist exact source-retention obligations before run finalization and protect them across cancellation, restart and task changes. Require board-authorized repair evidence without replaying old work or changing current task ownership, state or locks. Hide an unavailable retry action and document operator recovery and retention costs. Validated with 674 scoped regressions, 224 combined integration tests, full typecheck/build, independent safety reviews and green CI with Greptile 5/5. No historical file recovery is claimed. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
cd40ebb95b
commit
f1c44b7b56
21 files changed
+1223
-77
No files matched your search
@@ -314,6 +314,20 @@ describe("issue validators", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it.each(["backlog", "in_progress", "blocked", "cancelled"])("requires workspace evidence to record a repair at unchanged %s status", sourceIssueStatus => {
|
||||
const input = { outcome: "restored", sourceIssueStatus };
|
||||
expect(resolveIssueRecoveryActionSchema.safeParse(input).success).toBe(false);
|
||||
expect(resolveIssueRecoveryActionSchema.safeParse({ ...input, executionReconciliation: {
|
||||
runId: "11111111-1111-4111-8111-111111111111", providerStopped: true, actionOutcome: "mixed",
|
||||
outcomeEvidence: "Observed and reconciled the source run action outcomes.",
|
||||
} }).success).toBe(false);
|
||||
expect(resolveIssueRecoveryActionSchema.safeParse({ ...input, executionReconciliation: {
|
||||
runId: "11111111-1111-4111-8111-111111111111", providerStopped: true, actionOutcome: "mixed",
|
||||
outcomeEvidence: "Observed and reconciled the source run action outcomes.",
|
||||
workspaceRepairEvidence: "Copied the retained source files and verified the restored files.",
|
||||
} }).success).toBe(true);
|
||||
});
|
||||
|
||||
it("allows cancelled recovery resolutions to atomically restore the source issue status", () => {
|
||||
expect(
|
||||
resolveIssueRecoveryActionSchema.parse({
|
||||
|
||||
@@ -576,12 +576,15 @@ export const resolveIssueRecoveryActionSchema = z
|
||||
.optional(),
|
||||
actionId: z.string().guid().optional(),
|
||||
outcome: z.enum(RESOLVE_ISSUE_RECOVERY_ACTION_OUTCOMES),
|
||||
sourceIssueStatus: z.enum(["todo", "done", "in_review", "blocked"]),
|
||||
sourceIssueStatus: z.enum(ISSUE_STATUSES),
|
||||
resolutionNote: multilineTextSchema.optional().nullable(),
|
||||
})
|
||||
.strict()
|
||||
.superRefine((value, ctx) => {
|
||||
if (value.outcome === "restored") {
|
||||
// A retained-source repair records evidence without changing task state.
|
||||
// The route verifies the exact server-owned source and unchanged status.
|
||||
if (value.executionReconciliation?.workspaceRepairEvidence) return;
|
||||
if (
|
||||
value.sourceIssueStatus !== "todo" &&
|
||||
value.sourceIssueStatus !== "done" &&
|
||||
|
||||
Reference in new issue
Block a user