{"record":{"id":"7fe33858429013e2","repo":"JuliusBrussee/caveman","slug":"cacheengine-volatile-content-cannot-start-stable","errorCode":null,"errorMessage":"cacheengine: volatile content cannot start stable epoch","messagePattern":"cacheengine: volatile content cannot start stable epoch","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/engine.go","lineNumber":242,"sourceCode":"func (e *Engine) StartEpoch(request PlanRequest) (Plan, error) {\n\tif e == nil || e.guard == nil {\n\t\treturn Plan{}, errors.New(\"cacheengine: nil engine\")\n\t}\n\tif e.configErr != nil {\n\t\treturn Plan{}, e.configErr\n\t}\n\tif err := validatePlanRequest(request); err != nil {\n\t\treturn Plan{}, err\n\t}\n\tprefix, stableSegments, err := stablePrefix(request.Segments, e.maxStablePrefixBytes)\n\tif err != nil {\n\t\treturn Plan{}, err\n\t}\n\tif len(stableSegments) == 0 {\n\t\treturn Plan{}, errors.New(\"cacheengine: no stable prefix\")\n\t}\n\tif len(cacheguard.DetectVolatile(prefix)) > 0 {\n\t\treturn Plan{}, errors.New(\"cacheengine: volatile content cannot start stable epoch\")\n\t}\n\tprofile := normalizedProfile(request.Profile)\n\teconomicsBasis := \"modeled_input_rate_units\"\n\tvar warnings []string\n\tif !profile.EconomicsKnown {\n\t\teconomicsBasis = \"unavailable\"\n\t\twarnings = []string{\"cache_economics_unavailable\"}\n\t}\n\tresult, err := e.guard.StartNewEpoch(epochKey(request.Scope, request.Epoch, profile.ID), prefix)\n\tif err != nil {\n\t\treturn Plan{}, err\n\t}\n\treturn Plan{\n\t\tDecision:       DecisionNewEpoch,\n\t\tReason:         string(cacheguard.DecisionNewEpoch),\n\t\tProfileID:      profile.ID,\n\t\tMode:           profile.Mode,\n\t\tAttribution:    profile.Attribution,","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/engine.go#L224-L260","documentation":"The computed stable prefix for the new epoch contains content that cacheguard.DetectVolatile flags (timestamps, randomness, session-specific data). Freezing volatile content into a reused prefix would poison cache hits, so the epoch is refused.","triggerScenarios":"Thrown at cacheengine/engine.go:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or stabilize volatile segments (timestamps, unique IDs, nonces) from the front of the request","Move volatile content after the stable prefix segments"],"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"}