Repository navigation
nightly: surface tend check drift as a tracked issue - #511
Conversation
Add a nightly step that runs `uvx tend@latest check` and files/updates a single deduplicated tracking issue when configuration drift is detected, closing it when checks pass again. Keeps the bot's own setup (branch protection, secrets, allowlist) from silently rotting between releases. Filed as a plain unlabeled issue for now; the security-vs-drift discrimination and a private GitHub PVR channel are captured as a deferred follow-up in TODO.md rather than built here. Co-Authored-By: Claude <[email protected]>
tend-agent
left a comment
There was a problem hiding this comment.
Two concerns around the dedup search:
-
"configuration drift" in:titlematches any open issue containing that substring, including human-filed ones. Thexargs … gh issue closethen closes every match — a maintainer-filed issue like "Investigating configuration drift in X" would be silently auto-closed the next timetend checkgoes clean. Filtering by--author '@me'(or matching against a hidden HTML comment marker in the body) restricts the search to the bot's tracking issue. Inline suggestions below on both occurrences. -
The close-when-clean trigger is "No
FAILlines", which also fires when every check isSKIP(e.g., bot losesadminability to read collaborators, orghinvocation hits a transient error). In that case the bot would close an existing drift issue withtend check now passes.even though nothing was verified. Worth tightening to "all checksPASS" so SKIP-only runs leave the drift issue alone.
Address auto-reviewer feedback on PR #511: - Scope both `gh issue list` lookups to `--author '@me'` so a maintainer-filed issue containing "configuration drift" is never auto-closed or mistaken for the bot's tracking issue. - Close the drift issue only when every check is PASS (no FAIL and no SKIP). A SKIP-only run (lost API permission, transient gh error) no longer falsely clears the issue with "tend check now passes". Co-Authored-By: Claude <[email protected]>
Summary
Wires
uvx tend@latest checkinto the nightly maintenance sweep so that configuration drift in the bot's own setup (branch protection, bot permission, required secrets, secret allowlist) surfaces as a tracked GitHub issue instead of rotting silently between releases.New Step 2: Check tend configuration drift in the bundled nightly skill walks the agent through: run
tend check, close any open drift issue when clean, otherwise file/update a single deduplicated tracking issue (tend check: configuration drift on <owner>/<repo>) with the failing checks and a refreshed-date footer. Same-set updates only refresh the footer; changed sets edit the body and post a delta comment. Subsequent steps renumbered 2→3 … 8→9 (including the Review-checklist cross-reference).The logic lives in the skill, not a deterministic YAML step, per the "Agent-driven vs deterministic steps" guidance in
CLAUDE.md.Following auto-reviewer feedback, both issue lookups are scoped to
--author '@me'(a maintainer-filed issue containing "configuration drift" is never auto-closed), and the close condition requires every check to bePASS— aSKIP-only run (lost API permission, transientgherror) no longer falsely clears the drift issue.Security escalation: deferred
The issue is filed plain and unlabeled. Some
tend checkfailures are genuine security regressions (missing branch protection, a deploy token likeCLOUDFLARE_API_TOKENat repo level) and others are benign operational drift — but on a public repo a labeled public issue broadcasts the misconfig before it's fixed. GitHub's native private channel (Private Vulnerability Reporting / draft advisories) is the right escalation but is a semantic/ergonomic/permission mismatch for an unattended nightly. The full rationale, the security-vs-drift discrimination rule, and what a future implementation needs are captured in a newTODO.mdsection rather than built here.Test plan
pre-commit run --all-filespasses