{"record":{"id":"35556c7626a1d379","repo":"ruvnet/ruflo","slug":"manifest-not-found-localpath","errorCode":null,"errorMessage":"Manifest not found: ${localPath}","messagePattern":"Manifest not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/commands/verify.ts","lineNumber":70,"sourceCode":"  };\n}\n\nconst DEFAULT_MANIFEST_URL = 'https://raw.githubusercontent.com/ruvnet/ruflo/{branch}/verification.md.json';\n\nasync function fetchWitness(branch: string): Promise<Witness> {\n  const url = DEFAULT_MANIFEST_URL.replace('{branch}', branch);\n  // audit_1776853149979: bare fetch had no timeout — a hung GitHub CDN would\n  // pin the verify command indefinitely. 30s is generous for a sub-MB JSON.\n  const res = await fetch(url, { signal: AbortSignal.timeout(30000) });\n  if (!res.ok) {\n    throw new Error(`Failed to fetch manifest from ${url}: ${res.status} ${res.statusText}`);\n  }\n  return await res.json() as Witness;\n}\n\nfunction loadLocalWitness(localPath: string): Witness {\n  if (!existsSync(localPath)) {\n    throw new Error(`Manifest not found: ${localPath}`);\n  }\n  return JSON.parse(readFileSync(localPath, 'utf-8')) as Witness;\n}\n\n/**\n * Locate the user's installed package root.\n *\n * The witness manifest paths are repo-relative (e.g.\n * \"v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js\"). For\n * end users, only the dist/ subtree ships in node_modules. We map\n * the repo path → the installed equivalent by stripping the\n * \"v3/@claude-flow/<pkg>/\" prefix and looking up node_modules/<pkg>/.\n */\nfunction repoPathToInstalledPath(repoPath: string): string | null {\n  // Match v3/@claude-flow/<pkg>/<rest>\n  const match = repoPath.match(/^v3\\/(@claude-flow\\/[^/]+)\\/(.+)$/);\n  if (match) {\n    const pkg = match[1];","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/commands/verify.ts#L52-L88","documentation":"Thrown by loadLocalWitness() when existsSync(localPath) returns false. The local manifest path supplied to the verify command's --local option does not exist on disk, so the witness cannot be read.","triggerScenarios":"Passing a --local path that is misspelled, relative to the wrong working directory, or pointing at a file that was not yet downloaded/copied.","commonSituations":"Relative path resolved against an unexpected cwd, the manifest download step was skipped, the path uses `~` which Node does not expand, or a typo in the filename.","solutions":["Use an absolute path to the manifest file.","Expand `~` explicitly: `path.resolve(process.env.HOME, '...', 'verification.md.json')`.","Confirm the file exists: `ls -l <path>`; re-download it if missing.","If you intended the remote fetch, omit --local entirely."],"exampleFix":"// before\nruflo verify --local ~/manifests/verify.json   // '~' not expanded\n// after\nruflo verify --local \"$HOME/manifests/verify.json\"","handlingStrategy":"validation","validationCode":"function resolveLocalManifest(p: string): string {\n  const expanded = p.startsWith('~/')\n    ? require('path').join(process.env.HOME ?? '', p.slice(2))\n    : require('path').resolve(p);\n  if (!require('fs').existsSync(expanded)) {\n    throw new Error(`Manifest not found: ${expanded}`);\n  }\n  return expanded;\n}","typeGuard":"const isExistingFile = (p: string): boolean =>\n  require('fs').existsSync(require('path').resolve(p.replace(/^~/, process.env.HOME ?? '')));","tryCatchPattern":"try {\n  loadLocalWitness(localPath);\n} catch (e) {\n  const msg = e instanceof Error ? e.message : String(e);\n  if (msg.startsWith('Manifest not found')) {\n    console.error('File does not exist. Use an absolute path; ~ is not expanded.');\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Use absolute paths; Node does not expand `~`.","Confirm the file with `ls -l` before passing --local.","Drop the --local flag to use the remote fetch path."],"tags":["filesystem","verify","supply-chain"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}