{"record":{"id":"6439224e8c82dd17","repo":"ruvnet/ruflo","slug":"out-of-range-cidr-cidr","errorCode":null,"errorMessage":"out-of-range CIDR: ${cidr}","messagePattern":"out-of-range CIDR: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugin-agent-federation/src/domain/value-objects/wg-config.ts","lineNumber":89,"sourceCode":"  return {\n    publicKey: pubRaw.toString('base64'),\n    privateKey: privRaw.toString('base64'),\n    createdAt: new Date().toISOString(),\n  };\n}\n\n/**\n * Parse a `a.b.c.d/M` CIDR into a numeric base + mask-prefix-length.\n * Limited to IPv4 — v1 of ADR-111 is IPv4-only inside the mesh.\n */\nfunction parseCidr(cidr: string): { base: number; prefix: number } {\n  const m = cidr.match(/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\/(\\d{1,2})$/);\n  if (!m) throw new Error(`invalid CIDR: ${cidr}`);\n  const [, a, b, c, d, p] = m;\n  const octets = [a, b, c, d].map(Number);\n  const prefix = Number(p);\n  if (octets.some(o => o < 0 || o > 255) || prefix < 0 || prefix > 32) {\n    throw new Error(`out-of-range CIDR: ${cidr}`);\n  }\n  const base = ((octets[0] << 24) | (octets[1] << 16) | (octets[2] << 8) | octets[3]) >>> 0;\n  return { base, prefix };\n}\n\nfunction ipToString(n: number): string {\n  return `${(n >>> 24) & 0xff}.${(n >>> 16) & 0xff}.${(n >>> 8) & 0xff}.${n & 0xff}`;\n}\n\n/**\n * Derive a deterministic mesh IP for `nodeId` inside `subnet`.\n *\n * Strategy: sha256(nodeId) → top bytes interpreted as host portion of the\n * subnet, clamped to avoid the network address (.0) and broadcast (.255)\n * of any /24 inside the subnet. This is collision-resistant in the\n * birthday-paradox sense — see ADR for thresholds.\n *\n * `usedIPs` (when provided) gives previously-assigned IPs in the mesh.","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugin-agent-federation/src/domain/value-objects/wg-config.ts#L71-L107","documentation":"parseCidr matched the CIDR shape but a numeric component is out of range: an octet greater than 255 or a prefix length greater than 32. The textual format was valid, but the value cannot denote a real IPv4 network, so mesh-subnet derivation cannot proceed.","triggerScenarios":"A syntactically valid CIDR has an address or prefix length outside the allowed range.","commonSituations":"Prefix length exceeding the address family maximum (e.g. /33 for IPv4) or octets > 255.","solutions":["Use a prefix length valid for the address family (0-32 for IPv4, 0-128 for IPv6).","Correct out-of-range octets in the configured address."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}