{"record":{"id":"ea172fa700fb7be4","repo":"JuliusBrussee/caveman","slug":"native-pack-invalid-identity","errorCode":null,"errorMessage":"native pack: invalid identity","messagePattern":"native pack: invalid identity","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/nativepack/pack.go","lineNumber":93,"sourceCode":"\t}\n\ttaskType = strings.ToLower(strings.TrimSpace(taskType))\n\tvar selected Skill\n\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] {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/proxy/internal/nativepack/pack.go#L75-L111","documentation":"nativepack.validate enforces the pack's identity header: Schema must be exactly \"caveman.native-pack.v1\", ID and Version must be non-empty, and Protocol must be >= 1. Any deviation means the pack was built for a different schema generation or is malformed, and it is rejected before any skills are examined.","triggerScenarios":"Loading a pack JSON with a missing/misspelled schema string, empty id or version fields, protocol set to 0 or negative, or a pack authored for a future schema version.","commonSituations":"Hand-edited pack manifests with typos; pack produced by a newer/older tool version with a different schema id; packaging script that omits version; YAML-to-JSON conversion dropping fields.","solutions":["Set schema to exactly \"caveman.native-pack.v1\" and fill non-empty id and version","Set protocol to 1 (or the current protocol number) in the manifest","Regenerate the pack with the official packer for your runtime version instead of hand-writing it"],"exampleFix":"// before\npack := nativepack.Pack{Schema: \"caveman.nativepack.v1\", ID: \"\", Version: \"1.0\", Protocol: 0}\n\n// after\npack := nativepack.Pack{Schema: \"caveman.native-pack.v1\", ID: \"my-pack\", Version: \"1.0.0\", Protocol: 1}","handlingStrategy":"validation","validationCode":"if pack.Schema != \"caveman.native-pack.v1\" || pack.ID == \"\" || pack.Version == \"\" || pack.Protocol < 1 {\n    return errors.New(\"fix pack identity fields\")\n}\nerr := nativepack.Load(pack)","typeGuard":"func validPackIdentity(p nativepack.Pack) bool {\n    return p.Schema == \"caveman.native-pack.v1\" && p.ID != \"\" && p.Version != \"\" && p.Protocol >= 1\n}","tryCatchPattern":null,"preventionTips":["Generate packs with the official packer for your runtime version","Schema-lint pack manifests in CI (exact schema string, non-empty id/version, protocol >= 1)"],"tags":["nativepack","go","validation","manifest","schema"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}