ci: add a maintenance watch that notices unattended work - #130
Merged
Conversation
The scheduled agent sweep set up for this has been firing into nothing for a week. create_trigger only accepts a prompt, schedule and environment — it has no parameter for repository sources, and the session that created it had no connectors to pass on. So every morning a session woke with sweep instructions, no repository and no GitHub tools, and correctly did nothing. Silently, which is the worst way for a watchdog to fail: two contributor PRs sat unanswered for two days while it reported nothing. This does the detection half in CI, where GITHUB_TOKEN is native and there is no session plumbing to inherit. It checks three things that have each already gone wrong here: - Open PRs with no non-bot comment after two days. - The last seven scheduled registry-update runs, not just the latest. A failure can vanish on its own when `--since 2` stops selecting the broken version, turning the run green while the cause remains — that is exactly how the sanity breakage hid for four nights. - package.json version against npm dist-tags. A changeset can merge and never publish, which once left a security fix in main looking shipped. Findings go to one self-closing tracking issue. It never touches code. Every API response is shape-checked and an unexpected one fails the job, because a watchdog that reports "nothing outstanding" after a failed call is worse than none. Note the GitHub API is unreachable from the environment this was written in, so the API paths could not be exercised before merge — hence failing loudly rather than defaulting to silence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The scheduled agent sweep set up for this has been firing into nothing for a week.
create_triggeronly accepts a prompt, schedule and environment — it has no parameter for repository sources, and the creating session had no connectors to pass on. Compare the stored config against the content-agent Routine, which works:sourcesneuledge-internalhttp_apimeta_mcpSo every morning a session woke with sweep instructions, no repository checked out and no GitHub tools, and correctly did nothing. Silently — which is the worst way for a watchdog to fail. Two contributor PRs (#125, #126) sat unanswered for two days while it reported nothing wrong.
What this does
The detection half, in CI, where
GITHUB_TOKENis native and there's no session plumbing to inherit. Three checks, each for something that has already gone wrong in this repo:registry-updateruns, not just the latest. A failure can vanish on its own when--since 2stops selecting the broken version, turning the run green while the cause remains. That's precisely how the sanity breakage hid for four nights, and the check says so explicitly when the latest is green but earlier runs failed.package.jsonversion vs npmdist-tags. A changeset can merge and never publish — which once left a security fix inmainlooking shipped.Findings go to a single tracking issue that updates in place and closes itself when everything clears. It never touches code.
Honest limitation
The GitHub API is unreachable from the environment I wrote this in (403 through the proxy), so the API-dependent paths could not be exercised before merge. Only the npm check ran end-to-end (
local=1.2.3 npm=1.2.3, correctly no drift).That shaped the design: every response is shape-checked, and an unexpected one fails the job. A red run is a visible alarm; a watchdog that reports "nothing outstanding" because a call failed is worse than no watchdog at all.
What I could verify locally:
runblocks passbash -nset -etraps found in review:[ -n "$stale" ] && …and[ "$age" -lt 2 ] && continueboth exit non-zero when the condition is false, which would have failed the job on a healthy repo---line was a document separator)First scheduled run is 07:20 UTC;
workflow_dispatchis enabled to trigger it sooner.Not included
Review judgment still needs an agent session — there's no Claude action or API credential in this repo. This closes the gap that actually bit us: nothing was noticing.
Generated by Claude Code