{"record":{"id":"4cdaac1f5d7c88a5","repo":"paperclipai/paperclip","slug":"acpx-runtime-snapshot-digest-mismatch","errorCode":null,"errorMessage":"ACPX runtime snapshot digest mismatch","messagePattern":"ACPX runtime snapshot digest mismatch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts","lineNumber":758,"sourceCode":"        }\n        const privateSnapshot = process.platform === \"darwin\"\n          ? await createAcpxPrivateSnapshot([commandDirectory, ...dependencyAncestors.map((root) => root.path)], currentRuntimeExecutable)\n          : null;\n        if (privateSnapshot) {\n          try {\n            // Bind copied trees to the identities retained by the verified lease.\n            const paths = [commandDirectory, ...dependencyAncestors.map((root) => root.path)];\n            const handles = [currentDirectory.handle, ...currentDependencyAncestors];\n            for (let index = 0; index < paths.length; index++) {\n              const lexical = await lstat(paths[index]!, { bigint: true });\n              const held = await handles[index]!.stat({ bigint: true });\n              if (lexical.isSymbolicLink() || !sameIdentity(fileIdentity(lexical), fileIdentity(held))) {\n                throw new Error(\"ACPX package directory changed while snapshotting\");\n              }\n            }\n            if (runtimeExecutable && privateSnapshot.executable &&\n              `sha256:${privateSnapshot.digests[privateSnapshot.executable]}` !== runtimeExecutable.digest) {\n              throw new Error(\"ACPX runtime snapshot digest mismatch\");\n            }\n          } catch (error) { await privateSnapshot.close(); throw error; }\n        }\n        return commandLease(\n          commandDirectory,\n          basename(commandPath),\n          commandFormat,\n          current.bytes,\n          currentDirectory.handle,\n          currentDependencyAncestors,\n          serverDependencyAncestorCount,\n          serverPackageFormat,\n          dependencyAncestorFormats,\n          currentRuntimeExecutable,\n          runtimeExecutable?.environmentVariable ?? null,\n          privateSnapshot,\n        );\n      } catch (error) {","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts#L740-L776","documentation":"After snapshotting on macOS, if the qualified runtime executable was snapshotted, its sha256 digest inside the private snapshot is compared with the digest recorded at verification time. A mismatch means the copied executable in the snapshot differs from the verified binary (corrupt or partially written copy), so the launch is aborted rather than executing an unverified copy.","triggerScenarios":"openCommand on darwin where runtimeExecutable and privateSnapshot.executable are both set but `sha256:${privateSnapshot.digests[privateSnapshot.executable]}` !== runtimeExecutable.digest — the snapshot copy's hash differs from the qualified runtime digest.","commonSituations":"Disk-full or I/O error during the snapshot copy truncating the executable; the source file being replaced mid-copy (usually preceded by error 216); flaky storage or filesystem corruption; a security tool modifying the file during read.","solutions":["Retry openCommand — transient copy failures (disk pressure, concurrent write) often resolve on a clean re-snapshot after re-verification.","Check free disk space and filesystem health (fsck/Disk Utility) on the volume holding the install.","Re-verify and re-open with no concurrent writers; confirm the source binary still hashes to the qualified digest.","If persistent, reinstall the qualified runtime package and re-run installation verification."],"exampleFix":"// before\nconst lease = await verified.openCommand(); // snapshot copy truncated by full disk\n// after\nawait ensureDiskSpace(minBytes);              // free space before snapshot\nconst lease = await reverified.openCommand();","handlingStrategy":"retry","validationCode":"const free = await checkDiskSpace(path.dirname(runtimeExecutable.path));\nif (free < minRequiredBytes) throw new Error(`insufficient disk for private snapshot: ${free} free`);","typeGuard":null,"tryCatchPattern":"try {\n  lease = await verified.openCommand();\n} catch (e) {\n  if (e.message === \"ACPX runtime snapshot digest mismatch\") {\n    await reclaimDiskSpace();\n    verified = await verifyQualifiedAcpxInstallation(input);\n    lease = await verified.openCommand(); // retry after clean environment\n  } else throw e;\n}","preventionTips":["Monitor free disk space on the volume hosting the install tree.","Check filesystem health after recurring digest mismatches (fsck / Disk Utility).","Ensure no security or sync tools read-modify files in the install tree during launch."],"tags":["installation-integrity","acpx","checksum-mismatch","macos","snapshot"],"backgroundTag":"checksum-mismatch","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"}