{"record":{"id":"cfcbb4f989ad4cac","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-adapt-target-target","errorCode":null,"errorMessage":"Unknown adapt target: ${target}","messagePattern":"Unknown adapt target: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/adapt/index.ts","lineNumber":87,"sourceCode":"\t\t\t? `${selection.testSpecPaths.length} matching test spec artifact(s) linked.`\n\t\t\t: \"PRD detected, but no matching test spec artifact was found for its slug.\";\n\n\treturn {\n\t\tprdPath: selection.prdPath,\n\t\ttestSpecPaths: selection.testSpecPaths,\n\t\tdeepInterviewSpecPaths: selection.deepInterviewSpecPaths,\n\t\tsummary: testSpecSummary,\n\t};\n}\n\nexport function buildAdaptEnvelope(\n\tcwd: string,\n\ttarget: AdaptTarget,\n\tnow = new Date(),\n): AdaptEnvelope {\n\tconst descriptor = getAdaptTargetDescriptor(target);\n\tif (!descriptor) {\n\t\tthrow new Error(`Unknown adapt target: ${target}`);\n\t}\n\n\tconst paths = resolveAdaptPaths(cwd, target);\n\tconst planning = buildAdaptPlanningLink(cwd);\n\n\tif (target === \"openclaw\") {\n\t\treturn buildOpenClawEnvelope(paths, planning, descriptor.capabilities, now);\n\t}\n\n\treturn {\n\t\tschemaVersion: ADAPT_SCHEMA_VERSION,\n\t\tgeneratedAt: toIsoTimestamp(now),\n\t\ttarget,\n\t\tdisplayName: descriptor.displayName,\n\t\tsummary: descriptor.summary,\n\t\tadapterPaths: paths,\n\t\tplanning,\n\t\tcapabilities: descriptor.capabilities,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/adapt/index.ts#L69-L105","documentation":"Thrown when the native archive binary selected for extraction exists in the archive but reports a size of zero bytes. The library validates that the chosen candidate is non-empty before streaming it, because a 0-byte binary is almost certainly a corrupted, truncated, or placeholder archive entry and would produce an unusable executable.","triggerScenarios":"selectNativeArchiveBinary found exactly one matching entry (exact or wrapped name) but its size property is <= 0. Happens with corrupted/truncated downloads, archives packed with placeholder files (e.g. Git LFS pointer artifacts committed as empty), or zip entries whose central directory size field is zero.","commonSituations":"Downloading a release asset through a proxy that returns an empty file on auth failure; Git LFS-managed binaries committed without pulling LFS objects; interrupted curl/wget producing a partially-written zip; CI caches serving stale zero-byte artifacts.","solutions":["Re-download the archive from the release source and verify its SHA/checksum before retrying","Inspect the archive (unzip -l / tar -tvf) to confirm the binary entry has non-zero size; if zero, the upstream asset is broken — rebuild or re-upload it","If you maintain the release pipeline, ensure binaries are actually built and packed (not LFS pointers or empty stubs) before publishing","Add a size/checksum verification step in CI after fetching native assets"],"exampleFix":"// before\nconst bin = await archiveBinary(archivePath, 'mytool'); // throws archive_binary_empty\n\n// after\nconst entries = await inspectNativeArchive(archivePath);\nconst entry = entries.find(e => e.normalizedName.endsWith('mytool'));\nif (!entry || entry.size <= 0) throw new Error('archive corrupt, re-fetch release asset');\nconst bin = await archiveBinary(archivePath, 'mytool');","handlingStrategy":"validation","validationCode":"const entries = await inspectNativeArchive(archivePath);\nconst entry = entries.find(e => e.type === 'file' && e.normalizedName.endsWith('/mytool'));\nif (!entry || entry.size <= 0) {\n  await rm(archivePath, { force: true });\n  throw new Error('archive corrupt: empty binary entry, re-fetch release asset');\n}","typeGuard":"const isNonEmptyEntry = (e: { type: string; size: number }): boolean => e.type === 'file' && e.size > 0;","tryCatchPattern":"try { await archiveBinary(p, 'mytool'); } catch (e) { if ((e as {code?:string}).code === 'archive_binary_empty') { await rm(p, {force:true}); /* re-download then retry once */ } else throw e; }","preventionTips":["Verify archive checksum/size immediately after download","Download to a temp file and atomically rename","Delete and re-fetch the asset on any archive_binary_* error before retrying"],"tags":["native-assets","archive","corruption","binary"],"backgroundTag":"corrupted-archive-file","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}