Skip to main content

Module budget

Module budget 

Source
Expand description

Token budget allocation.

Given a budget and scored grains, decides which get full rendering and which are omitted entirely.

Two allocation strategies:

  • allocate() — pure priority-based allocation (70% threshold).
  • allocate_with_diversity() — reserves slots per grain type before filling by priority, ensuring rare types are not crowded out.

Structs§

ScoredEntry
A grain scored and measured for budget allocation.

Enums§

Allocation
Allocation decision for a single grain.

Functions§

allocate
Allocate budget across grains using priority-based allocation.
allocate_with_diversity
Allocate budget with grain type diversity floor.