Skip to content

fix(running-in-ci): permit maintainer-invited upstream contributions - #770

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-769
Jul 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-769

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Problem

The bundled running-in-ci Scope rule was unconditional:

Scope: PRs, pushes, and comments on existing threads in other repos are off-limits.

That default correctly stops the bot spamming issues/PRs outside the repo it maintains, but it had no carve-out for the case where an upstream maintainer explicitly invites the contribution (or the target's published policy welcomes it) and the contribution materially helps the repo the bot maintains. In that case the rule blocked the correct move — as surfaced in #769, where an upstream maintainer asked worktrunk-bot to open a one-line fix PR and the bot couldn't respond.

The tend/worktrunk owner asked for this to become a change in tend:

It's correct that you shouldn't spam issues or PRs outside your area of ownership. But if a maintainer of a different project (or the project's policy) says it's OK for you to contribute, and it's helpful for the project you maintain, then you should do this. Probably this is a change in tend.

Since the restriction fires for every tend consumer, this is a bundled-skill change rather than a per-repo running-tend overlay.

Solution

Add a bounded exception to the Scope rule. The anti-spam default holds; an explicitly invited upstream contribution is permitted only when BOTH conditions hold:

  • Explicit invitation — a target-repo maintainer asks for it in-thread, or the target's published contributing policy welcomes it. Inferred welcome (agent signals, a help wanted label without a direct ask) is not enough and reverts to the default.
  • Serves the home repo — most often upstreaming a fix for a dependency bug the bot is currently working around, so the workaround can later be dropped.

This parallels the existing agent-equipped standing exception (which relaxes the default for filing fresh issues), extending the same "invited, not unsolicited" principle to PRs and comments on existing threads — but gated on an explicit invitation rather than agent signals, since acting in a human-maintained repo is higher-touch.

Two edits to plugins/tend-ci-runner/skills/running-in-ci/SKILL.md:

  1. Rewrite the Scope bullet to state the anti-spam intent, name the exception, and point to the new subsection.
  2. Add a Contributing to Other Repos on Invitation subsection spelling out the two gates, the scope limit (the specific PR/comment asked for, same evidence bar), and the ambiguity fallback.

Testing

pre-commit run --files … (trailing whitespace, end-of-file, typos, bang-backtick guard, reference sync) passes. This is a skill-text/guidance change with no runtime surface — no test to add.


Closes #769 — automated triage

The Scope rule was unconditional, blocking PRs/comments in other repos
even when a target-repo maintainer explicitly invited the contribution
and it served the repo the bot maintains. Add a bounded exception
(Contributing to Other Repos on Invitation) gated on an explicit
invitation AND service to the home repo, paralleling the existing
agent-equipped exception for filing fresh issues.

Closes #769

@tend-agent tend-agent left a comment

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.

The skill edit itself is clean and the cross-references within running-in-ci resolve (the new subsection sits above When a scope rule blocks the right action, so the "below" pointers are correct). One concern, though — the same rule is stated in two other places that this PR leaves at the old unconditional wording, which undercuts the exception in the channels where it matters most:

1. shared/system-prompt.md — the harness-neutral base, loaded on every run for every harness. Its Operating rules bullet still reads (search for Act within this repository):

Act within this repository and its organization only. Do not push to other repos, post to other organizations, or initiate cross-repo workflows.

This is unconditional and, being the system-prompt floor, is the more authoritative of the two. The motivating case (#769) was upstreaming to Canop/termimad — a different org — which "post to other organizations … cross-repo workflows" bars outright. A future run reading both gets contradictory instructions: the skill says "the bot may open a PR or comment on that thread," the base says don't. Before this PR the skill's Scope bullet matched the base (both barred PRs/comments in other repos); this PR widens the gap on exactly the push/post-to-existing-thread clause. For the exception to actually fire, the base bullet needs the same carve-out (or at least a pointer to it).

2. plugins/tend-ci-runner/skills/notifications/SKILL.md restates the flat prohibition in two spots (the step-2 "Check scope" bullet and the "Cross-repo mentions" note: do not push code or create PRs in other repos). Cross-repo mentions are the most likely channel for an in-thread invitation to arrive, so leaving those unqualified means the new exception won't fire where it's most likely to be invoked.

Not blocking the intent — the wording added here is good. It's a completeness gap: the rule lives in three places and this moves one. Happy to push a follow-up commit that adds the matching carve-out/pointer to the system prompt bullet and qualifies the two notifications lines, if you'd like it in this PR rather than a separate one. Flagging as a COMMENT since this is self-authored and the layering question (how much nuance the deliberately-terse base should carry vs. a bare pointer) is a maintainer call.

@max-sixty
max-sixty merged commit fc00ca0 into main Jul 12, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/issue-769 branch July 12, 2026 08:56
@max-sixty max-sixty mentioned this pull request Jul 16, 2026
2 of 3 tasks
max-sixty added a commit that referenced this pull request Jul 16, 2026
## Summary

Version bump + CHANGELOG for 0.1.11. See
[CHANGELOG.md](https://github.com/max-sixty/tend/blob/release/CHANGELOG.md#0111)
for the full notes.

13 commits since 0.1.10:
- Adopter sandbox levers (`sandbox_path`/`sandbox_env`/`sandbox_setup`,
#768)
- Sandbox `PATH` derived from the runner's own `PATH` (#767)
- Invited upstream contributions (#770)
- `tend-mention` self-comment no-op skip (#751)
- Actionable self-review handling (#762, #775)
- `tend-outage` dedup self-heal (#744)
- Dropped-cron-tick recovery in `list-recent-runs` (#753)
- Drop self-authored attribution sign-offs (#773)
- Docs fixes (#776, #771)
- `claude_version` bump (#774)

## Test plan

- [x] `wt test` (275 passed)
- [x] `pre-commit run --all-files` (all hooks passed)
- [ ] CI green on this PR

> _This was written by Claude Code on behalf of Maximilian Roos_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Jul 17, 2026
Automated nightly regeneration of tend's workflow files, picking up the
upstream release.

**tend version:** 0.1.10 → 0.1.11

**Notable changes** (consumer-relevant):

- Skip no-op `tend-mention` sessions triggered by the bot's own comments
— a new pre-mention guard in the generated `tend-mention.yaml`
short-circuits before the engagement heuristics (max-sixty/tend#751).
- Respond to actionable bot self-reviews instead of exiting as a
self-loop: a review the review workflow leaves on its own PR is the
bot's reviewer role, so it gets actioned rather than silently skipped
(max-sixty/tend#762).
- Sandbox: adopter levers to reach inside the Claude-family sandbox, and
derive the sandbox `PATH` from the runner's `PATH` (max-sixty/tend#768,
max-sixty/tend#767).
- `running-in-ci`: permit maintainer-invited upstream contributions, and
prohibit self-authored attribution sign-offs (max-sixty/tend#770,
max-sixty/tend#773).
- Action reliability: self-heal duplicate `tend-outage` issues from
concurrent leg failures, and recover dropped cron ticks in
list-recent-runs via a previous-run anchor (max-sixty/tend#744,
max-sixty/tend#753).

Compare: max-sixty/tend@0.1.10...0.1.11

Co-authored-by: worktrunk-bot <[email protected]>
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.

running-in-ci: Scope rule blocks maintainer-invited upstream contributions (PRs/comments)

2 participants