Skip to content

Scatter every N days/weeks/months schedules to avoid pile-ups - #78779

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan/fuzzy-schedule-pileup
Nov 17, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan/fuzzy-schedule-pileup

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

every N days compiled to a fixed 0 0 */N * *. As a result, 63 workflows (62 of them smoke tests) using every 2 days all fired in the same minute at 00:00 UTC. That pile-up is exactly what fuzzy scheduling is meant to avoid. every 7 days (chaos-pr-bundle-fuzzer) had the same problem.

Root cause

In pkg/parser/schedule_parser.go, the cron builders for day, week and month intervals returned fixed 0 0 ... crons instead of fuzzy tokens. Because of that, the scatter step never ran for these schedules.

Changes

  • Parser: emits fuzzy tokens instead of fixed crons:
    • every 1 day → FUZZY:DAILY
    • every 1 week → FUZZY:WEEKLY
    • every N days → FUZZY:DAILY_INTERVAL/N
    • every N weeks → FUZZY:DAILY_INTERVAL/(7N)
    • every N months → FUZZY:MONTHLY_INTERVAL/N
  • Scatter: two new handlers in pkg/parser/schedule_fuzzy_scatter.go:
    • handleDailyInterval produces M H */N * *, using the existing weighted daily time slot.
    • handleMonthlyInterval produces M H D */N *, with a hashed day between 1 and 28.
    • handleDailyInterval is registered before handleDaily, because handleDaily matches the FUZZY:DAILY prefix.
  • Lock files: 64 recompiled; only their cron lines changed. Examples:
    • smoke-copilot is now 34 11 */2 * *.
    • chaos-pr-bundle-fuzzer is now 53 20 */7 * *.
    • The 63 */2 workflows are now spread over 18 hours, with at most 8 in any hour and at most 2 in the same minute.
  • Docs: schedule-syntax.md and the fuzzy schedule spec are updated. The every N minutes row was already wrong (it said Fixed, but the code already scatters it) and now says Fuzzy.
  • Changeset: minor.

Review notes

  • Compatibility: existing workflows using these intervals get a one-time cron change on recompile. Nothing in this repo depended on 00:00. Users who need an exact time can use a raw cron:.
  • Out of scope: every Nh still scatters only the minute, not the hour phase. Only 7 workflows here use it.
  • Test fixes: two tests in pkg/workflow/compiled_lock_files_test.go now call SetWorkflowIdentifier. They compile real workflows, and fuzzy schedules require an identifier.

Validation

  • Ran go test ./pkg/parser -run 'Schedule|Scatter|Cron|Interval'. It covers the new scatter tests:
    • exact output
    • at least 50 distinct crons for 60 identifiers
    • interval 0 is rejected
    • the monthly day stays in 1-28
  • golangci-lint on pkg/parser: 0 issues.
  • Custom linters: no findings on changed lines.

'every N days' compiled to a fixed '0 0 */N * *', so 63 workflows
(mostly smoke tests) fired in the same minute at 00:00 UTC. Day, week
and month intervals now emit fuzzy tokens (FUZZY:DAILY_INTERVAL/N,
FUZZY:MONTHLY_INTERVAL/N) that scatter to a hashed time per workflow.
Docs updated, including the 'every N minutes' row (already fuzzy).

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 16:16
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 16:16
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.7K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #78779 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #78779 · copilot · gpt56 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (134 added lines under pkg/) but does not have a linked Architecture Decision Record (ADR). The only existing ADR on this topic, ADR-42524, covers minute-interval schedules only.

