Skip to content

chore(workflows): reduce shepherd cron from 30min to 2h - #94

Merged
mashkovd merged 1 commit into
mainfrom
chore/shepherd-cron-frequency
May 2, 2026
Merged

mashkovd merged 1 commit into
mainfrom
chore/shepherd-cron-frequency

Conversation

@mashkovd

@mashkovd mashkovd commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Cuts shepherd cron from `*/30 * * * *` (48 ticks/day) to `30 */2 * * *` (12 ticks/day).
  • 3/3 cron-fired shepherd ticks today were no-ops — pipeline was empty / proposals already in terminal states. Codex review on a fresh implementer-PR is 5–15 min, so 2h cadence bounds worst-case PR-sit-time at ~2h while cutting cron pressure by 4×.
  • The :30 offset stays clear of `mctl-agents-daily` at 06:00 UTC and `rotate-mctl-agent-github-token` at HH:00, minimizing contention on the shared `mctl-gitops-main-writes` mutex.

Test plan

  • ArgoCD picks up CronWorkflow change cleanly
  • Next scheduled tick lands at the expected HH:30
  • No regression in proposal pipeline throughput over the next 48h

Was */30 * * * * (48 ticks/day). After a day of operation 3/3 cron-fired
ticks were no-ops — pipeline empty / proposals already in terminal
states. Codex review on a fresh implementer-PR is 5-15 min, so a 2-hour
shepherd cadence bounds worst-case PR-sit-time at ~2h while cutting
cron pressure by 4x.

The :30 offset (30 */2 * * *) stays clear of mctl-agents-daily at 06:00
UTC and rotate-mctl-agent-github-token at HH:00, minimizing contention
on the mctl-gitops-main-writes mutex.
@mashkovd

mashkovd commented May 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@mashkovd

mashkovd commented May 2, 2026

Copy link
Copy Markdown
Member Author

@copilot review

Copilot AI commented May 2, 2026

Copy link
Copy Markdown

@copilot review

Review of commit a022527

The change is correct and minimal. A few notes:

Cron expression — 30 */2 * * * is valid. It fires at 00:30, 02:30, 04:30, …, 22:30 (12 ticks/day). The 4× reduction in cron pressure is accurate.

Mutex/contention analysis — The :30 offset avoids rotate-mctl-agent-github-token at HH:00, but the shepherd will fire at 06:30, 30 minutes after mctl-agents-daily (06:00 UTC). If the daily run takes >30 min and holds the mctl-gitops-main-writes mutex, the 06:30 shepherd tick would be dropped (concurrencyPolicy: Forbid). That's acceptable behaviour given the new 2-hour cadence, and it's handled cleanly — worth mentioning in docs if it causes confusion in ops, but not a blocker.

Comment quality — The inline rationale block (lines 26–34) is detailed and accurate: observed no-op rate, worst-case sit-time bound, and offset reasoning all check out.

No structural or logic issues. LGTM.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mashkovd
mashkovd merged commit c9409cd into main May 2, 2026
@mashkovd
mashkovd deleted the chore/shepherd-cron-frequency branch May 2, 2026 09:16
mashkovd pushed a commit that referenced this pull request May 20, 2026
Codex and Claude both flagged two P2 inaccuracies in OPERATOR.md that
came from only consulting the implementer workflow template and
missing the shepherd template:

1. The status lifecycle table omitted four states that automation
   actively writes: `implemented` (implementer success), `error`
   (implementer crash before PR), `review-fixing` (shepherd
   address-review followup), `review-stuck` (shepherd gave up).
   Shepherd discovery is keyed to `{implemented, review-fixing}` —
   not `in-progress` or `merged`. Adds the missing rows with
   per-tier authorship and cites cwft-mctl-agents-shepherd.yaml lines
   11, 39-41, 154-155 as source of truth.

2. The `in-progress` meaning was wrong: a proposal can be at
   `in-progress` and already have a `pr:` URL (implementer crashed
   after push but before flipping to `implemented`). The shepherd
   dead-letter recovery handles that case
   (cwft-mctl-agents-shepherd.yaml:219-223). The previous "PR not
   yet opened" wording would lead an operator to manually
   re-trigger and open a duplicate PR.

Also addresses P3: drop the "(issues #86–#94 reference set)" qualifier
from the Go/No-Go checklist header — the checklist is general-purpose.

Adds a new "Recovering stuck or errored proposals" section with
explicit triage paths for `error`, `in-progress` (with and without
PR), `review-stuck`, and stalled `implemented`.
mashkovd added a commit that referenced this pull request May 21, 2026
chore(proposals): refine mctl-telegram #91 and #94 for accept-readiness
mashkovd pushed a commit that referenced this pull request May 22, 2026
…1-14)

Flip #91 (sticky routing) and #94 (Local Bridge) to accepted. #94 is scoped to
M4 only (Slices 1-2, tasks 1-14 + tests T1-T8) via the tasks.md "Accepted scope"
banner; Slices 3-6 (M4.1) are deferred.

Also refresh stale "Current state" facts found in a drift re-review against
current master:
- #91: metrics registry is now 14 collectors (was "twelve"); deploy/ already
  exists (alerts/canary/grafana), Layer-1 manifests go under a new deploy/ingress/.
- #94: the alert rule task/section now says "add to the existing
  deploy/alerts/mctl-telegram.rules.yaml" (created by #86), not "create".
mashkovd pushed a commit that referenced this pull request May 22, 2026
These two .status.yaml edits landed on this branch by accident (07ebbba).
The real accept for #91/#94 was applied directly to main in 2e0155c with
the M4 scope banner. Keeping the stray flip here would conflict on merge
and clobber that scoped accept, so drop it from this branch.
mashkovd pushed a commit that referenced this pull request May 22, 2026
#91 Layer-2 merged via PR #132 (PR #124 closed unmerged; Layer 1 deferred
to issue #126). #94 (M4, scoped to Slices 1-2) merged via PR #125 with the
3 P3 nits cleared in PR #134.
mashkovd pushed a commit that referenced this pull request Jul 3, 2026
These two .status.yaml edits landed on this branch by accident (3a66b7e).
The real accept for #91/#94 was applied directly to main in 2e0155c with
the M4 scope banner. Keeping the stray flip here would conflict on merge
and clobber that scoped accept, so drop it from this branch.
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.

2 participants