{"record":{"id":"8e13ca037e88ca77","repo":"JuliusBrussee/caveman","slug":"native-pack-invalid-core-budget-or-instructions","errorCode":null,"errorMessage":"native pack: invalid Core budget or instructions","messagePattern":"native pack: invalid Core budget or instructions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/nativepack/pack.go","lineNumber":96,"sourceCode":"\tfound := false\n\tfor _, skill := range pack.Skills {\n\t\tfor _, candidate := range skill.TaskTypes {\n\t\t\tif candidate == taskType {\n\t\t\t\tif !found || skill.Precedence > selected.Precedence {\n\t\t\t\t\tselected, found = skill, true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn selected, found\n}\n\nfunc validate(pack Pack) error {\n\tif pack.Schema != \"caveman.native-pack.v1\" || pack.ID == \"\" || pack.Version == \"\" || pack.Protocol < 1 {\n\t\treturn errors.New(\"native pack: invalid identity\")\n\t}\n\tif !pack.Core.Mandatory || pack.Core.Instructions == \"\" || pack.Core.EstimatedTokens > pack.Core.PromptTokenBudget {\n\t\treturn errors.New(\"native pack: invalid Core budget or instructions\")\n\t}\n\towners := map[string][]Skill{}\n\tids := map[string]bool{}\n\tfor _, skill := range pack.Skills {\n\t\tif skill.ID == \"\" || ids[skill.ID] || skill.Activation != \"classified\" || skill.Instructions == \"\" || len(skill.Instructions) > skill.PromptByteBudget {\n\t\t\treturn fmt.Errorf(\"native pack: invalid skill %q\", skill.ID)\n\t\t}\n\t\tids[skill.ID] = true\n\t\tfor _, taskType := range skill.TaskTypes {\n\t\t\towners[taskType] = append(owners[taskType], skill)\n\t\t}\n\t}\n\tfor _, skill := range pack.Skills {\n\t\tfor _, conflict := range skill.Conflicts {\n\t\t\tif !ids[conflict] {\n\t\t\t\treturn fmt.Errorf(\"native pack: %s conflicts with unknown skill %s\", skill.ID, conflict)\n\t\t\t}\n\t\t}","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/proxy/internal/nativepack/pack.go#L78-L114","documentation":"Native-pack Core section failed validation: Mandatory is false, Instructions is empty, or EstimatedTokens exceeds PromptTokenBudget. The Core block must be mandatory, carry instructions, and fit its declared token budget.","triggerScenarios":"Thrown at proxy/internal/nativepack/pack.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Mark core.mandatory true and provide core.instructions","Keep core.estimated_tokens ≤ core.prompt_token_budget, enlarging the budget or trimming instructions"],"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"}