{"record":{"id":"be03b96e28bdc589","repo":"JuliusBrussee/caveman","slug":"proposalrun-marshal-canonical-detail-w","errorCode":null,"errorMessage":"proposalrun: marshal canonical detail: %w","messagePattern":"proposalrun: marshal canonical detail: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/proposalrun/proposalrun.go","lineNumber":79,"sourceCode":"\tdec := json.NewDecoder(bytes.NewReader(detail))\n\tdec.UseNumber()\n\tif err := dec.Decode(&v); err != nil {\n\t\treturn nil, fmt.Errorf(\"proposalrun: detail is not valid JSON: %w\", err)\n\t}\n\tvar trailing any\n\tif err := dec.Decode(&trailing); err != io.EOF {\n\t\tif err == nil {\n\t\t\treturn nil, fmt.Errorf(\"proposalrun: detail contains trailing JSON\")\n\t\t}\n\t\treturn nil, fmt.Errorf(\"proposalrun: detail contains trailing data: %w\", err)\n\t}\n\tv, err := canonicalizeJSONValue(v)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"proposalrun: canonicalize detail: %w\", err)\n\t}\n\tout, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"proposalrun: marshal canonical detail: %w\", err)\n\t}\n\treturn out, nil\n}\n\n// PostgreSQL jsonb stores JSON numbers using its numeric type. These are the\n// documented numeric bounds (131072 digits before and 16383 after the decimal\n// point); rejecting at the canonicalization boundary keeps write and read-back\n// hashing deterministic and avoids unbounded strings from hostile exponents.\n// maxJSONBNumberExponent is an additional allocation guard. PostgreSQL can\n// accept some zero literals with a larger positive exponent after normalizing\n// their zero weight; this package rejects those spellings conservatively so a\n// hostile exponent never drives unbounded intermediate arithmetic.\nconst (\n\tmaxJSONBNumericIntegerDigits  = 131072\n\tmaxJSONBNumericFractionDigits = 16383\n\tmaxJSONBNumberCoefficient     = maxJSONBNumericIntegerDigits + maxJSONBNumericFractionDigits + 1\n\tmaxJSONBNumberExponent        = maxJSONBNumericIntegerDigits + maxJSONBNumericFractionDigits\n\tmaxJSONBNumberLexeme          = maxJSONBNumberCoefficient + 16","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/proposalrun/proposalrun.go#L61-L97","documentation":"Error \"proposalrun: marshal canonical detail: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/proposalrun/proposalrun.go:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix canonical detail marshaling and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}