derive-budget-count-is-linear

IN premise

Agent belief counting in `_build_beliefs_section` accumulates as N (number of beliefs shown per agent), not N² — the corrected behavior after the issue #23 fix where `count += len(belief_ids)` was moved outside the per-belief loop

Summary

The code that counts how many beliefs each agent has displayed works in straightforward linear time, adding up the count once per batch rather than once per individual item inside a nested loop. This matters because the old quadratic behavior before the fix could have caused incorrect budget tracking, potentially showing too many or too few beliefs per agent in the output.

Dependents

These beliefs depend on this one:

Details

Sourceentries/2026/04/29/tests-test_derive_budget.md