{"record":{"id":"9495399c6a3aee64","repo":"JuliusBrussee/caveman","slug":"cache-replay-trace-and-positive-request-token-tr","errorCode":null,"errorMessage":"cache-replay: -trace and positive request/token/trace/response/verifier limits required","messagePattern":"cache-replay: -trace and positive request/token/trace/response/verifier limits required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":219,"sourceCode":"\ttimeScale := flag.Float64(\"time-scale\", 1, \"trace timing multiplier; 1 preserves grounded timing\")\n\tallowUngrounded := flag.Bool(\"allow-ungrounded-timing\", false, \"permit synthetic/per-partition schedules; evidence is not timing-faithful\")\n\tallowEstimatedTokens := flag.Bool(\"allow-estimated-token-budget\", false, \"permit non-provider token estimates; input ceiling is not provider-grounded\")\n\tmaxResponseBytes := flag.Int64(\"max-response-bytes\", 16<<20, \"maximum retained provider response bytes/request\")\n\tproviderTimeout := flag.Duration(\"provider-timeout\", 2*time.Minute, \"hard timeout per provider request (1s-1h)\")\n\tverifierPath := flag.String(\"verifier-command\", \"\", \"task verifier executable; receives one JSON object on stdin\")\n\tverifierOutputBytes := flag.Int64(\"max-verifier-output-bytes\", 16<<20, \"maximum verifier JSON bytes/request\")\n\ttargetRate := flag.Float64(\"target\", .97, \"required request and token cache-hit rate\")\n\tminEligible := flag.Int(\"min-requests\", 100, \"minimum eligible requests/provider\")\n\tallowInsecureLoopback := flag.Bool(\"allow-insecure-loopback\", false, \"allow HTTP only for explicit loopback test base URLs\")\n\tallowCustomBaseURL := flag.Bool(\"allow-custom-base-url\", false, \"confirm credentials may be sent to explicit custom HTTPS base URLs\")\n\tverifierTimeout := flag.Duration(\"verifier-timeout\", 5*time.Minute, \"hard timeout per task-verifier invocation\")\n\tflag.Var(&verifierArgs, \"verifier-arg\", \"verifier argument; repeatable, no shell parsing\")\n\tflag.Var(&verifierEnv, \"verifier-env\", \"environment variable exposed to verifier; repeatable\")\n\tflag.Var(&baseURLs, \"base-url\", \"test/custom provider base URL as provider=https://host; repeatable\")\n\tflag.Parse()\n\n\tif *tracePath == \"\" || !filepath.IsAbs(*tracePath) || *maxRequests <= 0 || *maxRequests > maxReplayRequests || *maxTokens <= 0 || *maxTraceBytes <= 0 || *maxTraceBytes > maxReplayTraceBytes || *maxResponseBytes <= 0 || *maxResponseBytes > 256<<20 || *providerTimeout < time.Second || *providerTimeout > time.Hour || *verifierOutputBytes <= 0 || *verifierOutputBytes > 256<<20 || *verifierTimeout <= 0 || *maxScheduleDrift <= 0 || *maxConcurrency <= 0 || *maxConcurrency > 1024 {\n\t\tfatalConfig(errors.New(\"cache-replay: -trace and positive request/token/trace/response/verifier limits required\"))\n\t}\n\tif (*maxResponseBytes+*verifierOutputBytes)*int64(*maxConcurrency) > maxReplayInflightBytes {\n\t\tfatalConfig(fmt.Errorf(\"cache-replay: concurrent response and verifier buffers exceed %d bytes\", maxReplayInflightBytes))\n\t}\n\tif len(baseURLs) > 0 && !*allowCustomBaseURL {\n\t\tfatalConfig(errors.New(\"cache-replay: custom base URLs require -allow-custom-base-url\"))\n\t}\n\trecords, traceSHA, err := readTrace(*tracePath, *maxTraceBytes, *maxRequests)\n\tif err != nil {\n\t\tfatalConfig(err)\n\t}\n\tlimits := cachebench.ReplayLimits{\n\t\tMaxRequests: *maxRequests, MaxDeclaredBilledTokens: *maxTokens, MaxGap: *maxGap, MaxScheduleDrift: *maxScheduleDrift,\n\t\tMaxConcurrency:        *maxConcurrency,\n\t\tRequireGroundedTiming: !*allowUngrounded, RequireProviderTokens: !*allowEstimatedTokens,\n\t}\n\tpreflight, err := cachebench.ValidateReplay(records, limits, *timeScale)\n\tif err != nil {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cmd/cache-replay/main.go#L201-L237","documentation":"main's flag validation found the command line incomplete: -trace is missing, or one of the numeric limit flags (request/token/trace/response/verifier limits) is set to a non-positive value. These are mandatory safety bounds, not optional tuning.","triggerScenarios":"Thrown at cacheengine/cmd/cache-replay/main.go:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Always pass -trace pointing at the trace JSONL file","Keep -max-requests, token, trace, -max-response-bytes, and verifier limit flags strictly positive"],"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"}