JuliusBrussee/caveman · error

native pack: invalid identity

Error message

native pack: invalid identity

What it means

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.

Source

Thrown at proxy/internal/nativepack/pack.go:93

	}
	taskType = strings.ToLower(strings.TrimSpace(taskType))
	var selected Skill
	found := false
	for _, skill := range pack.Skills {
		for _, candidate := range skill.TaskTypes {
			if candidate == taskType {
				if !found || skill.Precedence > selected.Precedence {
					selected, found = skill, true
				}
			}
		}
	}
	return selected, found
}

func validate(pack Pack) error {
	if pack.Schema != "caveman.native-pack.v1" || pack.ID == "" || pack.Version == "" || pack.Protocol < 1 {
		return errors.New("native pack: invalid identity")
	}
	if !pack.Core.Mandatory || pack.Core.Instructions == "" || pack.Core.EstimatedTokens > pack.Core.PromptTokenBudget {
		return errors.New("native pack: invalid Core budget or instructions")
	}
	owners := map[string][]Skill{}
	ids := map[string]bool{}
	for _, skill := range pack.Skills {
		if skill.ID == "" || ids[skill.ID] || skill.Activation != "classified" || skill.Instructions == "" || len(skill.Instructions) > skill.PromptByteBudget {
			return fmt.Errorf("native pack: invalid skill %q", skill.ID)
		}
		ids[skill.ID] = true
		for _, taskType := range skill.TaskTypes {
			owners[taskType] = append(owners[taskType], skill)
		}
	}
	for _, skill := range pack.Skills {
		for _, conflict := range skill.Conflicts {
			if !ids[conflict] {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Set schema to exactly "caveman.native-pack.v1" and fill non-empty id and version
  2. Set protocol to 1 (or the current protocol number) in the manifest
  3. Regenerate the pack with the official packer for your runtime version instead of hand-writing it

Example fix

// before
pack := nativepack.Pack{Schema: "caveman.nativepack.v1", ID: "", Version: "1.0", Protocol: 0}

// after
pack := nativepack.Pack{Schema: "caveman.native-pack.v1", ID: "my-pack", Version: "1.0.0", Protocol: 1}
Defensive patterns

Strategy: validation

Validate before calling

if pack.Schema != "caveman.native-pack.v1" || pack.ID == "" || pack.Version == "" || pack.Protocol < 1 {
    return errors.New("fix pack identity fields")
}
err := nativepack.Load(pack)

Type guard

func validPackIdentity(p nativepack.Pack) bool {
    return p.Schema == "caveman.native-pack.v1" && p.ID != "" && p.Version != "" && p.Protocol >= 1
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/ea172fa700fb7be4. Report an issue: GitHub.