{"record":{"id":"9a4b02f3c1e83ce9","repo":"ruvnet/ruflo","slug":"unsupported-rvfp-version-ver","errorCode":null,"errorMessage":"Unsupported RVFP version: ${ver}","messagePattern":"Unsupported RVFP version: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/rvfa-distribution.ts","lineNumber":195,"sourceCode":"    };\n    if (opts.privateKey && opts.signedBy) {\n      const signable = Buffer.concat([Buffer.from(canonicalJson(header), 'utf-8'), payload]);\n      header.signature = edSign(signable, opts.privateKey);\n      header.signedBy = opts.signedBy;\n    }\n    const hJson = Buffer.from(JSON.stringify(header), 'utf-8');\n    const magic = Buffer.from('RVFP');\n    const ver = Buffer.alloc(4); ver.writeUInt32LE(RVFP_VERSION, 0);\n    const hLen = Buffer.alloc(4); hLen.writeUInt32LE(hJson.length, 0);\n    return Buffer.concat([magic, ver, hLen, hJson, payload, sha256B(payload)]);\n  }\n\n  static parsePatchHeader(buf: Buffer): RvfpHeader {\n    if (buf.length < PRE) throw new Error('Buffer too small for RVFP preamble');\n    const magic = buf.subarray(0, 4).toString('ascii');\n    if (magic !== 'RVFP') throw new Error(`Invalid RVFP magic: \"${magic}\"`);\n    const ver = buf.readUInt32LE(4);\n    if (ver !== RVFP_VERSION) throw new Error(`Unsupported RVFP version: ${ver}`);\n    const hLen = buf.readUInt32LE(8);\n    if (PRE + hLen > buf.length) throw new Error('Buffer too small for declared header');\n    const h = JSON.parse(buf.subarray(PRE, PRE + hLen).toString('utf-8')) as RvfpHeader;\n    if (h.magic !== 'RVFP') throw new Error('RVFP header magic mismatch');\n    return h;\n  }\n\n  static async verifyPatch(buf: Buffer): Promise<PatchVerifyResult> {\n    const errors: string[] = [];\n    let header: RvfpHeader;\n    try { header = RvfaPatcher.parsePatchHeader(buf); } catch (e) {\n      const empty: RvfpHeader = {\n        magic: 'RVFP', version: 0, targetApplianceName: '', targetApplianceVersion: '',\n        targetSection: '', patchVersion: '', created: '', newSectionSize: 0,\n        newSectionSha256: '', compression: 'none',\n      };\n      return { valid: false, header: empty, errors: [(e as Error).message] };\n    }","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/appliance/rvfa-distribution.ts#L177-L213","documentation":"The u32 LE version word at offset 4 of an RVFP patch must equal RVFP_VERSION (currently 1). A different value means the patch was produced by a tool with a different format version than this parser — a forward/backward compatibility break — or the version field got corrupted (though bad magic usually trips first).","triggerScenarios":"`parsePatchHeader` on a patch built by a newer @claude-flow/cli whose RVFP_VERSION moved past 1; a mangled file where the version word is garbage; stale cached patches read after a format bump.","commonSituations":"Producer and consumer machines on different CLI versions; patches fetched from IPFS that were built with a newer release; mixed-version fleets exchanging patches.","solutions":["Upgrade the consuming @claude-flow/cli to at least the version that produced the patch (check its changelog for RVFP version bumps)","Or regenerate the patch locally with the current version via RvfaPatcher.createPatch","If both sides claim version 1, suspect corruption — re-transfer the file"],"exampleFix":"// before — patch produced by a newer tool\nconst header = RvfaPatcher.parsePatchHeader(buf); // Unsupported RVFP version: 2\n\n// after — gate on the version word before parsing\nconst ver = buf.readUInt32LE(4);\nif (ver !== 1) throw new Error(`Patch format v${ver} unsupported by this CLI — upgrade or rebuild the patch`);","handlingStrategy":"validation","validationCode":"const version = buf.readUInt32LE(4);\nif (version !== 1) { // RVFP_VERSION\n  throw new Error(`Patch format v${version} unsupported — upgrade @claude-flow/cli or rebuild the patch`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  header = RvfaPatcher.parsePatchHeader(buf);\n} catch (e) {\n  if (/Unsupported RVFP version/.test(String(e))) {\n    // producer/consumer version skew — prompt upgrade or regenerate the patch\n  } else {\n    throw e;\n  }\n}","preventionTips":["Pin producer and consumer CLI versions when exchanging patches across machines","Feature-gate patch handling on the version word read directly from the file, before committing to a parse"],"tags":["rvfa-distribution","rvfp-patch","version-compatibility","binary-format"],"backgroundTag":"unsupported-format-version","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"}