feat(review): add hourly sweep-liveness watchdog with self-heal re-enqueue#3835
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3835 +/- ##
=======================================
Coverage 93.53% 93.53%
=======================================
Files 336 337 +1
Lines 33281 33324 +43
Branches 12175 12189 +14
=======================================
+ Hits 31128 31171 +43
Misses 1528 1528
Partials 625 625
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 21:29:10 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…queue (#3808) Nothing previously noticed when the scheduled regate sweep stopped advancing a repo's last-regated marker -- the 2026-07-06 incident stayed silent for hours until a human queried the database directly. Add an hourly watchdog (flag-gated by GITTENSORY_SWEEP_WATCHDOG, default OFF) that scans the same acting-autonomy repo set the sweep itself covers. A repo with open PRs whose sweep marker hasn't advanced within a 45-minute window gets a structured sweep_liveness_stale log (Sentry- visible) and a single targeted agent-regate-sweep re-enqueue -- the same message shape the normal fan-out sends, so this only nudges the existing sweep rather than bypassing its own gating/dedup logic. A registered-but- uninstalled repo is never watched, since it can never get a per-PR fan-out regardless of nudging. Fails safe per-repo and at the top level.
36c4b12 to
3094d0d
Compare
…pinned wrangler The previous commit's regeneration silently picked up a stale, globally-installed wrangler (4.103.0, bundling workerd@1.20260617.1) instead of this repo's pinned 4.107.0 (workerd@1.20260701.1) -- node_modules/.bin/wrangler didn't exist yet at that point (fresh worktree, npm ci hadn't run), so `wrangler types` fell through to PATH resolution and found /opt/homebrew/bin/wrangler instead. Not an actual repo-side drift issue: a clean npm ci + regeneration in a fresh worktree confirms origin/main's worker-configuration.d.ts is (and has been) correctly in sync since #3764 -- every commit back through #3835 already references workerd@1.20260701.1.
Summary
GITTENSORY_SWEEP_WATCHDOG, default OFF): an hourly cron job scans the SAME acting-autonomy repo set the sweep itself covers (mirrorsfanOutAgentRegateSweepJobs's own repo-selection exactly), and for any INSTALLED repo that has open PRs but whoselast_regated_atmarker hasn't advanced within a 45-minute staleness window, it:sweep_liveness_stalelog atlevel: "error"(Sentry-visible, same convention asops_anomalyand every other Sentry-forwarded anomaly signal in this codebase).agent-regate-sweepfor just that repo — the exact same message shape the normal fan-out sends, so this is a pure nudge, never a bypass of the sweep's own gating/dedup/backpressure logic.#sweep-uninstalled-budget-waste) — it never gets a per-PR fan-out regardless of installation status, so flagging it would just spend the sharedGITHUB_PUBLIC_TOKENbudget on a sweep that can never act.listRepositoriesitself failing) is logged and the function returns an empty result rather than throwing into the queue.sweep-liveness-watchdogjob type, wired end-to-end:types.ts(JobMessage variant),wrangler.jsonc/worker-configuration.d.ts(the new flag, regenerated viacf-typegen),env.d.ts(the widened-to-stringtest/runtime override, matching every other togglable flag's own override entry),src/index.ts(hourly cron enqueue, flag-gated),src/queue/processors.ts(the job handler),src/selfhost/maintenance-admission.ts(registered as a deferrable maintenance job type, same lane asops-alerts).This directly answers the "we should never have to nudge this system, it should just work on its own even after restarts" ask from today's incident retro, and is the concrete self-heal counterpart to #3807's fan-out isolation fix.
Closes #3808.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below. (N/A — no visible UI change.)Notes
*-wire.tspattern) — this PR's deploy is byte-identical until the flag is explicitly set.