{"record":{"id":"5249aa328f94d73b","repo":"ruvnet/ruflo","slug":"label-is-required","errorCode":null,"errorMessage":"label is required","messagePattern":"label is required","errorType":"exception","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/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts#L70-L106","documentation":"Thrown by validateLabel() (agenticow-loader.ts:88) when a copy-on-write branch/checkpoint label is falsy (undefined, null, '') or not a string. Labels identify branches and checkpoints in the agenticow COW chain persisted in the <file>.agenticow.json lineage manifest, so an empty label would make lineage entries unaddressable.","triggerScenarios":"Calling agenticow_branch, agenticow_checkpoint, agenticow_rollback or agenticow_promote without a label; passing label:'' — note the speculate handler wraps values with String(), so a candidate with label omitted becomes the string 'undefined' and passes, but an explicitly empty string '' throws.","commonSituations":"Forgetting the label argument when scripting a checkpoint before a risky ingest; a generated label field that came back empty from an upstream system; candidate arrays in agenticow_speculate whose entries were built dynamically and lost their label key.","solutions":["Supply a short non-empty label from the allowed charset [A-Za-z0-9_.\\-:/@] (e.g. 'pre-ingest-checkpoint')","If generating labels programmatically, default them (e.g. `label: rawLabel || 'branch-' + Date.now()`)","Validate the candidates array entries before calling agenticow_speculate"],"exampleFix":"// before\nawait callTool('agenticow_checkpoint', { path: 'memory/main.rvf', label: '' });\n// throws: label is required\n\n// after\nawait callTool('agenticow_checkpoint', { path: 'memory/main.rvf', label: 'before-bulk-ingest' });","handlingStrategy":"validation","validationCode":"function assertLabel(label: unknown): string {\n  if (typeof label !== 'string' || label.length === 0) {\n    throw new TypeError('label must be a non-empty string');\n  }\n  return label;\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.length > 0;","tryCatchPattern":"try {\n  await callTool('agenticow_checkpoint', args);\n} catch (e) {\n  if (e instanceof Error && e.message === 'label is required') {\n    args.label = `auto-${Date.now()}`;\n    return callTool('agenticow_checkpoint', args);\n  }\n  throw e;\n}","preventionTips":["Always generate a fallback label when scripting checkpoints (timestamp or counter based)","Validate every candidates[] entry of agenticow_speculate for label and ingest before submitting"],"tags":["validation","agenticow","memory","required-parameter","mcp"],"backgroundTag":"missing-required-argument","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}