Fix runtime prerequisite home, workspace, and integrity boundaries

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-11 07:49:03 -05:00
1 parent 1525c4ef27
commit 96db062487
9 files changed
+62 -18

No files matched your search

@@ -332,7 +332,7 @@ describe("server adapter registry", () => {
expect(config).not.toHaveProperty("engine");
});
it("verifies the Claude harness on a computer after checking its platform", async () => {
it.each([true, false])("retains the unverified ACPX warning after a computer Claude CLI probe (succeeds: %s)", async (succeeds) => {
const calls: string[] = [];
const result = await requireServerAdapter("paperclip_runner").testEnvironment({
companyId: "company-1", adapterType: "paperclip_runner",
@@ -342,13 +342,15 @@ describe("server adapter registry", () => {
calls.push(input.command);
const stdout = input.command === "claude" ? JSON.stringify({ type: "result", result: "hello", usage: { input_tokens: 1, output_tokens: 1 } })
: input.args?.some(arg => arg.includes("uname -s")) ? "Linux\nx86_64\n" : "";
return { exitCode: 0, timedOut: false, stdout, stderr: "", signal: null, pid: null, startedAt: new Date().toISOString() };
return { exitCode: input.command === "claude" && !succeeds ? 1 : 0, timedOut: false, stdout, stderr: "", signal: null, pid: null, startedAt: new Date().toISOString() };
} },
} as never,
});
expect(calls).toContain("claude");
expect(result.checks).toContainEqual(expect.objectContaining({ code: "claude_hello_probe_passed", level: "info" }));
expect(result.checks.some(check => check.level === "error")).toBe(false);
expect(result.status).toBe(succeeds ? "warn" : "fail");
expect(result.checks).toContainEqual(expect.objectContaining({ code: "acpx_remote_runtime_unverified", level: "warn" }));
if (succeeds) expect(result.checks).toContainEqual(expect.objectContaining({ code: "claude_hello_probe_passed", level: "info" }));
expect(result.checks.some(check => check.level === "error")).toBe(!succeeds);
});
it.each([true, false])("checks actual local ACPX installation readiness (%s)", async (ready) => {
+6 -3
View File
@@ -432,16 +432,19 @@ const paperclipRunnerAdapter: ServerAdapterModule = {
if (!((os === "Linux" && arch === "x86_64") || (os === "Darwin" && (arch === "arm64" || (profile.acpxAgent !== "grok" && arch === "x86_64"))))) {
throw new Error(`ACPX ${profile.acpxAgent} requires a qualified Linux x64 or macOS architecture.`);
}
const runtimeUnverified = { code: "acpx_remote_runtime_unverified", level: "warn" as const,
message: "The remote platform is supported. Runtime package integrity and readiness must still be verified by the remote runner before launch." };
if (target.transport === "computer" && profile.acpxAgent === "claude") {
const hello = await claudeTestEnvironment({ ...context, adapterType: "claude_local",
config: { ...context.config, engine: "cli", model: profile.model,
dangerouslySkipPermissions: context.config.acpxPermissionMode === "approve-all" } });
return { ...hello, adapterType: "paperclip_runner" };
return { ...hello, adapterType: "paperclip_runner",
status: hello.status === "fail" ? "fail" as const : "warn" as const,
checks: [...hello.checks, runtimeUnverified] };
}
return {
adapterType: "paperclip_runner", status: "warn" as const, testedAt: new Date().toISOString(),
checks: [{ code: "acpx_remote_runtime_unverified", level: "warn" as const,
message: "The remote platform is supported. Runtime package integrity and readiness must still be verified by the remote runner before launch." }],
checks: [runtimeUnverified],
};
}
const { probeAcpxClaudeInstallation, probeAcpxGrokInstallation, probeAcpxCursorInstallation, probeAcpxPiInstallation } = await import("../vendor/paperclip-runner/live/index.js");