Skip to content

refactor(cron): split timer lifecycle - #113141

Merged
steipete merged 1 commit into
mainfrom
refactor/split-cron-timer
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
refactor/split-cron-timer

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

src/cron/service/timer.ts had grown beyond 3,000 lines and required a grandfathered max-lines suppression, coupling timeout/watchdog execution, trigger retry policy, outcome mutation, timer admission, startup catch-up, and payload execution.

Why This Change Was Made

Split the unchanged public facade into focused timeout/contracts, job runner, trigger/retry, outcome application, runnable selection, scheduler, startup catch-up, notifications, and core execution modules. Shared responsibilities are arranged as an acyclic graph, and the test-only timer API remains registered through the facade.

The production diff grows by about 132 lines of imports and facade/contract plumbing. No scheduling, retry, timeout, or delivery path is duplicated.

User Impact

No user-visible behavior changes. Cron scheduling, startup catch-up, timeout cleanup, trigger evaluation, retry/backoff, and delivery retain their existing behavior while every resulting production module stays below 700 physical lines.

Evidence

  • node scripts/run-vitest.mjs src/cron/service/timer.test.ts src/cron/service/timer.regression.test.ts src/cron/service/timer.pacing.test.ts src/cron/service.heartbeat-payload.test.ts — 99 tests passed.
  • node --import tsx scripts/check-madge-import-cycles.ts — zero cycles.
  • node scripts/check-changed.mjs -- <touched files> — passed on Blacksmith Testbox, including both typechecks, full core lint, max-lines ratchet, boundary guards, and zero runtime import cycles.
  • $HOME/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean after fixing import-order and duplicate-import findings.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete steipete self-assigned this Jul 23, 2026
@steipete
steipete marked this pull request as ready for review July 23, 2026 20:16
@steipete
steipete merged commit 06776e7 into main Jul 23, 2026
188 of 191 checks passed
@steipete
steipete deleted the refactor/split-cron-timer branch July 23, 2026 21:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant