{"record":{"id":"e34fc58acbb2f5da","repo":"JuliusBrussee/caveman","slug":"cachebench-observations-and-corpus-are-mutually","errorCode":null,"errorMessage":"cachebench: -observations and -corpus are mutually exclusive","messagePattern":"cachebench: -observations and -corpus are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cachebench/main.go","lineNumber":51,"sourceCode":"\t\ttraceIn         = flag.String(\"trace-in\", \"\", \"request trace JSONL required with -observations\")\n\t\ttraceOut        = flag.String(\"trace-out\", \"\", \"write generated provider request trace as JSONL\")\n\t\tcorpusPath      = flag.String(\"corpus\", \"\", \"LMCache agent corpus file, or - for stdin\")\n\t\tcorpusFormat    = flag.String(\"corpus-format\", cachebench.CorpusFormatLMCacheJSONL, \"lmcache-jsonl or hf-rows\")\n\t\tcorpusName      = flag.String(\"corpus-name\", \"lmcache-agentic-traces\", \"corpus name recorded in report\")\n\t\tcorpusLicense   = flag.String(\"corpus-license\", \"\", \"corpus license recorded in report\")\n\t\tcorpusRevision  = flag.String(\"corpus-revision\", \"\", \"immutable corpus revision recorded in report\")\n\t\tcorpusMaxRows   = flag.Int(\"corpus-max-rows\", 100000, \"fail closed above this many corpus rows\")\n\t\tcorpusMaxSess   = flag.Int(\"corpus-max-sessions\", 10000, \"fail closed above this many corpus sessions\")\n\t\tcorpusMaxBytes  = flag.Int64(\"corpus-max-bytes\", 1<<30, \"fail closed above this many retained corpus bytes\")\n\t)\n\tflag.Parse()\n\ttarget := cachebench.Target{RequestHitRate: *targetRate, TokenHitRate: *targetRate, MinEligibleRequest: *minRequests}\n\tvar (\n\t\treport cachebench.Report\n\t\terr    error\n\t)\n\tif *observations != \"\" && *corpusPath != \"\" {\n\t\tfatal(fmt.Errorf(\"cachebench: -observations and -corpus are mutually exclusive\"))\n\t}\n\tif *observations != \"\" {\n\t\tif *traceIn == \"\" {\n\t\t\tfatal(fmt.Errorf(\"cachebench: -trace-in required with -observations\"))\n\t\t}\n\t\treport, err = observedReport(*observations, *traceIn, target)\n\t} else if *corpusPath != \"\" {\n\t\tif *traceIn != \"\" {\n\t\t\tfatal(fmt.Errorf(\"cachebench: -trace-in cannot be combined with -corpus\"))\n\t\t}\n\t\tproviders, providerErr := selectProviders(*providerList)\n\t\tif providerErr != nil {\n\t\t\tfatal(providerErr)\n\t\t}\n\t\treport, err = corpusReport(*corpusPath, *corpusFormat, cachebench.CorpusMetadata{\n\t\t\tName: *corpusName, License: *corpusLicense, Revision: *corpusRevision,\n\t\t}, cachebench.CorpusLimits{\n\t\t\tMaxRows: *corpusMaxRows, MaxSessions: *corpusMaxSess, MaxRetainedBytes: *corpusMaxBytes,","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cmd/cachebench/main.go#L33-L69","documentation":"Raised by cachebench's main: both -observations and -corpus were supplied. The two flags select mutually exclusive input modes (replaying observed traces vs. simulating over a corpus), so providing both is an ambiguous invocation that fails closed before any work starts.","triggerScenarios":"Thrown at cacheengine/cmd/cachebench/main.go:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only -observations (with -trace-in) for observation-based reports","Pass only -corpus for corpus simulation runs","Remove the unused input flag from the command line"],"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"}