{"record":{"id":"8c9174736dce0461","repo":"ruvnet/ruflo","slug":"jcs-canonicalization-rejects-undefined-object-valu","errorCode":null,"errorMessage":"JCS canonicalization rejects undefined object values","messagePattern":"JCS canonicalization rejects undefined object values","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/security/src/policy/product-plane.ts","lineNumber":1118,"sourceCode":"  }\n  if (Array.isArray(value)) {\n    const items: string[] = [];\n    for (let index = 0; index < value.length; index++) {\n      if (!Object.prototype.hasOwnProperty.call(value, index)) {\n        throw new TypeError('JCS canonicalization rejects sparse arrays');\n      }\n      items.push(canonicalizeProductPlane(value[index]));\n    }\n    return `[${items.join(',')}]`;\n  }\n  if (!isRecord(value)) {\n    throw new TypeError('JCS canonicalization accepts only JSON-compatible plain objects');\n  }\n  const entries: string[] = [];\n  for (const key of Object.keys(value).sort()) {\n    assertUnicodeScalarString(key);\n    if (value[key] === undefined) {\n      throw new TypeError('JCS canonicalization rejects undefined object values');\n    }\n    entries.push(`${JSON.stringify(key)}:${canonicalizeProductPlane(value[key])}`);\n  }\n  return `{${entries.join(',')}}`;\n}\n\nexport function canonicalProductPlaneBytes(value: unknown): Uint8Array {\n  return Buffer.from(canonicalizeProductPlane(value), 'utf8');\n}\n\nexport function canonicalProductPlaneDigest(value: unknown): `sha256:${string}` {\n  return `sha256:${createHash('sha256').update(canonicalProductPlaneBytes(value)).digest('hex')}`;\n}\n\nexport interface SignedProductActionEnvelopeV1 {\n  envelope: ProductActionEnvelopeV1;\n  algorithm: 'Ed25519';\n  keyId: string;","sourceCodeStart":1100,"sourceCodeEnd":1136,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/security/src/policy/product-plane.ts#L1100-L1136","documentation":"JCS canonicalizer guard: while serializing a plain object, a key's value is undefined. JSON.stringify would silently drop such members, which would make the canonical (signed) form diverge from the in-memory data, so the object is rejected as non-JSON-compatible.","triggerScenarios":"Thrown at v3/@claude-flow/security/src/policy/product-plane.ts:1118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove keys whose value is undefined before canonicalizing, or replace them with null.","Filter the object: Object.fromEntries(Object.entries(obj).filter(([,v]) => v !== undefined))."],"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-14T00:17:10.932Z"}