{"record":{"id":"ce54b3a0f1c7cb31","repo":"paperclipai/paperclip","slug":"missing-name-ce54b3","errorCode":null,"errorMessage":"Missing ${name}","messagePattern":"Missing (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/scripts/refresh-runner-protocol-eval-report.mjs","lineNumber":94,"sourceCode":"      providerCalls: 0,\n    },\n  };\n  await writeFile(\n    join(reportRoot, \"campaign.json\"),\n    `${JSON.stringify(refreshed, null, 2)}\\n`,\n  );\n  await validatePublicProtocolEvalReport(reportRoot, { viewerRoot });\n  return { reportRoot, campaignId: refreshed.campaignId, providerCalls: 0 };\n}\n\nif (\n  process.argv[1] &&\n  resolve(process.argv[1]) === resolve(import.meta.filename)\n) {\n  const arg = (name) => {\n    const index = process.argv.indexOf(name);\n    if (index < 0 || !process.argv[index + 1])\n      throw new Error(`Missing ${name}`);\n    return process.argv[index + 1];\n  };\n  console.log(\n    await refreshProtocolEvalReport({\n      sourceRoot: resolve(arg(\"--source\")),\n      evalsRoot: resolve(arg(\"--evals-root\")),\n      viewerRoot: resolve(arg(\"--viewer-root\")),\n      outputRoot: resolve(arg(\"--output\")),\n      revision: arg(\"--revision\"),\n    }),\n  );\n}\n","sourceCodeStart":76,"sourceCodeEnd":107,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/scripts/refresh-runner-protocol-eval-report.mjs#L76-L107","documentation":"The script's CLI entry point defines arg(name) to read required command-line flags, throwing `Missing ${name}` when the flag is absent or has no value. This error means a required argument (e.g. --source, --evals-root, --output, --revision) was not supplied or was given with an empty next token.","triggerScenarios":"Running the script directly with a missing required flag, or `--source` as the last argument with no value after it; invoking via npm script that drops an argument.","commonSituations":"Copy-pasting an older invocation from docs that lacked a newly added required flag; CI workflow step missing an `args:` entry; shell variable expansion emptying a flag's value (`--source $UNSET_VAR`).","solutions":["Add the missing flag with a value, e.g. --source /path/to/campaign","Check the exact flag name spelling required by the script (see its main block)","In CI, ensure the workflow step passes all required args and the shell variables are set","Wrap the invocation to echo process.argv when debugging which flag is missing"],"exampleFix":"// before\nnode refresh-runner-protocol-eval-report.mjs --output out/x --revision r1\n// after\nnode refresh-runner-protocol-eval-report.mjs --source ./campaign --evals-root ./evals --output out/x --revision r1","handlingStrategy":"validation","validationCode":"for (const f of ['--source','--evals-root','--output','--revision']) if (!process.argv.includes(f)) throw new Error('Missing ' + f);","typeGuard":"null","tryCatchPattern":"try { await main(); } catch (e) { if (e.message.startsWith('Missing ')) { console.error(e.message + ' — see script usage'); process.exit(2); } throw e; }","preventionTips":["Keep the canonical invocation in a package.json script","Quote shell variables so empty values still pass through predictably","List required flags in the script's usage comment"],"tags":["cli","arguments","usage"],"backgroundTag":"missing-cli-argument","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}