Router: money left is the worker pool's allowance; no repeat cards #181

Merged
teahubxyz merged 3 commits from router-money-left into main 2026-10-19 13:44:30 +00:00
Owner

Closes #175.

Before the router goes live, from reading its two dry rankings (Astra log, 01:02 and 13:14 UTC):

  • Money left (#175). router_tick gave router.pick TIME_DAILY_USD minus today's spend ($15 cap). Since #174, Claude calls answer to the anthropic-credits pool, about $8.07/day, so live mode would queue against money the worker can't spend. New money_left(): the allowance left in the pool that takes TIME_WORKER's route (as budget_check sees it), else the daily cap's remainder; either way capped by what's left of the month. The Astra header and the seat's prompt show the figure and its source.
  • Repeat cards. Both dry runs proposed a new housekeeping card ("never filter on a label that doesn't exist"), which is #137, landed yesterday as #138. Live, that would become a card a worker rebuilds. The seat now gets the cards closed in the last 14 days with "don't write these again", and the prompt says so. As a code backstop, a proposed title equal to an open or lately closed card's title, or containing it or contained in it (four words or more), is not written; the log lists it under "Not written". It's deliberately not a similarity score: sibling cards ("Tool: havre_check" / "Tool: havre_new", the three SKILL.md cards) share most of their words and scored ≥0.8.

Tests (80): pool allowance minus spend; the month's remainder caps it; no pool → daily cap; Cursor worker → daily cap; live with $0.50 left queues the S and skips the M; the closed list reaches the prompt; repeats are dropped, siblings aren't; an unreadable closed list is empty. test_time.py all green locally (23 sections).

🤖 Generated with Claude Code

https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD

Closes #175. Before the router goes live, from reading its two dry rankings (Astra log, 01:02 and 13:14 UTC): - **Money left (#175).** `router_tick` gave `router.pick` `TIME_DAILY_USD` minus today's spend ($15 cap). Since #174, Claude calls answer to the `anthropic-credits` pool, about $8.07/day, so live mode would queue against money the worker can't spend. New `money_left()`: the allowance left in the pool that takes `TIME_WORKER`'s route (as `budget_check` sees it), else the daily cap's remainder; either way capped by what's left of the month. The Astra header and the seat's prompt show the figure and its source. - **Repeat cards.** Both dry runs proposed a new housekeeping card ("never filter on a label that doesn't exist"), which is #137, landed yesterday as #138. Live, that would become a card a worker rebuilds. The seat now gets the cards closed in the last 14 days with "don't write these again", and the prompt says so. As a code backstop, a proposed title equal to an open or lately closed card's title, or containing it or contained in it (four words or more), is not written; the log lists it under "Not written". It's deliberately not a similarity score: sibling cards ("Tool: havre_check" / "Tool: havre_new", the three SKILL.md cards) share most of their words and scored ≥0.8. Tests (80): pool allowance minus spend; the month's remainder caps it; no pool → daily cap; Cursor worker → daily cap; live with $0.50 left queues the S and skips the M; the closed list reaches the prompt; repeats are dropped, siblings aren't; an unreadable closed list is empty. `test_time.py` all green locally (23 sections). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
teahubxyz added 3 commits 2026-10-19 13:42:57 +00:00
teahubxyz merged commit 805e20d695 into main 2026-10-19 13:44:30 +00:00
teahubxyz referenced this issue from a commit 2026-10-19 13:48:28 +00:00
Sign in to join this conversation.