{"record":{"id":"489df0c181e0e538","repo":"JuliusBrussee/caveman","slug":"cachebench-verifier-returned-invalid-json","errorCode":null,"errorMessage":"cachebench: verifier returned invalid JSON","messagePattern":"cachebench: verifier returned invalid JSON","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":58,"sourceCode":"type VerificationCommandOutput struct {\n\tSchema    string          `json:\"schema\"`\n\tRequestID string          `json:\"request_id\"`\n\tPassed    bool            `json:\"passed\"`\n\tVerifier  string          `json:\"verifier\"`\n\tEvidence  json.RawMessage `json:\"evidence\"`\n}\n\n// ParseVerificationCommandOutput validates and binds external grader evidence.\nfunc ParseVerificationCommandOutput(raw []byte, requestID string) (TaskVerification, error) {\n\traw = bytes.TrimSpace(raw)\n\tif !validUniqueJSONObject(raw) {\n\t\treturn TaskVerification{}, errors.New(\"cachebench: verifier returned duplicate or invalid JSON\")\n\t}\n\tdecoder := json.NewDecoder(bytes.NewReader(raw))\n\tdecoder.DisallowUnknownFields()\n\tvar result VerificationCommandOutput\n\tif decoder.Decode(&result) != nil {\n\t\treturn TaskVerification{}, errors.New(\"cachebench: verifier returned invalid JSON\")\n\t}\n\tvar trailing any\n\tif decoder.Decode(&trailing) != io.EOF || result.Schema != VerificationSchema || result.RequestID != requestID || !validBoundedText(result.Verifier, 256, false) || len(result.Evidence) == 0 || !json.Valid(result.Evidence) || bytes.Equal(bytes.TrimSpace(result.Evidence), []byte(\"null\")) {\n\t\treturn TaskVerification{}, errors.New(\"cachebench: verifier returned incomplete or mismatched evidence\")\n\t}\n\treturn TaskVerification{Passed: result.Passed, Verifier: result.Verifier, Evidence: append([]byte(nil), raw...)}, nil\n}\n\n// ReplayLimits bounds paid population, schedule, and concurrency.\ntype ReplayLimits struct {\n\tMaxRequests             int\n\tMaxDeclaredBilledTokens int64\n\tMaxGap                  time.Duration\n\tMaxScheduleDrift        time.Duration\n\tMaxConcurrency          int\n\tRequireGroundedTiming   bool\n\tRequireProviderTokens   bool\n}","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay.go#L40-L76","documentation":"Raised in ParseVerificationCommandOutput: the raw bytes passed the unique-object pre-check but strict decoding (with DisallowUnknownFields) into VerificationCommandOutput failed. The verifier's JSON is syntactically an object yet does not bind to the expected schema — wrong field types, unknown fields, or truncated output.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Match the expected schema exactly: schema, request_id, passed, verifier, evidence","Remove unknown/extra fields from the verifier output (DisallowUnknownFields is set)","Correct field types, e.g. passed must be a JSON boolean, not a string"],"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-23T08:17:48.524Z"}