Repository navigation
refactor: extract scheduler policy - #383
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 12:24 AM ET / 04:24 UTC. Summary Reproducibility: not applicable. This PR is a refactor rather than a bug report. The relevant confidence check is behavior equivalence, and the PR body provides tests plus a live scheduler plan result. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the extraction after scheduler/automation review confirms the module boundary preserves selection behavior and the proof is enough for this core scheduling path. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR is a refactor rather than a bug report. The relevant confidence check is behavior equivalence, and the PR body provides tests plus a live scheduler plan result. Is this the best way to solve the issue? Yes; extracting pure scheduler helpers while keeping orchestration in the CLI is a narrow maintainability path. The remaining decision is whether maintainers accept the scheduler automation risk before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d20cf36edb6b. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
2ce2445 to
675a899
Compare
|
Land-ready maintainer proof for
No known proof gaps remain for this behavior-preserving extraction. |
* refactor: extract scheduler policy * refactor(scheduler): keep test helpers out of runtime --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Scheduler policy lived inside the large CLI module, coupling pure candidate-selection decisions to orchestration and making behavior-preserving scheduler changes harder to review and test.
Why This Change Was Made
Extract the stable scheduler policy into
src/scheduler-policy.ts. The CLI still owns GitHub I/O and orchestration; the new module owns pure capacity, ordering, floor-backfill, and partition decisions. Runtime exports are limited to production callers, while tests exercise the pure helpers directly.User Impact
No intended scheduling behavior change. The scheduler keeps the same selection order, capacity rules, floor backfill, and shard partitioning with a smaller owner boundary.
Evidence
mainatd20cf36edb6bbcd499e2e1980e88e8ecc77e7f1b.pnpm run build, fullpnpm run lint,pnpm run format:check, andgit diff --check: passing.openclaw/openclaw: 22 shards, 66 selected items, 93 due backlog, 22 active Codex targets; saturated-capacity decision preserved.