Commit Graph
202 Commits
Author SHA1 Message Date
Claude 31f382d0e9 Router: answer haiku's review of the optimization candidates
ci / test (pull_request) Successful in 44s
heartbeat / tick (pull_request_review) Successful in 10s
Two of the four points hold and are fixed; two don't, and nothing changed for
them. The review was read from the diff alone, and the two it gets wrong are
both about code the diff doesn't carry.

**The cloud lane (holds as a test, not as a bug).** `pick_cloud` already skips a
candidate with no card: `router.py:333` reads `if r["n"] is not None and
r["actionable"] and ...`, and so does `order()` at `router.py:357`. Both guards
came with the cloud lane in #197, for `venture:new`, which has `n: None` for the
same reason an `opt:` candidate does; this card added a second kind of cardless
candidate and inherited them. So `tm.label(None, "cloud")` cannot happen and the
table cannot say "to the cloud today" for an `opt:` row. No code changed. The
test the review asks for is worth having and is now there: an `opt:` candidate
judged value 5 ranks first (3.75 against 0.765) under `per_day: 2, sizes:
["S", "M"]`, and the cloud lane takes only the real card behind it. Dropping
the `n is not None` from `pick_cloud` fails it.

**The parked window (holds as wording only).** The arithmetic is already what
the review proposes. `_recent(at, today, 1)` is `at >= today - 1 day`, and a
parked card is a candidate when that is false, i.e. when `at < today - 1 day` —
the review's own suggested fix. In whole days that is "parked the day before
yesterday or earlier", which is what "older than a day" means at day
granularity, so the threshold matches the card. What was wrong was the
docstring's "nor is one parked only today": it also holds back one parked
yesterday. `parked_candidates` now says so, and the boundary is pinned by test
(0 and 1 days yield nothing, 2 yields the candidate). No code changed.

**A closed card no longer lets its source come back (fixed).** This was real.
`named` was given only the open cards, so the day an optimization card closed
the same finding was proposed again — the ledger's window is seven days and
outlives the card written about it, and `repeat_of` cannot catch it because the
title carries the dollar amount, which moves. `router_tick` now keys the cards
closed lately too (`named(open_issues + closed)`; `closed_lately()` moved above
the candidate gathering, no extra call). Suppression lasts as long as
`closed_lately`'s fortnight, by which time the seven-day window no longer holds
the week the card was about, so a finding that is still true comes back as a
fresh question rather than never.

**`parked_cards` ignored a human retry (fixed).** The fourth point arrived
truncated at "astra.py, `parked_c", so I audited the function instead of
guessing at it, and it had a gap of its own: it checked #78's automatic retries
but not `/time retry`. The heartbeat clears a parked card's `last` for either
one (`time.py:1613` for the typed retry, `time.py:1622` for the automatic), so a
card someone trusted had already asked to retry was still proposed as "retry or
split #N" — a card for work the next heartbeat was about to do. It now skips
those, reusing `tm.retry_requested` so the rule is the heartbeat's, and the
tests cover the three cases that distinguish it: a trusted retry after the beat
holds the card back, a stranger's does not, and neither does one older than the
beat it would answer.

Audited and left alone: `open_pr` stays on `linked_prs`, not `adoptable`. It
looks like the broader check, but a card whose last beat is `error` is never
adopted (`time.py:1637` adopts only from `None`/`needs-done`/`would-dispatch`),
so a `PR: #N` line on a parked card does not put it in the review path, and
using `adoptable` would have hidden a genuinely stuck card. `linked_prs` is also
exactly what the heartbeat uses for this same decision at `time.py:1622`.

`python3 .github/time/test_time.py`, `test_seed.py` and `test_housekeeping.py`
are green. Each fix fails its new check when reverted.

Closes #171

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqK2e5z4sMp2BKghDt1D8w
2026-10-19 22:10:29 +00:00
Claude cf38e08677 Router: optimization candidates from the ledger, CI and parked cards
ci / test (pull_request) Successful in 45s
heartbeat / tick (pull_request_review) Successful in 22s
The router only ranked work someone had written a card for, so optimization
showed up only when a human noticed it. It now reads three of the factory's own
records over the last seven days and proposes the rest itself, deterministically.

