{"record":{"id":"15aca1cb8d4c957e","repo":"paperclipai/paperclip","slug":"acpx-input-profile-agent-runtime-omitted-its-ve","errorCode":null,"errorMessage":"ACPX ${input.profile.agent} runtime omitted its verified platform executable package","messagePattern":"ACPX (.+?) runtime omitted its verified platform executable package","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts","lineNumber":869,"sourceCode":"    );\n  }\n  if (!((process.platform === \"linux\" && process.arch === \"x64\")\n    || (input.profile.agent === \"claude\" && process.platform === \"darwin\" && (process.arch === \"arm64\" || process.arch === \"x64\")))) {\n    throw new Error(\n      `ACPX ${input.profile.agent} verified runtime executable is unavailable for ${process.platform} ${process.arch}`,\n    );\n  }\n\n  const optionalDependencies = input.runtimePackage.optionalDependencies;\n  if (\n    typeof optionalDependencies !== \"object\" ||\n    optionalDependencies === null ||\n    Array.isArray(optionalDependencies) ||\n    (optionalDependencies as Record<string, unknown>)[\n      qualification.packageName\n    ] !== qualification.dependencyDeclaration\n  ) {\n    throw new Error(\n      `ACPX ${input.profile.agent} runtime omitted its verified platform executable package`,\n    );\n  }\n\n  const executablePackageJsonPath = await realpath(\n    input.resolvePackageJson(\n      qualification.packageName,\n      input.runtimePackageJsonPath,\n    ),\n  );\n  const executablePackage = await readPackageJson(\n    executablePackageJsonPath,\n    qualification.packageName,\n  );\n  if (executablePackage.version !== qualification.packageVersion) {\n    throw new Error(\n      `ACPX ${input.profile.agent} runtime executable package version mismatch: expected ${qualification.packageVersion}, received ${executablePackage.version ?? \"unknown\"}`,\n    );","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts#L851-L887","documentation":"After confirming the runtime profile matches a qualified package/version, the verifier checks that the runtime package's package.json declares the platform-specific executable package in optionalDependencies with the exact dependencyDeclaration recorded in the qualification table. If optionalDependencies is missing, malformed, or lacks the expected entry/version, the runtime is considered tampered or incorrectly assembled and verification aborts.","triggerScenarios":"The resolved ACPX runtime package.json has no optionalDependencies object, has an array instead of a map, or its entry for qualification.packageName differs from the pinned declaration (wrong version range or replaced by a different specifier) — typically after hand-editing package.json, a partial/patched install, or a registry package that was rebuilt/republished with altered metadata.","commonSituations":"Manually pruning 'optional' deps with npm/yarn/pnpm prune or --omit=optional then editing metadata; a proxy/mirror serving a re-packed tarball; a monorepo patch (patch-package) rewriting the dependency spec; installing a different version of the runtime than the profile pins.","solutions":["Reinstall the ACPX runtime package cleanly from the official registry (delete node_modules entry + lockfile entry, then install) so optionalDependencies matches the published manifest.","Ensure the profile's agentRuntimeVersion matches the actually installed runtime package version; a version/profile mismatch surfaces as altered declarations.","Check for patch-package/pnpm patches or postinstall scripts modifying the runtime's package.json and remove/rebase them.","Verify the package source (corporate mirror/proxy) is serving unmodified published tarballs.","Confirm optionalDependencies resolution is not disabled (npm --omit=optional, pnpm optional=false)."],"exampleFix":"// before (runtime package.json, tampered)\n\"optionalDependencies\": { \"@paperclip/acpx-claude-linux-x64\": \"^1.0.0\" }\n// after (matches qualification.dependencyDeclaration)\n\"optionalDependencies\": { \"@paperclip/acpx-claude-linux-x64\": \"1.2.3\" }","handlingStrategy":"validation","validationCode":"const pkg = JSON.parse(fs.readFileSync(runtimePkgJsonPath, \"utf8\"));\nconst decl = pkg.optionalDependencies?.[platformPackageName];\nif (decl !== expectedDeclaration) {\n  throw new Error(`Runtime optionalDependencies['${platformPackageName}'] is '${decl ?? \"missing\"}', expected '${expectedDeclaration}'; reinstall the runtime package`);\n}","typeGuard":"function hasQualifiedOptionalDependency(pkg: unknown, name: string, declaration: string): boolean {\n  const od = (pkg as { optionalDependencies?: unknown })?.optionalDependencies;\n  return typeof od === \"object\" && od !== null && !Array.isArray(od) &&\n    (od as Record<string, unknown>)[name] === declaration;\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit the ACPX runtime's package.json or prune optionalDependencies.","Avoid --omit=optional installs for the runner's node_modules.","Audit patch-package/pnpm patches that rewrite runtime metadata.","Reinstall from the official registry after any node_modules surgery and diff package.json against the published tarball."],"tags":["supply-chain","package-integrity","npm","acpx"],"backgroundTag":"missing-optional-dependency","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}