Skip to content

fix(skills): default to not closing issues, defer to repo-specific guidance - #155

Merged
max-sixty merged 4 commits into
mainfrom
hourly/review-24053294363
Apr 7, 2026
Merged

max-sixty merged 4 commits into
mainfrom
hourly/review-24053294363

Conversation

@tend-agent

@tend-agent tend-agent commented Apr 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reworked approach: instead of adding special exceptions for specific actions, establish the general principle that repo-specific guidance always takes precedence over tend's defaults.

  • Triage skill: Reverted to the original default — duplicates are flagged but left for a maintainer. Repos that want auto-closing authorize it in their running-tend skill.
  • Running-in-ci: Removed the triage-specific carve-out. Added a general principle: repo-specific guidance overrides these defaults.
  • Review-reviewers: Added guidance to check repo-specific skills before flagging an action as a rule violation — so we don't incorrectly treat authorized behavior as a problem.

Test plan

  • Triage on a repo without closing guidance → leaves duplicates open
  • Triage on a repo whose running-tend authorizes closing → closes duplicates
  • Review-reviewers checks repo-specific guidance before flagging actions

The duplicate template says "I'll leave it to a maintainer to confirm
and link them" but lacks an explicit prohibition on closing. The bot
on max-sixty/worktrunk closed issue #1940 autonomously, violating
the conduct rules in running-in-ci.

Add an explicit "Do NOT close" instruction above the duplicate
template to prevent this.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Apr 6, 2026
@max-sixty

Copy link
Copy Markdown
Owner

we want to allow this sort of behavior. What makes you think that we didn't? let's change that

Reverses the previous prohibition — the triage workflow should close
issues it classifies as duplicates. Adds a carve-out in running-in-ci
conduct rules so the general "closing requires maintainer access" rule
doesn't override this.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent tend-agent changed the title fix(skills): prohibit triage bot from closing duplicate issues fix(skills): allow triage bot to close duplicate issues Apr 6, 2026
@tend-agent

Copy link
Copy Markdown
Collaborator Author

Good call — I was applying the running-in-ci conduct rule ("closing requires maintainer access") too broadly. That rule is about user-directed actions, but triage is an autonomous workflow that the maintainer has already authorized by configuring it.

Pushed a new commit that reverses direction: the triage skill now explicitly instructs closing duplicates (with gh issue close), and running-in-ci has a carve-out for triage so the general rule doesn't override it.

@max-sixty

Copy link
Copy Markdown
Owner

Well, we want to:

  • have a default, which is to not close issues
  • defer to repo-specific guidance, always

so:

  • our object-level guidance should reflect that (which it may do already in the existing code?)
  • our reviews of tend should definitely reflect that — we should have seen that the behavior was as requested in worktrunk's skill and evaluated it as good

…idance

The triage skill's default is to leave duplicates for a maintainer to
confirm. Repos that want automatic closing can authorize it in their
repo-specific guidance (running-tend skill).

Adds a general principle to running-in-ci: repo-specific guidance always
takes precedence over tend's defaults. This replaces the previous
approach of adding per-action carve-outs.

Also teaches review-reviewers to check repo-specific guidance before
flagging an action as a rule violation — the worktrunk incident showed
we were incorrectly treating authorized behavior as a problem.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent tend-agent changed the title fix(skills): allow triage bot to close duplicate issues fix(skills): default to not closing issues, defer to repo-specific guidance Apr 6, 2026
@tend-agent

Copy link
Copy Markdown
Collaborator Author

You're right — the original triage default (leave it to a maintainer) was already correct. The problem was that we didn't recognize worktrunk's repo-specific guidance as the authorizing layer.

Pushed a new approach:

  1. Triage reverted to the original default — flags duplicates but doesn't close them
  2. Running-in-ci gets a general principle instead of per-action carve-outs: repo-specific guidance always takes precedence over tend's defaults
  3. Review-reviewers now checks repo-specific guidance before flagging an action as a violation — so we don't repeat the mistake of treating authorized behavior as a problem

@tend-agent

Copy link
Copy Markdown
Collaborator Author

Agreed — the current state of this PR already reflects that:

  1. Triage default is unchanged — duplicates are left open for a maintainer to confirm (commit b086190 reverted the closing behavior).
  2. running-in-ci now says repo-specific guidance takes precedence over these defaults — so if worktrunk's running-tend skill says "close duplicates", the triage bot will follow that.
  3. review-reviewers now checks repo-specific guidance before flagging an action as a violation — which is the piece that was missing when we reviewed the worktrunk run.

The gap was specifically in (3): the reviewer saw "bot closed an issue" and flagged it without checking that worktrunk's skill explicitly authorized it. That's now addressed.

Comment on lines +65 to +69
When the bot took an action that looks like it violated tend's default rules (e.g., closing an
issue), check the target repo's repo-specific guidance (`running-tend` skill or equivalent) before
flagging it. If the repo-specific guidance explicitly authorized the action, the bot behaved
correctly — do not flag it as a problem.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

but more than this — center the reviews based on the overall guidance, in which the repo-specific guidance is primary. Not just as a comment in a single step

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point — moved it from a footnote in step 3 to a top-level "Core principle" section that frames the entire analysis. The reviewer now:

  1. Reads the repo's guidance as the first thing in step 2 (with a concrete command to fetch it)
  2. Evaluates all bot behavior against the repo's guidance hierarchy — repo-specific first, tend defaults only where the repo doesn't speak

