Skip to content

nightly: surface tend check drift as a tracked issue - #511

Merged
max-sixty merged 2 commits into
mainfrom
nightly-tend-check
May 15, 2026
Merged

max-sixty merged 2 commits into
mainfrom
nightly-tend-check

Conversation

@max-sixty

@max-sixty max-sixty commented May 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Wires uvx tend@latest check into 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 be PASS — a SKIP-only run (lost API permission, transient gh error) no longer falsely clears the drift issue.

Security escalation: deferred

The issue is filed plain and unlabeled. Some tend check failures are genuine security regressions (missing branch protection, a deploy token like CLOUDFLARE_API_TOKEN at 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 new TODO.md section rather than built here.

Test plan

  • Docs/skill-only change — no code paths affected, no automated tests
  • pre-commit run --all-files passes

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 tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two concerns around the dedup search:

  1. "configuration drift" in:title matches any open issue containing that substring, including human-filed ones. The xargs … gh issue close then closes every match — a maintainer-filed issue like "Investigating configuration drift in X" would be silently auto-closed the next time tend check goes 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.

  2. The close-when-clean trigger is "No FAIL lines", which also fires when every check is SKIP (e.g., bot loses admin ability to read collaborators, or gh invocation hits a transient error). In that case the bot would close an existing drift issue with tend check now passes. even though nothing was verified. Worth tightening to "all checks PASS" 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]>
@max-sixty
max-sixty merged commit 64fd95d into main May 15, 2026
10 of 12 checks passed
@max-sixty
max-sixty deleted the nightly-tend-check branch May 15, 2026 21:39
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