fix: keep quarantined cleanup out of automatic recovery projection

Also record the successful two-turn grounding qualification and semantic review.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-09-21 16:51:28 -05:00
1 parent cf6d4ae3a8
commit a11bd236e3
3 files changed
+31

No files matched your search

@@ -44,6 +44,9 @@ describe("execution truth projection", () => {
permittedActions: ["inspect_run", "inspect_recovery"],
});
expect(projectExecution(stopped, coordinator({ phase: "retryable_failure" }), [], undefined, now).phase).toBe("recovery_needed");
expect(projectExecution({ ...stopped, finishedAt: now }, coordinator({
phase: "terminal_failure", failureCode: "native_provider_terminal_failed",
}), [], undefined, now)).toMatchObject({ phase: "recovery_needed", recoveryOwner: "board" });
expect(projectExecution({ ...stopped, errorCode: "provider_frame_too_large" }, undefined, [], undefined, now).phase).toBe("failed");
expect(projectExecution(stopped, undefined, [], { status: "resolved", cause: "native_session_cleanup_quarantined", nextAction: "Verify prior execution",
evidence: { executionReconciliation: { providerStopped: true }, continuationRunId: "successor" } }, now))
@@ -260,6 +260,7 @@ export function projectExecution(
}
if (coordinator?.phase === "terminal_failure" || recoveryAction || cleanupQuarantined) {
if (
!cleanupQuarantined &&
coordinator?.failureCode === "native_provider_terminal_failed" &&
!detail.replacementDenied &&
run.finishedAt &&