{"record":{"id":"349a132f10d501e6","repo":"affaan-m/ECC","slug":"ecc-ito-cli-executable-must-point-to-the-canonical-dist-bin","errorCode":null,"errorMessage":"ECC_ITO_CLI_EXECUTABLE must point to the canonical dist/bin/ito.js entry.","messagePattern":"ECC_ITO_CLI_EXECUTABLE must point to the canonical dist/bin/ito\\.js entry\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":217,"sourceCode":"  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.`\n    );\n  }\n  if (!isUsableExecutable(canonicalCandidate)) {\n    throw new Error(\n      `${EXECUTABLE_OVERRIDE} does not point to a readable local Itô CLI file.`\n    );\n  }\n  return canonicalCandidate;\n}\n\nfunction isCanonicalItoEntry(candidate) {\n  const pathSegments = path\n    .normalize(candidate)\n    .split(path.sep)\n    .filter(Boolean);\n  if (pathSegments.length < CANONICAL_ENTRY_SEGMENTS.length) return false;\n  const candidateTail = pathSegments.slice(-CANONICAL_ENTRY_SEGMENTS.length);","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ito.js#L199-L235","documentation":"scripts/ito.js is a thin bridge that invokes the separately installed canonical Itô CLI and refuses to discover it via PATH. When ECC_ITO_CLI_EXECUTABLE is set, assertUsableExecutable resolves the path and checks it matches the canonical entry ito-cloud-runtime/cli/ito-compute-cli/dist/bin/ito.js. This error means the override points at a readable file but one that is NOT that canonical built entry (a shim, source file, or wrong binary), so the bridge refuses to run it.","triggerScenarios":"Setting ECC_ITO_CLI_EXECUTABLE to a wrapper/shell shim, to the TypeScript source cli/ito-compute-cli/src/ito.ts, to dist/bin/ito-mcp.js, to a globally installed package entry, or to a repo checkout where the dist output was moved/renamed; the path passes the readability check but fails isCanonicalItoEntry (segments .../cli/ito-compute-cli/dist/bin/ito.js).","commonSituations":"Developers point the override at an npx/npm-shim in node_modules/.bin, at a copied binary elsewhere, or at an older layout of the ito-cloud-runtime checkout (pre-dist build or renamed package path). Also common after building to a custom outDir.","solutions":["Build the canonical package (git clone https://github.com/Ito-Markets/ito-cloud-runtime.git, cd ito-cloud-runtime/cli/ito-compute-cli, npm ci, npm run check) so dist/bin/ito.js exists.","Set ECC_ITO_CLI_EXECUTABLE to the absolute path ending in cli/ito-compute-cli/dist/bin/ito.js, e.g. /absolute/path/to/ito-cloud-runtime/cli/ito-compute-cli/dist/bin/ito.js.","Verify the resolved path contains the expected segments (cli/ito-compute-cli/dist/bin/ito.js) rather than a symlink target elsewhere; use the real absolute path, not a symlink.","If a wrapper is unavoidable, make the wrapper exec the canonical dist/bin/ito.js and point the override at that canonical file instead."],"exampleFix":"// before\nexport ECC_ITO_CLI_EXECUTABLE=$(which ito)              # npm shim -> rejected\n// after\nexport ECC_ITO_CLI_EXECUTABLE=\"$HOME/src/ito-cloud-runtime/cli/ito-compute-cli/dist/bin/ito.js\"","handlingStrategy":"validation","validationCode":"const p = process.env.ECC_ITO_CLI_EXECUTABLE;\nconst canonical = p && p.endsWith('/cli/ito-compute-cli/dist/bin/ito.js') && require('path').isAbsolute(p);\nif (!canonical) throw new Error('Set ECC_ITO_CLI_EXECUTABLE to the absolute .../cli/ito-compute-cli/dist/bin/ito.js path');","typeGuard":"function isCanonicalItoEntry(p) { return typeof p === 'string' && require('path').isAbsolute(p) && p.split(require('path').sep).join('/').endsWith('/cli/ito-compute-cli/dist/bin/ito.js'); }","tryCatchPattern":null,"preventionTips":["Always point the override at the built dist/bin/ito.js from a canonical ito-cloud-runtime checkout","Never use PATH shims (npx, node_modules/.bin) or wrappers for this credential-bearing CLI","Re-export the override after moving or rebuilding the checkout"],"tags":["config","security","cli"],"backgroundTag":"invalid-config-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"}