test(cursor): verify public install and provider-loss settlement

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-03 13:33:38 -05:00
1 parent 37ba674378
commit f67dcc56fd
6 files changed
+25 -11

No files matched your search

+1 -1
View File
@@ -1112,7 +1112,7 @@ export const runnerSuites: readonly RunnerSuiteFixture[] = [
tasks: [{
id: "pending-permission-provider-loss", label: "Owned runtime loss with pending permission", groups: [], workMode: "standard", flow: "native_provider_loss",
expectedRunCount: 1, attemptTimeoutMs: { local: 300_000, daytona: 300_000 }, turnTimeoutMs: 120_000,
expectedTerminalState: { issue: "in_progress", run: "failed" },
expectedTerminalState: { issue: "blocked", run: "failed" },
buildTitle: nonce => `Native provider loss ${nonce}`,
buildVisibleMarker: nonce => `NATIVE-PROVIDER-LOSS-${nonce}`,
buildPrompt: () => "Attempt the supplied exact native shell operation once and leave its permission callback unanswered. Do not retry, use another tool or path, answer your own permission, call paperclip_finish, or claim completion. The qualification fixture will deliberately lose the isolated runtime before any approval.",
+2 -1
View File
@@ -118,7 +118,8 @@ export function buildRunnerE2EProcessEnvironment(
const admittedSuite = execution.suite.id === "extended-harnesses"
|| execution.suite.id === "rich-acp-warm-continuity"
|| (execution.suite.id === "cursor-native" && agent === "cursor")
|| (execution.suite.id === "native-active-stop" && agent === "cursor");
|| (execution.suite.id === "native-active-stop" && agent === "cursor")
|| (execution.suite.id === "native-provider-loss" && agent === "cursor");
if (!admittedSuite || !execution.suite.manualOnly) {
throw new Error("Candidate qualification requires an explicit provider qualification suite");
}
@@ -20,7 +20,7 @@ export function assertProviderLossSettlement(run: Row, issue: Row, events: reado
const fail = (ok: boolean, reason: string) => { if (!ok) throw new Error(`Native provider loss: ${reason}`); };
fail(run.id === pending.scope.runId && run.companyId === pending.scope.companyId && run.nativeIssueId === pending.scope.issueId
&& run.status === "failed" && run.runtimeMode === "native" && typeof run.error === "string" && run.error.length > 0
&& issue.id === pending.scope.issueId && issue.companyId === pending.scope.companyId && issue.status === "in_progress"
&& issue.id === pending.scope.issueId && issue.companyId === pending.scope.companyId && issue.status === "blocked"
&& run.resultJson?.nativeCancellation == null, "failure must leave the task open without claiming Stop or success");
const frames = events.flatMap(row => row.payload?.prpEvent ? [row.payload.prpEvent] : []);
const closures = frames.filter(frame => ["runtime_request.resolved", "runtime_request.cancelled", "runtime_request.expired"].includes(frame.eventType)
@@ -145,7 +145,7 @@ export async function runNativeProviderLossFlow(input: {
await expect(page.getByTestId("task-chat-history-loading")).toHaveCount(0);
await expect(card.getByRole("button", { name: "Deny", exact: true })).toHaveCount(0);
await load(); assertProviderLossSettlement(runs[0]!, issue, events, pending!);
check("one-unfinished-failed-run", runs.length === 1 && issue.status === "in_progress", "No automatic mutation replay or false task completion");
check("one-unfinished-failed-run", runs.length === 1 && issue.status === "blocked", "A visible blocked task owns the failure; no automatic mutation replay or false completion");
await input.capture("final-state", "Lost runtime fails clearly and leaves the task open", "final-state.png");
await input.evidence("api-state.json", { issue, runs, checks, settlement, runEvents: events, runEventsByRun: [{ runId: runs[0]!.id, events }] });
return { issue, runs, checks };
+10 -1
View File
@@ -2,11 +2,20 @@ import { expect, it } from "vitest";
import { assertProviderLossSettlement } from "./native-provider-loss-flow.js";
import { bootstrapReadExecutionId } from "./native-bootstrap-read-proof.js";
import type { ActiveStopPending } from "./native-active-stop-evidence.js";
import { buildRunnerE2EProcessEnvironment } from "./harness-env.js";
import { runnerMatrix } from "./catalog.js";
it("admits only explicit Cursor loss cells through the qualification harness", () => {
const execution = runnerMatrix.find(row => row.suite.id === "native-provider-loss" && row.environment.id === "local")!;
expect(JSON.parse(buildRunnerE2EProcessEnvironment({}, [execution]).PAPERCLIP_RUNNER_ACPX_QUALIFICATION!))
.toEqual([{ agent: "cursor", model: execution.profile.model }]);
expect(() => buildRunnerE2EProcessEnvironment({}, [{ ...execution, profile: { ...execution.profile, qualificationCandidate: "copilot" } }])).toThrow("explicit provider qualification suite");
});
function fixture() {
const pending = { scope: { runId: "run", companyId: "company", issueId: "issue" }, requestId: "permission", turnId: "turn", toolCallId: "mutation" } as ActiveStopPending;
const run = { id: "run", companyId: "company", nativeIssueId: "issue", runtimeMode: "native", status: "failed", error: "provider_transport_failed", resultJson: {} };
const issue = { id: "issue", companyId: "company", status: "in_progress" };
const issue = { id: "issue", companyId: "company", status: "blocked" };
const events = [{ payload: { prpEvent: { eventType: "runtime_request.expired", payload: { requestId: "permission", turnId: "turn", requestKind: "permission_approval" } } } }];
return { pending, run, issue, events };
}