mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
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 <noreply@paperclip.ing>
This commit is contained in:
1 parent
b9a0180c1a
commit
b080895310
4 files changed
+39
-6
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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<PluginRecord>("/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",
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user