{"record":{"id":"b595321b0705656b","repo":"ruvnet/ruflo","slug":"memory-path-is-required","errorCode":null,"errorMessage":"memory path is required","messagePattern":"memory path is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts","lineNumber":71,"sourceCode":"  }\n}\n\n/** Reset the module-level load cache. Test-only seam. */\nexport function __resetAgenticowCache(): void {\n  _agenticowMod = null;\n  _loadAttempted = false;\n}\n\nexport function degradedResult(reason: string): { success: true; degraded: true; reason: string } {\n  return { success: true, degraded: true, reason };\n}\n\n/**\n * Resolve a user-supplied memory path against the project cwd, rejecting path\n * traversal and NUL bytes (D-2 style hardening — same rule the MCP verbs use).\n */\nexport function resolveMemoryPath(path: string): string {\n  if (!path || typeof path !== 'string') throw new Error('memory path is required');\n  if (/\\.\\.[\\\\/]|\\0/.test(path)) throw new Error('memory path contains disallowed characters');\n  return isAbsolute(path) ? path : resolve(getProjectCwd(), path);\n}\n\n/**\n * Lineage manifest companion path. agenticow persists the COW chain\n * (working → checkpoints → base) into `<file>.agenticow.json` next to the\n * `.rvf` data file. Without it, forks/checkpoints are in-memory only and\n * disappear when the AgenticMemory handle closes.\n */\nexport function manifestFor(file: string): string {\n  return `${file}.agenticow.json`;\n}\n\n/** Validate a COW branch/checkpoint label (alnum + a small safe symbol set). */\nexport function validateLabel(label: string): string {\n  if (!label || typeof label !== 'string') throw new Error('label is required');\n  if (label.length > 256) throw new Error('label exceeds 256 chars');","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts#L53-L89","documentation":"Thrown by resolveMemoryPath() in agenticow-loader when the `path` argument is falsy, not a string, or empty. resolveMemoryPath is the shared resolver used by the agenticow MCP tools (and the SwarmMemoryBranches service) to resolve a user-supplied memory file path against the project cwd with traversal hardening — it cannot proceed without a path.","triggerScenarios":"Calling an agenticow tool without basePath; passing basePath as undefined/null/''; a destructuring bug that dropped the field; calling resolveMemoryPath directly with no argument.","commonSituations":"Integrator forgot to thread basePath; a fixture with basePath omitted expecting a default (there is no default here, unlike agentbbs); a refactor renamed the field.","solutions":["Always supply a non-empty basePath string to agenticow tools (e.g. `.agenticow/memory.rvf`).","If a default is desired, set it in your caller before invoking the tool.","Validate basePath at your boundary: non-empty string before calling."],"exampleFix":"// before\nspeculate({ candidates: [...] }); // throws: memory path is required\n// after\nspeculate({ basePath: '.agenticow/memory.rvf', candidates: [...] });","handlingStrategy":"validation","validationCode":"function requireMemoryPath(p: unknown): string {\n  if (typeof p !== 'string' || p.length === 0) throw new Error('basePath (memory path) is required');\n  return p;\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.length > 0;","tryCatchPattern":"null","preventionTips":["Set an explicit default basePath in your caller if you want one.","Validate the field exists and is a non-empty string before invoking agenticow tools.","Thread basePath through from configuration rather than computing it ad-hoc."],"tags":["validation","agenticow","memory","required-field","path"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}