{"record":{"id":"5249aa328f94d73b","repo":"ruvnet/ruflo","slug":"label-is-required","errorCode":null,"errorMessage":"label is required","messagePattern":"label is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts","lineNumber":88,"sourceCode":"export 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');\n  if (!/^[A-Za-z0-9_.\\-:/@]+$/.test(label)) {\n    throw new Error('label may only contain [A-Za-z0-9_.\\\\-:/@]');\n  }\n  return label;\n}\n\n/**\n * Open (or create) a memory file, restoring its COW chain from the lineage\n * manifest when one exists. When neither the `.rvf` nor the manifest exists,\n * `dimension` is required to create a fresh base.\n */\nexport async function openWithLineage(api: AgenticowApi, file: string, dimension?: number) {\n  const manifest = manifestFor(file);\n  if (existsSync(manifest)) {\n    return (api.AgenticMemory as any).load(manifest);\n  }\n  const opts: any = {};","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts#L70-L106","documentation":"Thrown by validateLabel() in agenticow-loader when the supplied branch/checkpoint label is falsy, not a string, or empty. Labels name COW branches and checkpoints in the agenticow lineage chain; an empty label would collide branches and break the lineage manifest, so it is rejected before any branch handle is opened.","triggerScenarios":"Calling an agenticow branching tool (fork/checkpoint/speculate) without a label; passing label as undefined/null/''; a candidate object missing its label field; a template that produced an empty string.","commonSituations":"Candidate list where one entry forgot `label`; integrator assumed label was optional; a refactor that renamed `branchName` to `label` left callers using the old key.","solutions":["Always supply a non-empty label for every candidate/branch/checkpoint.","Map/rename legacy field names to `label` at your boundary before calling the tool.","If generating labels programmatically, fail loudly when the generator returns empty rather than passing it through."],"exampleFix":"// before\nspeculate({ basePath, candidates: [{ ingest: [...] }] }); // throws\n// after\nspeculate({ basePath, candidates: [{ label: 'exp-a', ingest: [...] }] });","handlingStrategy":"validation","validationCode":"function requireLabel(label: unknown): string {\n  if (typeof label !== 'string' || label.length === 0) throw new Error('candidate.label is required');\n  return label;\n}","typeGuard":"const isLabel = (v: unknown): v is string => typeof v === 'string' && v.length > 0 && v.length <= 256;","tryCatchPattern":"null","preventionTips":["Require every candidate object to carry a non-empty `label` at your boundary.","Rename legacy field names to `label` before calling the tool.","Fail loudly in your label generator when it would return empty."],"tags":["validation","agenticow","label","required-field","cow"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}