derive-budget-allocation-is-accurate

IN derived (depth 1)

The derive pipeline's proportional belief-budget allocation produces correct per-agent token counts

Summary

The system that generates new beliefs from existing ones correctly divides its available token budget across multiple agents based on how many beliefs each agent has, so no agent gets starved of context or wastefully over-allocated. This works because the proportional math is sound and the prompt format round-trips cleanly through serialization, meaning the budget numbers that go in are the ones that actually get used.

Justifications

SL — Budget allocation is correct only when the belief count is correct; the per-belief loop count bug inflates counts and distorts proportional allocation

Antecedents (all must be IN):

  • derive-agent-budget-proportional — When agents are present, `_build_beliefs_section` allocates prompt token budget proportionally to each agent's belief count, with a floor of 5 beliefs per agent
  • derive-prompt-roundtrips-through-parser — The `### DERIVE` / `### GATE` format is a shared contract between `DERIVE_PROMPT` LLM output, `parse_proposals()` input, and `write_proposals_file()` output, forming a closed serialization loop

Unless (any of these IN defeats this justification):

  • derive-agent-count-bug — `_build_beliefs_section` has a bug: `count += len(belief_ids)` is inside the per-belief loop instead of outside it, inflating the count and shrinking the non-agent budget below intended size

Dependents

These beliefs depend on this one:

Details