{"record":{"id":"0f1fb8da97253433","repo":"affaan-m/ECC","slug":"executable-override-must-be-an-absolute-path-ex","errorCode":null,"errorMessage":"${EXECUTABLE_OVERRIDE} must be an absolute path explicitly configured by the operator.","messagePattern":"(.+?) must be an absolute path explicitly configured by the operator\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":200,"sourceCode":"      ...withoutJson,\n    ]),\n  });\n}\n\nfunction resolveItoExecutable(environment = process.env) {\n  const configured = environment[EXECUTABLE_OVERRIDE]?.trim();\n  if (!configured) {\n    throw new Error([\n      \"The canonical ito-compute-cli is unpublished and ECC will not resolve\",\n      `a credential-bearing \"ito\" executable from PATH. Build it from`,\n      `${CANONICAL_REPOSITORY.replace(/\\.git$/, \"\")}/${CANONICAL_PACKAGE_PATH},`,\n      \"run npm ci and npm run check, then set\",\n      `${EXECUTABLE_OVERRIDE} to the explicit absolute dist/bin/ito.js path.`,\n    ].join(\" \"));\n  }\n\n  if (!path.isAbsolute(configured)) {\n    throw new Error(\n      `${EXECUTABLE_OVERRIDE} must be an absolute path explicitly configured by the operator.`\n    );\n  }\n  return assertUsableExecutable(configured);\n}\n\nfunction assertUsableExecutable(candidate) {\n  let canonicalCandidate;\n  try {\n    canonicalCandidate = fs.realpathSync.native(candidate);\n  } catch {\n    throw new Error(\n      `${EXECUTABLE_OVERRIDE} does not point to a readable local Itô CLI file.`\n    );\n  }\n  if (!isCanonicalItoEntry(canonicalCandidate)) {\n    throw new Error(\n      `${EXECUTABLE_OVERRIDE} must point to the canonical dist/bin/ito.js entry.`","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ito.js#L182-L218","documentation":"resolveItoExecutable requires ECC_ITO_CLI_EXECUTABLE to contain an absolute path set explicitly by the operator. If a value is present but relative (path.isAbsolute fails), it throws this error, keeping the security invariant that only an operator-configured absolute path is trusted.","triggerScenarios":"Setting ECC_ITO_CLI_EXECUTABLE=./dist/bin/ito.js or dist/bin/ito.js — any relative path; also values like \"~/bin/ito.js\" (tilde is not expanded by the runtime and is not absolute).","commonSituations":"Composing the env var in shell profiles with relative paths; using ~ expansion that never happens because the variable is read by node directly; .env files with project-relative executable paths.","solutions":["Set an absolute path: export ECC_ITO_CLI_EXECUTABLE=\"$PWD/dist/bin/ito.js\"","Expand ~ explicitly: ECC_ITO_CLI_EXECUTABLE=\"$HOME/bin/ito.js\"","In .env files, use the fully resolved path rather than a project-relative one"],"exampleFix":"// before\nexport ECC_ITO_CLI_EXECUTABLE=./dist/bin/ito.js\n// after\nexport ECC_ITO_CLI_EXECUTABLE=\"$(pwd)/dist/bin/ito.js\"","handlingStrategy":"validation","validationCode":"const path = require('path');\nconst v = process.env.ECC_ITO_CLI_EXECUTABLE;\nif (v && !path.isAbsolute(v)) throw new Error('ECC_ITO_CLI_EXECUTABLE must be absolute');","typeGuard":"const isAbsPath = (v) => typeof v === 'string' && v.length > 0 && require('path').isAbsolute(v);","tryCatchPattern":"try {\n  const exe = resolveItoExecutable(process.env);\n} catch (e) {\n  if (e.message.includes('must be an absolute path')) {\n    process.env.ECC_ITO_CLI_EXECUTABLE = path.resolve(process.env.ECC_ITO_CLI_EXECUTABLE);\n    retry();\n  } else throw e;\n}","preventionTips":["Build the env var with $(pwd) or path.resolve so it is always absolute","Expand $HOME instead of ~ when configuring the override in shell profiles","Keep .env files with fully resolved paths per machine"],"tags":["cli","environment","path","validation"],"backgroundTag":"invalid-env-var-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}