JuliusBrussee/caveman · error

native pack: invalid Core budget or instructions

Error message

native pack: invalid Core budget or instructions

What it means

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.

Solutions

  1. Mark core.mandatory true and provide core.instructions
  2. Keep core.estimated_tokens ≤ core.prompt_token_budget, enlarging the budget or trimming instructions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/internal/nativepack/pack.go:96 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/8e13ca037e88ca77. Report an issue: GitHub.

Appendix: source

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

	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] {
				return fmt.Errorf("native pack: %s conflicts with unknown skill %s", skill.ID, conflict)
			}
		}

View on GitHub (pinned to 766dce6b13)