Skip to content

[Phase 1] Codify the off-peak scheduling standard + CI compliance check #724

Description

@github-actions

Story

As a org-standards maintainer,
I want document the off-peak-minute scheduling convention (plus the idempotent-sweep higher-frequency guidance) as a repo-local standard and add a CI check that flags any new minute-0 scheduled cron,
so that the convention is enforced for future workflow edits instead of relying on memory, and is staged for promotion into the org-wide standard.

Acceptance Criteria

  1. AGENTS.md gains a 'Scheduled workflows' standard section (mirroring the existing 'Cost reporting' repo-local-standard precedent) stating: never schedule at minute 0 / 0 * * * *; use a staggered off-peak minute; and per Option 2, idempotent/self-healing sweeps may run at a higher frequency on odd offsets because extra ticks are harmless and missed ticks self-heal.
  2. That section includes a 'Promotion' note: this is currently a repo-local standard; to make it org-wide, lift it into petry-projects/.github (standards/ci-standards.md) and have repos defer to it -- explicitly referencing the org-wide rollout story.
  3. A CI check (a new step/job in lint.yml, e.g. validate-workflow-schedules, backed by a small shell script) detects any schedule.cron using minute 0 across this repo's .github/workflows/*.yml and agentic *.md sources and reports the offending file(s).
  4. The check passes on the current tree (it runs after Story 1's offsets are applied) and flags a reintroduced 0 * * * * cron (demonstrated by a fixture/test).
  5. If the check is script-backed, it follows repo conventions (POSIX bash, set -euo pipefail) and its bats test file is added to the bats list in lint.yml.

Tasks / Subtasks

Dev Notes

  • Precedent for a repo-local standard with a promotion path: AGENTS.md '### Cost reporting' ends with a 'Promotion: this is currently a repo-local standard ... lift it into petry-projects/.github' note -- follow that exact shape so the standard is consistent and Story 4 can lift it cleanly.
  • lint.yml already hosts focused validation jobs (shellcheck, bats, validate-agent-profiles, gh-aw-compile) -- add the schedule check as a sibling job/step; the bats job runs an explicit allow-list of test files, so a new test file must be appended to that list (AGENTS.md documents that the bats list is intentionally repo-extended and must not be reset by template syncs).
  • This must land AFTER Story 1: a hard-failing minute-0 check would otherwise fail CI on the existing tree. The standard text also documents the convention Story 1 just applied.
  • Keep the parser simple and robust: match the cron minute field (first whitespace-delimited token after the quoted cron value). Guidance only -- do not attempt full cron validation.

Project Structure Notes

Edits AGENTS.md and lint.yml; adds one small script under scripts/ and one bats file under tests/ (added to the lint.yml bats list). No changes to workflow runtime behavior beyond the new check.

References

  • AGENTS.md#cost-reporting
  • AGENTS.md#workflow-files
  • .github/workflows/lint.yml#bats
  • .github/workflows/lint.yml#validate-agent-profiles
  • tests/fleet_report.bats

Likely target surface

  • AGENTS.md
  • .github/workflows/lint.yml
  • scripts/
  • tests/

Story prepared by the BMAD Scrum Master (Bob) for epic #722. Status: ready-for-dev.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions