Why and when they run
MokoGIT's release pipeline, cascade ladders, org governance, and sync engine are mostly self-driving. That is exactly why silent drift is dangerous: a tag can get pushed without its release materializing, an rc channel branch can get auto-deleted and never recreated, a repository branch-protection rule can quietly store a weaker value than the organization floor, or a sync profile can stop converging. None of these throws an error at the moment it happens - the system keeps running, just in a subtly wrong state.
The detectors close that gap. Each is a registered cron task that runs on its own interval, scans the relevant slice of the fleet, and raises a loud warning for anything out of place. Those warnings are forwarded by the log-to-ntfy pipeline, so an operator gets a push notification rather than having to read logs. The detectors emerged from real incidents - the release/version-advance epic (#1739) and the interrupted-merge incident (#1742) - and each one targets a specific failure signature those incidents produced.
The detector family
Six detectors make up the family. Each has a stable cron name (shown in Site Administration, then Monitoring, then Cron Tasks), a schedule, and a scope.
Release version drift - detect_release_version_drift
Runs every 6 hours. For each release-enabled repository it compares the newest immutable vNN.NN.NN tag against the latest published (non-draft, non-prerelease) release. It flags two cases: a newest release tag that has no published release at all (the release never materialized - the 404-publish aftermath), and a latest release that points at an older tag than the newest one on the branch (a stale channel pin). Because the version tags are fixed-width and zero-padded, newest-first ordering is a plain string comparison. Detect-and-alert only: it never touches tags, releases, or branches.
Orphan releases - detect_orphan_releases
Runs every 24 hours. It audits release-enabled repos for orphaned release data and classifies three categories: dangling-FK assets (an attachment whose release row no longer exists - an unambiguous orphan), missing-blob assets (a DB row whose backing object is gone from storage - alert-only, because a transient storage fault is indistinguishable from a true miss), and scheme-tags without a release (a vNN.NN.NN tag with no backing release - alert-only, because deleting a git tag is destructive). Its optional auto-cleanup (default off) only ever deletes the one unambiguous class: dangling-FK assets.
RC reprovision - detect_rc_reprovision
Runs every 30 minutes. The rc channel branch (the middle of the dev, then rc, then stable ladder) is meant to be permanent, but delete-after-merge removes it when an rc-to-stable promotion merges, and it must be recreated for the next cascade. This detector finds a repo that is supposed to carry rc - scoped precisely to repos with an enabled cascade rule referencing rc, a false-positive-free signal - but is currently missing it. Its optional auto-reprovision (default off) recreates rc from the branch it promotes into (typically stable), through the normal server-side branch-create path with all hooks and protection honored.
Governance drift - detect_governance_drift
Runs every 12 hours. It audits each repository's branch-protection rules against the organization-governance floor that matches the same branch, and alerts when a repo rule stores a value weaker than the org floor on a governance gate (status check, block-on-rejected-reviews, block-on-outdated-branch, require-signed-commits, block-admin-merge-override, or required-approvals). Important nuance: org governance is enforced live as a most-restrictive floor, so a repo rule can only ever tighten enforcement, never weaken it. The weaker stored value is therefore not a live security hole - it is a misleading stored value that makes the UI read dishonestly. Its auto-remediate flag exists for parity but is a deliberate no-op (there is no safe automatic apply path for governance), so reconciliation is always a human action.
Interrupted merges - detect_interrupted_merges
Runs hourly. It finds open, non-merged pull requests whose head branch is already an ancestor of the base branch - the signature of a merge whose commit landed but whose finalize step was lost. It scopes to pull requests updated in the last 24 hours so it stays cheap. Its optional auto-finalize (default off) records the already-landed merge so the pull request closes; that path deliberately bypasses the manual-merge policy gate (a lost server-merge finalize is not a user-initiated manual merge) while keeping every other safety check - the working lock, the verification that the commit really is on the base branch, and the compare-and-set that records the merge. This detector is the safety net that complements the virtual Actions-user merge-finalization fix.
Sync-profile drift - detect_sync_profile_drift
Runs hourly. It is the alerter complement to the sync-profile reconciler: for every active sync profile it runs the same dry-run plan the status API reports and warns on any profile with pending changes - a profile the reconciler has not converged. Observe-only: it never applies, writes, or reconciles. A profile that stays not-in-sync means its reconcile is failing or stuck, which this raises to a notification instead of letting it sit silently.
The shared design: detect first, heal by opt-in
Every detector follows the same philosophy, which is worth understanding because it shapes how you should respond to their alerts:
- Detection and alerting are always on. A detector is always safe to run - it reads state and warns. You cannot get into trouble by leaving it enabled.
- Remediation is opt-in and off by default. The detectors that can self-heal (orphan releases, rc reprovision, interrupted merges) ship with their heal flag off, because every one of those remedies is a write - deleting an asset, recreating a branch, finalizing a merge. You enable the heal deliberately, per detector, once you trust it in your environment.
- Heals are scoped to the unambiguous case only. Where a category is ambiguous (a missing blob might be a transient fault; a scheme-tag might legitimately precede its release), the detector stays alert-only even with heal enabled. It never guesses at a destructive action.
- Two detectors never heal at all. Release version drift is pure detection, and governance drift's remediate flag is a documented no-op because no safe automatic apply path exists.
Step-by-step: inspecting and tuning the detectors
From the admin UI:
- Go to Site Administration, then Monitoring, then Cron Tasks.
- Find the detector by its cron name (for example
detect_interrupted_merges). - Review its schedule and last-run status. You can trigger a run immediately with the Run action to check current fleet state on demand.
Schedules and the optional heal flags are configured in your instance's app configuration under the cron section, for example:
[cron.detect_interrupted_merges]
ENABLED = true
SCHEDULE = @every 1h
AUTO_FINALIZE = false
[cron.detect_rc_reprovision]
SCHEDULE = @every 30m
AUTO_REPROVISION = false
[cron.detect_orphan_releases]
SCHEDULE = @every 24h
AUTO_CLEANUP = false
[cron.detect_governance_drift]
SCHEDULE = @every 12h
AUTO_REMEDIATE = false
Leave the heal flags off until you have watched a detector's alerts and confirmed they reflect real, actionable drift in your fleet. Then enable the heal for the ones whose remedy you trust.
How to respond to an alert
- Release version drift - re-publish the missing release, or re-pin the channel to the newest tag.
- Orphan releases - for a dangling-FK asset, enable auto-cleanup or delete it by hand; for a missing blob, investigate storage before touching the row; for a scheme-tag without a release, confirm whether the release was lost.
- RC reprovision - recreate the
rcbranch from the branch it promotes into, once you confirm the promotion really finished. - Governance drift - reconcile the repo's stored branch-protection rule so it reads honestly (enforcement already honors the org floor).
- Interrupted merges - finalize the pull request (mark it merged) or re-run the merge.
- Sync-profile drift - apply the profile or investigate why the reconciler is not converging it.
Caveats
- These are operational safety nets, not primary controls. They surface drift that other mechanisms should have prevented; a firing detector usually points at an upstream issue worth fixing at the source.
- All heal flags default to off. An alert is not an automatic action - unless you have explicitly enabled the corresponding heal, the detector only warns.
- Governance drift reports a stored value mismatch, not a live enforcement hole. The org floor is always enforced regardless of the repo rule's stored value.
- Some detectors defer nuance by design - for example sync-profile drift alerts on any not-in-sync profile rather than only those drifted beyond a time window, because no drifted-since timestamp is yet persisted. Expect the occasional transient alert that clears on the next run.
- Scope limits keep the scans cheap and false-positive-free: interrupted merges only looks at the last 24 hours of pull-request activity, rc reprovision only looks at repos with an explicit
rccascade rule, and governance drift only scans orgs that actually have governance rules.
Get help
Open a support ticket or call (931) 820-0265.