From b080895310d91356128c4770075efc8734af97f6 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 4 Oct 2026 21:29:19 -0500 Subject: [PATCH] Use a public Daytona plugin in installed release qualification The first installed remote smoke failed before allocation because its fixture used the development plugin and workspace loader. Resolve the compiled plugin in the actual npm consumer and keep qualified Cursor outside candidate admission checks. Co-Authored-By: Paperclip --- tests/runner-e2e/harness-env.ts | 5 +---- tests/runner-e2e/installed-release.test.ts | 19 ++++++++++++++++++- tests/runner-e2e/installed-release.ts | 16 ++++++++++++++++ tests/runner-e2e/live-fixtures.ts | 5 ++++- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/tests/runner-e2e/harness-env.ts b/tests/runner-e2e/harness-env.ts index 7fe62c200f4..51a0968404d 100644 --- a/tests/runner-e2e/harness-env.ts +++ b/tests/runner-e2e/harness-env.ts @@ -116,10 +116,7 @@ export function buildRunnerE2EProcessEnvironment( const agent = execution.profile.qualificationCandidate; if (!agent || agent === "cursor") continue; 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-provider-loss" && agent === "cursor"); + || execution.suite.id === "rich-acp-warm-continuity"; if (!admittedSuite || !execution.suite.manualOnly) { throw new Error("Candidate qualification requires an explicit provider qualification suite"); } diff --git a/tests/runner-e2e/installed-release.test.ts b/tests/runner-e2e/installed-release.test.ts index 7e450403088..7f7f353385f 100644 --- a/tests/runner-e2e/installed-release.test.ts +++ b/tests/runner-e2e/installed-release.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, mkdirSync, realpathSync, rmSync, writeFileSync } from "nod import { tmpdir } from "node:os"; import path from "node:path"; import { afterEach, describe, expect, it } from "vitest"; -import { installedReleaseEnvironment, installedReleaseLaunch } from "./installed-release.js"; +import { installedReleaseDaytonaPlugin, installedReleaseEnvironment, installedReleaseLaunch } from "./installed-release.js"; const roots: string[] = []; afterEach(() => roots.splice(0).forEach(root => rmSync(root, { recursive: true, force: true }))); @@ -17,6 +17,23 @@ describe("ordinary installed release smoke", () => { expect(() => installedReleaseLaunch(cli)).toThrow("public package"); expect(() => installedReleaseLaunch("relative/index.js")).toThrow("absolute path"); }); + it("uses the public compiled Daytona plugin beside the installed CLI", () => { + const root = realpathSync(mkdtempSync(path.join(tmpdir(), "installed-daytona-"))); roots.push(root); + const cliRoot = path.join(root, "node_modules/paperclipai"), plugin = path.join(root, "node_modules/@paperclipai/plugin-daytona"); + mkdirSync(path.join(cliRoot, "dist"), { recursive: true }); mkdirSync(path.join(plugin, "dist"), { recursive: true }); + const cli = path.join(cliRoot, "dist/index.js"); writeFileSync(cli, ""); + writeFileSync(path.join(cliRoot, "package.json"), JSON.stringify({ name: "paperclipai", version: "0.0.0-verify" })); + const manifest = { name: "@paperclipai/plugin-daytona", paperclipPlugin: { manifest: "./dist/manifest.js", worker: "./dist/worker.js" }, exports: { ".": { import: "./dist/index.js" } } }; + for (const file of ["manifest.js", "worker.js"]) writeFileSync(path.join(plugin, "dist", file), ""); + writeFileSync(path.join(plugin, "package.json"), JSON.stringify(manifest)); + expect(installedReleaseDaytonaPlugin(cli)).toBe(plugin); + writeFileSync(path.join(plugin, "package.json"), JSON.stringify({ ...manifest, exports: { ".": "./src/index.ts" } })); + expect(() => installedReleaseDaytonaPlugin(cli)).toThrow("public compiled Daytona"); + writeFileSync(path.join(plugin, "package.json"), JSON.stringify(manifest)); + rmSync(path.join(plugin, "dist/worker.js")); + expect(() => installedReleaseDaytonaPlugin(cli)).toThrow(); + }); + it("removes repository executables, provider packs, native paths and loader injection", () => { const source = { PATH: "/repo/packages/node_modules/.bin:/tmp/provider-bin:/usr/bin:/tmp/node/bin", NODE_OPTIONS: "--import /repo/loader", NODE_PATH: "/repo/node_modules", PAPERCLIP_RUNNER_BINARY: "/repo/runner", PAPERCLIP_RUNNER_PROVIDER_PACK_ROOT: "/private/pack", diff --git a/tests/runner-e2e/installed-release.ts b/tests/runner-e2e/installed-release.ts index def2391d0f4..eaeafa8d2e3 100644 --- a/tests/runner-e2e/installed-release.ts +++ b/tests/runner-e2e/installed-release.ts @@ -14,6 +14,22 @@ export function installedReleaseLaunch(cliPath: string) { return { cli, cwd: root, args: [cli, "onboard", "--yes", "--run"], version: manifest.version }; } +/** Install the public plugin from the same consumer, without a workspace loader. */ +export function installedReleaseDaytonaPlugin(cliPath: string): string { + const cli = installedReleaseLaunch(cliPath); + const plugin = realpathSync(path.join(path.dirname(cli.cwd), "@paperclipai/plugin-daytona")); + const manifest = JSON.parse(readFileSync(path.join(plugin, "package.json"), "utf8")); + if (manifest.name !== "@paperclipai/plugin-daytona" || + manifest.paperclipPlugin?.manifest !== "./dist/manifest.js" || + manifest.paperclipPlugin?.worker !== "./dist/worker.js" || + manifest.exports?.["."]?.import !== "./dist/index.js") { + throw new Error("Installed release requires the public compiled Daytona plugin package"); + } + realpathSync(path.join(plugin, "dist/manifest.js")); + realpathSync(path.join(plugin, "dist/worker.js")); + return plugin; +} + /** Qualification assets must never make a public installed product smoke pass. */ export function installedReleaseEnvironment(source: NodeJS.ProcessEnv, repositoryRoot: string, providerBin: string): NodeJS.ProcessEnv { if (source.PAPERCLIP_RUNNER_ACPX_QUALIFICATION) throw new Error("Installed release smoke requires production admission without qualification overrides"); diff --git a/tests/runner-e2e/live-fixtures.ts b/tests/runner-e2e/live-fixtures.ts index 36becfe105d..91dd362734e 100644 --- a/tests/runner-e2e/live-fixtures.ts +++ b/tests/runner-e2e/live-fixtures.ts @@ -1,5 +1,6 @@ import { NATIVE_COMPLETION_BUDGET_CENTS } from "./native-completion-defaults.js"; import path from "node:path"; +import { installedReleaseDaytonaPlugin } from "./installed-release.js"; import { isManagedHiringCase } from "./chat-cases.js"; import { FixtureRegistry } from "./fixture-registry.js"; import { TASK_TITLE_BUDGET_CENTS } from "./task-titles.js"; @@ -115,7 +116,9 @@ export async function setupLiveFixtures(input: { id: "sandbox-provider", async setup() { return api.post("/api/plugins/install", { - packageName: path.resolve( + packageName: process.env.PAPERCLIP_RUNNER_E2E_INSTALLED_CLI + ? installedReleaseDaytonaPlugin(process.env.PAPERCLIP_RUNNER_E2E_INSTALLED_CLI) + : path.resolve( import.meta.dirname, "../../packages/plugins/sandbox-providers/daytona", ),