{"record":{"id":"25493e4e1437bd76","repo":"ruvnet/ruflo","slug":"label-may-only-contain-a-za-z0-9","errorCode":null,"errorMessage":"label may only contain [A-Za-z0-9_.\\-:/@]","messagePattern":"label may only contain \\[A-Za-z0-9_\\.\\\\-:/@\\]","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts","lineNumber":91,"sourceCode":"  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 = {};\n  if (typeof dimension === 'number' && Number.isInteger(dimension) && dimension > 0) {\n    opts.dimension = dimension;\n  } else if (!existsSync(file)) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/mcp-tools/agenticow-loader.ts#L73-L109","documentation":"Thrown by validateLabel() when the label is present but fails the allow-list `/^[A-Za-z0-9_.\\-:/@]+$/` (length>256 is a separate throw). Note this set is slightly narrower than agentbbs's — it does NOT include `#` — because agenticow labels become filesystem path segments in the lineage manifest and a `#` would be legal-but-confusing on case-sensitive filesystems. Spaces, commas, and shell metacharacters are rejected because labels are embedded in manifest JSON keys and branch paths.","triggerScenarios":"Label contains a space, `#`, comma, or other punctuation; an agentbbs-style '#sales' label reused as an agenticow branch label; unicode; a templated label joined with a disallowed separator.","commonSituations":"Cross-tool reuse of a label string that is valid in agentbbs but not here; free-form user input; a separator like '/' that is allowed but combined with a leading '#'.","solutions":["Restrict agenticow labels to alphanumerics and `_ . - : / @` (no `#`).","If migrating labels from agentbbs, strip leading `#` first.","Sanitize/slugify upstream and keep labels ≤256 chars."],"exampleFix":"// before — agentbbs-style label reused\nspeculate({ basePath, candidates: [{ label: '#exp-a', ingest }] });\n// after\nspeculate({ basePath, candidates: [{ label: 'exp-a', ingest }] });","handlingStrategy":"validation","validationCode":"const LABEL_RE = /^[A-Za-z0-9_.\\-:/@]+$/;\nfunction normalizeAgenticowLabel(label: string): string {\n  const v = label.replace(/^#/, '').trim();\n  if (!LABEL_RE.test(v)) throw new Error('label has disallowed chars (no # allowed)');\n  return v;\n}","typeGuard":"const isAgenticowLabel = (v: string): boolean =>\n  v.length > 0 && v.length <= 256 && /^[A-Za-z0-9_.\\-:/@]+$/.test(v);","tryCatchPattern":"null","preventionTips":["Do not reuse agentbbs '#sales' labels verbatim — strip the '#'.","Keep a single label-sanitize helper used by every caller.","Add a property test that generated labels always pass the regex."],"tags":["validation","agenticow","label","allowlist","cow"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}