{"record":{"id":"984408352ace4040","repo":"ruvnet/ruflo","slug":"serialization-format-format-is-not-implemente","errorCode":null,"errorMessage":"Serialization format '${format}' is not implemented. Use 'json' instead.","messagePattern":"Serialization format '(.+?)' is not implemented\\. Use 'json' instead\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"v3/@claude-flow/cli/src/transfer/serialization/cfp.ts","lineNumber":132,"sourceCode":"\n  return JSON.stringify(cfp, null, 2);\n}\n\n/**\n * Serialize CFP to Buffer (for CBOR/binary formats)\n */\nexport function serializeToBuffer(cfp: CFPFormat, format: SerializationFormat): Buffer {\n  // For now, just use JSON - in production, would use cbor-x or msgpack\n  const json = serializeToJson(cfp);\n\n  switch (format) {\n    case 'json':\n      return Buffer.from(json, 'utf-8');\n    case 'cbor':\n    case 'cbor.gz':\n    case 'cbor.zstd':\n    case 'msgpack':\n      throw new Error(`Serialization format '${format}' is not implemented. Use 'json' instead.`);\n    default:\n      return Buffer.from(json, 'utf-8');\n  }\n}\n\n/**\n * Deserialize CFP from string/buffer\n */\nexport function deserializeCFP(data: string | Buffer): CFPFormat {\n  const str = typeof data === 'string' ? data : data.toString('utf-8');\n\n  let parsed: CFPFormat;\n  try {\n    parsed = JSON.parse(str);\n  } catch (e) {\n    throw new Error(`Invalid CFP file: ${e instanceof Error ? e.message : String(e)}`);\n  }\n","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/transfer/serialization/cfp.ts#L114-L150","documentation":"serializeToBuffer(cfp, format) only implements JSON. The format union includes cbor, cbor.gz, cbor.zstd and msgpack, but those cases explicitly throw — the source comments say a production build would use cbor-x or msgpack, but no encoder is wired in. Only 'json' (and any unrecognized value, via the default branch) returns a Buffer, so requesting a compact binary format is a known unimplemented capability.","triggerScenarios":"Calling serializeToBuffer(cfp, 'cbor'), 'cbor.gz', 'cbor.zstd' or 'msgpack' on the CFP transfer path; config/CLI options that expose a format field and let users pick a binary encoding.","commonSituations":"Users choosing cbor to shrink large pattern files (the motivation for the union existing); copying example code that references msgpack; assuming the type union implies implemented support.","solutions":["Use 'json' — the only implemented serialization for CFP transfer","If you need compression, compress the JSON buffer yourself after serializeToBuffer(cfp, 'json') (e.g. zlib.gzipSync)","Watch or contribute the upstream issue — cbor-x/msgpack integration is explicitly deferred in the source","Whitelist format values in your UI/config so binary formats cannot be selected"],"exampleFix":"// before\nconst buf = serializeToBuffer(cfp, 'cbor'); // throws: not implemented\n\n// after\nimport { gzipSync } from 'node:zlib';\nconst buf = gzipSync(serializeToBuffer(cfp, 'json')); // JSON + gzip when size matters","handlingStrategy":"validation","validationCode":"const SUPPORTED_FORMATS = ['json'] as const;\nif (!SUPPORTED_FORMATS.includes(format)) {\n  throw new Error(`Format '${format}' not supported here; only ${SUPPORTED_FORMATS.join(', ')} is implemented`);\n}\nconst buf = serializeToBuffer(cfp, format);","typeGuard":"const SUPPORTED_SERIALIZATION_FORMATS = ['json'] as const;\nexport type SupportedSerializationFormat = (typeof SUPPORTED_SERIALIZATION_FORMATS)[number];\n\nfunction isSupportedSerializationFormat(value: unknown): value is SupportedSerializationFormat {\n  return value === 'json'; // cbor/cbor.gz/cbor.zstd/msgpack are declared but NOT implemented\n}","tryCatchPattern":null,"preventionTips":["Restrict any user-facing 'format' option to 'json' until binary codecs ship upstream","Do not infer capability from the TypeScript union — the extra literals are stubs that throw","If size matters, compress the JSON buffer yourself with zlib instead of requesting cbor"],"tags":["serialization","cfp","not-implemented","cbor","msgpack","transfer"],"backgroundTag":"unsupported-format","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}