{"record":{"id":"add42de5e916f1fe","repo":"ruvnet/ruflo","slug":"archive-did-not-contain-the-expected-binary-at-its","errorCode":null,"errorMessage":"archive did not contain the expected binary at its root: ${binaryNameInArchive()}","messagePattern":"archive did not contain the expected binary at its root: (.+?)","errorType":"exception","errorClass":"ExtractionError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/proxy/install.ts","lineNumber":153,"sourceCode":"      assetBytes: assets.archiveBytes,\n      assetFilename: assets.archiveFilename,\n    });\n    log(`Verified — sha256 ${sha256.slice(0, 16)}…`);\n\n    // fetchReleaseAssets's dev (gh) path already wrote the archive to workDir\n    // under archiveFilename; ensure it's there regardless of source so\n    // extraction always has a real file to operate on.\n    const archivePath = path.join(workDir, archiveFilename);\n    if (!fs.existsSync(archivePath)) {\n      fs.writeFileSync(archivePath, assets.archiveBytes);\n    }\n\n    const extractDir = path.join(workDir, 'extracted');\n    await extractArchive(archivePath, extractDir, releaseArchiveExtension(triple));\n\n    const extractedBinaryPath = path.join(extractDir, binaryNameInArchive());\n    if (!fs.existsSync(extractedBinaryPath)) {\n      throw new ExtractionError(`archive did not contain the expected binary at its root: ${binaryNameInArchive()}`);\n    }\n\n    // Defense in depth: confirm the extracted binary genuinely resolves\n    // inside extractDir (catches a symlink swap or similar), even though\n    // we only ever read one specific expected relative path, never an\n    // archive-listed one (so \"zip slip\" via arbitrary archive paths isn't\n    // reachable here in the first place).\n    const { PathValidator } = await import('@claude-flow/security');\n    const validator = new PathValidator({ allowedPrefixes: [extractDir] });\n    const validation = await validator.validate(extractedBinaryPath);\n    if (!validation.isValid) {\n      throw new ExtractionError(`extracted binary path failed validation: ${validation.errors.join('; ') || 'unknown'}`);\n    }\n\n    const finalPath = proxyBinaryPath();\n    fs.mkdirSync(path.dirname(finalPath), { recursive: true, mode: 0o700 });\n    const tmp = `${finalPath}.tmp`;\n    fs.copyFileSync(extractedBinaryPath, tmp);","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/proxy/install.ts#L135-L171","documentation":"Error \"archive did not contain the expected binary at its root: ${binaryNameInArchive()}\" thrown in ruvnet/ruflo.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/proxy/install.ts:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}