The old step-3 paragraph is removed since it's now redundant with the principle.

…mary

Restructured the review-reviewers skill so that repo-specific guidance
primacy is a core principle, not just a check in one step. The reviewer
now loads repo guidance in step 2 and evaluates all bot behavior against
the repo's hierarchy first.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty
max-sixty merged commit aa5fa74 into main Apr 7, 2026
7 checks passed
@max-sixty
max-sixty deleted the hourly/review-24053294363 branch April 7, 2026 03:34
tend-agent pushed a commit that referenced this pull request Apr 7, 2026
The nightly skill's Step 3 still instructed `gh issue close` unconditionally,
but #155 (aa5fa74) established that closing issues requires repo-specific
authorization. This caused run 24068363424 to close PRQL/prql#5778 without
authorization — the repo has no `running-tend` skill authorizing closures.

Now: nightly comments with evidence but only closes if the repo's guidance
explicitly authorizes it.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request Apr 7, 2026
…cy (#158)

## Summary

The nightly skill's Step 3 ("Check existing issues and close resolved
ones") unconditionally instructs `gh issue close` for resolved issues.
This conflicts with the policy established in #155 (aa5fa74), which
defaults to not closing issues unless the repo's guidance explicitly
authorizes it.

**Evidence:** Run
[24068363424](https://github.com/PRQL/prql/actions/runs/24068363424) on
PRQL/prql closed issue PRQL/prql#5778 without authorization — PRQL/prql
has no `.claude` directory or `running-tend` skill authorizing closures.

**Root cause:** #155 updated `running-in-ci` and `review-reviewers` but
missed the nightly skill, which has its own explicit close instruction
in Step 3.

**Fix:** Nightly now comments with evidence of resolution but only
closes the issue if the repo's `running-tend` skill (or equivalent)
explicitly authorizes closing.

**Gate assessment:**
- Evidence level: High (structural — deterministic instruction conflict)
- Classification: Structural — every nightly run follows Step 3's
explicit close instruction
- Change type: Targeted fix (modify existing instruction)
- Historical evidence: 1 post-policy occurrence (this run); pre-policy
closings were correct under the old rules

## Test plan

- [ ] Nightly on a repo without close authorization → comments with
evidence but leaves issue open
- [ ] Nightly on a repo whose `running-tend` authorizes closing → closes
as before

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: continuous-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request Apr 16, 2026
…ed (#290)

## Summary

The nightly Step 3 rule defaults to leaving resolved issues open for a
maintainer unless the repo's `running-tend` skill explicitly authorizes
closing. That default causes the bot to leave *its own* tracking issues
open indefinitely after the tracked condition resolves.

Adds a narrow carve-out: the bot may `gh issue close` an issue it opened
itself to report a transient condition (e.g. a "Nightly tests failed"
report), once the fix PR is merged and the relevant CI on `main` is
passing. Issues whose body contains "do not close manually" (monthly
review-runs / review-reviewers trackers) are explicitly excluded.

## Evidence

- **Run**: [PRQL/prql run
24499795330](https://github.com/PRQL/prql/actions/runs/24499795330)
(tend-review-runs, 2026-04-16T08:19Z)
- **Incident thread**:
[PRQL/prql#5802](PRQL/prql#5802) — bot opened
"Nightly tests failed", opened fixes
[#5801](PRQL/prql#5801) and
[#5803](PRQL/prql#5803), both merged, main CI
went green, bot commented "Leaving open for a maintainer to close"
- **Maintainer pushback**: max-sixty: *"@prql-bot you should close these
when things pass"* and then *"presumably we need to add this to the tend
skill?"*
- **Bot's own diagnosis** (posted as a diff in issue #5802): proposed to
authorize closures in PRQL's local `running-tend` skill; the tend-level
default was the actual structural gap

## Gate assessment

- **Evidence level**: Critical — direct maintainer correction on a bot
behavior
- **Classification**: Structural — the nightly skill's Step 3 explicitly
instructed "leave it open for a maintainer to close" in every case not
covered by `running-tend`; same conditions → same outcome every run
- **Change type**: Targeted fix — one carve-out paragraph added,
existing default preserved for user-reported issues
- **Occurrences**: 1 direct this window; prior tracking on #133
documented one *inverse* case (closing a tracking issue with "do not
close manually"), which this carve-out explicitly guards against by
excluding that marker

Both gates pass. The carve-out is intentionally narrow so the #155 /
#158 policy (no unauthorized closures on user-reported issues) stays
intact.

## Test plan

- [ ] Nightly run on a repo without `running-tend` close-authorization
where the bot has an open self-opened "X failed" issue with the fix
merged → bot closes the issue with a short comment citing the fix
- [ ] Same flow but issue body says "do not close manually" (e.g.
review-runs tracker) → bot still leaves it open
- [ ] User-reported issue (non-bot author) resolved by recent commits on
a repo without close authorization → bot comments with evidence, does
**not** close (unchanged behavior)

---------

Co-authored-by: tend-agent <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: tend-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants