The owner, this morning: the budget should factor in the usage pool.
Daily pacing already follows anthropic-credits ($161.49 as of 10-19, lapses 11-08, about $8.07/day). But the $100 monthly cap counted every dollar, including what the credit pays. At $43 now and about $8/day it would trip around Oct 26, flip TIME_MODE to dry-run and stop the factory for five days, with credit left to lapse.
time.py
New credit_covered(month): per expiring pool, what its routes booked from as_of until resets_at within the month, capped at the balance it still had at the month's start.
budget()'s month is now spend minus that, so the monthly cap guards the owner's own money.
Not covered: spend before as_of (the balance was read after it), spend past the balance or after the lapse, and routes without a pool. Those count as before. With no pools, nothing changes.
The refusal message, andon title and doctor row say "out of pocket".
astra.py: the seat's spend line says "out of pocket (credit-paid spend excluded)".
Tests (82):
credit-paid spend is left out and a no-pool route isn't;
past the balance, spend is the owner's money again and the cap refuses;
spend from before as_of isn't covered;
lapsed credit covers nothing;
window and balance pools aren't prepaid;
no pools behaves as before.
The run-cap test (55) matches the new wording.
Against the real ledger: October $42.99 booked, $4.49 credit-covered since 10-19, out-of-pocket $38.51. The $38.51 before as_of is counted conservatively, though the grant probably paid it too. That leaves $61.49 of headroom, so the pool's own pacing governs.
Risk: if the ledger's estimates run below Anthropic's real billing, the credit runs out sooner than the ledger thinks, and some spend would go uncounted until the operator refreshes balance_usd / as_of in time/pools.json. The gap is bounded by how far the estimates are off.
test_time.py all green locally on current main (24 sections).
The owner, this morning: the budget should factor in the usage pool.
Daily pacing already follows `anthropic-credits` ($161.49 as of 10-19, lapses 11-08, about $8.07/day). But the $100 monthly cap counted every dollar, including what the credit pays. At $43 now and about $8/day it would trip around Oct 26, flip `TIME_MODE` to dry-run and stop the factory for five days, with credit left to lapse.
- `time.py`
- New `credit_covered(month)`: per `expiring` pool, what its routes booked from `as_of` until `resets_at` within the month, capped at the balance it still had at the month's start.
- `budget()`'s month is now spend minus that, so the monthly cap guards the owner's own money.
- Not covered: spend before `as_of` (the balance was read after it), spend past the balance or after the lapse, and routes without a pool. Those count as before. With no pools, nothing changes.
- The refusal message, andon title and `doctor` row say "out of pocket".
- `astra.py`: the seat's spend line says "out of pocket (credit-paid spend excluded)".
- Tests (82):
- credit-paid spend is left out and a no-pool route isn't;
- past the balance, spend is the owner's money again and the cap refuses;
- spend from before `as_of` isn't covered;
- lapsed credit covers nothing;
- window and `balance` pools aren't prepaid;
- no pools behaves as before.
- The run-cap test (55) matches the new wording.
Against the real ledger: October $42.99 booked, $4.49 credit-covered since 10-19, out-of-pocket $38.51. The $38.51 before `as_of` is counted conservatively, though the grant probably paid it too. That leaves $61.49 of headroom, so the pool's own pacing governs.
Risk: if the ledger's estimates run below Anthropic's real billing, the credit runs out sooner than the ledger thinks, and some spend would go uncounted until the operator refreshes `balance_usd` / `as_of` in `time/pools.json`. The gap is bounded by how far the estimates are off.
`test_time.py` all green locally on current main (24 sections).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The owner, this morning: the budget should factor in the usage pool.
Daily pacing already follows
anthropic-credits($161.49 as of 10-19, lapses 11-08, about $8.07/day). But the $100 monthly cap counted every dollar, including what the credit pays. At $43 now and about $8/day it would trip around Oct 26, flipTIME_MODEto dry-run and stop the factory for five days, with credit left to lapse.time.pycredit_covered(month): perexpiringpool, what its routes booked fromas_ofuntilresets_atwithin the month, capped at the balance it still had at the month's start.budget()'s month is now spend minus that, so the monthly cap guards the owner's own money.as_of(the balance was read after it), spend past the balance or after the lapse, and routes without a pool. Those count as before. With no pools, nothing changes.doctorrow say "out of pocket".astra.py: the seat's spend line says "out of pocket (credit-paid spend excluded)".as_ofisn't covered;balancepools aren't prepaid;Against the real ledger: October $42.99 booked, $4.49 credit-covered since 10-19, out-of-pocket $38.51. The $38.51 before
as_ofis counted conservatively, though the grant probably paid it too. That leaves $61.49 of headroom, so the pool's own pacing governs.Risk: if the ledger's estimates run below Anthropic's real billing, the credit runs out sooner than the ledger thinks, and some spend would go uncounted until the operator refreshes
balance_usd/as_ofintime/pools.json. The gap is bounded by how far the estimates are off.test_time.pyall green locally on current main (24 sections).🤖 Generated with Claude Code
https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD