{"record":{"id":"7258c45cf299afd0","repo":"JuliusBrussee/caveman","slug":"required-session-value-feature-q-unavailable","errorCode":null,"errorMessage":"required session-value feature %q unavailable","messagePattern":"required session-value feature %q unavailable","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/routing/session_value.go","lineNumber":419,"sourceCode":"\t\t\treturn SessionValuePrediction{}, errors.New(\"session-value prediction non-finite\")\n\t\t}\n\t}\n\treturn prediction, nil\n}\n\nfunc sessionValueVector(specs []SessionValueFeatureSpec, state map[string]SessionValueFeatureValue) ([]float64, []float64, error) {\n\tfor name := range state {\n\t\tif _, known := sessionValueFeatureVocabulary[name]; !known {\n\t\t\treturn nil, nil, fmt.Errorf(\"unknown session-value feature %q\", name)\n\t\t}\n\t}\n\tvalues := make([]float64, len(specs))\n\tmissing := make([]float64, len(specs))\n\tfor i, spec := range specs {\n\t\tfeature, present := state[spec.Name]\n\t\tif !present || !feature.Available {\n\t\t\tif spec.Required {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"required session-value feature %q unavailable\", spec.Name)\n\t\t\t}\n\t\t\tmissing[i] = 1\n\t\t\tcontinue\n\t\t}\n\t\tif !finite(feature.Value) || feature.Value < spec.Min || feature.Value > spec.Max {\n\t\t\treturn nil, nil, fmt.Errorf(\"session-value feature %q outside artifact bounds\", spec.Name)\n\t\t}\n\t\tvalues[i] = (feature.Value - spec.Mean) / spec.Scale\n\t}\n\treturn values, missing, nil\n}\n\nfunc sessionValueEligibilityReason(features Features, candidate Candidate, baselineUnit float64, policy FrontierPolicy) string {\n\tif candidate.Provider == \"\" || candidate.Model == \"\" || unitPrice(candidate.Price) <= 0 {\n\t\treturn \"unpriced_or_invalid_candidate\"\n\t}\n\tif !policy.AllowCrossProvider && candidate.Provider != features.Provider {\n\t\treturn \"cross_provider_disabled\"","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/proxy/routing/session_value.go#L401-L437","documentation":"sessionValueVector found a feature marked Required in the artifact's specs that is either absent from the state map or present with Available=false. The model cannot impute required features (only optional ones get synthesized missing-values), so prediction fails closed rather than silently degrading.","triggerScenarios":"Thrown at proxy/routing/session_value.go:419 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the feature extractor populates all required features and marks them Available before calling prediction","If the feature genuinely can be absent, regenerate the artifact with that feature marked optional"],"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-14T00:17:10.932Z"}