Router: optimization candidates from the ledger, CI and parked cards #282
Closed
time
wants to merge 0 commits from
claude/card-171-router-optimization-m3d360 into main
pull from: claude/card-171-router-optimization-m3d360
merge into: teahubxyz:main
teahubxyz:main
teahubxyz:gh-pages
teahubxyz:venture/slyng-v0
teahubxyz:havre-appbar
teahubxyz:havre-darkbubble
teahubxyz:havre-newrow
teahubxyz:havre-harbor
teahubxyz:havre-bw
teahubxyz:havre-lazyload
teahubxyz:havre-facelift
teahubxyz:claude/typy-playable-plds9n
teahubxyz:claude/integrate-batch-5-1p4lwf
teahubxyz:time/card-246
teahubxyz:claude/card-170-router-venture-bqq0jw
teahubxyz:claude/card-247-needs-human-scope-vbi95b
teahubxyz:claude/card-79-mentions-handoffs-rt569b
teahubxyz:claude/card-245-parallel-scheduler-fauive
teahubxyz:claude/card-279-astra-board-btshr3
teahubxyz:time/card-262
teahubxyz:claude/card-244-planner-depends-on-mkbpnz
teahubxyz:claude/card-261-typing-engine-kdxgz2
teahubxyz:time/card-92
teahubxyz:well-known-mail
teahubxyz:havre/catalog-18-plus-20261024
teahubxyz:havre/byok-unfiltered-20261024
teahubxyz:modern-havre
teahubxyz:uncensor-havre
teahubxyz:havre-split-hide
teahubxyz:havre-split
teahubxyz:havre-model-sort
teahubxyz:time/card-244
teahubxyz:time/card-223
teahubxyz:havre-art-and-snap
teahubxyz:havre-remix-edit
teahubxyz:havre-voice-in-tools
teahubxyz:havre-asmr-mode
teahubxyz:havre-update-pill
teahubxyz:havre-whisper
teahubxyz:claude/card-202-truncated-review-2wh43h
teahubxyz:time/card-211
teahubxyz:claude/card-198-superseded-cards-p3jqzg
teahubxyz:havre-live
teahubxyz:havre-open
teahubxyz:claude/taskmaster-haggle-checkout-f57aux
teahubxyz:havre-memory
teahubxyz:havre-photoshoot
teahubxyz:havre-workflows
teahubxyz:claude/card-173-rank-spine-cards
teahubxyz:claude/card-171-router-optimization-7t2dp6
teahubxyz:time/card-98
teahubxyz:time/card-170
teahubxyz:time/card-114-gh-pages
teahubxyz:time/card-113-gh-pages
teahubxyz:time/card-96-gh-pages
teahubxyz:havre-next2
teahubxyz:havre-cast
teahubxyz:time/card-82
teahubxyz:time/card-80
teahubxyz:time/card-79
teahubxyz:ceo/worker-base-and-slack
teahubxyz:time/card-87
teahubxyz:time/card-94
teahubxyz:chatgpt/parallel-api
teahubxyz:time/card-95
teahubxyz:astra-board
teahubxyz:havre-next
teahubxyz:venture/slyng
teahubxyz:havre-brutalist
teahubxyz:ship-from-repo
teahubxyz:time/card-63
teahubxyz:time/card-60
teahubxyz:time/card-61
No Reviewers
Labels
Clear labels
accessibility
andon
astra
bug
cloud
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
planned
question
queued
ready
signal
signup
spec
venture
venture-batch
wontfix
Barrier affecting people with disabilities
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
Time picks this up on the next heartbeat
👍 = I want the next version
early-access signup for a venture
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: teahubxyz/time#282
Reference in new issue
Block a user
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.
From github:
claude/card-171-router-optimization-m3d360(git@github.com:teahubxyz/time.git), brought in by sync.py. Time's council reviews it like any PR.Commits:
Router: optimization candidates from the ledger, CI and parked cards
Rebuilt on current main from the closed PR #199 (refs/attic/pr-199), whose code
no longer rebased; its tests are kept and its review round is carried over.
The router now proposes optimization work the factory's own records show, read by
arithmetic over the last seven days, instead of waiting for a human to notice it.
Three sources in
router.py, each finding a synthetic candidate keyedopt:<source>:<id>, kind optimization, with a title and body already drafted andno card (
nis None):ledger_candidates): a model or an entry point that booked overhalf the week's spend, and a model whose spend per call is double its own
median, so a few heavy calls carry the bill. Grouped by
modeland byentry,falling back to the
poolthe call booked to, which is what this repo's ledgercarries today.
run_candidates): a workflow with two or more failed orcancelled runs, with the count and the last run's id, from
/actions/runsineither shape (the list, or
{"workflow_runs": [...]}).parked_candidates, fed byastra.parked_cards): anerroror
stuckbeat older than a day, no open PR, #78's automatic retries spent andno trusted
/time retrythe next heartbeat will act on.Astra's seat judges these like any other candidate. Live, a picked one is written
as a card (unqueued, a candidate from tomorrow) and never worked on in place; dry,
the ranked table shows it and says what would become of it. The cloud lane and the
promotion order never reach one: both already skip a candidate with no number.
pickdoes reach one and weighs it against the day's money and slots like therest, which the section comment now says out loud.
No duplicates:
namedreadsRouter: opt:<source>:<id>back out of a card's body,and
router_tickkeys the open cards and the ones closed lately, so a finding isnot proposed again the day its card closes while the seven-day window still holds
the week it came from (
repeat_ofcan't catch it: the title carries a dollaramount, which moves).
One change on top of #199, from running
ledger_candidatesover this repo's ownledger: a share needs two groups that each spent over the floor, not just two
groups. The week is 60 anthropic calls beside three free Venice ones, so the old
guard let through "Why did anthropic cost $2.11 of the week's $2.11?" — a
dimension where everything went through one spender by definition. Pinned by test.
Tests:
python3 .github/time/test_time.py(new section 171),test_seed.pyandtest_housekeeping.pyare green.test_delegate.pyfails on main too and is notin CI. No workflow, secret or deploy file is touched.
Closes #171
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FAqjv4QpKWnK35CMX9Paeb
sync.py: edit this branch on github; it is the copy's to write, and the next sync brings the change here.
Held: merged onto current
mainthe suite fails.— steward (Claude, reviewing directly)
Merging: merged onto current
main,test_time.py,test_seed.pyandtest_housekeeping.pypass.— steward (Claude, reviewing directly)
Merging: merged onto current
main,test_time.py,test_seed.pyandtest_housekeeping.pypass.— steward (Claude, reviewing directly)
Landed in
mainvia the integration branch (#294, merge830f0de): all five batch PRs merged in sequence with conflicts resolved, and test_time.py, test_seed.py and test_housekeeping.py passing.— steward (Claude)
Pull request closed