{"record":{"id":"a3848722d7e6e62f","repo":"pbakaus/impeccable","slug":"cannot-build-openai-plugin-missing-label-ab","errorCode":null,"errorMessage":"Cannot build OpenAI plugin: missing ${label}: ${absPath}","messagePattern":"Cannot build OpenAI plugin: missing (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/openai-plugin.js","lineNumber":9,"sourceCode":"import fs from 'fs';\nimport path from 'path';\n\nimport { buildCodexPluginManifest } from './codex-plugin.js';\nimport { buildCodexPluginHooksManifest } from './transformers/hooks.js';\n\nfunction requirePath(absPath, label) {\n  if (!fs.existsSync(absPath)) {\n    throw new Error(`Cannot build OpenAI plugin: missing ${label}: ${absPath}`);\n  }\n}\n\nfunction writeJson(absPath, value) {\n  fs.mkdirSync(path.dirname(absPath), { recursive: true });\n  fs.writeFileSync(absPath, `${JSON.stringify(value, null, 2)}\\n`);\n}\n\n/**\n * Stage the public OpenAI plugin from the Codex-transformed skill payload.\n *\n * The tracked ./plugin subtree is a Claude Code marketplace artifact. Reusing\n * its shared skills/ directory here silently ships Claude paths and slash\n * commands inside a Codex plugin. Keep this stage independent so each plugin\n * receives the provider transform it was built for.\n */\nexport function stageOpenAIPlugin(rootDir, distDir) {\n  const rootManifestPath = path.join(rootDir, '.claude-plugin', 'plugin.json');","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/scripts/lib/openai-plugin.js#L1-L27","documentation":"Thrown by stageOpenAIPlugin() when one of three required inputs is missing on disk: the root .claude-plugin/plugin.json manifest, the Codex-transformed skill payload under dist/codex/.codex/skills/impeccable, or the plugin icon at scripts/lib/assets/plugin-icon.png. The build cannot assemble an OpenAI/Codex plugin without all three.","triggerScenarios":"Running the OpenAI plugin stage before the Codex transform stage has produced dist/codex/...; deleting or moving the plugin icon asset; running from a shallow clone that omitted .claude-plugin/plugin.json; a partial build that ran stageOpenAIPlugin out of order.","commonSituations":"CI job that runs the OpenAI stage without first running the Codex transformer; a contributor removed scripts/lib/assets/plugin-icon.png; the manifest was relocated during a repo restructure.","solutions":["Run the full `bun run build:release` (or at least the Codex transform step) before the OpenAI stage so dist/codex/.codex/skills/impeccable exists.","Confirm the printed absPath for the missing label exists; create or restore it.","Restore .claude-plugin/plugin.json and scripts/lib/assets/plugin-icon.png from git if they were deleted."],"exampleFix":"// before — running stageOpenAIPlugin before the Codex stage\nstageOpenAIPlugin(rootDir, distDir);\n\n// after — ensure the Codex payload is built first\nawait buildCodexSkillPayload(rootDir, distDir);\nstageOpenAIPlugin(rootDir, distDir);","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nconst required = [\n  ['.claude-plugin/plugin.json', 'root plugin manifest'],\n  [path.join(distDir, 'codex', '.codex', 'skills', 'impeccable'), 'Codex skill payload'],\n  ['scripts/lib/assets/plugin-icon.png', 'plugin icon'],\n];\nfor (const [p, label] of required) {\n  if (!existsSync(path.join(rootDir, p))) console.error(`Missing ${label}: ${p}`);\n}","typeGuard":"function openAiPluginInputsReady(rootDir, distDir) {\n  return existsSync(path.join(rootDir, '.claude-plugin', 'plugin.json'))\n    && existsSync(path.join(distDir, 'codex', '.codex', 'skills', 'impeccable'))\n    && existsSync(path.join(rootDir, 'scripts', 'lib', 'assets', 'plugin-icon.png'));\n}","tryCatchPattern":"try {\n  stageOpenAIPlugin(rootDir, distDir);\n} catch (err) {\n  if (/Cannot build OpenAI plugin: missing/.test(err.message)) {\n    console.error('OpenAI stage inputs missing; run the Codex transform stage first.');\n  } else throw err;\n}","preventionTips":["Order build stages so the Codex transform runs before the OpenAI stage.","Add a preflight check for the three required inputs with actionable messages.","Treat the plugin icon and manifest as non-deletable in CI lint."],"tags":["build","openai-plugin","missing-file","plugin","build-order"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}