JuliusBrussee/caveman · error

cache-replay: -trace and positive…

Error message

cache-replay: -trace and positive request/token/trace/response/verifier limits required

What it means

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.

Solutions

  1. Always pass -trace pointing at the trace JSONL file
  2. Keep -max-requests, token, trace, -max-response-bytes, and verifier limit flags strictly positive
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cacheengine/cmd/cache-replay/main.go:219 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/9495399c6a3aee64. Report an issue: GitHub.

Appendix: source

Thrown at cacheengine/cmd/cache-replay/main.go:219

	timeScale := flag.Float64("time-scale", 1, "trace timing multiplier; 1 preserves grounded timing")
	allowUngrounded := flag.Bool("allow-ungrounded-timing", false, "permit synthetic/per-partition schedules; evidence is not timing-faithful")
	allowEstimatedTokens := flag.Bool("allow-estimated-token-budget", false, "permit non-provider token estimates; input ceiling is not provider-grounded")
	maxResponseBytes := flag.Int64("max-response-bytes", 16<<20, "maximum retained provider response bytes/request")
	providerTimeout := flag.Duration("provider-timeout", 2*time.Minute, "hard timeout per provider request (1s-1h)")
	verifierPath := flag.String("verifier-command", "", "task verifier executable; receives one JSON object on stdin")
	verifierOutputBytes := flag.Int64("max-verifier-output-bytes", 16<<20, "maximum verifier JSON bytes/request")
	targetRate := flag.Float64("target", .97, "required request and token cache-hit rate")
	minEligible := flag.Int("min-requests", 100, "minimum eligible requests/provider")
	allowInsecureLoopback := flag.Bool("allow-insecure-loopback", false, "allow HTTP only for explicit loopback test base URLs")
	allowCustomBaseURL := flag.Bool("allow-custom-base-url", false, "confirm credentials may be sent to explicit custom HTTPS base URLs")
	verifierTimeout := flag.Duration("verifier-timeout", 5*time.Minute, "hard timeout per task-verifier invocation")
	flag.Var(&verifierArgs, "verifier-arg", "verifier argument; repeatable, no shell parsing")
	flag.Var(&verifierEnv, "verifier-env", "environment variable exposed to verifier; repeatable")
	flag.Var(&baseURLs, "base-url", "test/custom provider base URL as provider=https://host; repeatable")
	flag.Parse()

	if *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 {
		fatalConfig(errors.New("cache-replay: -trace and positive request/token/trace/response/verifier limits required"))
	}
	if (*maxResponseBytes+*verifierOutputBytes)*int64(*maxConcurrency) > maxReplayInflightBytes {
		fatalConfig(fmt.Errorf("cache-replay: concurrent response and verifier buffers exceed %d bytes", maxReplayInflightBytes))
	}
	if len(baseURLs) > 0 && !*allowCustomBaseURL {
		fatalConfig(errors.New("cache-replay: custom base URLs require -allow-custom-base-url"))
	}
	records, traceSHA, err := readTrace(*tracePath, *maxTraceBytes, *maxRequests)
	if err != nil {
		fatalConfig(err)
	}
	limits := cachebench.ReplayLimits{
		MaxRequests: *maxRequests, MaxDeclaredBilledTokens: *maxTokens, MaxGap: *maxGap, MaxScheduleDrift: *maxScheduleDrift,
		MaxConcurrency:        *maxConcurrency,
		RequireGroundedTiming: !*allowUngrounded, RequireProviderTokens: !*allowEstimatedTokens,
	}
	preflight, err := cachebench.ValidateReplay(records, limits, *timeScale)
	if err != nil {

View on GitHub (pinned to 766dce6b13)