{"record":{"id":"afdaa0fa1fe750c3","repo":"Yeachan-Heo/oh-my-codex","slug":"manifest-binary-basename-mismatch","errorCode":"manifest_binary_basename_mismatch","errorMessage":"[native-assets] manifest_binary_basename_mismatch: ${asset.binary_path}","messagePattern":"\\[native-assets\\] manifest_binary_basename_mismatch: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/native-assets/policy.ts","lineNumber":166,"sourceCode":"    }\n    const assetSize = asset.size;\n    if (!/^[a-f0-9]{64}$/.test(asset.sha256) || assetSize === undefined || !Number.isSafeInteger(assetSize) || assetSize <= 0) {\n      throw policyError('manifest_invalid_integrity', asset.archive);\n    }\n    const mapping = nativeTargetMapping(asset.target);\n    if (!mapping || mapping.platform !== asset.platform || mapping.arch !== asset.arch\n      || (mapping.platform === 'linux' ? asset.libc !== mapping.libc : asset.libc !== undefined)) {\n      throw policyError('manifest_target_mismatch', asset.target || asset.archive);\n    }\n    const expectedBinary = nativeProductBinaryName(asset.product);\n    const expectedBinaryPath = nativeProductBinaryPath(asset.product, asset.platform);\n    if (!expectedBinary || !expectedBinaryPath || asset.binary !== expectedBinary) {\n      throw policyError('manifest_binary_product_mismatch', asset.binary);\n    }\n\n    const binaryPath = normalizeNativeArchivePath(asset.binary_path, 'file');\n    if (binaryPath !== asset.binary_path || binaryPath.split('/').at(-1) !== expectedBinaryPath) {\n      throw policyError('manifest_binary_basename_mismatch', asset.binary_path);\n    }\n\n    const key = nativeReleaseAssetLogicalKey(asset);\n    if (logicalKeys.has(key)) throw policyError('manifest_duplicate_logical_key', asset.archive);\n    logicalKeys.add(key);\n    const basename = nativeReleaseAssetBasename(asset);\n    if (asset.archive !== basename || !nativeArchiveSuffix(basename)) {\n      throw policyError('manifest_archive_invalid', asset.archive);\n    }\n    if (archiveHintMismatch(asset, basename)) throw policyError('manifest_archive_hint_mismatch', basename);\n    if (basenames.has(basename)) throw policyError('manifest_duplicate_archive_basename', basename);\n    basenames.add(basename);\n    let downloadUrl: URL;\n    try {\n      downloadUrl = new URL(asset.download_url);\n    } catch {\n      throw policyError('manifest_invalid_url', asset.download_url);\n    }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/native-assets/policy.ts#L148-L184","documentation":"The asset's binary_path must already be normalized and its basename must equal the canonical binary path segment for the product. This check catches unnormalized paths and misplaced binaries inside the archive layout.","triggerScenarios":"validateNativeReleaseManifest with asset.binary_path like './bin/tool', 'bin//tool', or whose last path segment differs from nativeProductBinaryPath(asset.product, asset.platform).","commonSituations":"Relative paths, trailing slashes, double slashes, or a binary stored under a different directory name than the canonical layout.","solutions":["Normalize the path so normalizeNativeArchivePath is a no-op (forward slashes, no './' or '..')","Ensure the basename equals nativeProductBinaryPath(product, platform)","Regenerate the manifest automatically"],"exampleFix":"// before\n\"binary_path\": \"./bin/omxd\"\n// after\n\"binary_path\": \"bin/omxd\"","handlingStrategy":"validation","validationCode":"const p = normalizeNativeArchivePath(asset.binary_path, 'file');\nconst ok = p === asset.binary_path && p.split('/').at(-1) === nativeProductBinaryPath(asset.product, asset.platform);","typeGuard":"function hasCanonicalBinaryPath(a: NativeAsset): boolean {\n  const p = normalizeNativeArchivePath(a.binary_path, 'file');\n  return p === a.binary_path && p.split('/').at(-1) === nativeProductBinaryPath(a.product, a.platform);\n}","tryCatchPattern":null,"preventionTips":["Never hand-write binary_path; derive it from product/platform","Lint manifests for './' and '//' in paths"],"tags":["native-assets","manifest","path-normalization"],"backgroundTag":"manifest-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}