Repository navigation
refactor(cron): split service operations - #113830
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 4:02 PM ET / 20:02 UTC. ClawSweeper reviewWhat this changesThis PR replaces the 2,045-line cron service operations implementation with focused lifecycle, read, mutation, and manual-run modules while preserving Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep open. The protected Priority: P3 Review scores
Verification
How this fits togetherThe cron service is OpenClaw’s scheduler layer: callers manage jobs through its public operations facade, which loads persisted jobs, controls the scheduler lifecycle, and admits manual or timed runs. The split moves those internal responsibilities into separate modules while retaining the facade used by the rest of the product. flowchart LR
Clients[Cron callers] --> Facade[Public operations facade]
Facade --> Lifecycle[Lifecycle operations]
Facade --> Reads[Read and list operations]
Facade --> Mutations[Job mutation operations]
Facade --> Runs[Manual run operations]
Lifecycle --> Store[SQLite cron store]
Mutations --> Store
Runs --> Scheduler[Timer and execution]
Reads --> Store
Decision needed
Why: The patch changes no stated product contract, but it reorganizes lifecycle and run-admission logic in a protected maintainer-reviewed area; test and CI output alone do not establish the requested after-fix real behavior proof. Before merge
Agent review detailsSecurityNone. PR surfaceSource +72, Other -1. Total +71 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the facade-only design, then provide a redacted real runtime transcript that starts the scheduler, runs a persisted job manually or on schedule, and confirms completion after reload before normal maintainer merge review. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a structural refactor, not a reported user-facing failure. Its relevant validation is an after-fix cron lifecycle run rather than reproducing a pre-fix bug. Is this the best way to solve the issue? Yes, preserving the existing facade while separating cohesive lifecycle, read, mutation, and run responsibilities is the maintainable direction; the remaining gap is runtime proof that the moved scheduler paths preserve behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad7f927e4038. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
0c90e46 to
1b0cae2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Applied the ClawSweeper rank-up moves on current PR head
|
|
Merged via squash.
|
* refactor(cron): split service operations * fix(ci): keep cron preparation type private
What Problem This Solves
Resolves an oversized core cron service module that mixed scheduler lifecycle, reads, persistence mutations, stream state, and manual-run admission/completion in one 2,045-line file. The file remained on the max-lines baseline and made ownership and review boundaries unnecessarily difficult to follow.
Why This Change Was Made
Keeps
src/cron/service/ops.tsas the stable public facade while moving the existing implementation into six cohesive modules, all below the repository's approximate 700-line guideline. Shared cron invariants live in one small internal helper module so the split remains acyclic and behavior-neutral.The required audit found pre-existing defects, including a live-probe expectation mismatch. They were deliberately not fixed in this PR so the structural change stays reviewable, and they are tracked separately for dedicated follow-ups.
User Impact
No user-visible behavior changes. This reduces core maintenance risk and removes
src/cron/service/ops.tsfrom the max-lines baseline without changing the cron service API, persisted job shape, scheduling behavior, or execution semantics.Evidence
origin/main.216e24c2-0596-47d2-b672-c2fcd62185ce, recorded runmanual:216e24c2-0596-47d2-b672-c2fcd62185ce:1785010228236:1withstatus: "ok", and confirmed cleanup (run).mainrefresh, including max-lines ratchet, formatting, production/test typechecks, full core/script lint, import-cycle checks, and architecture guards (run).ops.tsis a 22-line facade.