2026-07-17-cron-trigger-plan.md - #12
Merged
Merged
Conversation
…schedule loading" passed gates Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGgfho2J6YfRSQN1bSDhj6
…uler stall guard" passed gates Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGgfho2J6YfRSQN1bSDhj6
… — upsert + orphan prune" passed gates Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGgfho2J6YfRSQN1bSDhj6
… startWorker" passed gates Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGgfho2J6YfRSQN1bSDhj6
…ion surface, contract test, docs & spec hygiene" passed gates Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NGgfho2J6YfRSQN1bSDhj6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a cron trigger: scheduled
kind:"local"jobs via BullMQ Job Schedulers, configured by a JSON file (schedules.json, path inPI_SCHEDULES_FILE). A schedule is a trigger, not a job kind — each tick mints an ordinary local job that drains through the existingrunJob → reserveBudget → runContainerpath (no second processor, budget gate intact). Purely additive; no new dependencies (BullMQ 5.80.4 owns scheduling); the deprecatedrepeat:API is not introduced.The money-critical piece is a per-scheduler stall guard: BullMQ structurally exempts scheduler (
repeat:) jobs frommaxStalledCount, so a wedged scheduled job would re-run paid indefinitely. A Redis-backedHINCRBY+EXPIREcounter tears the schedule down (removeJobScheduler) pastPI_SCHEDULER_STALL_MAX(default 2). Startup reconcile installs schedules idempotently and prunes orphans (a schedule removed from config);-10/-11fromupsertJobSchedulerare surfaced loudly, never swallowed.kind:"github"schedules are rejected at load (a schedule has no webhook delivery/issue/title/body).Scope:
worker/only, plus docs/config, a CI comment, and spec additions.image/unchanged;receiver//cli.mjsuntouched.Verification
.key, stall→teardown, no-overlap;-10/-11= SDK throws (never swallowed)repeat:, no dead code)New spec surface:
REQ-CRON-SCHEDULED-JOBS,INT-SCHEDULES-FILE-CONTRACT, and reject-github/dual-enqueue bullets underDES-CRON-VIA-BULLMQ-SCHEDULER.detect_drift.pystays exit 0.Two known pre-existing issues are documented but out of scope: the
releaseBudgetcap-starvation leak (cross-cutting, all job kinds) and aqueue.test.mjsdedup test-hygiene flake.Closes #3
🤖 Generated with Claude Code