📄 Draft ADR committed: docs/adr/78779-scatter-day-week-month-interval-schedules.md. Review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to pelikhan/fuzzy-schedule-pileup. It was generated from the PR diff.

  2. Complete the missing sections. Add context the gate could not infer, confirm the rationale, and check the alternatives.

  3. Reference the ADR in the PR body, for example:

    ADR: ADR-78779: Scatter Day, Week, and Month Interval Schedules via Fuzzy Tokens (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate re-runs and checks that the implementation matches the decision.

⚠️ Behavior changes flagged in the draft for review
  • every 1w moves from a fixed Sunday to a per-workflow weekday, because handleWeekly hashes the weekday over 0-6.
  • every 1mo moves from the 1st of the month to a hashed day in 1-28.
  • Recompiling changes the cron for every existing workflow that uses these forms. This PR touches 64 lock files.
  • ScatterSchedule depends on handler order, since FUZZY:DAILY is a prefix of FUZZY:DAILY_INTERVAL.
📋 Michael Nygard ADR format reference

An ADR must contain these four sections to be complete:

  • Context: the problem and the forces at play
  • Decision: what was decided and why
  • Alternatives Considered: what else was evaluated
  • Consequences: positive and negative trade-offs

ADRs live in docs/adr/, prefixed by the PR number (for example, 78779-...md for PR #78779).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 28f05ae7c5cfcf778b9d74ff53e557cee5610700 against the fuzzy schedule specification (v1.2.0, §3.6 and interval conformance tests).

Blocking finding: the new monthly/weekly interval contract claims every <N> <unit> support, but the parser still rejects long-form weeks/months and no conformance evidence covers those forms. See the inline comment on the changed specification line. Please align the specification with implemented syntax or add parser support and tests.

Coverage: static specification review only; tests were not run per review policy.

Generated by PR Specification Reviewer for #78779 · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again

- Hours: `FUZZY:HOURLY/N * * *` (scattered minute)
- Days: `FUZZY:DAILY * * *` for N=1; otherwise `FUZZY:DAILY_INTERVAL/N * * *`, scattered to `M H */N * *`
- Weeks: `FUZZY:WEEKLY * * *` for N=1; otherwise `FUZZY:DAILY_INTERVAL/(N*7) * * *`, scattered to `M H */(N*7) * *`
- Months: `FUZZY:MONTHLY_INTERVAL/N * * *`, scattered to `M H D * *` (N=1) or `M H D */N *`, with a hashed day of month `D` in `[1, 28]`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new normative row is not implementable for the documented interval syntax. Section 3.6 defines every <N> <unit> and lists weeks, but parseLongIntervalParts still accepts only minutes, hours, and days (pkg/parser/schedule_parser.go:241-247), so every 2 weeks is rejected; long-form months are likewise unsupported. The implementation only handles every 2w/every 2mo. Please either add parser support and conformance tests for the long forms, or limit this contract to the supported abbreviations instead of claiming all interval forms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 88d824c: the specification now distinguishes long-form minute/hour/day units from attached short units and explicitly requires w/mo for weeks/months. The reference and changeset use the supported spellings.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-17T16:20:09Z
review_event: REQUEST_CHANGES
top_themes: [interval compatibility, calendar semantics]
files_reviewed: [pkg/parser/schedule_parser.go, pkg/parser/schedule_fuzzy_scatter.go, pkg/parser/schedule_fuzzy_scatter_test.go, pkg/parser/schedule_parser_test.go]
comment_count: 2
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two compatibility regressions in the interval compiler. every 1w now hashes the weekday instead of preserving Sunday, and every 1mo now hashes the day instead of preserving the first of the month. These alter existing workflow calendar semantics on recompilation, not just execution time. Inline comments provide details and suggested fixes.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again

return "0 0 1 * *"
}
return fmt.Sprintf("0 0 1 */%d *", interval)
return fmt.Sprintf("FUZZY:MONTHLY_INTERVAL/%d * * *", interval)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every 1mo previously compiled to the first day of each month (0 0 1 * *), but handleMonthlyInterval now hashes the day to 1–28. This changes the calendar date for every existing monthly workflow on recompilation, beyond merely scattering its time. Please preserve day 1 for the one-month interval (or explicitly document and test this breaking semantic change).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

88d824c explicitly documents the intentional first-of-month → hashed day 1–28 migration in the reference, changeset, and ADR, with a raw-cron migration example. Added a parser-to-scatter regression test for every 1mo; focused schedule tests pass.

func formatWeeklyIntervalCron(interval int) string {
if interval == 1 {
return "0 0 * * 0"
return "FUZZY:WEEKLY * * *"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every 1w previously compiled to 0 0 * * 0 (Sunday), but this now routes through FUZZY:WEEKLY, whose scatter handler hashes the weekday per workflow. Recompiling an existing workflow therefore changes not only the time but also its day-of-week, which can materially alter execution cadence and maintenance windows. Please preserve Sunday for this interval (scatter only the time) or explicitly document this compatibility change in the changeset and schedule docs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

88d824c documents the intentional Sunday → hashed weekday migration in the reference, changeset, and ADR. It recommends weekly on sunday when Sunday must be preserved and adds parser-to-scatter coverage for every 1w.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-3aab01b5-f1a5-4ce8-ba0f-454b0ae001a3","parents":[],"payload":{"id":"ldg-3791125e-cc73-4c07-9d44-cffa6eaf2b2d","operation":"append","value":{"finding_count":1,"head_sha":"28f05ae7c5cfcf778b9d74ff53e557cee5610700","outcome":"regression"}},"sha":"sha256:0f1f623edef43a9cb9032f934911b86efc7bf49c7ed6ff0b56b9accb3f21e652","timestamp":"2026-11-17T16:28:23.155Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-1ac1b570-4be3-41d7-a49f-31e07be48739","parents":[],"payload":{"id":"ldg-8226e0a2-55c0-46fb-a8f8-684e34fbe437","operation":"append","value":{"finding_count":2,"head_sha":"28f05ae7c5cfcf778b9d74ff53e557cee5610700","outcome":"findings"}},"sha":"sha256:d5f61aeb52afdbe8d3603d1e88bd17913499c8845673872b3d3074706458a375","timestamp":"2026-11-17T16:29:05.431Z","type":"ledger_append","version":1}
History

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two existing tests remain broken: the atomic smoke contract still expects the old cron, and the work-queue integration test omits the workflow identifier required to resolve the fuzzy schedule.

2 open issues
What changed in this PR

This PR extends gh-aw’s deterministic schedule scattering to day, week, and month intervals, reducing simultaneous workflow starts at midnight.

Changes:

  • Emit fuzzy interval tokens and resolve them into scattered cron schedules.
  • Update parser tests, compiler test setup, schedule documentation, and release notes.
  • Regenerate 64 workflow lock files with distributed execution times.
File Description
pkg/​workflow/​compiled_lock_files_test.go Supplies identifiers for fuzzy schedule compilation.
pkg/​parser/​schedule_parser.go Emits fuzzy day, week, and month interval tokens.
pkg/​parser/​schedule_parser_test.go Updates expected interval tokens.
pkg/​parser/​schedule_fuzzy_scatter.go Adds daily and monthly interval scattering.
pkg/​parser/​schedule_fuzzy_scatter_test.go Tests interval output, distribution, and bounds.
docs/​src/​content/​docs/​specs/​fuzzy-schedule-specification.md Specifies fuzzy interval behavior.
docs/​src/​content/​docs/​reference/​schedule-syntax.md Updates interval examples and compatibility guidance.
.github/​workflows/​smoke-workflow-call.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-workflow-call-with-inputs.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-work-queue.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-update-cross-repo-pr.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-test-tools.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-temporary-id.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-service-ports.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-repo-memory-ledger.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-pydantic.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-project.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-pi.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-pi-routed.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-pi-routed-claude.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-pi-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-otel-backends.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-opencode.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-multi-pr.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-kiro.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-goose.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-github-claude.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-gemini.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-drive.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-deepseek-harness.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-cursor.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-crush.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-create-cross-repo-pr.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-sub-agents.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-small.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-sdk.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-sdk-routed.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-sdk-routed-claude.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-routed.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-routed-steering.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-routed-claude.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-mai.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-arm.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-aoai-entra.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-copilot-aoai-apikey.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-codex.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-codex-routed.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-codex-routed-openai.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-codex-bare-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-codex-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude-routed.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude-routed-anthropic.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude-on-copilot.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude-copilot-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-claude-auto.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-checkout-pr-dispatch.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-call-workflow.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-builtin-ledgers.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-azure-pi.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-azure-codex.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-atomic.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-aider.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-agent-scoped-approved.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-agent-public-none.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-agent-public-approved.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-agent-all-none.lock.yml Scatters the two-day schedule.
.github/​workflows/​smoke-agent-all-merged.lock.yml Scatters the two-day schedule.
.github/​workflows/​chaos-pr-bundle-fuzzer.lock.yml Scatters the seven-day schedule.
.changeset/​scatter-day-week-month-intervals.md Records the minor release and recompilation impact.

Review effort: Balanced (adaptive)

on:
schedule:
- cron: "0 0 */2 * *" # Friendly format: every 2 days
- cron: "51 16 */2 * *" # Friendly format: every 2 days (scattered)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 88d824c: the contract now expects the regenerated 51 16 */2 * * schedule. TestAtomicSmokeContract passes.

return "FUZZY:DAILY * * *"
}
return fmt.Sprintf("0 0 */%d * *", interval)
return fmt.Sprintf("FUZZY:DAILY_INTERVAL/%d * * *", interval)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 88d824c by supplying WithWorkflowIdentifier("smoke-work-queue"). go test -tags integration ./pkg/workflow -run '^TestWorkQueueSmokeVerification$' -count=1 passes.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design, /diagnosing-bugs, and /grill-with-docs. Scatter logic and handler ordering look correct: handleDailyInterval is registered before handleDaily, and the monthly day is hashed into [1, 28]. Targeted parser tests pass, and the committed smoke-copilot lock cron matches compiler output.

📋 Key Themes & Highlights

Key Themes

  • Behavior change for every 1w: it now hashes to a weekday instead of Sunday midnight. Confirm this is intended.
  • Identifier dependency: every N days now needs a workflow identifier, like daily. Confirm the CLI parse paths set one.
  • Docs example: the every 1w and every 2w cron examples read as fixed output. Mark them as illustrative.

Positive Highlights

  • ✅ Clear ordering comment at the handler registration site
  • ✅ New TestScatterScheduleDailyInterval and TestScatterScheduleMonthlyInterval pin the */N day field and the day-of-month range
  • ✅ Changeset documents the one-time recompile cron change and the cron: escape hatch

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again

func formatWeeklyIntervalCron(interval int) string {
if interval == 1 {
return "0 0 * * 0"
return "FUZZY:WEEKLY * * *"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] every 1w now emits FUZZY:WEEKLY, which hashes to a weekday instead of Sunday midnight. The changeset documents the change, but existing workflows will move to a different weekday on recompile. Confirm the weekday change is intended. The parser test checks the FUZZY:WEEKLY token, but nothing pins the resulting weekday.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The weekday scattering is intentional. 88d824c adds parser-to-scatter coverage asserting the identifier-hashed weekday and documents the calendar migration and weekly on sunday alternative in the reference, changeset, and ADR.


// Day, week, and month intervals compile to fuzzy schedules so that many workflows
// sharing the same interval do not all fire at 00:00 UTC.
func formatDailyIntervalCron(interval int) string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] every N days now emits FUZZY:DAILY_INTERVAL/N, which only resolves when a workflow identifier is set. Parsing without one now fails for every 2 days with the same error as daily, where it previously compiled to a fixed cron. Confirm that CLI paths such as mcp inspect, graders run, and dispatch never parse user schedules without an identifier, or set the identifier on those paths.

💡 Reproduction

With schedule: every 2 days and no identifier, NewCompiler().ParseWorkflowFile returns fuzzy cron expression FUZZY:DAILY_INTERVAL/2 * * * requires a workflow identifier.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed these paths omitted identifiers. Fixed in 88d824c: both MCP inspection paths, grader definition loading, and both parsed-file dispatch/call dependency loaders now supply workflow identifiers. Added scheduled-workflow regressions for MCP inspection and grader loading; focused tests pass.

schedule: every 1w # 0 0 * * 0 (Sunday midnight)
schedule: every 2w # 0 0 */14 * *
# Weeks (fuzzy - scattered time)
schedule: every 1w # 43 5 * * 1 (same as weekly)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] These example crons are illustrative only. The real weekday and time come from a hash of the workflow identifier, so 43 5 * * 1 will not match what a given workflow compiles to. Add a note such as "example; actual weekday and time depend on the workflow identifier" so readers do not treat it as fixed output.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 88d824c: the interval reference explicitly labels the crons as illustrative and states that actual times, weekdays, and monthly dates depend on the workflow identifier.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot run pr-finisher skill

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot run pr-finisher skill

Ran PR-finisher and pushed 88d824c: fixed the smoke tests and missing CLI workflow identifiers, added regressions, and clarified syntax/calendar migration docs. Replied to all eight review threads. Focused tests, impacted unit tests, and make lint pass; the final progress gate fails on existing custom-linter findings outside changed lines. Secret scan is clean; CodeQL skipped analysis because its database is too large.

Not yet merge-ready: thread resolution needs an authenticated maintainer/tool, the draft ADR still needs acceptance and a link in the PR body, and CI on the new HEAD is unverified until a maintainer re-triggers it. No merge performed.

@pelikhan
pelikhan merged commit 808d6fd into main Nov 17, 2026
123 of 124 checks passed
@pelikhan
pelikhan deleted the pelikhan/fuzzy-schedule-pileup branch November 17, 2026 17:18
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants