{"record":{"id":"6e7e36242070cb51","repo":"JuliusBrussee/caveman","slug":"native-runtime-invalid-response","errorCode":null,"errorMessage":"native runtime: invalid response","messagePattern":"native runtime: invalid response","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/nativeruntime/server_common.go","lineNumber":33,"sourceCode":"func Call(ctx context.Context, home string, request Request) (*Response, error) {\n\tcallCtx, cancel := context.WithTimeout(ctx, hookDeadline)\n\tdefer cancel()\n\tconn, err := dialNativeRuntime(callCtx, home)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer conn.Close()\n\t_ = conn.SetDeadline(time.Now().Add(hookDeadline))\n\tif err := json.NewEncoder(conn).Encode(request); err != nil {\n\t\treturn nil, err\n\t}\n\tlimited := &io.LimitedReader{R: conn, N: maxRequestBytes + 1}\n\tvar response Response\n\tif err := json.NewDecoder(limited).Decode(&response); err != nil {\n\t\treturn nil, err\n\t}\n\tif limited.N <= 0 || !validResponse(response) {\n\t\treturn nil, errors.New(\"native runtime: invalid response\")\n\t}\n\treturn &response, nil\n}\n\nfunc validResponse(response Response) bool {\n\tif response.ProtocolVersion != ProtocolVersion || !response.FailOpen {\n\t\treturn false\n\t}\n\tif response.PolicyMode != \"\" && response.PolicyMode != \"record\" && response.PolicyMode != \"safe\" && response.PolicyMode != \"max\" {\n\t\treturn false\n\t}\n\tif response.Profile != \"\" {\n\t\tswitch response.Profile {\n\t\tcase \"record-only\", \"core\", \"core-lean-build\", \"ledger\", \"ccr-masking\", \"cache-aware\", \"full-safe\", \"full-max\":\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/proxy/internal/nativeruntime/server_common.go#L15-L51","documentation":"The native runtime Call decoded a response from the runtime socket, but the payload exceeded maxRequestBytes or failed response validation (schema/shape check). The response is untrusted IPC input, so oversized or malformed frames are rejected rather than parsed.","triggerScenarios":"Thrown at proxy/internal/nativeruntime/server_common.go:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the runtime response size (trim payloads, paginate results) below the IPC limit","Verify the runtime version produces the expected response schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}