{"record":{"id":"3ec517c2e8248766","repo":"paperclipai/paperclip","slug":"refusing-unusual-public-report-path-absolute","errorCode":null,"errorMessage":"Refusing unusual public report path ${absolute}","messagePattern":"Refusing unusual public report path (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/scripts/publish-runner-protocol-eval-history.mjs","lineNumber":129,"sourceCode":"      .some((segment) => !segment || segment === \".\" || segment === \"..\")\n  ) {\n    return false;\n  }\n  return SAFE_REPORT_PATHS.some((pattern) => pattern.test(relativePath));\n}\n\nasync function relativeFiles(root, current = root) {\n  const entries = await readdir(current, { withFileTypes: true });\n  const files = [];\n  for (const entry of entries) {\n    const absolute = join(current, entry.name);\n    if (entry.isSymbolicLink())\n      throw new Error(`Refusing public report symlink ${absolute}`);\n    if (entry.isDirectory())\n      files.push(...(await relativeFiles(root, absolute)));\n    else if (entry.isFile())\n      files.push(relative(root, absolute).split(sep).join(\"/\"));\n    else throw new Error(`Refusing unusual public report path ${absolute}`);\n  }\n  return files.sort();\n}\n\nfunction internalHtmlHrefs(content) {\n  return [...content.matchAll(/href\\s*=\\s*[\"']([^\"']+)[\"']/giu)]\n    .map((match) => match[1])\n    .filter((href) => href && !href.startsWith(\"#\"));\n}\n\nexport async function validatePublicProtocolEvalReport(\n  reportRoot,\n  { viewerRoot } = {},\n) {\n  const root = resolve(reportRoot);\n  const files = await relativeFiles(root);\n  const hasChat = files.some((file) =>\n    /^attempts\\/[^/]+\\/index\\.html$/.test(file),","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/scripts/publish-runner-protocol-eval-history.mjs#L111-L147","documentation":"During publication of a runner protocol eval report, the script walks the public report directory collecting relative file paths. The walk only handles symlinks (rejected earlier), regular directories, and regular files; any other directory entry kind (fifo, socket, device node) aborts the walk with this message naming the absolute path. It is a safety guard so the publisher never processes or uploads odd filesystem objects.","triggerScenarios":"Running publish-runner-protocol-eval-history.mjs against a report root containing a non-regular, non-directory entry (named pipe, unix socket, device node) at any depth walked by relativeFiles.","commonSituations":"A test tool or dev server created a fifo/socket inside the report output directory; a stale build artifact left a device file; a debugger dropped a socket next to attempt HTML outputs.","solutions":["Find and remove the non-regular file: run `find <report-root> ! -type f ! -type d ! -type l` and delete or relocate the reported path.","Regenerate the report from a clean output directory (rm -rf the report dir and rebuild) so no stray sockets/pipes are present.","Check for tools (test harnesses, dev servers) that write sockets into the report dir and point their output elsewhere."],"exampleFix":"# before\n$ find public-report ! -type f ! -type d\npublic-report/attempts/a1/debug.sock (socket)\n# after\n$ rm public-report/attempts/a1/debug.sock\n$ node scripts/publish-runner-protocol-eval-history.mjs ...","handlingStrategy":"validation","validationCode":"import { readdirSync } from 'node:fs';\nconst bad = [];\n(function walk(dir) {\n  for (const e of readdirSync(dir, { withFileTypes: true })) {\n    if (e.isSymbolicLink()) throw new Error(`symlink: ${e.name}`);\n    if (e.isDirectory()) walk(`${dir}/${e.name}`);\n    else if (!e.isFile()) bad.push(`${dir}/${e.name}`);\n  }\n})(reportRoot);\nif (bad.length) throw new Error(`non-regular files: ${bad.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await publishReport(root);\n} catch (err) {\n  if (String(err.message).startsWith('Refusing unusual public report path')) {\n    console.error('Remove the non-regular file named in the message and re-run:', err.message);\n  } else throw err;\n}","preventionTips":["Before publishing, run `find <report-root> ! -type f ! -type d ! -type l` and fail fast on output.","Configure build/test tools to write sockets, fifos, and temp files outside the report directory.","Clean the report output directory (rm -rf) before regenerating instead of publishing in place."],"tags":["filesystem","validation","publish-script"],"backgroundTag":"invalid-argument-value","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"}