router.py, one synthetic candidate per finding (`opt:<source>:<id>`, kind
optimization, no card yet, a drafted title and body that carries its own key and
a `DONE:` line):

- `ledger_candidates`: the week's spend grouped by model and by entry point (a
  line's `entry` where it has one, else `pool`, the route it booked to). A group
  that took over half the bill is a candidate, where there is a second group in
  that dimension to compare it with; so is a model whose spend per call is double
  its own median, which is a few heavy calls behind a cheap average. Pennies
  (under $0.25 a week) are left alone and one group yields at most one candidate.
- `run_candidates`: Actions runs as `/actions/runs` gives them (the shape
  `tea_actions` reads: the list, or `workflow_runs`). A workflow with two or more
  failed or cancelled runs in the window is a candidate, with the failure count
  and the last run's id.
- `parked_candidates`: a card parked by an `error` or `stuck` beat older than a
  day, with no open PR and #78's automatic retries spent ("retry or split #N").
  One Time will still retry on its own is left to it.
- `named` / `opt_candidates`: a source an open card already names (`Router:
  opt:<source>:<id>` in the body) is not proposed again.

astra.py gathers the three sources (`ledger_week`, `action_runs`, `parked_cards`;
each is context, so unreadable means no candidates from it, never a failed run)
and the seat judges them like any other candidate. Live, a picked one is written
as a card, unqueued and a candidate from tomorrow, and is never worked on in
place; dry, the ranked table shows it as "would be written as a card". The log
line and the beat's `opt` say which source became which card.

Tests (test_time.py section 171): a ledger with one dominant route yields one
candidate, and so does the entry-point dimension, the median rule, pennies, a
single group and a stale window; two failed runs of one workflow yield one
candidate with its count and last run id; a parked card yields one unless it has
an open PR, retries left or was parked today; a source an open card names yields
none; Astra live writes the card unqueued while dry writes nothing.

