{"record":{"id":"1adc4e3c9e24e8a2","repo":"paperclipai/paperclip","slug":"refusing-an-unrecognized-local-provider-smoke-root","errorCode":null,"errorMessage":"Refusing an unrecognized local provider smoke root","messagePattern":"Refusing an unrecognized local provider smoke root","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/scripts/run-local-provider-smoke.mjs","lineNumber":186,"sourceCode":"    ...typescriptSources,\n  ],\n  requiredArtifacts.filter((artifact) => artifact !== runnerd),\n);\nconst rustSources = await filesUnder(\n  resolve(packageRoot, \"runner\"),\n  (path) =>\n    path.endsWith(\".rs\") ||\n    path.endsWith(\"Cargo.toml\") ||\n    path.endsWith(\"Cargo.lock\"),\n  (path) => /\\/(?:target|tests|benches|examples)$/u.test(path),\n);\nawait assertArtifactsFresh(\"runnerd\", rustSources, [runnerd]);\n\nconst smokeRoot = await mkdtemp(\n  join(tmpdir(), \"paperclip-local-provider-smoke-\"),\n);\nif (!basename(smokeRoot).startsWith(\"paperclip-local-provider-smoke-\")) {\n  throw new Error(\"Refusing an unrecognized local provider smoke root\");\n}\nawait Promise.all(\n  [\"tmp\", \"home\", \"paperclip-home\", \"codex-home\", \"claude-home\"].map(\n    (directory) => mkdir(join(smokeRoot, directory), { recursive: true }),\n  ),\n);\n\nconst ambientEnvironment = { ...process.env };\nfor (const name of Object.keys(process.env)) delete process.env[name];\nfor (const name of [\n  \"PATH\",\n  \"SystemRoot\",\n  \"ComSpec\",\n  \"PATHEXT\",\n  \"LANG\",\n  \"LC_ALL\",\n  \"LC_CTYPE\",\n  \"TZ\",","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/scripts/run-local-provider-smoke.mjs#L168-L204","documentation":"The script creates its scratch directory with mkdtemp using the prefix `paperclip-local-provider-smoke-` inside the OS temp dir, then asserts the generated basename still carries that prefix before creating subdirectories. If the basename check fails, an internal invariant is broken and it throws this defensive error. Normally unreachable; it guards against platform/mkdtemp behavior changes.","triggerScenarios":"Practically never from user input: only if mkdtemp returns a name without the requested prefix (unusual tmpdir behavior, mocked fs, or the script was modified to use a different prefix/template).","commonSituations":"Custom test harnesses or patched environments stubbing fs.mkdtemp, or contributors editing the mkdtemp template without updating the guard.","solutions":["Confirm the mkdtemp template string still starts with `paperclip-local-provider-smoke-` and matches the basename check.","Retry in a normal environment; if reproducible, inspect any fs mocking or TMPDIR overrides in play.","Report as a bug if it occurs on an unmodified checkout."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await runSmoke(); } catch (e) { if (e.message.includes('unrecognized local provider smoke root')) console.error('mkdtemp prefix invariant broken; report bug'); else throw e; }","preventionTips":["Do not mock fs.mkdtemp in harnesses","Keep the mkdtemp template and basename check in sync when editing","Treat occurrences as a bug report trigger"],"tags":["internal","invariant","filesystem","smoke-test"],"backgroundTag":"internal-invariant-violation","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"}