Daily housekeeping: prune merged branches, close spent signal issues and empty milestones, list the stale #83

Closed
opened 2026-10-18 00:56:31 +00:00 by teahubxyz · 5 comments
Owner

Why. Nobody sweeps. Merged branches pile up (time/card-53, time/card-58, ceo/protected-paths, labs/aicharts-fast are there now: merges made through the MCP keep the head branch, Time's own merges delete it), signal issues ("want the next version?") outlive their measure window, batch milestones stay open empty, and stale needs-human cards and idle PRs sit unlisted. The operator wants this daily, and deterministic: no model decides what to delete.

Change.

  • housekeeping.yml: daily (a jittered minute after the Astra tick) and workflow_dispatch; runs python3 .github/time/housekeeping.py with the heartbeat's env, acting as time.
  • housekeeping.py, each step idempotent and logged:
    1. Branches: delete every branch whose PR merged into the default branch (time/card-*, ceo/*, labs/*, anything with a merged PR), never the default branch, gh-pages, or a branch with an open PR. Count deleted.
    2. Signal issues: close signal issues whose venture's measure window (TIME_VENTURE_MEASURE_DAYS) has passed with no signups, with one closing line naming the count.
    3. Milestones: close milestones with no open issues and at least one closed one.
    4. Stale list (no action, one comment on the Astra log #57): needs-human older than 3 days, open PRs idle 7 days, cards parked after their automatic retries (#78), error cards older than 2 days. Empty list → no comment.
    5. One line on #57 per run: branches deleted, issues closed, milestones closed, stale count.
  • Dry run with TIME_MODE=dry-run: prints what it would do, deletes nothing.

Tests (test_housekeeping.py, offline fake like test_time.py's World): a merged branch is deleted, an unmerged one is kept, the default branch and gh-pages are never touched; a spent signal issue closes, a fresh one stays; an empty milestone closes, one with an open issue stays; the stale list names a 4-day-old needs-human and a 7-day idle PR and not a 1-day-old card; dry-run deletes nothing.

Docs: a short SOP at .agents/skills/housekeeping/SKILL.md (trigger, what the sweep does, what the steward does with the stale list), linked from AGENTS.md's situation table.

DONE: PR open with the code above, python3 .github/time/test_housekeeping.py and test_time.py green, CI green; the workflow file itself is the CEO's merge

**Why.** Nobody sweeps. Merged branches pile up (`time/card-53`, `time/card-58`, `ceo/protected-paths`, `labs/aicharts-fast` are there now: merges made through the MCP keep the head branch, Time's own merges delete it), `signal` issues ("want the next version?") outlive their measure window, batch milestones stay open empty, and stale `needs-human` cards and idle PRs sit unlisted. The operator wants this daily, and deterministic: no model decides what to delete. **Change.** - `housekeeping.yml`: daily (a jittered minute after the Astra tick) and `workflow_dispatch`; runs `python3 .github/time/housekeeping.py` with the heartbeat's env, acting as `time`. - `housekeeping.py`, each step idempotent and logged: 1. **Branches:** delete every branch whose PR merged into the default branch (`time/card-*`, `ceo/*`, `labs/*`, anything with a merged PR), never the default branch, `gh-pages`, or a branch with an open PR. Count deleted. 2. **Signal issues:** close `signal` issues whose venture's measure window (`TIME_VENTURE_MEASURE_DAYS`) has passed with no signups, with one closing line naming the count. 3. **Milestones:** close milestones with no open issues and at least one closed one. 4. **Stale list** (no action, one comment on the Astra log #57): `needs-human` older than 3 days, open PRs idle 7 days, cards parked after their automatic retries (#78), `error` cards older than 2 days. Empty list → no comment. 5. One line on #57 per run: branches deleted, issues closed, milestones closed, stale count. - Dry run with `TIME_MODE=dry-run`: prints what it would do, deletes nothing. **Tests (`test_housekeeping.py`, offline fake like `test_time.py`'s `World`):** a merged branch is deleted, an unmerged one is kept, the default branch and `gh-pages` are never touched; a spent `signal` issue closes, a fresh one stays; an empty milestone closes, one with an open issue stays; the stale list names a 4-day-old `needs-human` and a 7-day idle PR and not a 1-day-old card; dry-run deletes nothing. Docs: a short SOP at `.agents/skills/housekeeping/SKILL.md` (trigger, what the sweep does, what the steward does with the stale list), linked from AGENTS.md's situation table. DONE: PR open with the code above, `python3 .github/time/test_housekeeping.py` and `test_time.py` green, CI green; the workflow file itself is the CEO's merge
teahubxyz added the ready label 2026-10-18 01:54:59 +00:00

⏱️ Time: today's spend is $5.01 of the $5.00 cap; carrying on tomorrow. Nothing is lost; this card resumes once there is budget.

⏱️ Time: today's spend is $5.01 of the $5.00 cap; carrying on tomorrow. Nothing is lost; this card resumes once there is budget. <!-- time {"beat":"capped"} -->

⏱️ Time: Claude Sonnet (Anthropic) is working on this now, on branch time/card-83.

⏱️ Time: Claude Sonnet (Anthropic) is working on this now, on branch `time/card-83`. <!-- time {"beat":"dispatched","launched":true,"worker":"anthropic"} -->
gitea-actions Bot referenced this issue from a commit 2026-10-18 04:13:48 +00:00

⏱️ Time: sonnet opened PR #115 (28 steps, claude-sonnet-5-5). Review and landing follow on the next beat.

⏱️ Time: `sonnet` opened PR #115 (28 steps, claude-sonnet-5-5). Review and landing follow on the next beat. <!-- time {"beat":"dispatched","worker":"anthropic","pr":115,"steps":28,"seat":"sonnet","model":"claude-sonnet-5-5"} -->

⏱️ Time: PR #115 is up for this card. haiku reviewed it on the PR.

⏱️ Time: PR #115 is up for this card. `haiku` reviewed it on the PR. <!-- time {"beat":"pr","pr":115,"launched":false,"review":"venice","seat":"haiku"} -->
time closed this issue 2026-10-18 04:27:12 +00:00

⏱️ Time: approved and green, merged PR #115. Card done.

⏱️ Time: approved and green, merged PR #115. Card done. <!-- time {"beat":"merged","pr":115} -->
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: teahubxyz/time#83