Closes #171

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzRXxLDJF4YDoZgzSsbW24
2026-10-19 17:03:18 +00:00
teahubxyzandClaude Opus 5.5 1a2ae6bc7e The cloud lane: cloud sessions build cards on the cloud-session credit (#197)
ci / test (push) Successful in 45s
sync / sync (push) Successful in 5s
The cloud lane: cloud sessions build cards on the cloud-session credit (#197)

Astra labels the best M cards `cloud` (up to 3 in the lane); the launcher on hb-5 starts a claude --cloud session per card on the GitHub copy; sync brings the branch home as a PR that closes the card and moves it cloud -> ready; the heartbeat adopts and the council lands it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 16:46:15 +00:00
time 608510afde ledger: 14 calls, $0.09 2026-10-19 16:15:24 +00:00
time 89070f46a4 Scaffold the Havre MCP server (walking skeleton) (#195)
time/worker-run cd havre && npm ci >/dev/null 2>&1; cd node_modules/@modelcontextprotocol/sdk && sed -n 20,60p dist/
ci / test (push) Successful in 42s
sync / sync (push) Successful in 5s
Co-authored-by: Time <time@users.noreply.teahub.xyz>
2026-10-19 16:14:10 +00:00
time 26f64e2f00 ledger: 1 calls, $0.00 2026-10-19 16:14:01 +00:00
time 73d6995df3 ledger: 34 calls, $0.87 2026-10-19 16:12:20 +00:00
teahubxyzandClaude Opus 5.5 7e7d2d569d Budget: the monthly cap counts out-of-pocket money; credit is limited by its pool (#193)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 5s
time/worker-run sed -n 845,885p .github/time/test_time.py; tail -5 .github/time/test_time.py
Budget: the monthly cap counts out-of-pocket money; credit is limited by its pool (#193)

credit_covered(): what an expiring pool's prepaid credit paid this month, within its balance and before it lapses, is left out of the month TIME_MONTHLY_USD caps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 16:03:08 +00:00
time 5b1843521f ledger: 36 calls, $0.51 2026-10-19 15:12:24 +00:00
time 7156f0023c Time updates a PR branch that fell behind its base; a conflict goes to the worker as a revision (#190)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 5s
Co-authored-by: Time <time@users.noreply.teahub.xyz>
2026-10-19 15:11:37 +00:00
time 5aefa807be ledger: 47 calls, $0.93
time/worker-run git branch -a; git ls-tree -r --name-only origin/gh-pages 2>&1 | grep -i havre | head; ls; ls ventur
2026-10-19 14:13:57 +00:00
time 815649f59f ledger: 15 calls, $0.24
time/worker-run cd .github/time; cat > /tmp/p.py <<'EOF' import re p = ".github/time/time.py" s = open(p).read() #
2026-10-19 13:57:46 +00:00
teahubxyzandClaude Opus 5.5 bc1da90c33 Router: a card that waits is never picked; Astra gets TIME_WORKER (#185)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 4s
Router: a card that waits is never picked; Astra gets TIME_WORKER (#185)

An open Depends on #N, or the seat's blocked note, keeps a card out of the picks and after the movable cards in the promotion order. astra.yml passes TIME_WORKER and TIME_PACE.

Closes #184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 13:55:03 +00:00
time 8fdb2f9469 ledger: 1 calls, $0.18 2026-10-19 13:50:29 +00:00
teahubxyzandClaude Opus 5.5 5a0ffcfee6 router: live
ci / test (push) Successful in 37s
sync / sync (push) Successful in 4s
Two dry rankings (2026-10-19 01:02 and 13:14 UTC) put the right cards on top (#135, #175), dropped blocked #84 once it was known stale, and kept L cards out. The two gaps they showed are fixed: money left is the worker's pool (#181, closes #175) and repeat cards aren't written (#181); the stall that kept promotion from happening at all is fixed (#183, closes #135).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 13:48:28 +00:00
teahubxyzandClaude Opus 5.5 32943339e1 promote_next counts only moving cards: one waiting on a person holds no ready slot (#183)
sync / sync (push) Canceled after 0s
ci / test (push) Successful in 36s
promote_next counts only moving cards: one waiting on a person holds no ready slot (#183)

Closes #135.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 13:47:55 +00:00
teahubxyzandClaude Opus 5.5 d235afb7f3 Housekeeping: a null page is an empty one (#182)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 4s
Housekeeping: a null page is an empty one (#182)

Gitea answers an issue nobody reacted to with null; the signal step failed on it today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 13:47:24 +00:00
teahubxyzandClaude Opus 5.5 805e20d695 Router: money left is the worker pool's allowance; no repeat cards (#181)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 4s
Router: money left is the worker pool's allowance; no repeat cards (#181)

money_left(): the allowance left in the pool that takes TIME_WORKER's route, else the daily cap's remainder, capped by the month's. The seat sees cards closed in the last 14 days; a new card repeating an open or lately closed one is not written.

Closes #175.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 13:44:30 +00:00
time 2efe67c9a9 ledger: 1 calls, $0.16 2026-10-19 13:14:08 +00:00
teahubxyzandClaude Opus 5.5 745231844f sync: secret names Gitea accepts (SYNC_GITHUB_KEY, SYNC_GITHUB_TOKEN) (#179)
ci / test (push) Successful in 36s
sync / sync (push) Successful in 4s
sync: secret names Gitea accepts (SYNC_GITHUB_KEY, SYNC_GITHUB_TOKEN) (#179)

Gitea refuses secret names starting GITHUB_ or GITEA_, so the GitHub copy's deploy key is in SYNC_GITHUB_KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 04:03:20 +00:00
teahubxyzandClaude Opus 5.5 e34994bbc6 Sync: the GitHub copy over SSH with a deploy key (host keys pinned) (#178)
ci / test (push) Successful in 35s
sync / sync (push) Successful in 2s
Sync: the GitHub copy over SSH with a deploy key, host keys pinned (#178)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 03:33:59 +00:00
teahubxyzandClaude Opus 5.5 ab3c5f5200 Sync: a repo's copies on other forges follow its home (GitHub first, for cloud sessions) (#177)
ci / test (push) Successful in 36s
sync / sync (push) Successful in 3s
Sync: a repo's copies on other forges follow its home (#177)

sync.py + time/sync.json + the sync workflow. One home per repo, one writer per branch: main goes out to every copy
fast-forward only (a diverged copy is a needs-human issue, never overwritten, unless forced once); a copy's claude/*
branches come home as PRs for the council. First copy: github.com/teahubxyz/time, skipped until GITHUB_MIRROR_TOKEN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 03:18:50 +00:00
time 896fd3c872 ledger: 1 calls, $0.00 2026-10-19 03:07:58 +00:00
time 17c2fa0377 ledger: 35 calls, $1.72 2026-10-19 02:21:30 +00:00
teahubxyzandClaude Opus 5.5 b7bd03c6fd pools: pace Claude spend to the Anthropic credit ($161.49 left on 2026-10-19, lapses 2026-11-08)
ci / test (push) Successful in 36s
time/worker-run cd .github/time; grep -n "stuck_h =\|auto_max =\|TIME_AUTO_RETRY" time.py | head | cut -c1-220; sed
The owner's credit: $200 granted 2026-10-13, $162.22 left on the 18th by the console, expiring 2026-11-08. The ledger
books $38.51 of Claude spend since the grant, so $161.49 as of the 19th. Paced over the 20 days left that is about
$8/day for the anthropic route; the $100 monthly cap stays hard and binds first in October.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 01:10:37 +00:00
teahubxyzandClaude Opus 5.5 ec043b2985 Adaptive budget: pace spend to each capacity pool (re-cut of #167 onto main) (#174)
ci / test (push) Successful in 36s
Adaptive budget: pace spend to each capacity pool (#174, re-cut of #167)

The worker's #82 change (sonnet via Time): budget_check(route) paces each call to its capacity pool in
time/pools.json (expiring credit spread over the days left, refilling windows, or TIME_DAILY_USD without a pool);
the monthly cap stays hard. pools.json is read through the API once per run, since every workflow checks out only
.github/time. Ships empty: nothing changes until it is filled in. Closes #82.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 01:10:09 +00:00
time 463a6fecbb ledger: 1 calls, $0.00 2026-10-19 01:07:54 +00:00
time 0fdce2c58f ledger: 1 calls, $0.18 2026-10-19 01:02:01 +00:00
teahubxyzandClaude Opus 5.5 b8d52252f4 Router v1: the factory ranks its own next work (dry to start) (#169)
ci / test (push) Successful in 34s
Router v1: the factory ranks its own next work, dry to start (#169)

Astra's seat judges every candidate (kind, value, size); router.py ranks them with the owner's weights per kind
(time/router.json), a restless boost and card age. dry posts the table; live queues from the top within the day's
money and the heartbeat promotes queued cards in ranked order. Astra reads the last 14 days of its log. Closes #168.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-19 01:00:17 +00:00
time b8041955ab ledger: 19 calls, $0.55 2026-10-19 00:10:39 +00:00
teahubxyz 3d1865ecb9 Signups count by the venture's name, not only its slug (#159)
ci / test (push) Successful in 35s
Co-authored-by: teahubxyz <boring+teahub@agentmail.to>
2026-10-19 00:10:37 +00:00
time ef00a80f7f ledger: 1 calls, $0.00 2026-10-19 00:07:41 +00:00
teahubxyzandClaude Opus 5.5 97e3e1f35f venture: the lead (opus) researches and picks the day's venture alone; fable is out (#164)
ci / test (push) Successful in 35s
venture: the lead (opus) researches and picks the day's venture alone; fable is out (#164)

One seat, TIME_VENTURE_LEAD (opus), runs the day's venture: a research round over the top trending repos (with the
start of their READMEs) and the studio's track record, TIME_VENTURE_FIELD candidates with a verdict each, one pick;
no pitches, no vote. It writes the launch plan alone and judges the build, and hands the launch drafts to its helper
(TIME_VENTURE_HELPER, sonnet). The chair and judge default to opus. Batches keep the board; TIME_VENTURE_LEAD=board
brings it back for the daily venture. Closes #165.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-18 22:11:50 +00:00
teahubxyzandClaude Opus 5.5 c268e75234 venture: one venture a day, built for quality (#162)
ci / test (push) Successful in 34s
venture: one venture a day, built for quality (#162)

The day's card starts only once every other venture card is launched or held; the board picks one from a field of
TIME_VENTURE_FIELD (6) pitches; opus builds; the judge scores the product 1-10 and a page under TIME_VENTURE_BAR (8)
gets polish rounds (never the last of TIME_VENTURE_FIXES=3), then launches with its score. An open batch card with
no Time beats no longer starts a batch while batches are off. Closes #163.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-18 22:04:49 +00:00
teahubxyzandClaude Opus 5.5 e6f04f614a venture.yml: install Chromium for the browser pass (#157)
ci / test (push) Successful in 35s
venture.yml: install Chromium for the browser pass (#157)

The first Claude ventures launched without the browser pass (no Chrome on the runner): no headless checks, no
contact sheet for the portfolio. One step installs Chromium in the job image; venture.py's chrome() finds it.
Merged on the owner's word, CI green (run 1014).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-18 19:46:19 +00:00
time 4512c59c8f ledger: 10 calls, $0.75 2026-10-18 18:32:22 +00:00
time 3f81c2cfa9 ledger: 37 calls, $3.43 2026-10-18 18:17:46 +00:00
time facd11d390 ledger: 2 calls, $0.01 2026-10-18 17:52:37 +00:00
teahubxyz f329066a51 Worker: a cut-off tool call is an error the worker reads, not a crash (#155)
ci / test (push) Successful in 35s
Co-authored-by: teahubxyz <boring+teahub@agentmail.to>
2026-10-18 17:52:36 +00:00
time a7c92b6497 ledger: 27 calls, $0.72 2026-10-18 17:52:02 +00:00
time 80f21b58ea ledger: 45 calls, $3.17
time/worker-run cat > /tmp/patch.py <<'EOF' import re p = ".github/time/time.py" s = open(p).read() def sub(old, new
2026-10-18 17:46:45 +00:00
teahubxyzandClaude Opus 5.5 8fe83ac05a venture.yml: every 6 hours, Claude seats (#141)
ci / test (push) Successful in 35s
venture.yml: every 6 hours, Claude seats (#141)

Owner's call: the venture loop runs every 6 hours instead of every 20 minutes, on the Claude seats.
The builder is vars.TIME_VENTURE_WORKER || claude:sonnet, decoupled from the heartbeat's worker.
Merged on the owner's word after the council approved the engine half (#140).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
2026-10-18 17:25:59 +00:00
teahubxyz ebedc7a5bc Venture loop on Teahub with Claude seats (#140)
ci / test (push) Successful in 35s
Co-authored-by: teahubxyz <boring+teahub@agentmail.to>
2026-10-18 17:24:35 +00:00
teahubxyz 8ab719e2f2 Ponytail on prod: seat workers carry its rules (#145)
ci / test (push) Successful in 36s
Co-authored-by: teahubxyz <boring+teahub@agentmail.to>
2026-10-18 17:24:33 +00:00
time 4b521f7a86 ledger: 2 calls, $0.01 2026-10-18 17:24:27 +00:00
time 8c0d93db9d ledger: 1 calls, $0.00 2026-10-18 17:18:58 +00:00
time 9abd17f979 ledger: 1 calls, $0.01 2026-10-18 17:16:19 +00:00
time 5fac881ec5 ledger: 1 calls, $0.01 2026-10-18 16:59:59 +00:00
teahubxyz 385b1a48d0 A label filter is checked on every row: housekeeping listed all 59 open issues as parked (#138)
ci / test (push) Successful in 35s
Co-authored-by: teahubxyz <boring+teahub@agentmail.to>
2026-10-18 16:22:20 +00:00
time 429595a543 ledger: 1 calls, $0.00 2026-10-18 16:22:14 +00:00